Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active November 4, 2021 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/68adb40cdb317125614e04c8d1cf56b7 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/68adb40cdb317125614e04c8d1cf56b7 to your computer and use it in GitHub Desktop.
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