GithubHelp home page GithubHelp logo

d294270681 / ccm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thu-coai/ccm

0.0 0.0 0.0 822 KB

This project is a tensorflow implement of our work, CCM (Commonsense Conversational Model).

License: Apache License 2.0

Python 100.00%

ccm's Introduction

Commonsense Knowledge Aware Conversation Generation with Graph Attention

Introduction

Commonsense knowledge is vital to many natural language processing tasks. In this paper, we present a novel open-domain conversation generation model to demonstrate how large-scale commonsense knowledge can facilitate language understanding and generation. Given a user post, the model retrieves relevant knowledge graphs from a knowledge base and then encodes the graphs with a static graph attention mechanism, which augments the semantic information of the post and thus supports better understanding of the post. Then, during word generation, the model attentively reads the retrieved knowledge graphs and the knowledge triples within each graph to facilitate better generation through a dynamic graph attention mechanism, as shown in Figure 1.

image

This project is a tensorflow implement of our work, CCM.

Dependencies

  • Python 2.7
  • Numpy
  • Tensorflow 1.3.0

Quick Start

  • Dataset

    Commonsense Conversation Dataset contains one-turn post-response pairs with the corresponding commonsense knowledge graphs. Each pair is associated with some knowledge graphs retrieved from ConceptNet. We have applied some filtering rules to retain high-quality and useful knowledge graphs.

    Please download the Commonsense Conversation Dataset to data directory.

  • Train

    python main.py

    The model will achieve the expected performance after 20 epochs.

  • Test

    python main.py --is_train False

    You can test the model using this command. The statistical result and the text result will be output to the 'test.res' file and the 'test.log' file respectively.

Details

Training

You can change the model parameters using:

--units xxx 				the hidden units
--layers xxx 				the number of RNN layers
--batch_size xxx 			batch size to use during training 
--per_checkpoint xxx 			steps to save and evaluate the model
--train_dir xxx				training directory

Evaluation

image

Paper

Hao Zhou, Tom Yang, Minlie Huang, Haizhou Zhao, Jingfang Xu, Xiaoyan Zhu.
Commonsense Knowledge Aware Conversation Generation with Graph Attention.
IJCAI-ECAI 2018, Stockholm, Sweden.

Please kindly cite our paper if this paper and the code are helpful.

Acknowlegments

Thanks for the kind help of Prof. Minlie Huang and Prof. Xiaoyan Zhu. Thanks for the support of my teammates.

License

Apache License 2.0

ccm's People

Contributors

tuxchow 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.