Giter VIP home page Giter VIP logo

twitter-sentiment's Introduction

Twitter Sentiment analyzer

Sentiment analysis is the task of determining the sentiment of a given expression in natural language, It is essentially a multiclass text classification text where the given input text is classified into positive, neutral, or negative sentiment. But the number of classes can vary according to the nature of the training dataset. This project aims to build a sentiment analyzer specifically for twitter domain.

Why a Custom model for twitter domain?

Simply put, a Tweet is a message sent on Twitter. Most of the tweets do not follow normal English grammar and vocabulary mainly due to the limitation of the number of characters allowed in a tweet. This requires special care to yield better performance, hence this project.

Want to build a similar project? Read my article to find out how I build twittersentimt.

Install

!pip install twittersentiment

Examples

  • Using pretrained model
from twittersentiment import TwitterSentiment
sent = TwitterSentiment.Sentiment()
sent.load_pretrained()
sent.predict("hey how are you?")

basic

  • You can train your own model with custom dataset and your choice of word embedding
from twittersentiment import TwitterSentiment
import pandas as pd
df = pd.read_csv("your_dataset.csv")
sent = TwitterSentiment.Sentiment()
sent.train(df["text"],df["target"],path="/your_model_save_path",name="6B",dim=100)
sent.train("hey you just trained a custom model")

see examples for more.

twitter-sentiment's People

Contributors

shahules786 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

twitter-sentiment's Issues

Extract sentiments from url

Add a feature for model.predict(tweeturl) with parameters subtweet=True and depth=num so that a url and its subtweets to a depth will be extracted to the dataset.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.