zaf / asterisk-speech-recog

Speech recognition script for Asterisk that uses google's speech engine.
GNU General Public License v2.0
245 stars 131 forks source link

AGI not returning confidence parameter #21

Closed dvarella closed 8 years ago

dvarella commented 8 years ago

Dear Zaf,

The speech-recog.agi was working perfectly for months, but since some weeks ago I´m checking that It is not returning the "confidence" parameter anymore as you can see by Asterisk AGI debug attached file. And I was using that parameter to check how "confident" the recognition engine feels about the result. Is there any trouble with this engine ? How can I start receive this parameter again ?

PS: Since then I realized that recognition has a certain drop in quality. Where, for example, my name was recognized in my tests often as "Daniels," "Daniel 1", "Danieles", and my correct name is 'Daniel'. Earlier recognition is very in tune.

agi set debug on

<SIP/2555-0000000b>AGI Tx >> agi_request: speech-recog.agi <SIP/2555-0000000b>AGI Tx >> agi_channel: SIP/2555-0000000b <SIP/2555-0000000b>AGI Tx >> agi_language: pt_BR <SIP/2555-0000000b>AGI Tx >> agi_type: SIP <SIP/2555-0000000b>AGI Tx >> agi_uniqueid: pabx_ip-1444091299.11 <SIP/2555-0000000b>AGI Tx >> agi_version: 1.8.25.0 <SIP/2555-0000000b>AGI Tx >> agi_callerid: 99999999999 <SIP/2555-0000000b>AGI Tx >> agi_calleridname: unknown <SIP/2555-0000000b>AGI Tx >> agi_callingpres: 0 <SIP/2555-0000000b>AGI Tx >> agi_callingani2: 0 <SIP/2555-0000000b>AGI Tx >> agi_callington: 0 <SIP/2555-0000000b>AGI Tx >> agi_callingtns: 0 <SIP/2555-0000000b>AGI Tx >> agi_dnid: 2555 <SIP/2555-0000000b>AGI Tx >> agi_rdnis: unknown <SIP/2555-0000000b>AGI Tx >> agi_context: principal <SIP/2555-0000000b>AGI Tx >> agi_extension: s <SIP/2555-0000000b>AGI Tx >> agi_priority: 5 <SIP/2555-0000000b>AGI Tx >> agi_enhanced: 0.0 <SIP/2555-0000000b>AGI Tx >> agi_accountcode: <SIP/2555-0000000b>AGI Tx >> agi_threadid: 140502816749312 <SIP/2555-0000000b>AGI Tx >> agi_arg_1: pt-BR <SIP/2555-0000000b>AGI Tx >> agi_arg_2: 2 <SIP/2555-0000000b>AGI Tx >> agi_arg_3: <SIP/2555-0000000b>AGI Tx >> agi_arg_4: NOBEEP <SIP/2555-0000000b>AGI Tx >> <SIP/2555-0000000b>AGI Rx << SET VARIABLE "utterance" "-1" <SIP/2555-0000000b>AGI Tx >> 200 result=1 <SIP/2555-0000000b>AGI Rx << SET VARIABLE "confidence" "-1" <SIP/2555-0000000b>AGI Tx >> 200 result=1 <SIP/2555-0000000b>AGI Rx << CHANNEL STATUS <SIP/2555-0000000b>AGI Tx >> 200 result=6 <SIP/2555-0000000b>AGI Rx << GET FULL VARIABLE ${CHANNEL(audionativeformat)} <SIP/2555-0000000b>AGI Tx >> 200 result=1 (ulaw) <SIP/2555-0000000b>AGI Rx << RECORD FILE /tmp/stt_DA02Se sln "#" "-1" "s=2" <SIP/2555-0000000b>AGI Tx >> 200 result=99980 (timeout) endpos=22560 <SIP/2555-0000000b>AGI Rx << SET VARIABLE "utterance" "Daniels" <SIP/2555-0000000b>AGI Tx >> 200 result=1 <SIP/2555-0000000b>AGI Rx << SET VARIABLE "confidence" "" <SIP/2555-0000000b>AGI Tx >> 200 result=1

agi set debug off

Thanks in advance.

zaf commented 8 years ago

Thank you for the report, I noticed it a few days ago. The format of the JSON data that the API returns has changed a bit lately. I will push a fix soon.

zaf commented 8 years ago

Fix pushed, feel free to test and report.

dvarella commented 8 years ago

Zaf, Yes ! The fix worked as expected. Thank you.