copyright | lastupdated | ||
---|---|---|---|
|
2017-07-21 |
{:shortdesc: .shortdesc} {:new_window: target="_blank"} {:tip: .tip} {:pre: .pre} {:codeblock: .codeblock} {:screen: .screen} {:javascript: .ph data-hd-programlang='javascript'} {:java: .ph data-hd-programlang='java'} {:python: .ph data-hd-programlang='python'} {:swift: .ph data-hd-programlang='swift'}
To override automatic language detection in /analyze
requests, specify a language code in the language
attribute of the parameters
JSON object.
Example parameters.json file
{
"text": "...X, Y, Z, now I know my A, B, Cs",
"features": {
"semantic_roles": {}
},
"language": "en"
}
{: codeblock}
Example curl request
curl -X POST \
-H "Content-Type: application/json" \
-u "{username}":"{password}" \
-d @parameters.json \
"https://gateway.watsonplatform.net/natural-language-understanding/api/v1/analyze?version=2017-02-27"
{: pre}