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

toxicity evaluator added #70

Merged
merged 1 commit into from
Sep 26, 2024
Merged

toxicity evaluator added #70

merged 1 commit into from
Sep 26, 2024

Conversation

qingyangliu0065
Copy link
Collaborator

@qingyangliu0065 qingyangliu0065 commented Sep 19, 2024

Description

This PR implemented the ToxicityEvaluator class. It provides methods for evaluating single or batch of text strings using the Perspective API.

  • For the evaluate() and evaluate_batch() methods, only the "toxicity" metric is supported.
  • For all other available metrics or evaluating multiple metrics at once, use evaluate_multiple() or evaluate_batch_multiple().

Additionally, this PR fixed the file naming of dataset_ml.py to dataset_lm.py.

References

Copy link
Contributor

@neubig neubig left a comment

Choose a reason for hiding this comment

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

Looks great, nice work!

Please use evaluate_multiple() for other metrics."
)

return self._get_toxicity_scores(hyp)["toxicity"]
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine for now, but we could also make this configurable by passing in variety in the initializer of the class.

@qingyangliu0065 qingyangliu0065 merged commit 9dae41c into main Sep 26, 2024
5 checks passed
@qingyangliu0065 qingyangliu0065 deleted the toxicity_evaluator branch September 26, 2024 16:40
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.

2 participants