Skip to content

A ready-to-use sentiment analysis and emotion classification model for Philippine tweets.

Notifications You must be signed in to change notification settings

atmarges/phil_emote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

phil_emote

A ready-to-use sentiment analysis and emotion classification model for Philippine tweets.

Using tweets collected from the Philippine, an LSTM model was trained for sentiment analysis and emotion classification. This model was trained into 11 classes specifically:

Emoji Emotion Sentiment
πŸ“ neutral neutral
πŸ˜„ happy positive
😌 relief positive
πŸ˜‘ unammused negative
😘 love positive
😜 playful positive
😞 sad negative
😑 angry negative
😱 shocked negative
😷 sick negative
πŸ€” pondering neutral

Labels used were the 11 emojis which were selected by clustering a set of facial expression emojis into ten clusters. Then, tweets containing news were added to the dataset to represent the neutral class.

Quickstart

Create an instance of PhilEmoteModel. Then, pass a list of tweets to predict_dataset to predict its respective emotion. Alternatively, the model can be used to predict sentiment by setting output_type='sentiment'. Also, setting output_type='emoji' will output the emoji labels used.

Running the following code:

from phil_emote.models import PhilEmoteModel

dataset = [
    "Nakakaasar nman! ahhh... ang dami dami kong gagawin... kulang time...",
    "Asar... Badtrip!",
    "May bagong bagyo ang namataan sa kanlurang bahagi ng bansa.",
    "Thank you po Lord Jesus at gumana din sya.",
    "Congrats po sa inyong lahat!",
]

model = PhilEmoteModel()
pred = model.predict_dataset(dataset, output_type='emotion')
print(pred)

will output the following:

['unammused', 'angry', 'neutral', 'love', 'love']

Setting output_type='sentiment' will output the following:

['negative', 'negative', 'neutral', 'positive', 'positive']

About

A ready-to-use sentiment analysis and emotion classification model for Philippine tweets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages