Quickstart Code Example
Annotate a document and read the entities back — in Python
This page submits one document with the Python SDK and reads the coded entities out of the result. It is the shortest path from an API key to structured output; the Quickstart covers the same ground from the command line, and Building your own client goes deeper.
Install the SDK and set your key in the environment:
Create a client
The SDK takes the server URL and your credentials. A single string is an API
key; a (access key, shared secret) tuple selects
HMAC authentication instead.
Pass the server URL explicitly, as below. Do not use
Emtellipro.DEFAULT_SERVER — the value compiled into the SDK is
api.emtelligent.com, which is deprecated and no longer answers.
Submit a document
Every document needs an id unique within the submission, plus a category and
subcategory — these are validated against the sets the engine accepts, so they
are not free text.
submit returns immediately with a ResultFuture. Passing features= narrows
what the engine computes; the default is every feature.
Wait for the result
Read the entities
A Result holds annotated_docs, one per document you submitted. Each found
entity carries the text it matched, its assertion attributes, and the concepts it
resolved to — which is how one mention maps into several ontologies at once.
The shape of what comes back — how concept_links and locations resolve — is
laid out with a real payload on the
JSON Result Format page.
