Skip to content

Add text2text evaluator#261

Merged
lvwerra merged 11 commits into
mainfrom
add-text2text-evaluator
Oct 12, 2022
Merged

Add text2text evaluator#261
lvwerra merged 11 commits into
mainfrom
add-text2text-evaluator

Conversation

@lvwerra

@lvwerra lvwerra commented Aug 18, 2022

Copy link
Copy Markdown
Member

This PR adds three evaluators following the pipeline philosophy:

  • text2text
  • translation
  • summarization

While they are functionality similar they use slightly different defaults. The parity tests for the Trainer are missing but we can add those in a separate PR I think.

(for some reason I can't add you as reviewer @fxmarty but I think you can comment anyway)

cc @philschmid

@lvwerra
lvwerra requested review from mathemakitten and ola13 August 18, 2022 17:02
@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Aug 18, 2022

Copy link
Copy Markdown

The documentation is not available anymore as the PR was closed or merged.

if tokenizer is not None and feature_extractor is not None:
logger.warning("Ignoring the value of the preprocessor argument (`tokenizer` or `feature_extractor`).")
if pipe.task != self.task:
if (pipe.task != self.task) and not (self.task == "translation" and pipe.task.startswith("translation")):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because for translation the task in the pipeline is translation_xx_to_yy where the placeholders are the languages.

@fxmarty

fxmarty commented Aug 19, 2022

Copy link
Copy Markdown
Contributor

That's great! We should include the new subclasses in https://github.com/huggingface/evaluate/blob/main/docs/source/package_reference/evaluator_classes.mdx I think, and probably mention them in the how-to guide.

@ola13 ola13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, some comments and questions inline!

Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py
lvwerra and others added 3 commits October 7, 2022 16:47
Co-authored-by: helen <31600291+mathemakitten@users.noreply.github.com>
@lvwerra

lvwerra commented Oct 10, 2022

Copy link
Copy Markdown
Member Author

Thanks for your feedback, I think I integrated everything. Let me know if you think anything else needs to be changed!

@mathemakitten mathemakitten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good to me, just some minor changes needed to the examples in the doc; see comments.

@NimaBoscarino have you had a chance to try this out yet? We can merge this for now but make updates to text2text-generation if it doesn't work with HONEST.

Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Co-authored-by: helen <31600291+mathemakitten@users.noreply.github.com>

@NimaBoscarino NimaBoscarino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a couple small comments! I don't think that this works with HONEST for the moment for a couple reasons, but I'm wrapping up a few tests and will post my thoughts + questions as soon as I'm done.

EDIT: After talking with Leandro, it sounds like HONEST would likely work better with a FillMaskEvaluator, so I can hack one together for that tomorrow!

Comment thread src/evaluate/evaluator/__init__.py
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
Comment thread src/evaluate/evaluator/text2text_generation.py Outdated
lvwerra and others added 2 commits October 12, 2022 11:53
Co-authored-by: Nima Boscarino <nima.boscarino@gmail.com>
@lvwerra
lvwerra merged commit 039a77c into main Oct 12, 2022
@lvwerra
lvwerra deleted the add-text2text-evaluator branch October 12, 2022 10:44
NimaBoscarino added a commit that referenced this pull request Oct 17, 2022
* add text2text evaluator

* add tests

* Apply suggestions from code review

Co-authored-by: helen <31600291+mathemakitten@users.noreply.github.com>

* final tweaks to t2t evaluators

* fix compute docstring in base class

* add new split/subset logic

* Apply suggestions from code review

Co-authored-by: helen <31600291+mathemakitten@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Nima Boscarino <nima.boscarino@gmail.com>

* update docs

Co-authored-by: helen <31600291+mathemakitten@users.noreply.github.com>
Co-authored-by: Nima Boscarino <nima.boscarino@gmail.com>
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.

6 participants