Skip to content

Chatbot implementation for Telegram with Twitter emergency estimation

License

Notifications You must be signed in to change notification settings

erikycd/Bot_E3_telegram

Repository files navigation

Bot_E3_telegram

The designed chatbot follows the guides for connecting the APIs of Telegram, Wolframalpha and Twitter.

  1. The idea behind this project is to show the conversational skills of the Wolframalpha artificial intelligence by means of Telegram. It can be also used as a bot for data inquiries to search in both Wolframalpha and Wikipedia search engines.
  2. This bot is also designed for predicting the real risk transmitted by a Twitter post with a logistic regression estimator.

This bot is currently available in telegram and mounted on AWS-EC2 free instance.

Table of content

  1. Main Diagram

  2. Installation requirements

  3. API Basic configuration

  4. Conversational results

  5. Emergency predictor sample

Main diagram

A diagram of the implementation is shown below:

Installation requirements

Install or upgrade python-telegram-bot by the command:

$ pip install python-telegram-bot --upgrade

Wolframalpha libraries are required. Install them with:

$ pip install wolframalpha

Install twitter libraries by:

$ pip install tweepy

Basic configuration

After creating a bot in telegram with the help of @BotFather. Insert your token in the line:

updater =  Updater('', use_context=True) # Insert here API code of telegram

Moreover, you should be registered as Wolframalpha developer, then insert your token in line:

app_id = '' # Insert here API code of wolframalpha 
client = wolframalpha.Client(app_id)

Finally, you should log in as Twitter developer, then insert your keys in lines:

consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
# authorization of consumer key and consumer secret
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
# set access to user's access key and access secret 
auth.set_access_token(access_token, access_token_secret)
# calling the api 
api = tweepy.API(auth)

Conversational results

Emergency predictor sample

- Visit him at: https://t.me/E3_demoBot

About

Chatbot implementation for Telegram with Twitter emergency estimation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages