不支持的文本语言:自然语言理解 API
Unsupported text language : natural language understanding API
我正在使用 IBM 云的自然语言理解 API,但是英语以外的语言给我一个不受支持的语言的错误。
我的请求参数如下所示:
$url = "https://api.us-south.natural-language-understanding.watson.cloud.ibm.com/instances/****/v1/analyze?version=2017-02-27";
$token = "apikey:****************";
$token = base64_encode($token);
$language = 'de';
$bodyArray = [
"text" => $text,
"features" => [
"syntax" => [
"sentences" => true
]
],
"language" => $language
];
$body = json_encode($bodyArray);
$headers = [
'Authorization' => 'Basic ' . $token,
"Content-Type" => "application/json"
];
$client = new Client();
$request = new GuzzleHttpRequest('POST', $url, $headers, $body);
$response = $client->send($request);
$response = $response->getBody()->getContents();
syntax / sentences seems to be an experimental feature and hence only supported for the English language. That feature is not listed in the language support for the GA features 的 NLU 功能。
因此,我认为它不是设计使然。
我正在使用 IBM 云的自然语言理解 API,但是英语以外的语言给我一个不受支持的语言的错误。
我的请求参数如下所示:
$url = "https://api.us-south.natural-language-understanding.watson.cloud.ibm.com/instances/****/v1/analyze?version=2017-02-27";
$token = "apikey:****************";
$token = base64_encode($token);
$language = 'de';
$bodyArray = [
"text" => $text,
"features" => [
"syntax" => [
"sentences" => true
]
],
"language" => $language
];
$body = json_encode($bodyArray);
$headers = [
'Authorization' => 'Basic ' . $token,
"Content-Type" => "application/json"
];
$client = new Client();
$request = new GuzzleHttpRequest('POST', $url, $headers, $body);
$response = $client->send($request);
$response = $response->getBody()->getContents();
syntax / sentences seems to be an experimental feature and hence only supported for the English language. That feature is not listed in the language support for the GA features 的 NLU 功能。
因此,我认为它不是设计使然。