Coder Social home page Coder Social logo

visconde's Introduction

Visconde: Multi-document QA with GPT-3 and Neural Reranking

In this repository, we maintain the code used in the paper Visconde: Multi-document QA with GPT-3 and Neural Reranking, accepted for publication at the European Conference on Information Retrieval ECIR2023.

Abstract: This paper discusses a question-answering system that can answer questions whose supporting evidence is spread over multiple (potentially long) documents. The system, called Visconde, uses a three-step pipeline to perform the task: decompose, retrieve, and aggregate. The first step decomposes the question into simpler questions using a few-shot large language model (LLM). Then, a state-of-the-art search engine is used to retrieve candidate passages from a large collection for each decomposed question. In the final step, we use the LLM in a few-shot setting to aggregate the contents of the passages into the final answer. The system is evaluated on three datasets: IIRC, Qasper, and StrategyQA. Results suggest that current retrievers are the main bottleneck and that readers are already performing at the human level as long as relevant passages are provided. The system is also shown to be more effective when the model is induced to give explanations before.

We evaluated our proposal on three datasets: IIRC, QASPER and StrategyQA.

Reproducing

Download datasets

sh setup.sh

IIRC

  1. Decompose test questions
  2. Create Indices
  3. Create list for reranking
  4. Rerank items (GPU required)
  5. Generate explanation for training examples
  6. Testing

QASPER

  1. Rerank paragraphs by question
  2. Generate explanations for training examples
  3. Testing
  4. Compute metrics For computing metrics download run:

python qasper_evaluator.py --predictions PREDICTIONS_FILE --gold data/qasper-test-v0.3.json --text_evidence_only

StrategyQA

  1. Create indices
  2. Decompose questions
  3. Create lists for reranking
  4. Rerank items (GPU required)
  5. Testing
  6. Compute metrics For computing metrics clone this repository and run the evaluator.

How to Cite

@inproceedings{10.1007/978-3-031-28238-6_44,
author = {Pereira, Jayr and Fidalgo, Robson and Lotufo, Roberto and Nogueira, Rodrigo},
title = {Visconde: Multi-Document QA With GPT-3 And Neural Reranking},
year = {2023},
isbn = {978-3-031-28237-9},
publisher = {Springer-Verlag},
address = {Berlin, Heidelberg},
url = {https://doi.org/10.1007/978-3-031-28238-6_44},
doi = {10.1007/978-3-031-28238-6_44},
booktitle = {Advances in Information Retrieval: 45th European Conference on Information Retrieval, ECIR 2023, Dublin, Ireland, April 2–6, 2023, Proceedings, Part II},
pages = {534–543},
numpages = {10},
location = {Dublin, Ireland}
}

visconde's People

Contributors

jayralencar avatar rodrigonogueira4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

visconde's Issues

Error while import MonoT5 from Pygaggle

I am running the notebook on Colab on Python v3.9.16
Kindly help me resolve the issue @rodrigonogueira4, @jayralencar.

1 from pygaggle.rerank.base import Query, Text
----> 2 from pygaggle.rerank.transformer import MonoT5
3
4 reranker = MonoT5(model=model)

7 frames
/usr/local/lib/python3.9/dist-packages/pygaggle/rerank/transformer.py in
11 import torch
12 from .base import Reranker, Query, Text
---> 13 from .similarity import SimilarityMatrixProvider
14 from pygaggle.model import (BatchTokenizer,
15 LongBatchEncoder,

/usr/local/lib/python3.9/dist-packages/pygaggle/rerank/similarity.py in
3 import torch
4
----> 5 from pygaggle.model.encode import SingleEncoderOutput
6
7

/usr/local/lib/python3.9/dist-packages/pygaggle/model/init.py in
4
5 from .decode import *
----> 6 from .encode import *
7 from .evaluate import *
8 from .serialize import *

/usr/local/lib/python3.9/dist-packages/pygaggle/model/encode.py in
6 import torch.nn as nn
7
----> 8 from .tokenize import BatchTokenizer
9 from pygaggle.rerank.base import TextType
10

/usr/local/lib/python3.9/dist-packages/pygaggle/model/tokenize.py in
170
171
--> 172 class SpacySenticizer:
173 nlp = English()
174 nlp.add_pipe(nlp.create_pipe('sentencizer'))

/usr/local/lib/python3.9/dist-packages/pygaggle/model/tokenize.py in SpacySenticizer()
172 class SpacySenticizer:
173 nlp = English()
--> 174 nlp.add_pipe(nlp.create_pipe('sentencizer'))
175
176 def init(self, max_paragraph_length: int = None):

/usr/local/lib/python3.9/dist-packages/spacy/language.py in create_pipe(self, name, config)
300 raise KeyError(Errors.E002.format(name=name))
301 factory = self.factories[name]
--> 302 return factory(self, **config)
303
304 def add_pipe(

/usr/local/lib/python3.9/dist-packages/spacy/language.py in factory(nlp, **cfg)
1043 def factory(nlp, **cfg):
1044 if hasattr(obj, "from_nlp"):
-> 1045 return obj.from_nlp(nlp, **cfg)
1046 elif isinstance(obj, class_types):
1047 return obj()

pipes.pyx in spacy.pipeline.pipes.Sentencizer.from_nlp()

TypeError: type() takes 1 or 3 arguments

need requirements.text

I am facing several dependencies while installing and running the notebook. Could you please help me with all relevant packages with their respective versions, that would be really helpful.

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.