Code Monkey home page Code Monkey logo

nubia's Introduction

Welcome to the NUBIA repo!

NUBIA (NeUral Based Interchangeability Assessor) is a new SoTA evaluation metric for text generation

Check out the paper, blog post, FAQ and demo colab notebook.

Installation:

Clone the repo: git clone https://github.com/wl-research/nubia.git

Install requirements: pip install -r requirements.txt

Use:

Import and initialize the Nubia class from nubia.py (wherever you cloned the repo):

Note: The first time you initialize the class it will download the pretrained models from the S3 bucket, this could take a while depending on your internet connection.

Nubia().score takes seven parameters: (ref, hyp, verbose=False, get_features=False, six_dim=False, aggregator="agg_two")

ref and hyp are the strings nubia will compare.

Setting get_features to True will return a dictionary with additional features (semantic relation, contradiction, irrelevancy, logical agreement, and grammaticality) aside from the nubia score. Verbose=True prints all the features.

six_dim = True will not take the word count of hyp and ref into account when computing the score.

aggregator is set to agg_two by default, but you may choose to try agg_one which was used to achieve the WMT 2017 results.

Example:

nubia.score("The dinner was delicious.", "The dinner did not taste good.", verbose=True, get_features=True)

Semantic relation: 1.4594818353652954/5.0
Percent chance of contradiction: 99.90345239639282%
Percent chance of irrelevancy or new information: 0.06429857457987964%
Percent chance of logical agreement: 0.03225349937565625%


NUBIA score: 0.18573102718477918/1.0

See more exmaples of usage at our demo notebook nubia-demo.pynb

Citation:

If you use Nubia in your work, please cite:

@misc{kane2020nubia,
    title={NUBIA: NeUral Based Interchangeability Assessor for Text Generation},
    author={Hassan Kane and Muhammed Yusuf Kocyigit and Ali Abdalla and Pelkins Ajanoh and Mohamed Coulibali},
    year={2020},
    eprint={2004.14667},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

Contact Us:

You can reach us by email here or by opening an issue at this repo.

nubia's People

Contributors

aliabd avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.