-
Notifications
You must be signed in to change notification settings - Fork 126
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
Task Library: BertNLClassifier Python implementation #837
Task Library: BertNLClassifier Python implementation #837
Conversation
edited
- Python API implementation for the BertNLClassifier
- A simple test to try out the API
|
||
@dataclasses.dataclass | ||
class BertNLClassifierOptions: | ||
"""Options for the Bert NL classifier task.""" |
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.
Please add docstring to explain each parameter. They will show up in API documentation like this:
https://www.tensorflow.org/lite/api_docs/python/tflite_support/task/audio/AudioClassifierOptions
I realized that some option classes don't have parameter docstring so please send a follow-up PR to fix other classes.
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.
@khanhlvg Updated the docstring now. PTAL.
max_seq_len: Max number of tokens to pass to the model. | ||
""" | ||
base_options: _BaseOptions | ||
max_seq_len: Optional[int] = 128 |
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.
Actually it looks like max_seq_len is now deprecated so you can remove this option.
tflite-support/tensorflow_lite_support/cc/task/text/proto/bert_nl_classifier_options.proto
Line 33 in 46cd036
optional int32 max_seq_len = 2 [default = 128]; |
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.
@khanhlvg Alright, I've removed it now.