Skip to content

Instantly share code, notes, and snippets.

@LetticiaNicoli
Last active September 15, 2019 00:27
Show Gist options
  • Save LetticiaNicoli/50554c8011d4803dfea24620330d2b84 to your computer and use it in GitHub Desktop.
Save LetticiaNicoli/50554c8011d4803dfea24620330d2b84 to your computer and use it in GitHub Desktop.
Autokeras - Sentiment Analysis
#pip3 install autokeras.pretrained
from autokeras_pretrained.text_classifier import SentimentAnalysis
sentiment_cls = SentimentAnalysis()
polarity = sentiment_cls.predict("Today I forgot my wallet.")
print("Polarity of the input sentence is (sentiment is positive if polarity > 0.5) : ", polarity)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment