Giter Site home page Giter Site logo

thienudomsrirungruang / impostor Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 144 KB

Chatbot that can emulate someone's chatting style by looking at their LINE chat logs. Uses transfer learning on GPT-2 using the Hugging Face model. Can be interacted with using discord.

License: GNU General Public License v3.0

Python 100.00%
ai chatbot chat-application discord-bot discord-py pytorch gpt-2 huggingface huggingface-transformer transformer transfer-learning line nlp discord bot

impostor's Introduction

Impostor-bot

Inspired by https://medium.com/huggingface/how-to-build-a-state-of-the-art-conversational-ai-with-transfer-learning-2d818ac26313 and https://towardsdatascience.com/speak-to-the-dead-with-deep-learning-a336ef88425d.

Put your chat data into impostor/data

Installation

This project was installed on conda, python version 3.9.

Pytorch installation:

conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch -c=conda-forge

Hugging Face transformer install:

pip install transformers

Also requires (from pip):

  • matplotlib
  • pyyaml
  • discord.py

And from conda:

  • ftfy
  • spacy

Usage

  1. Make a directory with exported LINE chat logs. Remove the headers in each of the files.
  2. Put this directory in the chat_log_directory in config.yaml.
  3. Put your LINE username into the user_name field in config.yaml.
  4. Enter a file location for the dataset in the dataset/file field.
  5. Run create_dataset.py.
  6. Configure training parameters in config.yaml (especially the device).
  7. Run train.py.
  8. Choose a model saved in the checkpoints folder and put it in model_path in config.yaml.
  9. Create a discord bot.
  10. Put the bot secret in bot_token.
  11. Invite the bot to your favourite server. Link should look like https://discord.com/oauth2/authorize?client_id=1234567890&permissions=68672&scope=bot
  12. Run bot.py
  13. Chat with your bot!

impostor's People

Contributors

thienudomsrirungruang avatar

Stargazers

 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.