Keywords support

Post Reply
zkaiser
Posts: 1
Joined: Mon Feb 25, 2019 9:09 am

Keywords support

Post by zkaiser » Mon Feb 25, 2019 9:14 am

I asked in Unity forum if there was the possibility to add keywords to improve detection as stated in google forums with:
"config": {
"encoding":"LINEAR16",
"sampleRateHertz": 8000,
"languageCode":"en-US",
"speechContexts": [{
"phrases":["Chromecast", "Chromecast model"]
}]
},

And you told me to use Speech Context as Phrases list. How is it supposed to be used?
I have this code:
string[] phrases = _contextPhrases.text.Trim().Split(","[0]);

if (phrases.Length > 0)
_speechRecognition.SetContext(new List<string[]>() { phrases });

I try to implement before and after start recording and before and after stop recording, but there is no improvement in recognition. System recognizes keywords the same way other words are recognized.

Can you post use example? Thanks in advance,

Pedro.

admin
Site Admin
Posts: 5
Joined: Thu Jan 17, 2019 10:10 am

Re: Keywords support

Post by admin » Tue Feb 26, 2019 10:14 am

zkaiser wrote:
Mon Feb 25, 2019 9:14 am
I asked in Unity forum if there was the possibility to add keywords to improve detection as stated in google forums with:
"config": {
"encoding":"LINEAR16",
"sampleRateHertz": 8000,
"languageCode":"en-US",
"speechContexts": [{
"phrases":["Chromecast", "Chromecast model"]
}]
},

And you told me to use Speech Context as Phrases list. How is it supposed to be used?
I have this code:
string[] phrases = _contextPhrases.text.Trim().Split(","[0]);

if (phrases.Length > 0)
_speechRecognition.SetContext(new List<string[]>() { phrases });

I try to implement before and after start recording and before and after stop recording, but there is no improvement in recognition. System recognizes keywords the same way other words are recognized.

Can you post use example? Thanks in advance,

Pedro.
Hello,
actually you trying to use correct API for speech context.
it generates json you sent above.

As I understand speech context affect on detection not so much, just use this a sconext of speech recognition but it will not use it as final result.

Better ask Google team how his service detect speech context - phrases.
https://cloud.google.com/speech-to-text ... rase-hints

You may use these phrase hints in a few ways:
Improve the accuracy for specific words and phrases that may tend to be overrepresented in your audio data. For example, if specific commands are typically spoken by the user, you can provide these as phrase hints. Such additional phrases may be particularly useful if the supplied audio contains noise or the contained speech is not very clear.

Add additional words to the vocabulary of the recognition task. Speech-to-Text includes a very large vocabulary. However, if proper names or domain-specific words are out-of-vocabulary, you can add them to the phrases provided to your requests's speechContext.
So when you use Speech context it will improve accuracy or add some words to vocabulary but this process only on google side and we cant affect on it.
just insert phrases in speech context and thats all..

Hope it will help you a bit with that.

Best Regards

Post Reply