Skip to content

A library to collect tweets, clean it (pre-processing), translate it, and create analytics with Textblob and VADER methods.

License

Notifications You must be signed in to change notification settings

dev-willcode/feelingtweets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maintenance issues forks stars

Feelingtweets - Sentiments Analysis on Twitter 📊📳

A library to collect tweets, clean it (pre-processing), translate it, and create analytics with Textblob and VADER methods.

🚧 Requirements

  • Python 3.6+

🔧 Install

pip install feelingtweets

Unfortunately, this library requires some experimental versions of twint, you should install with this cmd:

pip3 install --upgrade git+https://github.com/twintproject/twint.git#egg=twint

👷‍♀️ Usage

    import feelingtweets as ft

    config = Config(input_collect_language="es")
    collector = ft.TweetCollector(config)
    cleaner = ft.Cleaner(config)
    traductor = ft.Traductor(config)
    analizer = ft.Analizer()

    # Twitter API search
    search = "(ECUADOR OR TRI OR FEF) AND (FUTBOL OR FÚTBOL OR partido OR selección OR seleccion OR copa OR mundial)"
    query = ft.Query(search, date_start="2021-09-06", limit_tweets=100)
    # collecting phase
    collected_data = collector.collect(query, True)
    # pre-processing phase
    cleaned_data = cleaner.clean(collected_data, True)
    # translateting phase
    translate_data = traductor.traduce(cleaned_data, True)

    if translate_data is not None:
        # analize with both methods
        analized_data = analizer.analize(translate_data["traduced"])
        # standard pandas DataFrame with text, texblob_score, vader_score
        print(analized_data)

Analize only with one:

Textblob:

        # analize with textblob method
        analized_data = analizer.analize_with_textblob(translate_data["traduced"])
        # standard pandas DataFrame with text, score
        print(analized_data)

VADER:

        # analize with VADER method
        analized_data = analizer.analize_with_vader(translate_data["traduced"])
        # standard pandas DataFrame with text, score
        print(analized_data)

🎯 Purpose

This project has made for educational purposes, to practice about data mining techniques and get some useful experience on Python, and libs related to data science.

About

A library to collect tweets, clean it (pre-processing), translate it, and create analytics with Textblob and VADER methods.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages