Coder Social home page Coder Social logo

chatbot-seq2seq's Introduction

Chatbot-Seq2Seq

Simple chatbot implemented with a GRU recurrent sequence-to-sequence model with attention using Pytorch.

How to use it

  1. Prepare your dataset
  sentence1A\tsententence1B\n
  sentence2A\tsententence2B\n
  how are you?\tI'fine\n
  ...

Where sentenceNA is the input sequence ad sentenceNB is the target sentence. Make sure each line contains one pair and that each pair is sepated with a tab (\t). If you want to use the predefined dataset run the command:

  python CMDC_data_preprocessing.py -n "formatted_movie_lines.txt" -cl "data/cornell movie-dialogs corpus"

-n in the name of the new formatted dataset and cl is the location of the original corpus.

  1. Train your model

Run the following command to train and evaluate your model and save it in a new my_model directory.

  python chatbot.py -mn "cornell_movie_dialogs_chatbot" -cl "data/cornell movie-dialogs corpus/formatted_movie_lines.txt -sd "my_model" -tr -ev

Many more options are available such as setting the input size, learning rate, attention method, load a previous trained model, ecc. You can use the command --help to visualize them.

References

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.