-
Notifications
You must be signed in to change notification settings - Fork 1
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
Enhancements to ASR API #5
Conversation
@LoyVanBeek This wasn't ready :) |
Oh hey, that's weird. Looked OK but didn't see it was a draft |
As only asr uses these pipeline elements, it makes sense to rename the module to asr
@LoyVanBeek With this I can say, the API can almost be treated as stable. I have tested the changes with |
"""Optional method to stop the stream of the element""" | ||
|
||
def register_callback(self, callback): | ||
"""Register a callback to the element outside the pipeline""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be either implemented or raise NotImplementedError
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't have this implemented then by default it is pass
. But do you suggest to add a NotImplementedError
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is pass
in a valid behavior, could there be a class that works by using pass
? If not, then use NotImplementedError
. Otherwise, pass
is a valid default implementation.
from ..logger import logger | ||
|
||
|
||
class AsrPipeline(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this an AsrPipelineElementBase
subclass as well for extra software architecture hard-on :-).
It matches the API already and allows for nesting, which is always cool somehow 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha yeah! I had to think a lot for making it like this. Will subclass it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to make this into an issue as there are some attributes that need cleanup by converting it into a property
Bump |
This PR:
AsrPipeline
class to construct a pipeline using appropriate elements. This would serve as a manager of the pipeline and its methods likeopen
,start
,stop
,close
would act as the controlling interfaces to the pipeline.Each element of the ASR pipeline can still be used standalone by supplying the appropriate input using the method
next_chunk
of the element. Supplying input toSource
elements usingnext_chunk
would do nothing as they generate data, but to keep an unified API they accept input.Completes a part of #4
Appropriate changes need to be made in tue-robotics-graveyard/yapykaldi_ros#1