Coder Social home page Coder Social logo

fruitify's Introduction

Fruitify

Dependencies

pip3 install transformers
pip3 install pytorch-lightning

Objective

Monolingual Reverse Dictionary

Given a description of a fruit, have an English BERT predict the fruits that best match with the description (out of apple, banana, orange, grape and strawberry).

  • e.g.1: a red fruit of round shape -> apple / strawberry / orange / grape / banana
  • e.g.2: a yellow fruit of round shape -> orange / banana / apple / grape / strawberry

Unaligned Cross-lingual Reverse Dictionary

Given a description of a fruit in Korean, have an mBERT predict the fruits in English that best match with the Korean description.

  • e.g.1: 동그랗고 빨간 과일 -> apple / strawberry / orange / grape / banana
  • e.g.2: 동그랗고 노란 과일 -> orange / banana / apple / grape / strawberry

Note that we attempt to do so with exactly the same training dataset as is used for the monolingual one. This is to explore to what degree mBERT can compensate for unaligned data.

Implementation

We follow the same architecture as what is presented in BERT for Monolingual and Cross-Lingual Reverse Dictionary(Yan et al., 2020)

Examples

### desc: The fruit that monkeys love ###
0: ('banana', -10.440376281738281)
1: ('grape', -10.463106155395508)
2: ('strawberry', -10.712398529052734)
3: ('orange', -10.870870590209961)
4: ('apple', -11.218637466430664)
5: ('pineapple', -16.276872634887695)

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.