.NET Text & Documents Classification API

Empower your .NET applications with File & Text Classifier abilities using pre-defined tags or categories within IAB-2, Documents and Sentiment taxonomies.

Download Free Trial

GroupDocs.Classification for .NET is an intuitive C# Netstandard 2.0 API that helps you create powerful text and document classification/categorization applications in C#, ASP.NET, and other .NET-based technologies. API supports four different types of taxonomies and offers advanced document and text classification by using IAB-2 for assigning standardized text categories, Documents taxonomy as developed by Aspose for different document types, or Sentiment (and Sentiment3) for the sentiment analysis. API analyzes text, sentences, even words and supports classifying a variety of industry-standard document formats including PDF, Microsoft Word, OpenDocument, RTF, and TXT. Sentiment analysis (classification) supports English, Chinese, Spanish, and German languages with language auto-detection. API can return positiveness probability which could be used for fine-grained sentiment analysis in C#.

GroupDocs.Classification for .NET uses its own document processing/classification engine and does not require any external tools to be installed on the system. It targets .NET platform to develop applications and supports all popular operating systems (Windows, Linux, macOS) where .NET frameworks (including .NET Core) can be installed.

Advanced Text & Documents Classification API Features

Precise Document Classification

GroupDocs.Classification API supports classification for a variety of document formats. The below C# code example shows how to classify a PDF file from the current folder with Documents taxonomy by returning 3 best results.

// Initialize general-purpose classifier (IAB-2, Documents, Sentiment Analysis).
var classifier = new GroupDocs.Classification.Classifier();

// Classify pdf file with Documents taxonomy and return the 3 most likely categories.
var response = classifier.Classify("document.pdf", ".", 3, Taxonomy.Documents);
Console.WriteLine($"{response.BestClassName}: {response.BestClassProbability}");

Precise Text Classification

GroupDocs.Classification API also supports text classification. Text classification can be performed with 4 different taxonomies: IAB-2, Documents, Sentiment, and Sentiment3. The below C# code example shows how to classify text with the default (IAB-2) taxonomy by returning the best result.

// Initialize general-purpose classifier (IAB-2, Documents, Sentiment Analysis).
var classifier = new GroupDocs.Classification.Classifier();

// Classify text with IAB-2 taxonomy and return the the best category.
var response = classifier.Classify("Classify text using the default IAB-2 taxonomy");
Console.WriteLine($"{response.BestClassName}: {response.BestClassProbability}");

Precise Multilingual Sentiment Analysis

GroupDocs.Classification for .NET allows to perform cross-domain Sentiment Analysis (Classification) in English, Chinese, Spanish, and German. GroupDocs.Classification for .NET will detect the proper language(s) automatically. Sentiment analysis API use cases are illustrated by the following C# code:

// Initialize cross-domain multilingual sentiment classifier. 
// SentimentClassifier supports multilingual classification with English, Chinese, Spanish, and German.
var classifier = new GroupDocs.Classification.SentimentClassifier();

// Sentiment analysis of the English text.
var response = classifier.Classify("Experience is simply the name we give our mistakes");
Console.WriteLine($"{response.BestClassName}: {response.BestClassProbability}");

// Sentiment analysis of the Chinese text with the same classifier and Sentiment3 (Negative/Neutral/Positive) taxonomy.
response = classifier.Classify("熟能生巧", taxonomy: Taxonomy.Sentiment3);
Console.WriteLine($"{response.BestClassName}: {response.BestClassProbability}");

Support and Learning Resources

Back to top