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

New sentiment models #1613

Merged
merged 3 commits into from
May 14, 2020
Merged

New sentiment models #1613

merged 3 commits into from
May 14, 2020

Conversation

alanakbik
Copy link
Collaborator

This PR adds new sentiment models for English to Flair and closes #1503

The new models are trained over a combined corpus of sentiment dataset, including Amazon product reviews. So they should be applicable to more domains than the old sentiment models that were only trained with movie reviews.

There are two new models, a transformer-based model you can load like this:

# load tagger
classifier = TextClassifier.load('sentiment')

# predict for example sentence
sentence = Sentence("enormously entertaining for moviegoers of any age .")
classifier.predict(sentence)

# check prediction
print(sentence)

And a faster, slightly less accurate model based on RNNs you can load like this:

# load tagger
classifier = TextClassifier.load('sentiment-fast')

# predict for example sentence
sentence = Sentence("enormously entertaining for moviegoers of any age .")
classifier.predict(sentence)

# check prediction
print(sentence)

@alanakbik alanakbik merged commit 324c51a into master May 14, 2020
@alanakbik alanakbik deleted the sentiment-models branch May 14, 2020 20:36
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.

Add better sentiment analysis model
1 participant