All Projects → THUDM → KBRD

THUDM / KBRD

Licence: MIT license
Towards Knowledge-Based Recommender Dialog System @ EMNLP 2019

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to KBRD

recometrics
(Python, R, C++) Library-agnostic evaluation framework for implicit-feedback recommender systems
Stars: ✭ 19 (-84.55%)
Mutual labels:  recommender-systems
everything
The semantic desktop search engine
Stars: ✭ 22 (-82.11%)
Mutual labels:  knowledge-graph
vsm-box
Web-component for creating & showing VSM-sentences — Visual Syntax Method
Stars: ✭ 25 (-79.67%)
Mutual labels:  knowledge-graph
BiLSTM-and-CNN-for-Link-Prediction
Keras implementation of path-based link prediction model for knowledge graph completion
Stars: ✭ 17 (-86.18%)
Mutual labels:  knowledge-graph
KBQA-Exploration
知识图谱初探,关系抽取,实体抽取,基于kb的问答,基于es的问答,知识图谱可视化
Stars: ✭ 45 (-63.41%)
Mutual labels:  knowledge-graph
KBE
Node.js application to extract the knowledge represented in Google infoboxes (aka Google Knowlege Graph Panel)
Stars: ✭ 27 (-78.05%)
Mutual labels:  knowledge-graph
Keras-LSTM-Trajectory-Prediction
A Keras multi-input multi-output LSTM-based RNN for object trajectory forecasting
Stars: ✭ 88 (-28.46%)
Mutual labels:  sequence-to-sequence
deep-spell-checkr
Keras implementation of character-level sequence-to-sequence learning for spelling correction
Stars: ✭ 65 (-47.15%)
Mutual labels:  sequence-to-sequence
CONVEX
As far as we know, CONVEX is the first unsupervised method for conversational question answering over knowledge graphs. A demo and our benchmark (and more) can be found at
Stars: ✭ 24 (-80.49%)
Mutual labels:  knowledge-graph
parse seq2seq
A tensorflow implementation of neural sequence-to-sequence parser for converting natural language queries to logical form.
Stars: ✭ 26 (-78.86%)
Mutual labels:  sequence-to-sequence
cross-lingual-open-ie
MT/IE: Cross-lingual Open Information Extraction with Neural Sequence-to-Sequence Models
Stars: ✭ 22 (-82.11%)
Mutual labels:  sequence-to-sequence
hugo-documentation-theme
📖 Project Docs / Knowledge Base template for Hugo Website Builder. 创建项目文档
Stars: ✭ 101 (-17.89%)
Mutual labels:  knowledge-graph
SSIM Seq2Seq
SSIM - A Deep Learning Approach for Recovering Missing Time Series Sensor Data
Stars: ✭ 32 (-73.98%)
Mutual labels:  sequence-to-sequence
LD-Connect
LD Connect is a Linked Data portal for IOS Press in collaboration with the STKO Lab at UC Santa Barbara.
Stars: ✭ 0 (-100%)
Mutual labels:  knowledge-graph
nlm
Memory for Knowledge Graph, using Neo4j. 知识图谱存储与查询。
Stars: ✭ 43 (-65.04%)
Mutual labels:  knowledge-graph
Awesome-Federated-Learning-on-Graph-and-GNN-papers
Federated learning on graph, especially on graph neural networks (GNNs), knowledge graph, and private GNN.
Stars: ✭ 206 (+67.48%)
Mutual labels:  knowledge-graph
kgx
KGX is a Python library for exchanging Knowledge Graphs
Stars: ✭ 78 (-36.59%)
Mutual labels:  knowledge-graph
codelani
PLDB: a Programming Language Database. A public domain knowledge graph focused on programming languages distributed as a CSV file.
Stars: ✭ 610 (+395.93%)
Mutual labels:  knowledge-graph
retailbox
🛍️RetailBox - eCommerce Recommender System using Machine Learning
Stars: ✭ 32 (-73.98%)
Mutual labels:  recommender-systems
BinPacking Neural Combinatorial Optimization
Bin Packing Problem using Neural Combinatorial Optimization.
Stars: ✭ 93 (-24.39%)
Mutual labels:  sequence-to-sequence

KBRD: Towards Knowledge-Based Recommender Dialog System

GitHub stars GitHub license

Paper accepted at EMNLP-IJCNLP 2019. Latest version at arXiv.

  • New: code and README are improved.
  • We curated a paper list for NLP + Recommender System at THUDM/NLP4Rec-Papers. Contributions are welcome.

Prerequisites

  • Linux
  • Python 3.6
  • PyTorch >= 1.2.0

Getting Started

Installation

Clone this repo.

git clone https://github.com/THUDM/KBRD
cd KBRD

Please install dependencies by

pip install -r requirements.txt

Dataset

  • We use the ReDial dataset, which will be automatically downloaded by the script.
  • Download the refined knowledge base (dbpedia) used in this paper [Google Drive]. Decompress it and get the <path/to/KBRD/dbpedia/> folder, which should contain two files mappingbased_objects_en.ttl and short_abstracts_en.ttl.
  • Download the proprocessed extracted entities set [Google Drive] and put it under <path/to/KBRD/data/redial/.

Training

  1. To train the recommender part, run:
bash scripts/both.sh <num_exps> <gpu_id>
(optional) bash scripts/baseline.sh <num_exps> <gpu_id>
  1. To train the dialog part, run:
bash scripts/t2t_rec_rgcn.sh <num_exps> <gpu_id>

The test results are displayed at the end of training and can also be found at saved/<model_name>.test.

Logging

Training outputs, TensorBoard logs and models files are be saved in saved/ folder.

Evaluation

  1. scripts/score.py is used to hypothesis testing the significance of improvement between different models. To use, first run multiple experiments with num_exps > 1, for example:
bash scripts/both.sh 2 <gpu_id>
bash scripts/baseline.sh 2 <gpu_id>

Then,

python scripts/score.py --name-1 saved/release_baseline --name-2 saved/both_rgcn --num 2 --metric recall@50

where you should remove the trailing _0, _1 automatically added to the model names, nums should be set the same as num_exps above, and recall@50 can be replaced with other evaluation metrics in the paper.

Sample output:

[0.298, 0.2918]
0.2949
0.0031
[0.3417, 0.3369]
0.3393
0.0024
Ttest_indResult(statistic=-11.325204070341204, pvalue=0.007706635327863829)
  1. scripts/display_model.py is used to generate responses.
python scripts/display_model.py -t redial -mf saved/transformer_rec_both_rgcn_0 -dt test

Example output ([TorchAgent] is our model output):

~~
[eval_labels_choice]: Oh, you like scary movies?
I recently watched __unk__
[movies]:
  37993
[redial]: 
Hello!
Hello!
What kind of movies do you like?
I am looking for a movie recommendation.   When I was younger I really enjoyed the __unk__
[label_candidates: 3|37993|50395||Oh, you like scary movies?
I recently watched __unk__]
[eval_labels: Oh, you like scary movies?
I recently watched __unk__]
   [TorchAgent]: have you seen "The Shining  (1980)" ?
~~
  1. scripts/show_bias.py is used to show the vocabulary bias of a specific movie (like the qualitative analysis in Table 4)
python scripts/show_bias.py -mf saved/transformer_rec_both_rgcn_0

Common Q&A

  1. Understanding model outputs. Please see #15 (comment).

  2. Adapting this code to other datasets. It is not straightforward for this code to be run on other datasets currently. The main reason is that we cached the entity linking process in KBRD for ReDial. Please see #10 (comment) for details.

  3. Why the recommender and the dialog part are trained separatedly? Please refer to #9 (comment) for detailed explanation.

If you have additional questions, please let us know.

Cite

Please cite our paper if you use this code in your own work:

@article{chen2019towards,
  title={Towards Knowledge-Based Recommender Dialog System},
  author={Chen, Qibin and Lin, Junyang and Zhang, Yichang and Ding, Ming and Cen, Yukuo and Yang, Hongxia and Tang, Jie},
  journal={arXiv preprint arXiv:1908.05391},
  year={2019}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].