Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Taxonomic Classification of Text using C#
/*
* Classify Text with Document Taxonomy using C#
*/
Classifier classifier = new Classifier();
string statement = "Sooner or later technology will overcome labor work";
var response = classifier.Classify(statement, 2, Taxonomy.Documents);
response.BestResults.ToList().ForEach(bestResult => Console.WriteLine($"Class: {bestResult.Name}, \tProbability: {bestResult.Probability}"));
/*
* Classify Text with IAB-2 Taxonomy using C#
*/
Classifier classifier = new Classifier();
string statement = "Medicine is an important part of our lives";
var response = classifier.Classify(statement, 3, Taxonomy.Iab2);
response.BestResults.ToList().ForEach(bestResult => Console.WriteLine($"Class: {bestResult.Name}, \tProbability: {bestResult.Probability}"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment