-
Notifications
You must be signed in to change notification settings - Fork 30
CometoidWMTQualityEstimation processor implementation #151
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
Conversation
Signed-off-by: Sasha Meister <[email protected]>
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.
Thanks for the PR. Please see minor comments:)
self.model = None | ||
|
||
def load_model(self): | ||
from pymarian import Evaluator |
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.
Let’s wrap this in a try/except block. Attempt to import Evaluator, and if the import fails, log a message indicating that pymarian needs to be installed.
|
||
self.model = Evaluator(marian_args) | ||
|
||
def process_dataset_entry(self): |
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 there a reason to inherit from BaseParallel processor if we do not use process_dataset_entry
tests/test_cometoid_qe.py
Outdated
mock_processor.finalize = MagicMock() | ||
mock_processor.number_of_entries = 0 | ||
|
||
# 👇 Patch load_model to avoid real downloading |
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 love the emoji 😄 But sadly, our codebase is an emoji-free zone 🚫. Mind removing it?
Signed-off-by: root <[email protected]>
A processor for estimating translation quality using pretrained COMET-like models based on MarianNMT and the pymarian Evaluator