milliemaoo / jokes-generation

A seq2seq question-answer jokes generation with keywords information. (Pytorch)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QA jokes generation

This is a seq2seq question-answer jokes generation inspired by seq2bf. It is able to predict a keyword representing the gist of the reply from the questions and then incorporate this additional information into the generation to get a humorous reply.

Corpus

You can get the corpus from QA jokes
Prepare your query, reply, and cue words file, with one instance per line.

Usage

  • You can train and inference by start_train.py and start_test.py, change the argument values in your own need.

  • Note in the test, the post is entered by terminal, each post need a keyword which is decided by yourself, you can also refer to toolkits.py to automatically select a keyword based on post sentence.

Example

q: What will happen if you went inside a black hole?    
k: world
a: I don't know either. It must be out of this world.  

References

Seq2BF for Dialogue Generation

seq2seqchatbot

It's a preliminary version now.

About

A seq2seq question-answer jokes generation with keywords information. (Pytorch)


Languages

Language:Python 100.0%