Do you have any questions? Just write us an email or ask us through the feedback section.

Response

The output contains information about the status of the request and the categories extracted. The information provided is the same for the different output formats and the naming convention used for all fields is lowercase_separated_by_underscore.

Response output

These are the fields included in the response document.

Name Description
status

Contains information about the extraction process and whether it has finished successfully. It is formed by a status code (code), a natural number that identifies the result, and a message (msg), a string describing the result. In addition, the field (credits) contains a natural number that indicates the credits consumed in the request and (remaining_credits) shows the number of credits left to the user to get to the credit limit.

You can find all the possible status codes returned by the API with an explanation and tips on how to manage them in our error codes catalog.

A request is any HTTP request done to the API to analyze less than 125 words. If the text sent is longer than that, then it will be considered that more than a request is made, more specifically, as many requests as we would need if the text were divided in chunks of 125 words.

For instance, an HTTP request with 1013 words, will count as nine requests, so 9 credits will be consumed; an HTTP request with a text 25648 words long would count as 25648/125 = 205.184 => 206 credits, and so on.

Did you know...?

Only the successful requests to the API will consume credits. In other words, the credits specified in the answer will only count as credits consumed when code=0.

category_list

List of categories in which the input text is classified. Each category (category) contains the following fields:

  • code: category code.
  • label: category description.
  • abs_relevance: absolute relevance value of the category. Categories will be ordered by this value.
  • relevance: relative relevance value of the category, a number in the 0-100% range. It's computed with respect to the top ranked result (for generic models) and with respect to the top ranked result in the same dimension (for dimension models).
  • polarity: polarity associated to the category. It will only appear in the response when the polarity parameter is enabled.
  • term_list: list of the relevant terms of the category. It will only appear when the verbose parameter is enabled (and the category is triggered by terms). Each term contains the value of the term, a numeric value of how the term affects the abs_relevance of the category and a list of offsets (offset_list field), i.e. the starting and ending positions of each mention of the term within the text (inip and endp fields).
  • debug: contains information that will help in debugging user defined models. It will contain a list of the rules that were triggered for the classification. It will only appear when the debug parameter is enabled and the model used is user-defined. Each rule contains the following fields:
    • rule, with the definition of the rule.
    • line, with the line of the model where the rule is located.
    • weight, with the weight assigned to the rule.
    • type, which specifies the type of rule. Currently, only expression is supported.

Response examples

The format in which this information will be shown will be in JSON.

"@AskCiti it's been almost 3 months since I requested account change of ownership and I have heard nothing from you guys."

{
    status: {
      code: "0",
      msg: "OK",
      credits: "1",
      remaining_credits: "1179999"
    },
    category_list: [
      {
        code: "Quality>SpeedAgility",
        label: "Speed and agility",
        abs_relevance: "2",
        relevance: "100"
      },
      {
        code: "Company>Citibank",
        label: "Citibank",
        abs_relevance: "1",
        relevance: "100"
      },
      {
        code: "CustomerService>AccessibilityCommunication",
        label: "Accessibility and communication",
        abs_relevance: "1",
        relevance: "100"
      },
      {
        code: "Operation>Participants",
        label: "Participants",
        abs_relevance: "1",
        relevance: "100"
      },
      {
        code: "Satisfaction>Negative",
        label: "Negative",
        abs_relevance: "1",
        relevance: "100"
      }
    ]
}