/* * Run with your own PDF or use the sample Amtrak-Financials file * provided in this repo. */ async static Task Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Please provide the filepath of a PDF to OCR"); Environment.Exit(0); } IndicoConfig config = new IndicoConfig( host: "app.indico.io" ); IndicoClient client = new IndicoClient(config); JObject extractConfig = new JObject() { { "preset_config", "standard" } }; DocumentExtraction ocrQuery = client.DocumentExtraction(extractConfig); Job job = await ocrQuery.Exec(args[0]); JObject result = await job.Result(); string url = (string)result.GetValue("url"); Blob blob = await client.RetrieveBlob(url).Exec(); Console.WriteLine(blob.AsJSONObject()); }
async static Task Main(string[] args) { IndicoConfig config = new IndicoConfig( host: "app.indico.io" ); IndicoClient client = new IndicoClient(config); string query = @" query GetDatasets { datasets { id name status rowCount numModelGroups modelGroups { id } } } "; GraphQLRequest request = client.GraphQLRequest(query, "GetDatasets"); JObject response = await request.Call(); Console.WriteLine(response); }
static void Main(string[] args) { IndicoConfig config = new IndicoConfig(host: "app.indico.io"); IndicoClient client = new IndicoClient(config); getDatasets(client); getModelGroup(client, 4415); }
/* * Get the progress (% complete) of a training model group. This * is handy as some sequence models can take a very long time (hours) * to train. Pass your model's Model Group ID on the command line. * You can find the model group ID on your model's Review page. */ private static async Task Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Please provide a model group id"); Environment.Exit(0); } int mgId = Int32.Parse(args[0]); var config = new IndicoConfig( host: "app.indico.io" ); var client = new IndicoClient(config); var mg = await client.ModelGroupQuery(mgId).Exec(); var trainingStatus = await client.TrainingModelWithProgressQuery(mg).Exec(); Console.WriteLine(mg.Name); Console.WriteLine(trainingStatus); }
/* * To actually run this example, you need to train a classifier in * the Indico IPA Platform using the reviews.csv file included in * this repo. After the model is trained, just pass its model group * ID into this sample as a command line arg. You can find the model * group ID on your trained model's Review page. */ private static async Task Main(string[] args) { int mgId = -1; if (args.Length != 1) { Console.WriteLine("Please provide model group and selected model IDs"); System.Environment.Exit(0); } else { mgId = Int32.Parse(args[0]); } var config = new IndicoConfig( host: "app.indico.io" ); var client = new IndicoClient(config); var mg = await client.ModelGroupQuery(mgId).Exec(); // Load Model string status = await client.ModelGroupLoad(mg).Exec(); var reviews = new List <string>() { "This was the best food of our trip. Fantastic experience!", "The service was rude and the food was awful. Don\'t waste your time!" }; var job = await client.ModelGroupPredict(mg).Data(reviews).Exec(); var jobResult = await job.Results(); Console.WriteLine(jobResult); }
public Application(string token, string host) { IndicoConfig config = new IndicoConfig(host: host, apiToken: token); Client = new IndicoClient(config); }