Documents Classification

Classify documents

This API retrieves document classification result for IAB-2 taxonomy or Documents taxonomy. It returns an object that contains information about the best class and its probability and about probability of other classes.

See Classify request parameters for request’s details.

Resource

This resource represents a controller for single call document classification.

Classify document with taxonomy. Set taxonomy parameter to “default” for IAB-2 or set to “documents” for Documents taxonomy.

cURL REST Example for IAB-2 (default) taxonomy

Request

curl -v "http://api.groupdocs.cloud/v1.0/classification/classify"
-H "content-type: application/json"
-X POST -d '{ "Document": {"Folder": "words/docx","Name": "four-pages.docx" } }'

Response

{
  "bestClassName": "Books_and_Literature",
  "bestClassProbability": 48.92,
  "bestResults": [],
  "code": 200,
  "status": "OK"
}

cURL REST Example for “Documents” taxonomy

Request

curl -v "http://api.groupdocs.cloud/v1.0/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"
}

cURL REST Example for Sentiment taxonomy

Request

curl -v "http://api.groupdocs.cloud/v1.0/classification/classify?bestClassesCount#1&taxonomy#sentiment"
-H "content-type: application/json"
-X POST -d '{ "Document": {"Folder": "words/docx","Name": "four-pages.docx" } }'

Response

{
  "bestClassName": "Positive",
  "bestClassProbability":90.02,
  "bestResults":[{
    "className":"Positive",
    "classProbability":90.02
  }],
  "Code":200,
  "status":"OK"
}

SDKs

The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here

Classify Document from Storage

C#

Classify Document from Stream

C#