Giter Site home page Giter Site logo

deeptweets's Introduction

The project is tested on python 3.6.9, and it may work on later versions as well.

Create a virtual environment using the command

python -m venv deep_tweets_workspace

Clone this project inside the environment.

Dependencies

  • Tensorflow
  • Numpy
  • Pandas
  • PyTorch
  • Rake
  • Transformers
  • Wandb (Weights and Biases)

Dependencies can be installed using pip:

pip install -r requirements.txt

Note, you'll need free a Weights and Biases account to run the GPT-2 models. The LSTM models can be run without it. Getting started: https://wandb.ai/

LSTM models

To run the inference on the LSTM model, navigate to the ./models/LSTM folder, and run the command

python inference.py [twitter_handle] [prompt]

To train the LSTM model from scratch, run the following command from the same directory

python training.py [twitter_handle]

twitter_handle can be either realDonaldTrump or JoeBiden, and prompt is the starting prompt of the sentence, e.g., I like

Note: Training the LSTM models take a significant amount of time. If you just want to obtain the results, run the inference.

GPT-2 models

Navigate to the directory GPT2, and run the file deeptweets_prompt.ipynb. for the DeepTweets-Prompt model and the file deeptweets_context.ipynb. for the DeepTweets-Context model. You can change the following line in each file to replace the handle:

handle = [twitter_handle]

deeptweets's People

Contributors

adityagaydhani 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.