GithubHelp home page GithubHelp logo

python-twitter-spell-checking's Introduction

Twitter Spell Checking

What is it ?

Twitter Spell Checking aims to correct a word from a text database generated by twitter streams.

First, set twitter accounts that fit most with the words that you want to correct (ex: news, sport, music, health...). Then, launch a crontab every hour to get new tweets (twitter_spelling fetch -n [namespace] -c [settings_file_location]) Finally, just call the api to check the word.

Be careful, if you want to correct some music artists from a specific genre, try to watch best specialised twitter accounts !

Installation

python setup.py install

Configuration

Create a conf file as this one :

[twitter]
CONSUMER_KEY = gFlXceJo9HKBeZjXOjgw
CONSUMER_SECRET = QpCq1uQLsBC3FvreKMqzkfKUllf0R22LM6oCP50
ACCESS_TOKEN = 195869-eTemy6p0ljmq2cWL6kGTXTR1BT7BpJqX9uNwzftpo
ACCESS_TOKEN_SECRET = kfAcMwqrJ9sEUjwy1vf0ItL7Nf673DBEnTCLvaM

[namespace:fr]
files = /var/www/twitter_spelling/
accounts = Caradisiac, gizmodofr, Rue89, futurasciences, purecharts, jeuxvideo, LeNouvelObs, sports_direct, 20minutes, SportF24, Slatefr, PremiereFR, LaRedouteFR, liberation_info, purepeople, Maxisciences, aufeminin_com, ZDNet, AutoPlus, lequipe, lemondefr, Telerama, Clubic, GEOfr, lesinrocks, France24_fr, LesEchos, doctissimo, ELLEfrance,  Boursier_com, francefootball

[namespace:en]
files = /var/www/twitter_spelling/
accounts = Slate, gizmodo

Fetch the tweets

twitter_spelling fetch -n [namespace] -c [settings_file_location]

The tweets will be loggued into the file [files]/tweets_[namespace].txt

Spell Checking

Some parts of code from http://norvig.com/spell-correct.html

from twitter_spelling import Correct
c = Correct(settings_file_location)
c.correct('my expression')

If in your namespace, your are following some sport and news account :

>> c.correct('franck riberi')
franck ribery
>> c.correct('steve job')
steve jobs
>> c.correct('news york')
new york
>> c.correct('comunity')
community

python-twitter-spell-checking's People

Contributors

ampelmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

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.