Uberi / Uberi/speech_recognition
IBM iam_apikey
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9k
- Forks
- 2.4k
- Avg merge
- 12h 24m
- Merged PRs (30d)
- 3
Description
Steps to reproduce
- I would like to use IBM instead of Google. In the word game example, replaced line 43 with response["transcription"] = recognizer.recognize_ibm(audio).
In the documentation: recognizer_instance.recognize_ibm(audio_data: AudioData, username: str, password: str, language: str = "en-US", show_all: bool = False) -> Union[str, Dict[str, Any]]
IBM moved to IAM_APIKEY, away from username / password
-
Code from word guess game example:
set up the response object
response = {
"success": True,
"error": None,
"transcription": None
}try recognizing the speech in the recording
if a RequestError or UnknownValueError exception is caught,
update the response object accordingly
try:
#PH: replacing with IBM response["transcription"] = recognizer.recognize_google(audio)
response["transcription"] = recognizer.recognize_ibm(audio, iam_apikey='*********',
url='https://stream.watsonplatform.net/speech-to-text/api')
Expected behaviour
Would like to leverage IBM since it provides intermediate results, much faster as Google
Actual behaviour
Error:
Traceback (most recent call last):
File "wordGuess.py", line 92, in
guess = recognize_speech_from_mic(recognizer, microphone)
File "wordGuess.py", line 45, in recognize_speech_from_mic
url='https://stream.watsonplatform.net/speech-to-text/api')
TypeError: recognize_ibm() got an unexpected keyword argument 'iam_apikey'
(What happened instead? How is it different from what you expected?)
(If the library threw an exception, paste the full stack trace here)
System information
(Delete all the statements that don't apply.)
My system is macOS Mojave
My Python version is 3.7.2
My Pip version is 19.0.3
My SpeechRecognition library version is 3.8.1
My PyAudio library version is 0.2.11
My microphones are: MacBook Pro Microphone', 'MacBook Pro Speakers', 'Soundflower (2ch)', 'Soundflower (16ch)']
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the recognize_ibm signature and its documentation, then reproduce the reported TypeError with the word game example in the issue. Done means IBM authentication using iam_apikey is supported or the documented authentication parameters match the current IBM API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100