[go: nahoru, domu]

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

Task Library: BertNLClassifier Python implementation #837

Merged

Conversation

kinarr
Copy link
Contributor
@kinarr kinarr commented Jun 13, 2022
  • 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."""
Copy link
Member

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.

Copy link
Contributor Author

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.

@kinarr
Copy link
Contributor Author
kinarr commented Jun 13, 2022

@khanhlvg I've raised a small PR to address the parameter docstrings for the other tasks here.

#838

max_seq_len: Max number of tokens to pass to the model.
"""
base_options: _BaseOptions
max_seq_len: Optional[int] = 128
Copy link
Member

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.

Copy link
Contributor Author

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.

@copybara-service copybara-service bot merged commit f559ab8 into tensorflow:master Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants