This repository contains source code and datasets for paper "Riker: Mining Rich Keyword Representations for Interpretable Product Question Answering" (SIGKDD 2019). (paper)
The original dataset are from this work. Both the QA and review datasets can be downloaded following the instructions in this paper.
The preprocessed QA data can be found here. The preprocessed review datasets are not uploaded due to their sizes, but they can be preprocessed from the raw data using the preprocessing scripts.
The annotated reviews for our user study can be found here.
IMPORTANT: Set required environment variables by calling. set_envs.sh
from this project's home directory.
It basically does the following:
export PQA_HOME=$PWD
export PQA_DOMAIN=baby
export PQA_DATA_SOURCE=${PQA_HOME}/preprocess/${PQA_DOMAIN}_qa_review_spacy_preprocessed.txt
export PQA_DATA_PATH=${PQA_HOME}/preprocess/${PQA_DOMAIN}
export PQA_GLOVE_DIM=300
export PQA_GLOVE_PATH=${PQA_HOME}/data-raw/glove/glove.42B.300d.txt
cd ${PQA_HOME}/src
python run.py --log_file_name=exp
This will save tensorflow model checkpoints to folder ${PQA_HOME}/checkpoints/exp-checkpoint-<xx>
and logs to
${PQA_HOME}/logs/train_exp_<xxxxxxx_xxxxxx>.log
.
cd ${PQA_HOME}/src
python run.py --log_file_name=exp --train=false --save_query
Set save_query
argument to save the re-weighted query words to
${PQA_HOME}/intermediate/exp-query/[train|dev|test]_quesiton_focus_query_xxxxxxxx_xxxxxx.pickle
and logs to
${PQA_HOME}/logs/test_exp_<xxxxxxx_xxxxxx>.log
.
cd ${PQA_HOME}/src
python eval_word_expansion.py --log_file_name=exp
This will produce:
- word similarities:
${PQA_HOME}/intermediate/exp-query/word_similarity_rnn_input_new.pickle
- word similarities:
${PQA_HOME}/intermediate/exp-query/word_similarity_rnn_output_new.pickle
- qualitative results:
${PQA_HOME}/result/exp/temp_results_word_expansion_rnn_input.txt
- qualitative results:
${PQA_HOME}/result/exp/temp_results_word_expansion_rnn_output.txt
- intermediate data:
${PQA_HOME}/intermediate/exp-query/word_embed_rnn_output.pickle
cd ${PQA_HOME}/src
python eval_sent_level_expansion.py --log_file_name=exp
This will produce:
${PQA_HOME}/intermediate/exp-query/[dev|test]_question_focus_query_expansion_xxxxxxxx_xxxxxx.pickle
Please kindly cite our paper if you use the code or the datasets in this repo:
@inproceedings{Zhao:2019:RMR:3292500.3330985,
author = {Zhao, Jie and Guan, Ziyu and Sun, Huan},
title = {Riker: Mining Rich Keyword Representations for Interpretable Product Question Answering},
booktitle = {Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery \& Data Mining},
series = {KDD '19},
year = {2019},
isbn = {978-1-4503-6201-6},
location = {Anchorage, AK, USA},
pages = {1389--1398},
numpages = {10},
url = {http://doi.acm.org/10.1145/3292500.3330985},
doi = {10.1145/3292500.3330985},
acmid = {3330985},
publisher = {ACM},
address = {New York, NY, USA},
keywords = {interpretable search, product qa, question representation},
}