Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Taxonomic Classification of Documents using C#
/*
* Classify documents (PDF, Word, ...) with Document Taxonomy using C#
*/
Classifier classifier = new Classifier();
var filename = "document.pdf";
var response = classifier.Classify(filename, "<inputFolderPath>" , 4, Taxonomy.Documents);
response.BestResults.ToList().ForEach(bestResult => Console.WriteLine($"Class: {bestResult.Name}, \t Probability: {bestResult.Probability}"));
/*
* Classify documents (PDF, Word, ...) with IAB-2 Taxonomy using C#
*/
Classifier classifier = new Classifier();
var filename = "document.pdf";
var response = classifier.Classify(filename, "<inputFolderPath>" , 4, Taxonomy.Iab2);
response.BestResults.ToList().ForEach(bestResult => Console.WriteLine($"Class: {bestResult.Name}, \t Probability: {bestResult.Probability}"));
/*
* Classify password protected documents using C#
*/
Classifier classifier = new Classifier();
var filename = "password-protected.docx";
var response = classifier.Classify(filename, "<inputFolderPath>", password: "password");
Console.WriteLine($"Best Class: {response.BestClassName}, \t Probability: {response.BestClassProbability}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment