Skip to main content

TBA

Project description

license PyPI version PyPI pyversions PyPI status

TweetNLP

All you need to understand Twitter is tweetnlp!

Get Started

pip install tweetnlp

Prediction

  • Named Entity Recognition
import tweetnlp 
model = tweetnlp.load('ner')  # Or `model = tweetnlp.NER()` 
model.ner('Jacob Collier is a Grammy-awarded English artist from London.')  # Or `model.predict`
>>> {
    'prediction': ['B-person', 'I-person', 'O', 'O', 'O', 'O', 'O', 'O', 'B-location'],
    'probability': [0.9606876969337463, 0.9834017753601074, 0.9816871285438538, 0.9896021485328674, 0.44137904047966003, 0.375810831785202, 0.8757674694061279, 0.9786785244941711, 0.9398059248924255],
    'input': ['Jacob', 'Collier', 'is', 'a', 'Grammy-awarded', 'English', 'artist', 'from', 'London.'],
    'entity_prediction': [
        {'type': 'person', 'entity': ['Jacob', 'Collier'], 'position': [0, 1], 'probability': [0.9606876969337463, 0.9834017753601074]},
        {'type': 'location', 'entity': ['London.'], 'position': [8], 'probability': [0.9398059248924255]}]
}
  • Sentiment Analysis
import tweetnlp 
model = tweetnlp.load('sentiment')  # Or `model = tweetnlp.Sentiment()` 
model.sentiment("How many more days until opening day? 😩")  # Or `model.predict`
  • Irony Detection
import tweetnlp 
model = tweetnlp.load('irony')  # Or `model = tweetnlp.Irony()` 
model.irony('If you wanna look like a badass, have drama on social media')  # Or `model.predict`
  • Hate Detection
import tweetnlp 
model = tweetnlp.load('hate')  # Or `model = tweetnlp.Hate()` 
model.hate('Whoever just unfollowed me you a bitch')  # Or `model.predict`
  • Offensive Detection
import tweetnlp 
model = tweetnlp.load('offensive')  # Or `model = tweetnlp.Offensive()` 
model.offensive("All two of them taste like ass. ")  # Or `model.predict`
  • Emoji Prediction
import tweetnlp 
model = tweetnlp.load('emoji')  # Or `model = tweetnlp.Emoji()` 
model.emoji('Beautiful sunset last night from the pontoon @ Tupper Lake, New York')  # Or `model.predict`
  • Emotion Analysis
import tweetnlp 
model = tweetnlp.load('emotion')  # Or `model = tweetnlp.Emotion()` 
model.emotion('I love swimming for the same reason I love meditating...the feeling of weightlessness.')  # Or `model.predict`

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tweetnlp-0.0.1.tar.gz (12.6 kB view details)

Uploaded Source

File details

Details for the file tweetnlp-0.0.1.tar.gz.

File metadata

  • Download URL: tweetnlp-0.0.1.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.10

File hashes

Hashes for tweetnlp-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4a908e48106480a4da4291c2533f32b69dc171440e20469adc355cace684f231
MD5 ca06e8323e46ea2b44f9c3f8eb13fad4
BLAKE2b-256 7700eb7caacf851aee73a3e1d971d46abda9d9127922f77c36535ff808e76eea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page