sdelgadoc / download-tweets-ai-text-gen-plus

Python script to download public Tweets from a given Twitter account into a format suitable for AI text generation
MIT License
35 stars 8 forks source link

Need testers for new reply and sentiment functionality #3

Closed sdelgadoc closed 3 years ago

sdelgadoc commented 4 years ago

I added two new pieces of functionality that others might be interested in using.

  1. The code will now collect data that lets you train an AI that can not only generate tweets, but also generate replies to existing tweets.
  2. Second, the code can also measure the sentiment of tweets, so you can generate positive/neutral/negative tweets programmatically.

I've been testing it with my Data Journalist twitter bot account, and it's been surprisingly good at responding to some tweets.

You can find the code with the new functionality in the development branch of this repo below: https://github.com/sdelgadoc/download-tweets-ai-text-gen-plus/tree/development

You can clone the repo with the following command:

git clone -b development https://github.com/sdelgadoc/download-tweets-ai-text-gen-plus.git

Although the repo's README explains what you need to do in detail to use the new functionality, below is a quick summary:

You can then run the script with the command below to generate text that can train an AI to reply, and includes sentiment information:

python3 download_tweets.py <twitter_username> None True False False False 3 reply

Let me know if you have any questions.

Below I am tagging folks that have used this repo, or that I have helped with issues in the past, in case they are interested: @arceusisafish. @DeFiDude, @wradd, @RalphORama, @minimaxir, @YazzyYaz, @antherknee, @dmccaffrey12, @zhermi, @rewinded, @luisgabriel53, @faizankshaikh

sdelgadoc commented 4 years ago

Thank you to everyone who has tried the code. I just updated to code to fix a corner case.

In commit https://github.com/sdelgadoc/download-tweets-ai-text-gen-plus/commit/e6b4d22d8bd8985f6ef03fdf5b9529465b29e0d1 I added code to turn REPLY tweets to ORIGINAL tweets if the parent tweet can't be found.

Previously, if the parent tweet of a REPLY tweet couldn't be found, the REPLY tweet's text was used as the parent tweet's text.

There are enough cases where the parent tweet can't be found, that the trained model responds often with the parent tweet as the generated tweet

sdelgadoc commented 4 years ago

Thank you everyone for your feedback. Folks have been running the new version of the script for about 3 weeks now, and it seems to be working fine.

I'm going to push merge this into the main branch.