GeezerVison is showing github.com — Tracking Speech API development. · Issue #2522 · googleapis/google-cloud-python
Tracking Speech API development. #2522DescriptionThese are the items required to reach feature completion.
Cleanup
Future Updates:
Activitydaspecster commented on Oct 28, 2016 ContributorAuthor More actions @dhermes I commented on your gist from today but I'll copy it here as well...
Ref: https://gist.github.com/dhermes/09c964d6d27003ae817b650424fda7c3
Thank you for this!
I have another question.
As you saw in your output here, the final result has a response attribute.
In the sample the way that you unpack the response is via
response = cloud_speech_pb2.AsyncRecognizeResponse()
operation.response.Unpack(response)
But that has to be done after the Operation is completed.
How would we handle that in google-cloud-python?
The point of async is not to block right? If our lib has to wait until the operation is complete before the data can be unpacked then it would block right?
One thought I had was to add a helper of some kind that unpacks the data for us.
import time
from google.cloud import speech
from google.cloud.speech.encoding import Encoding
client = speech.Client()
sample = client.sample(source_uri='gs://ferrous-arena-my-test-bucket/sample.raw', encoding=Encoding.LINEAR16, sample_rate=16000)
operation = client.async_recognize(sample, max_alternatives=2)
retry_count = 10
while retry_count > 0 and not operation.complete:
retry_count -= 1
time.sleep(1)
operation.poll() # API call
for result in speech.unpack_async(operation): # The helper `unpack_async`.
print('Result:')
for alternative in result.alternatives:
print(u' ({}): {}'.format(
alternative.confidence, alternative.transcript))
But otherwise I'm not sure how to get the data without blocking unless we do some kind of weird pubsub design. daspecster commented on Oct 28, 2016 ContributorAuthor More actions Scratch that...we could just parse it in Operation.poll() right? I think I would have to either override google.cloud.core.operation.Operation.poll or I could add some kind of polling proxy method. dhermes commented on Oct 28, 2016 @daspecster It's not up to use to get the data, just give the user the Operation and let them decide how to poll. fehrenbacher commented on Nov 8, 2016 Is this available yet? I've installed google-cloud 0.20.0, but can't find the google.cloud.speech.client.Client class. I've also found this page for a separate google-cloud-speech library, but pip can't find any actual releases there. The documentation sure makes it sound like this is available to use now... gw00207 commented on Nov 9, 2016 @fehrenbacher yes, that documentation is confusing. hopefully a message is added soon to explain: #2620 daspecster commented on Nov 9, 2016 ContributorAuthor More actions @fehrenbacher it's not released yet, however if you install from source you can play with the API.
As you can see in the first link, it's at the "Planning" stage. That package is a place holder.
The documentation message hasn't gone up because there hasn't been a release yet. We're working on a better release strategy as well. fehrenbacher commented on Nov 9, 2016 K thanks for clearing that up! daspecster commented on Nov 9, 2016 ContributorAuthor More actions gw00207 commented on Nov 11, 2016 daspecster commented on Dec 8, 2016 ContributorAuthor More actions Closing this since everything is complete and I opened #2842 to track the last few little changes.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|