Git Product home page Git Product logo

twitter-svm-tfidf.py's Introduction

Twitter data mining with Python

Build Status

Using Support Vector Machine and Term Frequency–Inverse Document Frequency in three steps:

  1. Collect many tweets from Twitter
  2. Classify some tweets with positive, negative or neutral
  3. Predict others tweets

System dependencies

sudo apt-get install build-essential python-dev python-setuptools \
                     python-numpy python-scipy libblas-dev gfortran \
                     libatlas-dev libatlas3gf-base liblapack-dev \
                     libatlas-base-dev

If you use Python 3

sudo apt-get install python3-minimal

Install Packages

Use pip with virtualenv

pip install -r requirements.txt

Configuration

The Natural Language Toolkit provide human language data (over 50 corpora and lexical resources) in different languages and formats as twitter samples, RSLP Stemmer (Removedor de Sufixos da Lingua Portuguesa), complete work of Machado de Assis for Brazilian Portuguese language and much more.

For download all corpora

python -m nltk.downloader all

Or download the corpora of your choice from Python Interpreter

>>> import nltk
>>> nltk.download()

A new window should open, showing the NLTK Downloader.

Credentials

Set your Twitter credentials from Twitter Application Manager for variables: CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN and ACCESS_TOKEN_SECRET.

Run tests

python -m unittest discover

Start

Run the Human-Machine Interface

python hmi.py

Example

Collect

collect

Listing collected tweets

tweets

Classification

training

Predication

prediction

Roadmap

twitter-svm-tfidf.py's People

Contributors

fernandopso avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bennio masete

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.