我想使用Azure的文本分析工具來提取主題,但得到的400錯誤請求錯誤:我下面的代碼:Azure的認知文本分析工具返回400錯誤的請求的Python
account_key = '546e6162da424e6f991d03b7f6acxxx'
headers = {
'Ocp-Apim-Subscription-Key': account_key,
'Content-Type': 'application/json',
'Accept': 'application/json'}
import requests
tufani={
"documents": [
{
"language": "en",
"id": "1",
"text": "First document"
},
{
"language": "en",
"id": "100",
"text": "Final document"
}
]
}
print('Starting topic detection.')
uri = base_url + 'text/analytics/v2.0/topics'
r=requests.post('https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/topics',data=str(tufani),headers =headers)
print(r.status_code, r.reason)
(400,「壞請求')
我在這做錯了什麼?
謝謝!