Skip to content

Roboy/roboy_generative_nlp

Repository files navigation

Generative NLP with Reinforcement learning

Code for reproducing main results in the paper A Neural Conversational Model to build a conversational chat bot using seq2seq model.

This model extends seq2seq with these features:

  • Reinforcment learning for more coherent dialouge instead of 1-to-1 relpy.
  • Buckets while training to limit memory consumption
  • Beam search to avoid local minima resopnses (needs to be optimized)
  • Anti-langauge moddel to supress global solutions like "Thanks, ok" when uncertain.

Dependencies

Setup

chmod +x setup
./setup

Data

  1. The format should be one txt file with input on a line followed by the response on the next line.

    Datasets/
    |
    |-Your-dataset/
      |
      |-data/raw/
        |- chat.txt
    
    twitter             Twitter chat by [Marsan](https://github.com/Marsan-Ma/chat_corpus)
    
  2. Optional: to get trained model, download and extract:

Training

  • To train Seq2Seq run seq2seq_train passing model name

    python seq2seq_train.py --model_name twitter and pass in params
    

Evaluation

Python Script

  • To evaluate Seq2Seq run seq2seq_eval passing model name

    python seq2seq_eval.py --model_name twitter and pass in params
    

Bash script

  • Or simply run ./twitter_chat which will download the trained model and start the chatting interface. This model wasn't trained with reinforcment learning as the chat dataset is not dialouge.

    ./twitter_chat
    

ROS Service

  • Make sure rosbridge_websocket (port 9090) is running on the ROS master
  • In order to start the ROS node and service for answer generation call
    ./advertise_gnlp_service
    
  • Call a service
    rosservice call /roboy/cognition/generative_nlp/answer "text_input: 'hello'"
    

Papers

[1] Sequence to Sequence Learning with Neural Networks [2] A Neural Conversational Model

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •