Skip to content

A Twitter bot based on seq2seq model, trained on twitter chat log

Notifications You must be signed in to change notification settings

suriyadeepan/tweet_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tweet Bot

Setup

  • pull pretrained model
# pull metadata
wget -c 'https://www.dropbox.com/s/d35skwq8hk2ljbr/metadata.pkl?dl=0' -O metadata.pkl
# pull pretrained model
cd ckpt
./pull
cd ..
  • setup twitter bot
  1. Create an account
  2. Connect mobile phone with your account
  3. Create an app
  4. Open up the app settings; go to "Keys and Access Tokens"
  5. Grab consumer key/API key, consumer secret/API secret ; save locally
  6. Create access token; save access token, access token secret locally
  7. Note down Owner ID and your handle
# need 'tweepy' module
sudo -H pip3 install --upgrade tweepy
# clone repository
git clone https://github.com/suriyadeepan/tweet_bot
cd tweet_bot
# download template config file
wget -c 'https://raw.githubusercontent.com/twitterdev/sample-python-autoreply/master/.twitter.sample' -O .twitter.sample
# **fill in .twitter.sample with keys and tokens**
#
# setup complete

Execute

  • chatbot
import chatbot
# >> Initializing data
# >> Initializing model
# <log> Building Graph </log>
# >> Loading pretrained model
# >> Initialization complete; call respond(msg)
chatbot.respond('Hey! Good morning.. Have a nice day.')
# 'have a wonderful weekend'
  • autoreply
# checklist
# - [ ] download pretrained model and metadata
# - [ ] fill in access keys and tokens in .twitter.sample
python3 autoreply.py

About

A Twitter bot based on seq2seq model, trained on twitter chat log

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published