Skip to content

Instantly share code, notes, and snippets.

@chosa91
Last active November 14, 2022 21:27
Show Gist options
  • Select an option

  • Save chosa91/e49fd9dc114721747e247cca1ad7a795 to your computer and use it in GitHub Desktop.

Select an option

Save chosa91/e49fd9dc114721747e247cca1ad7a795 to your computer and use it in GitHub Desktop.
Hackweek 2020 Q1 - Sentiment analysis

πŸ‘‹ Hackweek 2020 Q1 - Sentiment analysis πŸ‘€

Goal

Plan

Tone analysis on text like Grammarly.

Tone detector teaser

Tones

Result

Offline on-device sentiment analysis on texts.

Why tone matters?

Effective communication involves a variety of factors.

Tech background from Deep Learning's site

Plutchik's wheel of emotions Keywords: joy, trust, fear, surprise, sadness, disgust, anger, anticipation

Plutchik's wheel of emotions

Framing Sentiment Analysis as a Deep Learning Problem

  1. Training a word vector generation model (such as Word2Vec) or loading pretrained word vectors
  2. Creating an ID's matrix for our training set (We'll discuss this a bit later)
  3. RNN (With LSTM units) graph creation
  4. Training
  5. Testing

*Word2Vec: words-to-vectors on a cosine distance scale *RNN: Recurrent Neural Networks *LSTM: Long Short Term Memory Units *CNN: Convolutional Neural Networks for Sentence Classification

Pretrained models

Cool stuffs around the world

  • IBM Watson Tone analyser (first 1000 API call/month is free)
    • Emotion
    • Language style
    • Social tendencies

What we have? (iOS12+)

Natural Language Processing β€’ NaturalLanguage Framework - NLTagger Language Support Matrix

@mattt's findings tweet

  • English, French, German, Italian, Portuguese, Spanish support all NLTagger schemes
  • Russian and Turkish support all except sentiment
  • All other languages support only language / script detection and tokenization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment