Classify document by path
Leave feedback
Classifying of the document could be performed with the next steps
- Call Classify method for “document.pdf” file in the current (".") directory with IAB-2 taxonomy and return 2 best results.
- Handle possible ApiException
try
{
var response = classifier.Classify("document.pdf", ".", 3, Taxonomy.Iab2);
Console.WriteLine(response.BestClassName, response.BestClassProbability);
}
catch (ApiException e)
{
Console.WriteLine(e.Message);
}
- Call Classify method for “document.doc” file in the current (".") directory with Documents taxonomy, set precision/recall balance to “Precision” and return 4 best results.
- Handle possible ApiException
try
{
var response = classifier.Classify("document.doc", ".", 4, Taxonomy.Documents, PrecisionRecallBalance.Precision);
Console.WriteLine(response.BestClassName, response.BestClassProbability);
}
catch (ApiException e)
{
Console.WriteLine(e.Message);
}
Classifying of the password-protected document could be performed with the next step
- Call Classify method for “document.doc” file in the current (".") directory with password parameter.
- Handle possible ApiException
try
{
response = classifier.Classify("password-protected.docx", dataFolderPath, password: "password");
Console.WriteLine(response.BestClassName, response.BestClassProbability);
}
catch (ApiException e)
{
Console.WriteLine(e.Message);
}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.