Meaningtool Neocortex API Python Client
Pull request Compare This branch is 5 commits behind popego:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Meaningtool Neocortex API Python Client

This is a library that implements meaningtool's neocortex API in python.

All API access begins with the creation of a NeocortexRestClient object. For the sake of brevity, this document assumes you've created an object called nc as a meaningtool endpoint:

import neocortex_client
nc = neocortex_client.NeocortexRestClient('myapikey')

You can find your api key from your account page at meaningtool.

Wherever you are asked for input on neocortex's API mehtods it can either be an url or text.


Obtain a set of categories of an specific tree from your input.

ca = nc.categories('yourinput', 'sometreekey')

You can pick a tree to categorize your input from the public tree directory or from your private trees on your 'My Trees' section at meaningtool, by pasting the desired tree's key.

Some examples for better understanding:

# This example uses the default 'General Knowledge' tree.
ca = nc.categories('')

# This example uses the 'Gadget Trends' tree.
ca = nc.categories('', '7fdc08c2-37e8-46a6-b8db-27e328d47320')


Obtain a set of keywords from your input.

kw = nc.keywords('yourinput')


Obtain a set of entities from your input.

en = nc.entities('yourinput')


Obtain your input's language.

la = nc.language('yourinput')

Multifunction Requests

You can use this feature to obtain results of multiple api methods for the same input in one request.

You must first get a builder:

builder = nc.get_builder()

Then you can chain any api method, for example:

res = builder.input('yourinput').categories().keywords().language().meaningfy()

Obtaining your result from res.payload.