Hi, I just confirmed that this is by design. The rest API returns only the best result. There has been no change in the behavior of this api for a long while.
Azure Speech To Text: How to receive NBext with REST API
Hello,
i have lot of short audio wave files of 5 seconds or so in hand. When i transcribe them with Azure Speech-To-Text REST API, i hope to receive NBest candidate list with below config:
url='https://eastasia.stt.speech.azure.cn/speech/recognition/conversation/cognitiveservices/v1?language=' + LANG
headers = {
'Accept': 'application/json;text/xml',
'Content-Type': 'audio/wav;codecs="audio/pcm";samplerate=16000',
'Ocp-Apim-Subscription-Key': <my key>,
'format': 'detailed'
}
But the response always contain only one best like {"RecognitionStatus":"Success","DisplayText":"what's the weather","Offset":1900000,"Duration":90900000}, instead of NBest i received from SDK like
{
"DisplayText":"What's the weather",
"Duration":21700000,
"Id":"ec7ccf3b7ba043f38cc37ab8460bee1a",
"NBest":[
{
"Confidence":0.9751314,
"Display":"What's the weather",
"ITN":"what's the weather",
"Lexical":"what's the weather",
"MaskedITN":""
},
{
"Confidence":0.9354952,
"Display":"What the weather",
"ITN":"what the weather",
"Lexical":"what the weather",
"MaskedITN":""
},
{
"Confidence":0.93834907,
"Display":"What is the weather",
"ITN":"what is the weather",
"Lexical":"what is the weather",
"MaskedITN":""
},
{
"Confidence":0.93267226,
"Display":"What's the weather",
"ITN":"whats the weather",
"Lexical":"whats the weather",
"MaskedITN":""
},
{
"Confidence":0.9348001,
"Display":"What S the weather",
"ITN":"what s the weather",
"Lexical":"what s the weather",
"MaskedITN":""
}
],
"Offset":7800000,
"RecognitionStatus":"Success"
}
Any config i missed in REST API ?
Thank you.
1 additional answer
Sort by: Most helpful
-
duuq 1 Reputation point
2022-03-16T12:15:27.77+00:00 I'd like to request that the REST API please behave like the SDK and return more than one result, not just "the best" result.
Many people are looking for this, and are confused, including posters on Stack Overflow.Nowhere in the documentation does it say that the REST API return only one result, in fact the REST API documentation shows a sample return with two results. Multiple results is key for many projects, please don't hobble the REST API.
I ask that Microsoft please fix this so that REST API returns multiple results just as the SDK does.