Code Monkey home page Code Monkey logo

praline's Introduction

Contrastive Representation Learning for Conversational Question Answering over Knowledge Graphs

This paper addresses the task of conversational question answering (ConvQA) over knowledge graphs (KGs). The majority of existing ConvQA methods rely on full supervision signals with a strict assumption of the availability of gold logical forms of queries to extract answers from the KG. However, creating such a gold logical form is not viable for each potential question in a real-world scenario. Hence, in the case of missing gold logical forms, the existing information retrieval-based approaches use weak supervision via heuristics or reinforcement learning, formulating ConvQA as a KG path ranking problem. Despite missing gold logical forms, an abundance of conversational contexts, such as entire dialog history with fluent responses and domain information, can be incorporated to effectively reach the correct KG path. This work proposes a contrastive representation learning-based approach to rank KG paths effectively. Our approach solves two key challenges. Firstly, it allows weak supervision-based learning that omits the necessity of gold annotations. Second, it incorporates the conversational context (entire dialog history and domain information) to jointly learn its homogeneous representation with KG paths to improve contrastive representations for effective path ranking. We evaluate our approach on standard datasets for ConvQA, on which it significantly outperforms existing baselines on all domains and overall. Specifically, in some cases, the Mean Reciprocal Rank (MRR) and Hit@5 ranking metrics improve by absolute $10$ and $18$ points, respectively, compared to the state-of-the-art performance.

PRALINE architecture

PRALINE (Path Ranking for conversAtionaL questIon aNswEring) architecture. It consists of three steps: 1) Extract KG paths and domains and represent them using a BERT model. 2) Learn the conversational context using a BART model and a domain identification pointer. 3) A contrastive ranking module that learns a joint embedding space $\phi^{c}, \phi^{p}$ for the conversation (contextual embeddings $h^{(enc)}$ & selected domain embeddings $h^{(dm)}$) and the context path $h^{(p)}$.

Requirements and Setup

Python version >= 3.7

PyTorch version >= 1.10.0

# clone the repository
git clone https://github.com/endrikacupaj/PRALINE.git
cd PRALINE
pip install -r requirements.txt

Train

For training you will need to adjust the paths in args file. At the same file you can also modify and experiment with different model settings.

# train PRALINE
python train.py

Test

For testing, first consider the args file for specifying the desired checkpoint path, after you can run the test file:

# test PRALINE
python test.py

License

The repository is under MIT License.

Cite

@inproceedings{10.1145/3511808.3557267,
  author = {Kacupaj, Endri and Singh, Kuldeep and Maleshkova, Maria and Lehmann, Jens},
  title = {Contrastive Representation Learning for Conversational Question Answering over Knowledge Graphs},
  year = {2022},
  isbn = {9781450392365},
  publisher = {Association for Computing Machinery},
  address = {New York, NY, USA},
  url = {https://doi.org/10.1145/3511808.3557267},
  doi = {10.1145/3511808.3557267},
  abstract = {This paper addresses the task of conversational question answering (ConvQA) over knowledge graphs (KGs). The majority of existing ConvQA methods rely on full supervision signals with a strict assumption of the availability of gold logical forms of queries to extract answers from the KG. However, creating such a gold logical form is not viable for each potential question in a real-world scenario. Hence, in the case of missing gold logical forms, the existing information retrieval-based approaches use weak supervision via heuristics or reinforcement learning, formulating ConvQA as a KG path ranking problem. Despite missing gold logical forms, an abundance of conversational contexts, such as entire dialog history with fluent responses and domain information, can be incorporated to effectively reach the correct KG path. This work proposes a contrastive representation learning-based approach to rank KG paths effectively. Our approach solves two key challenges. Firstly, it allows weak supervision-based learning that omits the necessity of gold annotations. Second, it incorporates the conversational context (entire dialog history and domain information) to jointly learn its homogeneous representation with KG paths to improve contrastive representations for effective path ranking. We evaluate our approach on standard datasets for ConvQA, on which it significantly outperforms existing baselines on all domains and overall. Specifically, in some cases, the Mean Reciprocal Rank (MRR) and Hit@5 ranking metrics improve by absolute 10 and 18 points, respectively, compared to the state-of-the-art performance.},
  booktitle = {Proceedings of the 31st ACM International Conference on Information & Knowledge Management},
  pages = {925–934},
  numpages = {10},
  keywords = {conversations, question answering, contrastive learning, kg},
  location = {Atlanta, GA, USA},
  series = {CIKM '22}
}

praline's People

Contributors

endrikacupaj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

praline's Issues

How can I get startpoints.json?

Hello, I was so impressed by PRALINE and I want to run this code.
However, there are unknown files, such as /data/final/paths.json, and /data/final/startpoints.json.
I cannot find these files in CONQUER dataset.

I would be grateful if you upload the files in /data/final and data/labels_dict.json
or share me with my email, [email protected]

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.