Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 991 Bytes

overriding-language-detection.md

File metadata and controls

46 lines (37 loc) · 991 Bytes
copyright lastupdated
years
2015, 2017
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'}

Overriding language detection

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}