0

I have a question regarding the integration of the speech to text iOS library called SFSpeechRecognizer. I need SFSpeechRecognizer to recognize terms that are not present in the iOS dictionary like medication names, chemistry terms, etc. I would have to add them, somehow, for SFSpeechRecognizer to be able to recognise them. Is this possible? Thanks

Bruno Coelho
  • 926
  • 13
  • 25

1 Answers1

1

Add your words to the

SFSpeechRecognitionRequest.contextualStrings array:

 let request = SFSpeechURLRecognitionRequest(url: fileUrl)
 request.contextualStrings = ["twersht", "baglom"]

now "My baglom is very twersht" will be returned by the SFSpeechRecognizer after you say it.

contextualStrings reference

Ross Knipe
  • 518
  • 3
  • 16