Azure Language in Foundry Tools
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I followed the document and created API access, posting queries but it returned 404 with the message 'resource not found'. Hope to get help
My codes:
def submit_job(text):
data = {
"kind": "Conversation",
"analysisInput": {
"conversationItem": {
"id": "1",
"participantId": "1",
"text": text
}
},
"parameters": {
"projectName": f"{PROJECT_NAME}",
"deploymentName": f"{DEPLOYMENT_NAME}",
"stringIndexType": "Utf16CodeUnit"
}
}
resp = requests.post(
endpoint,
headers=headers,
json=data
)
return resp
#%% Azure call
PROJECT_NAME='Bond-parser-conversation'
DEPLOYMENT_NAME='merged_2'
API_VERSION='2022-10-01-preview'
endpoint = 'https://conversation-und.cognitiveservices.azure.com/language/:analyze-conversations?api-version={API_VERSION}'
headers = {
'Ocp-Apim-Subscription-Key': 'xxxxxxxxxxxxxxxxxxxxx'
}
result=submit_job(text)
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
Answer accepted by question author
Try this u[dated code below
def submit_job(text):
data = {
"kind": "Conversation",
"analysisInput": {
"conversationItem": {
"id": "1",
"participantId": "1",
"text": text
}
},
"parameters": {
"projectName": f"{PROJECT_NAME}",
"deploymentName": f"{DEPLOYMENT_NAME}",
"stringIndexType": "Utf16CodeUnit"
}
}
resp = requests.post(
endpoint,
headers=headers,
json=data
)
return resp
PROJECT_NAME = 'Bond-parser-conversation'
DEPLOYMENT_NAME = 'merged_2'
API_VERSION = '2022-10-01-preview'
endpoint = f'https://conversation-und.cognitiveservices.azure.com/language/analyze-conversations?api-version={API_VERSION}'
headers = {
'Ocp-Apim-Subscription-Key': 'xxxxxxxxxxxxxxxxxxxxx'
}
text = "Your conversation text here." # fill your convo here
result = submit_job(text)
: Removed the colon : from the endpoint path.submit_job. from the endpoint path.Hope this helps, kindly accept the answer if you find it useful thanks much.