Abdul Wadhood Rehman
Abdul Wadhood Rehman

Reputation: 119

Speech recognition application not returning the exact word in android

I have created an application which allows the user to find the nearest hotels. Now the user is able to give the voice and able to see the result. But the local names like "cochin" or "Chennai" are not in the result if the user speaks those names. But the names like "London", "New York" or "Mumbai" are able to view. The code which I am using given below.

private void startVoiceRecognitionActivity() {
    Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
            RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
    intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speak Now");
    startActivityForResult(intent, REQUEST_CODE);
}

Upvotes: 2

Views: 592

Answers (2)

gregm
gregm

Reputation: 12169

You can't improve Google speech recognition, but you can match anyway even through if Google does not return the correct word..

Use a phonetic matching algorithm like Soundex to determine if the words that google returns sound like the one you want. For example, if the user is trying to say "cochin" and google returns "corn" it may be still is possible to still match it.

Upvotes: 0

Ollie C
Ollie C

Reputation: 28519

This is a limitation of the speech engine. It's the same in all locations - well-known places (larger towns and cities) work fine, but the dictionaries Google uses just don't seem to include the names of smaller places.

I don't think there's anything you can do to resolve this. It's up to Google to improve their speech recognition.

Upvotes: 2

Related Questions