Using the Analytics API
Input Parameters
All input parameters, including the text or names being analyzed, are defined in the request body, along with any options. Babel Street Analytics analyzes two different types of input data. Each endpoint only analyzes one of the following types of data:
Options
-d '{"options": {"optionName": value}}' -d '{"options": {"calculateConfidence": true}}'
The endpoints use options to pass settings or override default values for settings. The options syntax is:
{"options": {"optionName": value}}
where optionName is the name of the option and value is the selected value for the call.
For example, to return the confidence score for each entity returned by the /entities
endpoint, the option calculateConfidence
must be set to true.
{"options": {"calculateConfidence": true}}
Language Support and Selection
The documentation for each endpoint contains a Language Support section, which lists the endpoint’s supported languages and scripts. This list can be dynamically retrieved using the endoint’s GET /[endpoint]/supported-languages
method.
If you know the language of your input, include the three-letter language code as a parameter in your call. This will improve response time and the accuracy of your results. If you do not know the language of your text, the endpoint will run an extra process to automatically detect it.
If no language is provided, and the endpoint is unable to auto-detect it, an endpoint may provide a “Language xxx
is not supported” error, where xxx
indicates the language was not determined.