GithubHelp home page GithubHelp logo

chatbot-pytorch's Introduction

chatbot

requirments requirments

A base Seq2Seq+Attention chatbot model, using DD(daily dialogue) for dataset.

Content

Requirements

  • python 3.6+
  • torch 1.2.0+
  • torchtext 0.4.0+
  • torchnet
  • tensorboard

Train

Train the model for default setting

python main.py --train

Or chage the default setting.

python main.py --help
usage: main.py [-h] [--train] [--test] [--epoch EPOCH] [--n_epochs N_EPOCHS]
               [--batch_size BATCH_SIZE] [--lr LR] [--b1 B1] [--b2 B2]
               [--decay_epoch DECAY_EPOCH] [--data_path DATA_PATH]
               [--device DEVICE] [--enc_emb_dim ENC_EMB_DIM]
               [--dec_emb_dim DEC_EMB_DIM] [--enc_hid_dim ENC_HID_DIM]
               [--dec_hid_dim DEC_HID_DIM] [--attn_dim ATTN_DIM]
               [--n_layers N_LAYERS] [--max_len MAX_LEN]
               [--enc_dropout ENC_DROPOUT] [--dec_dropout DEC_DROPOUT]
               [--input_dim INPUT_DIM] [--output_dim OUTPUT_DIM]
               [--clip CLIP]

The trained model will save in checkpoints/ folder named "model{n}.pkl" where the n is the number of epoch. And the tensorboard log file created in runs/ folder

Predict

Predict the setences use trained model with test data.

python main --test

The results will be generate in results/ folder.

And the example of pred.txt is as follow

q:thank you very much . 
a:you 're welcome . 

q:ok . thank you . 
a:you are welcome . 

q:you 're looking great . 
a:yeah , i 'm not sure 

q:how 's the chicken ? 
a:i 'm not sure . 

q:one hundred dollars . 
a:here 's your money . i 

chatbot-pytorch's People

Contributors

luckyssc avatar

Stargazers

yehc avatar  avatar

Watchers

 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.