Skip to content

Script for creating a chabot that is able to receive a question and search about its related topics on Twitter

Notifications You must be signed in to change notification settings

lucasgml/chatbot_twitter_nlp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

chatbot_twitter_nlp

Script for creating a chabot that is able to receive a question and search about its related topics on Twitter.

This chatbot was implemented using five main libraries:

  • telepot Lib to interact with Telegram bots
  • spacy NLP lib used for NER (Named Entity Recognition)
  • nltk NLP lib used for tokenization stemming and removing stopwords
  • gensim NLP lib used for creating a Tf-idf model
  • tweepy Lib create a read-only connection with a Tweeter account

Other libraries were used for plotting graphs or (pre)processing the data.

Bot logic

This chatbot receives a sentence as input and processes a NER using spacy for detecting names, organizations and locations.

The next movement is to run a search on Tweeter looking for 1000 tweets containing all entities found in the last step.

After that, a WordCloud and a barchart are generated with the most commom words found in the collected tweets.

Finally, other graphs are plotted with the most important words in the tweets (using the Tf-idf model) and the most cited entities (applying NER on collected tweets).

Screenshots

These screenshots were taken from the execution of the bot Gossip Guy (gossip_guy_bot) created for this code.

This bot will not anwser any calls because it is hosted in my machine and it is not running continuously. Please send me a message and I can run it for you for any tests or create a bot using Telegram's BotFather and insert your tweeter developer credentials.

About

Script for creating a chabot that is able to receive a question and search about its related topics on Twitter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published