GithubHelp home page GithubHelp logo

imadtoubal / mr-donald-j.-trump-tweet-generation Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 2.94 MB

This project aims to implement a generative model to learn the speech style of Mr. Donald Trump based on a dataset of his speeches; and then, automatically generate an unlimited amount of new speeches in the vein of Trump´s previous speeches.

License: MIT License

Jupyter Notebook 99.09% Python 0.91%

mr-donald-j.-trump-tweet-generation's Introduction

Mr. Donald J. Trump Tweet Generation with LSTMs

  • Open Word-Level In Colab: Character level
  • Open Character-Level In Colab: Word level

Text generation is a popular problem in natural language processing with machine learning. It ranges from simple email replies, word suggestions to simulating DNA sequences, and unfortunately fake news. This project aims to implement a generative model to learn the speech style of Mr. Donald Trump based on a dataset of his speeches; and then, automatically generate an unlimited amount of new speeches in the vein of Trump´s previous speeches.

Dataset description

This project uses a dataset from Kaggle that contained Donald J. Trump’s tweets from between May 2009 to August 2018. The dataset originally included 7 columns: source, text, created_at, retweet_count, favorite_count, is_retweet, and id_str.

Getting Started

This project was originally built on Google Colab. You can either upload the .ipynb notebooks to Colab or install dependencies locally on your computer.

Using Google Colab

  • Upload the .ipynb as a notebook in google colab.
  • Upload the dataset to the right folder.
  • Change path to the dataset in the code.

Run locally

You need to have Python installed in your computer.

  1. Install virtualenv:

    pip install virtualenv
  2. Create a Python virtual environment:

    virtualenv venv
  3. Activate virtual environment:

    1. Windows:
    cd venv\Scripts
    activate
    cd ..\..
    1. Lunix / Mac:
    source venv/bin/activate
  4. Install libraries:

    pip install -r requirements.txt

Run the code

  • Word level training code:
    python word_level_text_generation.py
  • Character level training code:
    python character_level_text_generation.py

Built With

Authors

  • Imad Eddine Toubal - Initial work - imadtoubal
  • How Lia - Initial work

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

Happy coding!

mr-donald-j.-trump-tweet-generation's People

Contributors

dependabot[bot] avatar imadtoubal avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.