_id
stringlengths 3
7
| text
stringlengths 0
841
| title
stringclasses 652
values | doc_id
stringclasses 652
values | paragraph_no
int64 0
558
| total_paragraphs
int64 20
559
| is_candidate
bool 1
class |
---|---|---|---|---|---|---|
0-0 | Overview | Child Tax Credit | 0 | 0 | 77 | true |
0-1 | You can only make a claim for Child Tax Credit if you already get Working Tax Credit. | Child Tax Credit | 0 | 1 | 77 | true |
0-2 | If you cannot apply for Child Tax Credit, you can apply for Universal Credit instead. | Child Tax Credit | 0 | 2 | 77 | true |
0-3 | You might be able to apply for Pension Credit if you and your partner are State Pension age or over. | Child Tax Credit | 0 | 3 | 77 | true |
0-4 | What you’ll get | Child Tax Credit | 0 | 4 | 77 | true |
0-5 | The amount you can get depends on how many children you’ve got and whether you’re: | Child Tax Credit | 0 | 5 | 77 | true |
0-6 | making a new claim for Child Tax Credit | Child Tax Credit | 0 | 6 | 77 | true |
0-7 | already claiming Child Tax Credit | Child Tax Credit | 0 | 7 | 77 | true |
0-8 | Child Tax Credit will not affect your Child Benefit. | Child Tax Credit | 0 | 8 | 77 | true |
0-9 | You can only claim Child Tax Credit for children you’re responsible for. | Child Tax Credit | 0 | 9 | 77 | true |
0-10 | If you're making a new claim | Child Tax Credit | 0 | 10 | 77 | true |
0-11 | You can only make a claim for Child Tax Credit if you already get Working Tax Credit. | Child Tax Credit | 0 | 11 | 77 | true |
0-12 | You can only claim Child Tax Credit for children you’re responsible for. | Child Tax Credit | 0 | 12 | 77 | true |
0-13 | What you’ll get | Child Tax Credit | 0 | 13 | 77 | true |
0-14 | The amount you could get depends on when your children were born. | Child Tax Credit | 0 | 14 | 77 | true |
0-15 | If all your children were born before 6 April 2017 | Child Tax Credit | 0 | 15 | 77 | true |
0-16 | You could get the ‘child element’ of Child Tax Credit for all of your children. | Child Tax Credit | 0 | 16 | 77 | true |
0-17 | You’ll also get the basic amount, known as the ‘family element’. | Child Tax Credit | 0 | 17 | 77 | true |
0-18 | If one or more of your children were born on or after 6 April 2017 | Child Tax Credit | 0 | 18 | 77 | true |
0-19 | You could get the child element of Child Tax Credit for up to 2 children. You might get the child element for more children if exceptions apply. | Child Tax Credit | 0 | 19 | 77 | true |
0-20 | You’ll only get the family element if at least one of your children was born before 6 April 2017. | Child Tax Credit | 0 | 20 | 77 | true |
0-21 | Child Tax Credit rates for the 2021 to 2022 tax year | Child Tax Credit | 0 | 21 | 77 | true |
0-22 | Element | Yearly amount | Child Tax Credit | 0 | 22 | 77 | true |
0-23 | The basic amount (this is known as ‘the family element’) | Up to £545 | Child Tax Credit | 0 | 23 | 77 | true |
0-24 | For each child (this is known as ‘the child element’) | Up to £2,845 | Child Tax Credit | 0 | 24 | 77 | true |
0-25 | For each disabled child | Up to £3,435 (on top of the child element) | Child Tax Credit | 0 | 25 | 77 | true |
0-26 | For each severely disabled child | Up to £1,390 (on top of the child element and the disabled child element) | Child Tax Credit | 0 | 26 | 77 | true |
0-27 | Use the tax credit calculator to work out how much you could get. | Child Tax Credit | 0 | 27 | 77 | true |
0-28 | Moving to the UK from the EEA | Child Tax Credit | 0 | 28 | 77 | true |
0-29 | You must wait 3 months before claiming Child Tax Credit if you arrived in the UK from the EEA on or after 1 July 2014 and do not work. | Child Tax Credit | 0 | 29 | 77 | true |
0-30 | There are some exceptions who will not have to wait 3 months, for example refugees. | Child Tax Credit | 0 | 30 | 77 | true |
0-31 | You're already claiming Child Tax Credit | Child Tax Credit | 0 | 31 | 77 | true |
0-32 | How much Child Tax Credit you get depends on your circumstances. | Child Tax Credit | 0 | 32 | 77 | true |
0-33 | You must tell HM Revenue and Customs if your circumstances change. | Child Tax Credit | 0 | 33 | 77 | true |
0-34 | If your claim started before 6 April 2017 | Child Tax Credit | 0 | 34 | 77 | true |
0-35 | You get: | Child Tax Credit | 0 | 35 | 77 | true |
0-36 | the basic amount of Child Tax Credit (known as the ‘family element’) | Child Tax Credit | 0 | 36 | 77 | true |
0-37 | the ‘child element’ for children born before 6 April 2017 | Child Tax Credit | 0 | 37 | 77 | true |
0-38 | If you have another child on or after 6 April 2017, you’ll usually only get the child element for them if they’re the second child you’re claiming for. | Child Tax Credit | 0 | 38 | 77 | true |
0-39 | You might get the child element for more children if exceptions apply. | Child Tax Credit | 0 | 39 | 77 | true |
0-40 | If your claim started on or after 6 April 2017 | Child Tax Credit | 0 | 40 | 77 | true |
0-41 | You get the child element for up to 2 children. You might get the child element for more children if exceptions apply. | Child Tax Credit | 0 | 41 | 77 | true |
0-42 | You only get the family element if at least one of your children was born before 6 April 2017. | Child Tax Credit | 0 | 42 | 77 | true |
0-43 | If all your children were born before 6 April 2017 | Child Tax Credit | 0 | 43 | 77 | true |
0-44 | You get the child element for all your children. You also get the basic amount (known as the family element). | Child Tax Credit | 0 | 44 | 77 | true |
0-45 | Child Tax Credit rates for the 2021 to 2022 tax year | Child Tax Credit | 0 | 45 | 77 | true |
0-46 | Element | Yearly amount | Child Tax Credit | 0 | 46 | 77 | true |
0-47 | The basic amount (this is known as ‘the family element’) | Up to £545 | Child Tax Credit | 0 | 47 | 77 | true |
0-48 | For each child (this is known as ‘the child element’) | Up to £2,845 | Child Tax Credit | 0 | 48 | 77 | true |
0-49 | For each disabled child | Up to £3,435 (on top of the child element) | Child Tax Credit | 0 | 49 | 77 | true |
0-50 | For each severely disabled child | Up to £1,390 (on top of the child element and the disabled child element) | Child Tax Credit | 0 | 50 | 77 | true |
0-51 | Use the tax credit calculator to work out how much you could get. | Child Tax Credit | 0 | 51 | 77 | true |
0-52 | How you're paid | Child Tax Credit | 0 | 52 | 77 | true |
0-53 | All benefits, pensions and allowances are paid into an account (a bank account, for example) of the person mainly responsible for the child. | Child Tax Credit | 0 | 53 | 77 | true |
0-54 | You’re paid every week or every 4 weeks from the date of your claim up to the end of the tax year (5 April), unless your circumstances change. | Child Tax Credit | 0 | 54 | 77 | true |
0-55 | How to claim | Child Tax Credit | 0 | 55 | 77 | true |
0-56 | You can no longer make a new claim for Child Tax Credit. You can apply for Universal Credit instead. | Child Tax Credit | 0 | 56 | 77 | true |
0-57 | You might be able to apply for Pension Credit if you and your partner are State Pension age or over. | Child Tax Credit | 0 | 57 | 77 | true |
0-58 | You can only make a claim for Child Tax Credit if you already get Working Tax Credit. | Child Tax Credit | 0 | 58 | 77 | true |
0-59 | To claim Child Tax Credit, update your existing tax credit claim by reporting a change in your circumstances online or by phone. | Child Tax Credit | 0 | 59 | 77 | true |
0-60 | Responsibility for a child | Child Tax Credit | 0 | 60 | 77 | true |
0-61 | You can only claim Child Tax Credit for children you’re responsible for. | Child Tax Credit | 0 | 61 | 77 | true |
0-62 | You’re usually responsible for a child if: | Child Tax Credit | 0 | 62 | 77 | true |
0-63 | they live with you all the time | Child Tax Credit | 0 | 63 | 77 | true |
0-64 | they normally live with you and you’re the main carer | Child Tax Credit | 0 | 64 | 77 | true |
0-65 | they keep their toys and clothes at your home | Child Tax Credit | 0 | 65 | 77 | true |
0-66 | you pay for their meals and give them pocket money | Child Tax Credit | 0 | 66 | 77 | true |
0-67 | they live in an EEA country or Switzerland but are financially dependent on you | Child Tax Credit | 0 | 67 | 77 | true |
0-68 | Contact HM Revenue and Customs (HMRC) if you’re not sure you’re responsible for the child. | Child Tax Credit | 0 | 68 | 77 | true |
0-69 | If you share responsibility for a child and you cannot agree who should claim you can both apply. HMRC will decide for you. | Child Tax Credit | 0 | 69 | 77 | true |
0-70 | If you adopted or fostered a child | Child Tax Credit | 0 | 70 | 77 | true |
0-71 | You can claim for an adopted or fostered child if you’re not getting money from your local council (Health and Social Services Board in Northern Ireland). If you do get money, call HMRC to find out if you can claim. | Child Tax Credit | 0 | 71 | 77 | true |
0-72 | If you’re responsible for a disabled child | Child Tax Credit | 0 | 72 | 77 | true |
0-73 | You may get extra Child Tax Credits if your child either: | Child Tax Credit | 0 | 73 | 77 | true |
0-74 | gets Disability Living Allowance, Personal Independence Payment or Armed Forces Independence Payment | Child Tax Credit | 0 | 74 | 77 | true |
0-75 | is certified blind (or was within 28 weeks of your tax credits claim) | Child Tax Credit | 0 | 75 | 77 | true |
0-76 | You still qualify if Disability Living Allowance, Personal Independence Payment or Armed Forces Independence Payment stops because the child goes into hospital. | Child Tax Credit | 0 | 76 | 77 | true |
1-0 | Eligibility | Working Tax Credit | 1 | 0 | 95 | true |
1-1 | You can only make a claim for Working Tax Credit if you already get Child Tax Credit. | Working Tax Credit | 1 | 1 | 95 | true |
1-2 | If you cannot apply for Working Tax Credit, you can apply for Universal Credit instead. | Working Tax Credit | 1 | 2 | 95 | true |
1-3 | You might be able to apply for Pension Credit if you and your partner are State Pension age or over. | Working Tax Credit | 1 | 3 | 95 | true |
1-4 | Hours you work | Working Tax Credit | 1 | 4 | 95 | true |
1-5 | You must work a certain number of hours a week to qualify. | Working Tax Credit | 1 | 5 | 95 | true |
1-6 | Circumstance | Hours a week | Working Tax Credit | 1 | 6 | 95 | true |
1-7 | Aged 25 to 59 | At least 30 hours | Working Tax Credit | 1 | 7 | 95 | true |
1-8 | Aged 60 or over | At least 16 hours | Working Tax Credit | 1 | 8 | 95 | true |
1-9 | Disabled | At least 16 hours | Working Tax Credit | 1 | 9 | 95 | true |
1-10 | Single with 1 or more children | At least 16 hours | Working Tax Credit | 1 | 10 | 95 | true |
1-11 | Couple with 1 or more children | Usually, at least 24 hours between you (with 1 of you working at least 16 hours) | Working Tax Credit | 1 | 11 | 95 | true |
1-12 | A child is someone who is under 16 (or under 20 if they’re in approved education or training). | Working Tax Credit | 1 | 12 | 95 | true |
1-13 | Use the tax credits calculator to check if you work the right number of hours. | Working Tax Credit | 1 | 13 | 95 | true |
1-14 | You can still apply for Working Tax Credit if you’re on leave. | Working Tax Credit | 1 | 14 | 95 | true |
1-15 | Exceptions for couples with at least one child | Working Tax Credit | 1 | 15 | 95 | true |
1-16 | You can claim if you work less than 24 hours a week between you and one of the following applies: | Working Tax Credit | 1 | 16 | 95 | true |
1-17 | you work at least 16 hours a week and you’re disabled or aged 60 or above | Working Tax Credit | 1 | 17 | 95 | true |
1-18 | you work at least 16 hours a week and your partner is incapacitated (getting certain benefits because of disability or ill health), is entitled to Carer’s Allowance, or is in hospital or prison | Working Tax Credit | 1 | 18 | 95 | true |
1-19 | What counts as work | Working Tax Credit | 1 | 19 | 95 | true |
1-20 | Your work can be: | Working Tax Credit | 1 | 20 | 95 | true |
1-21 | for someone else, as a worker or employee | Working Tax Credit | 1 | 21 | 95 | true |
1-22 | as someone who’s self-employed | Working Tax Credit | 1 | 22 | 95 | true |
DAPR: Document-Aware Passage Retrieval
This datasets repo contains the queries, passages/documents and judgements for the data used in the DAPR paper.
DAPR is a benchmark for document-aware passage retrieval: given a (large) collection of documents, relevant passages within these documents for a given query are required to be returned.
A key focus of DAPR is forcing/encouraging retrieval systems to utilize the document-level context which surrounds the relevant passages. An example is shown below:
In this example, the query asks for a musician or a group who has ever played at a certain venue. However, the gold relevant passage mentions only the reference noun, "the venue" but its actual name, "the Half Moon, Putney". The model thus needs to explore the context from the belonging document of the passage, which in this case means coreference resolution.
Overview
For the DAPR benchmark, it contains 5 datasets:
Dataset | #Queries (test) | #Documents | #Passages |
---|---|---|---|
MS MARCO | 2,722 | 1,359,163 | 2,383,023* |
Natural Questions | 3,610 | 108,626 | 2,682,017 |
MIRACL | 799 | 5,758,285 | 32,893,221 |
Genomics | 62 | 162,259 | 12,641,127 |
ConditionalQA | 271 | 652 | 69,199 |
And additionally, NQ-hard, the hard subset of queries from Natural Questions is also included (516 in total). These queries are hard because understanding the document context (e.g. coreference, main topic, multi-hop reasoning, and acronym) is necessary for retrieving the relevant passages.
Notes: for MS MARCO, its documents do not provide the gold paragraph segmentation and we only segment the document by keeping the judged passages (from the MS MARCO Passage Ranking task) standing out while leaving the rest parts surrounding these passages. These passages are marked by
is_candidate==true
.
For Natural Questions, the training split is not provided because the duplidate timestamps cannot be compatible with the queries/qrels/corpus format. Please refer to https://public.ukp.informatik.tu-darmstadt.de/kwang/dapr/data/NaturalQuestions/ for the training split.
Load the dataset
Loading the passages
One can load the passages like this:
from datasets import load_dataset
dataset_name = "ConditionalQA"
passages = load_dataset("UKPLab/dapr", f"{dataset_name}-corpus", split="test")
for passage in passages:
passage["_id"] # passage id
passage["text"] # passage text
passage["title"] # doc title
passage["doc_id"]
passage["paragraph_no"] # the paragraph number within the document
passage["total_paragraphs"] # how many paragraphs/passages in total in the document
passage["is_candidate"] # is this passage a candidate for retrieval
Or strem the dataset without downloading it beforehand:
from datasets import load_dataset
dataset_name = "ConditionalQA"
passages = load_dataset(
"UKPLab/dapr", f"{dataset_name}-corpus", split="test", streaming=True
)
for passage in passages:
passage["_id"] # passage id
passage["text"] # passage text
passage["title"] # doc title
passage["doc_id"]
passage["paragraph_no"] # the paragraph number within the document
passage["total_paragraphs"] # how many paragraphs/passages in total in the document
passage["is_candidate"] # is this passage a candidate for retrieval
Loading the qrels
The qrels split contains the query relevance annotation, i.e., it contains the relevance score for (query, passage) pairs.
from datasets import load_dataset
dataset_name = "ConditionalQA"
qrels = load_dataset("UKPLab/dapr", f"{dataset_name}-qrels", split="test")
for qrel in qrels:
qrel["query_id"] # query id (the text is available in ConditionalQA-queries)
qrel["corpus_id"] # passage id
qrel["score"] # gold judgement
We present the NQ-hard dataset in an extended format of the normal qrels with additional columns:
from datasets import load_dataset
qrels = load_dataset("UKPLab/dapr", "nq-hard", split="test")
for qrel in qrels:
qrel["query_id"] # query id (the text is available in ConditionalQA-queries)
qrel["corpus_id"] # passage id
qrel["score"] # gold judgement
# Additional columns:
qrel["query"] # query text
qrel["text"] # passage text
qrel["title"] # doc title
qrel["doc_id"]
qrel["categories"] # list of categories about this query-passage pair
qrel["url"] # url to the document in Wikipedia
Retrieval and Evaluation
The following shows an example, how the dataset can be used to build a semantic search application.
This example is based on clddp (
pip install -U cldpp
). One can further explore this example for convenient multi-GPU exact search.
# Please install cldpp with `pip install -U cldpp`
from clddp.retriever import Retriever, RetrieverConfig, Pooling, SimilarityFunction
from clddp.dm import Separator
from typing import Dict
from clddp.dm import Query, Passage
import torch
import pytrec_eval
import numpy as np
from datasets import load_dataset
# Define the retriever (DRAGON+ from https://arxiv.org/abs/2302.07452)
class DRAGONPlus(Retriever):
def __init__(self) -> None:
config = RetrieverConfig(
query_model_name_or_path="facebook/dragon-plus-query-encoder",
passage_model_name_or_path="facebook/dragon-plus-context-encoder",
shared_encoder=False,
sep=Separator.blank,
pooling=Pooling.cls,
similarity_function=SimilarityFunction.dot_product,
query_max_length=512,
passage_max_length=512,
)
super().__init__(config)
# Load data:
passages = load_dataset("UKPLab/dapr", "ConditionalQA-corpus", split="test")
queries = load_dataset("UKPLab/dapr", "ConditionalQA-queries", split="test")
qrels_rows = load_dataset("UKPLab/dapr", "ConditionalQA-qrels", split="test")
qrels: Dict[str, Dict[str, float]] = {}
for qrel_row in qrels_rows:
qid = qrel_row["query_id"]
pid = qrel_row["corpus_id"]
rel = qrel_row["score"]
qrels.setdefault(qid, {})
qrels[qid][pid] = rel
# Encode queries and passages: (refer to https://github.com/kwang2049/clddp/blob/main/examples/search_fiqa.sh for multi-GPU exact search)
retriever = DRAGONPlus()
retriever.eval()
queries = [Query(query_id=query["_id"], text=query["text"]) for query in queries]
passages = [
Passage(passage_id=passage["_id"], text=passage["text"]) for passage in passages
]
query_embeddings = retriever.encode_queries(queries)
with torch.no_grad(): # Takes around a minute on a V100 GPU
passage_embeddings, passage_mask = retriever.encode_passages(passages)
# Calculate the similarities and keep top-K:
similarity_scores = torch.matmul(
query_embeddings, passage_embeddings.t()
) # (query_num, passage_num)
topk = torch.topk(similarity_scores, k=10)
topk_values: torch.Tensor = topk[0]
topk_indices: torch.LongTensor = topk[1]
topk_value_lists = topk_values.tolist()
topk_index_lists = topk_indices.tolist()
# Run evaluation with pytrec_eval:
retrieval_scores: Dict[str, Dict[str, float]] = {}
for query_i, (values, indices) in enumerate(zip(topk_value_lists, topk_index_lists)):
query_id = queries[query_i].query_id
retrieval_scores.setdefault(query_id, {})
for value, passage_i in zip(values, indices):
passage_id = passages[passage_i].passage_id
retrieval_scores[query_id][passage_id] = value
evaluator = pytrec_eval.RelevanceEvaluator(
query_relevance=qrels, measures=["ndcg_cut_10"]
)
query_performances: Dict[str, Dict[str, float]] = evaluator.evaluate(retrieval_scores)
ndcg = np.mean([score["ndcg_cut_10"] for score in query_performances.values()])
print(ndcg) # 0.21796083196880855
Note
This dataset was created with datasets==2.15.0
. Make sure to use this or a newer version of the datasets library.
Citation
If you use the code/data, feel free to cite our publication DAPR: A Benchmark on Document-Aware Passage Retrieval:
@article{wang2023dapr,
title = "DAPR: A Benchmark on Document-Aware Passage Retrieval",
author = "Kexin Wang and Nils Reimers and Iryna Gurevych",
journal= "arXiv preprint arXiv:2305.13915",
year = "2023",
url = "https://arxiv.org/abs/2305.13915",
}
- Downloads last month
- 1,070