Skip to content

Latest commit

 

History

History
51 lines (40 loc) · 1.01 KB

File metadata and controls

51 lines (40 loc) · 1.01 KB
copyright
years
2015, 2020
lastupdated 2020-02-24
subcollection natural-language-understanding

{:shortdesc: .shortdesc} {:new_window: target="_blank"} {:tip: .tip} {:pre: .pre} {:note: .note} {: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

{: #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 --user "apikey:{apikey}" \
"{url}/v1/analyze?version=2018-09-21" \
--request POST \
--header "Content-Type: application/json" \
--data @parameters.json

{: pre}