GithubHelp home page GithubHelp logo

bennio / tweet-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from minimaxir/tweet-generator

0.0 0.0 0.0 1.94 MB

Train a neural network optimized for generating tweets based off of any number of Twitter users.

License: MIT License

Python 100.00%

tweet-generator's Introduction

Tweet Generator

dank

Train a neural network optimized for generating tweets based off of any number of Twitter users! Blend wildly different Twitter users together for hilarity!

Tweet Generator is based off of textgenrnn, and trains the network using context labels for better tweet synthesis.

Usage

Open config.yml and at the top, add the Twitter API keys from a Twitter App you own. Then configure the list of twitter_users you wish to train the network on. You can also configure the num_epochs and whether to use the pretrained model or train a new_model. Then simply run:

python3 tweet_generator.py

The script will automatically save the weights (+ config and vocab for if new_model) for the trained model, which can then be loaded into textgenrnn and used anywhere.

The included realDonaldTrump_dril_twitter_weights.hdf5 was trained on @realDonaldTrump and @dril's tweets for 200 epochs. You can load it and generate text from it simply with:

from textgenrnn import textgenrnn
textgen=textgenrnn('realDonaldTrump_dril_twitter_weights.hdf5')
textgen.generate_samples()

Requirements

  • textgenrnn
  • tensorflow (either CPU or GPU flavors)
  • tweepy

Maintainer

Max Woolf (@minimaxir)

Max's open-source projects are supported by his Patreon. If you found this project helpful, any monetary contributions to the Patreon are appreciated and will be put to good creative use.

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.