- RETINAQA is a robust KBQA model for detecting unanswerability.
- It is a multi-staged Retrieve, Generate and Rank framework.
- It contains major 3 components : Sketch Generation, Logical Form Integrator and a Discriminator.
- Logical Form Integrator combines outputs of sketch generator and two types of reteriver - schema reteriver and path reteriver (similar to TIARA).
conda create -n retinaqa python=3.9
pip install -r requirements.txt
-
Run setup.py to download data and retriever outputs for different datasets.
- If you want to re-train all retriever modules - entity linker, schema reteriver and logical form reteriver, then follow steps mentioned in https://github.com/microsoft/KC/tree/main/papers/TIARA.
- Copy the output files - entities, top-k relations, top-k classes and top-k paths to appropriate location inside ./data (Example given in setup.py file)
-
Train sketch generator : Follow steps as mentioned in src/sketch_generation.
-
Generate candidate logical forms : Follow steps as mentioned in src/lf_integrator
-
Train discriminator : Follow steps as mentioned in src/discriminator
To directly run inference on GrailQability please find the links to pre-trained model checkpoints for different stages here. Please follow instructions in respective sections to run inference.
Training Type | Module | Checkpoint link |
---|---|---|
A | Sketch Generation Logical Form Candidates Cache Discriminator |
link link link |
AU | Sketch Generation Logical Form Candidates Cache Discriminator |
link link link |
Parts of our code/data are taken from: