What is Text Classification?
Text classification is the process of assigning tags or categories to text according to its content with broad applications such as sentiment analysis, topic labeling, spam detection, and intent detection.

GroupDocs.Classification Cloud
Unstructured data in the form of raw text is everywhere: emails, chats, web pages, social media, support tickets, survey responses, and more. Text can be an extremely rich source of information, but extracting insights from it can be hard and time-consuming due to its unstructured nature. Businesses are turning to text classification for structuring text in a fast and cost-efficient way to enhance decision-making and automate processes.
What is Taxonomy?
Taxonomy is the practice and science of classification. The word is also used as a taxonomic scheme. Taxonomy is a particular classification. In a wider, more general sense, it may refer to a classification of things or concepts, as well as to the principles underlying such a classification.
GroupDocs.Classification Cloud API
GroupDocs.Classification Cloud API retrieves raw text classification output for IAB-2 taxonomy or Documents taxonomy. It returns an object that contains information about the best class and its probability and about probabilities of the other classes.
IAB-2 Taxonomy Example
GroupDocs.Classification Cloud API supports IAB-2 taxonomy scheme, Some of the taxonomy examples are listed below :
- ‘Automotive’,
- ‘Books_and_Literature’,
- ‘Business_and_Finance’,
- ‘Careers’,
- ‘Education’,
- ‘Events_and_Attractions’,
- ‘Family_and_Relationships’,
- ‘Fine_Art’,
- ‘Food_&_Drink’,
- ‘Healthy_Living’,
- ‘Hobbies_&_Interests’,
- ‘Home_&_Garden’,
- ‘Medical_Health’,
- ‘Movies’,
- ‘Music_and_Audio’,
- ‘News_and_Politics’,
- ‘Personal_Finance’
- etc.
cURL Request
### Upload document to default storage | |
curl -X POST "https://api.groupdocs.cloud/v2.0/viewer/storage/file/viewerdocs%2Fthree-layouts.dwf?storageName=MyStorage" | |
-H "accept: application/json" | |
-H "authorization: Bearer [Access_Token]" | |
-H "Content-Type: multipart/form-data" | |
-T C:/Temp/three-layouts.dwf |
Response
{ | |
"bestClassName": "Healthy_Living", | |
"bestClassProbability": 53.77, | |
"bestResults": [ | |
{ | |
"className": "Healthy_Living", | |
"classProbability": 53.77 | |
}, | |
{ | |
"className": "Medical_Health", | |
"classProbability": 38.27 | |
}, | |
{ | |
"className": "Pets", | |
"classProbability": 1.98 | |
} | |
], | |
"code": 200, | |
"status": "OK" | |
} |
.NET Example
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
using System; | |
using System.Diagnostics; | |
using GroupDocs.Classification.Cloud.Sdk.Api; | |
using GroupDocs.Classification.Cloud.Sdk.Model; | |
using GroupDocs.Classification.Cloud.Sdk.Model.Requests; | |
namespace GroupDocs.Classification.Cloud.Sdk.Examples | |
{ | |
class Classification_CSharp_Classify_Document_from_Storage | |
{ | |
public static void Run() | |
{ | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud/ (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXX-XXXXXXX-XXXX", | |
AppKey = "XXXXXXXXXXXXX" | |
}; | |
var apiInstance = new ClassificationApi(configuration); | |
try | |
{ | |
var request = new ClassifyRequest(new BaseRequest() | |
{ | |
Document = new FileInfo() | |
{ | |
Name = "one-page.docx", | |
Folder = "" | |
}, | |
}, | |
bestClassesCount: "3"); | |
// Get classification results | |
ClassificationResponse response = apiInstance.Classify(request); | |
Console.WriteLine(response.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when calling ClassificationApi.Classify: " + e.Message); | |
} | |
} | |
} | |
} |
Documents Taxonomy Example
Documents taxonomy includes the following list in GroupDocs.Classification Cloud API:
- ADVE - advertisements, brochures.
- Form
- Letter
- Memo - memorandums.
- News - articles, including news articles.
- Invoice
- Report
- Resume
- Scientific - scientific papers.
- Other - the other classes of documents or cases where the classifier is not sure.
cURL Request
curl -v "http://api.groupdocs.com/v/v1/classification/classify?bestClassesCount=3&taxonomy=documents" | |
-H "content-type: application/json" | |
-X POST -d '{ "Document": {"Folder": "words/docx","Name": "four-pages.docx" } }' |
Response
{ | |
"bestClassName": "Other", | |
"bestClassProbability": 36.8, | |
"bestResults": [ | |
{ | |
"className": "Other", | |
"classProbability": 36.8 | |
}, | |
{ | |
"className": "ADVE", | |
"classProbability": 14.72 | |
}, | |
{ | |
"className": "News", | |
"classProbability": 12.77 | |
} | |
], | |
"code": 200, | |
"status": "OK" | |
} |
.NET Example
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
using System; | |
using System.Diagnostics; | |
using GroupDocs.Classification.Cloud.Sdk.Api; | |
using GroupDocs.Classification.Cloud.Sdk.Model; | |
using GroupDocs.Classification.Cloud.Sdk.Model.Requests; | |
namespace GroupDocs.Classification.Cloud.Sdk.Examples | |
{ | |
class Classification_CSharp_Classify_Raw_Text | |
{ | |
public static void Run() | |
{ | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud/ (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXX-XXXXXXX-XXXX", | |
AppKey = "XXXXXXXXXXXXX" | |
}; | |
var apiInstance = new ClassificationApi(configuration); | |
try | |
{ | |
var request = new ClassifyRequest(new BaseRequest() { Description = "Try Text classification using GroupDocs.Classification Cloud API" }, "3"); | |
// Get classification results | |
var response = apiInstance.Classify(request); | |
Console.WriteLine(response.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when calling ClassificationApi.Classify: " + e.Message); | |
} | |
} | |
} | |
} |
Start a Free Trial Today
Start a free trial today – all you need is to sign up with the GroupDocs Cloud service. Once you have signed up, you are ready to try the powerful file processing features offered by GroupDocs Cloud.