<< Back to API Docs

Categories

This method returns a set of categories resolved from a particular Meaningtool Category Tree for some text input.

HTTP Method

GET / POST

Note: POST is also accepted here, since sometimes GET won't be enough (e.g, very long GET query strings are not supported by all web servers and proxies).

URL
http://brain.meaningtool.com/neocortex/categories
HTTP Request parameters (query string)
api_key
The API key obtained after you signed up in meaningtool.com.
input
Input data to be categorized. Could be text or a URL.
tree_key
The key of the Category Tree that will be used to make the categorization. Could be one of your trees or any public trees. If none is provided Neocortex will use any.
Additionals
top-terms
Include a list of overall top terms found in the text that where relevant to the categorization.
classifiers
Include a list of the classifiers in the Category Tree that were involved in this categorization together with its overall score in the categorization.
classifiers-top-terms
Include a list of top terms found in each classifier that appeared in the input text together with its score within the classifier.

Example JSON representation of a Result on success (with additionals top-terms+classifiers+classifiers-top-terms):

    {
      "status": "ok",
      "code": "0",
      "message": "Categories retrieved.",
      "data": {
        "categories": [
          { "score": 0.75,
            "name": "Nature",
            "top-terms": [
              { "name": "face", "score": 0.0071603300926556899 },
              { "name": "muscle", "score": 0.0055394087158549873 },
              { "name": "humanenvironment", "score": 0.012263227804223781 },
              { "name": "body", "score": 0.005647710374115854 },
              { "name": "stong", "score": 0.026752083266814566 }
            ],
            "classifiers": [
              {
                "name": "Digg Environment",
                "score": 0.59999999999999998,
                "top-terms": [
                  { "score": 0.40000000000000002, "name": "face" },
                  { "score": 0.29999999999999999, "name": "muscle" },
                  { "score": 0.20000000000000001, "name": "human" },
                  { "score": 0.10000000000000001, "name": "strong" }
                ]
              },
    
    
    
          },
          { "score": 0.5, "name": "Human body" },
          { "score": 0.40000000000000002, "name": "Physics" }
        ],
        "top-terms": [
          { "name": "face" },
          { "name": "muscle" },
          { "name": "humanenvironment" },
          { "name": "body" },
          { "name": "stong" }
        ],
        "classifiers": [
          {
            "name": "Digg Environment",
            "score": 0.59999999999999998,
            "top-terms": [
              { "score": 0.40000000000000002, "name": "face" },
              { "score": 0.29999999999999999, "name": "muscle" },
              { "score": 0.20000000000000001, "name": "human" },
              { "score": 0.10000000000000001, "name": "strong" }
            ]
          },
          {
            "name": "Slashdot.org Science",
            "score": 0.5,
            "top-terms": [
              { "score": 0.29999999999999999, "name": "muscle" },
              { "score": 0.20000000000000001, "name": "environment" },
              { "score": 0.10000000000000001, "name": "body" }
            ]
          }
        ]
      }
    }
    

Example XML representation of a Result on success (with additionals=top-terms,classifiers,classifiers-top-terms):

    <?xml version="1.0" encoding="UTF-8"?>
    <resource>
      <status>ok</status>
      <errcode></errcode>
      <message>3 categories found</message>
      <data>
        <categories>
          <category score="0.75" name="Nature" />
          <category score="0.5" name="Human body" />
          <category score="0.40000000000000002" name="Physics" />
        </categories>
        <top-terms>
          <term name="face" />
          <term name="muscle" />
          <term name="humanenvironment" />
          <term name="body" />
          <term name="stong" />
        </top-terms>
        <classifiers>
          <classifier name="Digg Environment" score="0.59999999999999998">
            <top-terms>
              <term name="face" score="0.40000000000000002" />
              <term name="muscle" score="0.29999999999999999" />
              <term name="human" score="0.20000000000000001" />
              <term name="strong" score="0.10000000000000001" />
            </top-terms>
          </classifier>
          <classifier name="Slashdot.org Science" score="0.5">
            <top-terms>
              <term name="muscle" score="0.29999999999999999" />
              <term name="environment" score="0.20000000000000001" />
              <term name="body" score="0.10000000000000001" />
            </top-terms>
          </classifier>
        </classifiers>
      </data>
    </resource>