Requests are made using GET or POST data submissions to the API entry point. Typically, a POST method is recommended in order to overcome the parameter maximum length limit associated to the GET method.
This is the endpoint to access the API.
Service | Method | Url | ||
---|---|---|---|---|
Text Classification | POST | https://api.meaningcloud.com/class-2.0 | Console |
If you are working with an on-premises installation, you will need to substitute api.meaningcloud.com by your own server address.
These are the supported parameters.
Name | Description | Values | Default |
---|---|---|---|
key |
The access key is required for making requests to any of our web services. You can get a valid access key for free just by creating an account at MeaningCloud. | Required | |
of |
Output format. | json | Optional. Default: of=json |
verbose |
Verbose mode. When active, it shows additional information about the classification, specifically, it shows the terms that have been used for classifying a text within a category along with how they influence the relevance of the category for the processed text. | y n |
Optional. Default: verbose=n |
debug |
Debug mode. When enabled, it shows additional debug information about the rules in the model that have been fired. | y n |
Optional. Default: debug=n |
title |
Descriptive title of the content. The terms relevant for the classification process found in the title will have more influence in the classification than if they were in the text. | UTF-8 encoded text (plain text, HTML or XML). | Optional. Default: title="" |
abstract |
Descriptive abstract of the content. The terms relevant for the classification process found in the abstract will have more influence in the classification than if they were in the text (but less than the ones in the title). | UTF-8 encoded text (plain text, HTML or XML). | Optional. Default: abstract="" |
txt |
Input text that's going to be classified. | UTF-8 encoded text (plain text, HTML or XML). | Optional. Default: txt="" |
url |
URL with the content to classify. Currently only non-authenticated HTTP and FTP are supported. The content types supported for URL contents can be found here. | Optional. Default: url="" |
|
doc |
Input file with the content to analyze. The supported formats for file contents can be found here. | Optional. Default: doc="" |
|
model |
Classification model to use. It will define into which categories the text may be classified. | See models section. | Required. |
categories_filter |
List of prefixes of the code of the categories to which the classification is limited. Each value will be separated by '|'. All the categories that do not start with any of the prefixes specified in the list will not be taken account in the classification. For example, if only a clasification within the human interest category, the prefix used would be 0800. All the codes associated to the categories can be seen in the classification models section. |
Optional. Default: categories="" |
|
expand_hierarchy |
It allows you to select if in the results you want to include the parents or the ancestors of the category/categories in which the content has been classified. It only applies to models with explicit hierarchy. | n (No expansion) p (Only parents) a (All ancestors) |
Optional. Default:expand_hierarchy=n |
Important: The fields txt
, doc
and url
are mutually exclusive; in other words, at least one of them must not be empty (a content parameter is required), and in cases where more than one of them has a value assigned, only one will be processed. The precedence order is txt
, url
and doc
. If title
is specified, it will apply independently of the field used to send the content.
The fields txt
, doc
and url
are mutually exclusive; in other words, at least one of them must not be empty (a content parameter is required), and in cases where more than one of them has a value assigned, only one will be processed. The precedence order is txt
, url
and doc
. If title
is specified, it will apply independently of the field used to send the content.