Classify document from stream

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

Classifying of the document from stream could be performed with the next step

  • Call Classify method for “stream” stream with Documents taxonomy and return 2 best results.
  • Handle possible ApiException 
// Classify document from stream with Documents taxonomy and return 2 best resultstry
{
    var response = classifier.Classify(stream, 2, Taxonomy.Documents);
    Console.WriteLine(response.BestClassName, response.BestClassProbability);
}
catch (ApiException e)
{
    Console.WriteLine(e.Message);
}