Classify Raw Text

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Simple IAB-2 text classification

Call Classify method with a text as the first parameter to perform classification. Default taxonomy (IAB-2) and bestClassesCount (1) will be used.

var response = classifier.Classify("Medicine is an important part of our lifes");
Console.WriteLine(response.BestClassName, response.BestClassProbability);

Raw text classification with Documents taxonomy and 2 best classes to return

Taxonomy, bestClassesCount and precisionRecallBalance could also be specified:

var response = classifier.Classify("Medicine is an important part of our lifes", 2, Taxonomy.Documents, PrecisionRecallBalance.Recall);
Console.WriteLine(response.BestClassName, response.BestClassProbability);