adik993 / emojify

RNN to predict emoji given a short sentence

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emojify

This repository implements simple many-to-one RNN that classifies the sentences into one of 5 classes:

  1. ❀️ :heart:
  2. ⚾ :baseball:
  3. πŸ˜„ :smile:
  4. 😞 :disappointed:
  5. 🍴 :fork_and_knife:

How it works

First we use the pre-trained Glove word embedding vectors to convert each word to the 50 dimensional vector. Then we run such encoded sentences through the RNN and take the last output(many-to-one RNN) to be used for the classification. Output of the RNN is the 5 dimensional vector that we run through the cross entropy loss.

By using pre-trained word embeddings our RNN already knows what is the relation between each word what makes it easier to train the classification problem even with the small training set.

What is Glove

Glove is one of the word embedding algorithms used to convert words to N dimensional vectors. Glove in particular minimizes the loss that measures how related are two words by measuring how often they occur near each other in the text corpus.

Results

Train history

User input sentences

Your own sentence: it is incredible
it is incredible πŸ˜„
Your own sentence: food looks delicious
food looks delicious 🍴
Your own sentence: it is bad
it is bad 😞

Mislabeled examples

Sentence Predicted Actual
i love you to the stars and back πŸ˜„ ❀️
my grandmother is the love of my life 😞 ❀️
she got me a nice present 😞 πŸ˜„
what you did was awesome 😞 πŸ˜„
i miss you so much 😞 ❀️
will you be my valentine 😞 πŸ˜„
family is all i have 😞 ❀️
you brighten my day 😞 πŸ˜„
she is a bully πŸ˜„ 😞
work is hard πŸ˜„ 😞
i did not have breakfast 😞 🍴
i like your jacket πŸ˜„ ❀️
i love taking breaks πŸ˜„ ❀️
any suggestions for dinner πŸ˜„ 🍴
i miss her πŸ˜„ ❀️
work is horrible πŸ˜„ 😞

References

  1. deeplearning.ai
  2. GloVe: Global Vectors for Word Representation

About

RNN to predict emoji given a short sentence


Languages

Language:Python 100.0%