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

adding scripts and tests for naturalness metric #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sharan21
Copy link

@sharan21 sharan21 commented Jan 13, 2022

PR for feature addition related to issue 129.

Motivation:
In Summarization, Generation, and Style Transfer Tasks, it is also useful to check the Fluency/ Coherence of the generated outputs (references in this case). The traditional method of using perplexity depends highly on the architecture of the pre-trained model chosen and does not correlate with human correlations as well as other newly introduced metrics. The "Naturalness" metric, for example, uses a Neural Classifier whose task is to determine whether a given sentence is a real English sentence or a fake. It is shown more to correlate with human judgments in determining the coherence of the generated outputs. This feature might be of use for people will similar needs.

Please refer to the full publication for more information: https://aclanthology.org/N19-1049/

Feature Addition:
The "Naturalness" metric has been added to scores variable in both functions calls and the NLGEval API. Unit tests to validate this metric has been added in test_nlgevals.py. All dependencies for this metric have been added to the nlgeval/naturalness directory, complying with the design architecture of the other metrics.

Behaviour:
The metric calculates the mean Naturalness score of the references provided. In case a list of references is provided (such as in NLGEval.compute_metrics()), the mean naturalness score of the union of all lists is calculated.

Please let me know your thoughts on this feature addition or if anything changes are required. Thanks!

@msftgits
Copy link

msftgits commented Jan 13, 2022

CLA assistant check
All CLA requirements met.

@temporaer
Copy link
Member

Apologies for the long delay in response, @sharan21, and thank you for the contribution! Does the code and data you added come with some sort of license? I'd appreciate it if you could add that before merging. Thank you!

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.

3 participants