Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Speech Streaming usage documentation. #2483

Closed
wants to merge 2 commits into from

Conversation

daspecster
Copy link
Contributor

Speech streaming has some implications to it that I think could be good to talk about.

  • What kind of inputs should we support or is just a file correct for now?
  • Should a context manager be used outside of the client or in the client.stream_recognize() method itself?
  • If interum_results is True, should we yield the results as we receive them?

@daspecster daspecster added docs api: speech Issues related to the Speech-to-Text API. labels Oct 3, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 3, 2016
@daspecster
Copy link
Contributor Author

@tseaver @dhermes LMK if you have any feedback for this. I updated it with the changes from #2495.

Copy link
Contributor

@dhermes dhermes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My nits aren't really with these docs, they are with the implementation. WDYT?


>>> results = client.stream_recognize('hello.flac', 'FLAC', 44100,
... interim_results=True)
>>> print results

This comment was marked as spam.

0.96976006031

For continuous speech containing more than one word, the ``single_utterance``
option should be disabled.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


>>> from google.cloud import speech
>>> client = speech.Client()
>>> results = client.stream_recognize('hello.flac', 'FLAC', 44100)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

>>> results[2].alternatives[0].transcript
hello
>>> results[2].alternatives[0].confidence
0.96976006031

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

}
is_final: true
}
]

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -97,6 +97,7 @@ Great Britian.
transcript: Hello, this is one test
confidence: 0


This comment was marked as spam.

This comment was marked as spam.

>>> sample = client.sample(source_uri='gs://my-bucket/recording.flac',
... encoding=Encoding.FLAC,
... sample_rate=44100)
>>> results = client.stream_recognize(sample, single_utterance=False)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

... encoding=Encoding.FLAC,
... sample_rate=44100)
>>> results = client.stream_recognize(sample, interim_results=True)
>>> print results[0].alternatives.transcript

This comment was marked as spam.

@daspecster
Copy link
Contributor Author

I'm going to close this and make a new PR with the whole shebang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: speech Issues related to the Speech-to-Text API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants