前段時(shí)間有一個(gè)語(yǔ)音識(shí)別的項(xiàng)目,便輕輕地研究了一下,雖沒(méi)有達(dá)到預(yù)期的效果,但過(guò)程還是比較有趣。
題目是這樣的:給定一些潛在客戶(hù),用 FreeSWITCH 自動(dòng)呼叫,如果用戶(hù)應(yīng)答,則轉(zhuǎn)至 IVR,播放歡迎信息甚至轉(zhuǎn)至人工座席;如果客戶(hù)不應(yīng)答,則獲取不應(yīng)答原因。
該想法想要達(dá)到的目標(biāo)是:1)客戶(hù)關(guān)懷?蛻(hù)注冊(cè)即可收到關(guān)懷電話(huà)(當(dāng)然前提是留下電話(huà)號(hào)碼。OK,發(fā)短信是另一種方式,但我這們里討論的是語(yǔ)音);2)過(guò)濾無(wú)效客戶(hù)。從不同渠道來(lái)的客戶(hù)數(shù)據(jù)良莠不齊,有的甚至50%以上都無(wú)法打通,所以,把這部分?jǐn)?shù)據(jù)過(guò)濾掉顯然是很有意義的。
雖然我們?cè)谕夂糁惺褂?SIP,但被叫用戶(hù)在PSTN,而PSTN信令網(wǎng)一個(gè)很令人討厭的地方就是返回的信令不準(zhǔn)確,所以,你無(wú)法從信令層面獲取被叫用戶(hù)的狀態(tài)(空號(hào),忙等),而只能從語(yǔ)音層面去“聽(tīng)”。當(dāng)然,聽(tīng),對(duì)于人來(lái)說(shuō)是沒(méi)有問(wèn)題的,但對(duì)于機(jī)器來(lái)說(shuō),就不輕松了,它需要使用語(yǔ)音識(shí)別(ASR,Automatic Sound Recognition)技術(shù)來(lái)實(shí)現(xiàn)。
Sphinx 應(yīng)該是開(kāi)源的語(yǔ)音識(shí)別公認(rèn)的比較好的軟件。幸運(yùn)的是 FreeSWITCH 帶了 pocket_sphinx 模塊。它即能進(jìn)行連續(xù)的識(shí)別,也能針對(duì)關(guān)鍵詞進(jìn)行識(shí)別,在測(cè)試階段,成功率還是比較高的。但實(shí)際上我們真正要測(cè)的數(shù)據(jù)太爛,所以沒(méi)有收到好的效果。
樣本
目前PSTN網(wǎng)上有各種語(yǔ)音數(shù)據(jù),除了各種各樣的彩鈴之外,便是五花八門(mén)的語(yǔ)音提示,而且,針對(duì)同一種掛機(jī)原因,有各種不同版本的語(yǔ)音提示。為了獲取樣本,我打了不同省市不同運(yùn)營(yíng)商的電話(huà)并錄音:
originate sofia/gateway/blah/139xxxxxxxx &record(/tmp/testx.wav)
作為測(cè)試,我選擇了以下幾種:
您撥的號(hào)碼是空號(hào),請(qǐng)查證再撥....(無(wú)限循環(huán))
對(duì)不起,您撥叫的用戶(hù)不方便接聽(tīng)您的電話(huà),請(qǐng)稍后再撥。Sorry, the subscriber you have dialed is not convenient to answer now, please dial again later. (循環(huán)...)
您好,您所撥打的號(hào)碼是空號(hào),請(qǐng)核對(duì)后再撥。您好,您所撥打的號(hào)碼是空號(hào),請(qǐng)核對(duì)后再撥。Sorry, the number YOU dialed doesn't exist, please check it and dial again.(循環(huán)... 一個(gè)問(wèn)題是 YOU 有必要強(qiáng)調(diào)嗎?)
號(hào)碼是空號(hào),請(qǐng)查證后再撥。 Sorry, The number you have dialed is not in service, please check the number and dial again. (循環(huán))
如果你聽(tīng)一下,你會(huì)發(fā)現(xiàn)真是太難聽(tīng)了。那么大的電話(huà)公司,不能找個(gè)專(zhuān)業(yè)的人錄音嗎?(個(gè)人感覺(jué) test4.wav 還是比較專(zhuān)業(yè))
test1.wav test2.wav test3.wav test4.wav
第一種方案,關(guān)鍵詞
我將幾個(gè)關(guān)鍵字寫(xiě)進(jìn)了 grammer中,如:
grammar hpcause;
<service> = [ service ];
<rejected> = [ convenient ];
<busy> = [ busy ];
<konghao> = [ konghao ];
<exist> = [ exist ];
public <hpcause> = [ <service> | <rejected> | <busy> | <konghao> | <exist> ];
實(shí)際測(cè)試中,我甚至將“空號(hào)”(konghao)作為關(guān)鍵詞加上去,的確有時(shí)候能識(shí)別出來(lái)。由于中英文混雜,識(shí)別率太低。純英文的環(huán)境比較理想。
第二種方案,連續(xù)識(shí)別
當(dāng)然我也試過(guò)連續(xù)的語(yǔ)音識(shí)別,效果都不理想。pocket_sphinx 是支持中文的,但配置比較復(fù)雜,而且我也懷疑它在中英文混合識(shí)別方面的效果到底如何。
第三種方案,只錄音,采用外部程序識(shí)別
要想在 FreeSWITCH 中準(zhǔn)確識(shí)別這么復(fù)雜的情況看來(lái)是不現(xiàn)實(shí)的。另一種想法就是只錄音,而采用外部程序(可能還是 Sphinx)來(lái)識(shí)別?梢葬槍(duì)中英文各識(shí)別一次,去掉不能識(shí)別的部分,我相信效果還是可以的。但沒(méi)有試過(guò)。
第四種方案,Google Voice
實(shí)際上 Google Voice 有一個(gè)很有趣的功能就是 Voice Mail,當(dāng)你的電話(huà)無(wú)法接通時(shí),它可以錄音,并能轉(zhuǎn)換成文本。我今天忽然想到,能否讓 Google Voice 來(lái)替我們做這項(xiàng)工作 ?如果行,對(duì)于每個(gè) Voice Mail 我們都能收到一封電子郵件,豈不是絕了?
我趕緊試了以下命令:
originate {ignore_early_media=true}sofia/gateway/blah/1717673xxxx 'sleep:3,playback:/home/app/t/test4.wav' inline
上面,我呼叫我的 Google Voice 號(hào)碼,并撥放聲音文件,為了等待 Google Voice 啟動(dòng) Voice Mail,暫停了3秒。其中使用了 FreeSWITCH 的 inline dialplan。
不得不說(shuō),人家 Google Voice 的功力就是比較深,以下是呼叫結(jié)果(雖然它花了好長(zhǎng)時(shí)間生成這些文本):
But how much you called her some cat content, a lot. But how much you called her some cat content walk. But how much you called her chin cat content walk. But how much you called her some cat content water. But how much you called her some cat content walk. But how much you called her team cat content walk. But how much you called her teams have content walk. But how much you called her team cat content walk. But how much you called her team captain sample. But how much you called her some cat content. Blah. But how much you called her team packing 10 o'clock. But.
由于第一條語(yǔ)音是純中文的,對(duì)比一下,可以發(fā)現(xiàn) GV 的想象力是比較豐富的。
您 撥的 號(hào) 碼是 空 號(hào)
But How much Called her
Dave, date which he didn't full full time. Thank you can. Looking for some sure. Okay well, sorry the subscriber to get that out. If not, yes right now. Please check it out later, date which he didn't hopeful. I think you can. Looking for some chance. Okay well, sorry. The subscriber to get that out. If not, yes uncertain, so. Please straight out later. If You Keep Doing phone found antiquing employer some chocolates as well. Sorry. The subscriber you have dialed is not company as uncertain. So please straight out later. Hey Vicky, but I think in full full time. Thank you been looking for. So, I'm sure. Okay well, sorry. The subscriber you have dialed is house company as of right now lease without a later Hello. Hey Vicky, like, I can hopeful. I think you can get them some chocolates at. Well, sorry. The subscriber you have dialed is not come again it's on sale now. Please straight out later. Hey Vicky, but I don't know 4 phone so I think you can get some fire some chocolate at 40 sorry. The subscriber you have dialed is not come again it's on sat. Now, Please, straight out later.
"not convenient" 跟 "not come again" 相比意思應(yīng)該差不多吧?哈
Com critical table, the com the job without the how much you can call team critical examples of the the number in the Dells doesn't exist. Please check it and Dale again the com job without a, how much you can call few critical table, the com the job without a, how much you can call team critical to thank both of these, the number in the Dells doesn't exist. Please check it and down again.