SlowGuess/NAACL_2021_OCR huggingface dataset:
Raviteja Anantha\*, Svitlana Vakulenko\*, Zhucheng Tu\*, Shayne Longpre\*, Stephen Pulman\*, Srinivas Chappidi\*
Apple Inc. University of Amsterdam, Amsterdam, the Netherlands
We introduce a new dataset for Question Rewriting in Conversational Context (QReCC), which contains 14K conversations with 80K question-answer pairs. The task in QReCC is to find answers to conversational questions within a collection of 10M web pages (split into 54M passages). Answers to questions in the same conversation may be distributed across several web pages. QReCC provides annotations that allow us to train and evaluate individual subtasks of question rewriting, passage retrieval and reading comprehension required for the end-to-end conversational question answering (QA) task. We report the effectiveness of a strong baseline approach that combines the state-of-the-art model for question rewriting, and competitive models for open-domain QA. Our results set the first baseline for the QReCC dataset with F1 of 19.10, compared to the human upper bound of 75.45, indicating the difficulty of the setup and a large room for improvement.
It is often not possible to address a complex information need with a single question. Consequently, there is a clear need to extend open-domain question answering (QA) to a conversational setting. This task is commonly referred to as conversational (interactive or sequential) QA (Webb, 2006; Saeidi et al., 2018; Reddy et al., 2019). Conversational QA requests an answer conditioned on both the question and the previous conversation turns as context. Previously proposed large-scale benchmarks for conversational QA, such as QuAC and CoQA, limit the topic of conversation to the content of a single document. In practice, however, the answers can be distributed across several documents
Question: Tell me about the benefits of Yoga? Answer: Increased flexibility, muscle strength... URL: https://osteopathic.org/what-is-osteopathic-medicine/benefits-of-yoga
Question: Does it help in reducing stress? Rewrite: Does Yoga help in reducing stress? Answer: Yoga may help reduce stress, lower blood and lower your heart rate. URL: https://www.mayoclinic.org/healthy-lifestyle/stress-management/in-dep
Question: What are some of the main types?  
Rewrite: What are some of the main types of Yoga?  
Answer: Hatha, Kundalini, Ashtanga, ...  
URL: https://www.mindbodygreen.com/articles/the-11-major-types-of-yoga-explained-simplify
Question: What are common poses in Kundalini Yoga? Rewrite: What are common poses in Kundalini Yoga? Answer: Lotus Pose, Calibrate Pose, Perfect Pose, ... URL: https://www.kundaliniyoga.org/Asanas
Figure 1: A snippet of a sample conversation from QReCC with question rewrites and answer provenance links. Orange indicates coreference cases where the highlighted token should be replaced with its antecedent (in bold). Blue indicates the tokens that should be generated to make the question unambiguous outside of the conversational context.
that are relevant to the conversation, or the topic of the conversation may also drift. To investigate this phenomena and develop approaches suitable for the complexities of this task, we introduce a new dataset for open-domain conversational QA, called QReCC. The dataset consists of 13.6K conversations with an average of 6 turns per conversation.
A conversation in QReCC consists of a sequence of question-answer pairs. The answers to questions were produced by human annotators, who looked up relevant information on the web using a search engine. QReCC is therefore the first large-scale dataset for conversational QA that incorporates an information retrieval subtask. QReCC is accompanied with scripts for building a collection of passages from the Commoncrawl and the Wayback Machine for passage retrieval.
QReCC is inspired by the task of question rewriting (QR) that allows us to reduce the task of conversational QA to non-conversational QA by
- Work done as an intern at Apple Inc.
https://github.com/apple/ml-qrecc
Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 520-534 June 6-11, 2021. ©2021 Association for Computational Linguistics
generating self-contained versions of contextually-dependent questions. QR was recently shown crucial for porting retrieval QA architectures to a conversational setting (Dalton et al., 2019). Follow-up questions in conversational QA often depend on the previous conversation turns due to ellipsis (missing content) and coreference (anaphora). Every question-answer pair in QReCC is also annotated with a question rewrite. We evaluate the quality of these rewrites as self-contained questions in terms of the ability of the rewritten question, when used as input to the web search engine, to retrieve the correct answer. A snippet of a sample QReCC conversation is given in Figure 1.
The dataset collection included two phases: (1) dialogue collection, and (2) document collection. First, we set up an annotation task to collect dialogues with question-answer pairs along with question rewrites and answer provenance links. Second, after all dialogues were collected we downloaded the web pages using the provenance links, and then extended this set with a random sample of other web pages from Common crawl, preprocessed and split the pages into passages.
To produce the first baseline, we augment an open-domain QA model with a QR component that allows us to extend it to a conversational scenario. We evaluate this approach on the QReCC dataset, reporting the end-to-end effectiveness as well as the effectiveness on the individual subtasks separately.
Our contributions. We collected the first large-scale dataset for end-to-end, open-domain conversational QA that contains question rewrites that incorporate conversational context. We present a systematic comparison of existing automatic evaluation metrics on assessing the quality of question rewrites and show the metrics that best correlate with human judgement. We show empirically that QR provides a unified and effective solution for resolving references — both co-reference and ellipsis — in multi-turn dialogue setting and positively impacts the conversational QA task. We evaluate the dataset using a baseline that incorporates the state-of-the-art model in QR and competitive models for passage retrieval and answer extraction. This dataset provides a resource for the community to develop, evaluate, and advance methods for end-to-end, open-domain conversational QA.
QReCC builds upon three publicly available datasets and further extends them to the open-domain conversational QA setting: Question Answering in Context (QuAC) (Choi et al., 2018), TREC Conversational Assistant Track (CAsT) (Dalton et al., 2019) and Natural Questions (NQ) (Kwiatkowski et al., 2019). QReCC is the first large-scale dataset that supports the tasks of QR, passage retrieval, and reading comprehension (see Table 1 for the dataset comparison).
Open-domain QA. Reading comprehension (RC) approaches were recently extended to incorporate a retrieval subtask (Chen et al., 2017; Yang et al., 2019; Lee et al., 2019). This task is also referred to as machine reading at scale (Chen et al., 2017) or end-to-end QA (Yang et al., 2019). In this setup a reading comprehension component is preceded by a document retrieval component. The answer spans are extracted from documents retrieved from a document collection, given as input. The standard approach to end-to-end open-domain QA is (1) use an efficient filtering approach to reduce the number of candidate passages to the top- $k$  of the most relevant ones (usually BM25 based on the bag-of-words representation); and then (2) re-rank the subset of the top- $k$  relevant passages using a more fine-grained approach, such as BERT based on vector representations (Yang et al., 2019).
Conversational QA. Independently from end-to-end QA, the RC task was extended to a conversational setting, in which answer extraction is conditioned not only on the question but also on the previous conversation turns (Choi et al., 2018; Reddy et al., 2019). The first attempt at extending the task of information retrieval (IR) to a conversational setting was the recent TREC CAsT 2019 task (Dalton et al., 2019). The challenge was to rank passages from a passage collection by their relevance to an input question in the context of a conversation history. The size of the collection in CAsT 2019 was  $38.4\mathrm{M}$  passages, requiring efficient IR approaches. As efficient retrieval approaches operate on bag-of-words representations they need a different way to handle conversational context since they can not be trained end-to-end using a latent representation of the conversational context. A solution to this computational bottleneck was a QR model that learns to sample tokens from the conversational context as a pre-processing step before QA.
Table 1: The datasets that QReCC extends to open-domain conversational QA (QuAC, CAsT and NQ) and the datasets that are complementary to QReCC (CANARD and SaaC). RC - Reading Comprehension, PR - Passage Retrieval, QR - Question Rewriting.
Dataset	#Dialogues	#Questions	Task	Provenance
QuAC (Choi et al., 2018)	13.6K	98K	RC	-
NQ (Kwiatkowski et al., 2019)	0	307K	RC	-
CAsT (Dalton et al., 2019)	80	748	PR	-
CANARD (Elgohary et al., 2019)	5.6K	41K	QR	QuAC
OR-QuAC (Qu et al., 2020)	5.6K	41K	PR+RC	QuAC+CANARD
SaaS (Ren et al., 2020)	80	748	QR+PR+RC	CAst
QReCC (our work)	13.7K	81K	QR+PR+RC	QuAC+NQ+CAst
Question Rewriting. CANARD (Elgohary et al., 2019) provides rewrites for the conversational questions from the QuAC dataset. QR effectively modifies all follow-up questions such that they can be correctly interpreted outside of the conversational context as well. This extension to the conversational QA task proved especially useful while allowing retrieval models to incorporate conversational context (Voskarides et al., 2020; Vakulenko et al., 2020; Lin et al., 2020).
More recently, Qu et al. introduced OR-QuAC dataset that was automatically constructed from QuAC and CANARD datasets. OR-QuAC uses the same rewrites and answers as the ones provided in QuAC and CANARD. In contrast to OR-QuAC, the answers in QReCC are not tied to a single Wikipedia page. The answers can be distributed across several web pages. QReCC's passage collection is also larger and more diverse: 11M passages from Wikipedia in OR-QuAC vs. 54M passages from CommonCrawl in QReCC. The answers in OR-QuAC are single spans, whereas QReCC answers were produced by human annotators instructed to imitate natural conversational answers and may include several spans from different parts of the same web page.
TREC CAsT 2019 paved the way to conversational QA for retrieval but had several important limitations: (1) no training data and (2) no answer spans. First, the size of the CAsT dataset is limited to 80 dialogues, which is nowhere enough for training a machine-learning model. This was also the reason why CANARD played such an important role for the development of retrieval-based approaches even though it was collected as a RC dataset. Second, the task in TREC CAsT 2019 was conversational passage retrieval not extractive QA since the expected output was ranked passages and not a text span. We designed QReCC to overcome
both of these limitations.
The size of the QReCC dataset is comparable with other large-scale conversational QA datasets (see Table 1). The most relevant to our work is the concurrent work by Ren et al., who extended the TREC CAsT dataset with crowd-sourced answer spans. Since the size of this dataset is inadequate for training a machine-learning model and can be used only for evaluation, the authors train their models on the MS MARCO dataset instead, which is a non-conversational QA dataset (Bajaj et al., 2016). Their evaluation results show how the performance degrades due to the lack of conversational training data. TREC CAsT will continue in the future and the QReCC dataset provides a valuable benchmark helping to train and evaluate novel conversational QA approaches.
3 Dialogue Collection
To simplify the data collection task we decided to use questions from pre-existing QA datasets as seeds for dialogues in QReCC. We used questions from QuAC, CAsT and NQ. While QuAC and CAsT datasets contain question sequences, NQ is not a conversational dataset but contains standalone questions from web search. We use the NQ dataset to increase and diversify the number of samples beyond QuAC and CAsT by generating more rewrites for cases beyond coreference resolution. The majority of the follow-up questions in QuAC require coreference resolution for QR. Therefore, we explicitly instructed the annotators to use NQ as a start of a conversation and then come up with relevant follow-up questions, which would require generation of missing content, i.e., ellipsis, instead of coreference resolution for QR.
The task for the annotators was also to answer questions using a web search engine. Question rewrites were used as input to a search engine. This
Table 2: Summary statistics for the QReCC dataset.
QReCC	Train	Dev.	Test	All
# questions (Qs)	50.8K	12.7K	16.4K	80.0K
# dialogues	8.7K	2.2K	2.8K	13.6K
max Qs/dialogue	12	12	12	12
avg Qs/dialogue	6	6	6	6
min Qs/dialogue	5	5	5	5
% replacement	53	52	53	52
% insertion	35	36	37	38
% copy	11	11	9	9
% removal	1	1	1	1
setup helps to obtain feedback on the quality of QR with respect to the effectiveness of answer retrieval (see Section 6 for more details on using search results for the evaluating QR). Finally, the question-answer pair is annotated with the link to the web page that was used to produce the answer.
Thereby, every dialogue was produced by the same annotator including the questions, answers and rewrites. This design decision is called self-dialog technique that was shown to help improve quality of the data by avoiding some of the challenges observed in simulated dialogues produced by pairs of annotators (Byrne et al., 2019).
A team of 30 professional annotators with a project lead were employed to perform the task. The annotation task was described in the guidelines (see Appendix B for more details). To ensure the quality of the annotations we followed a post-hoc evaluation procedure, in which 5 reviewers go through the dataset and update incorrect examples they identify with consensus.
4 Dialogue Analysis
QReCC contains 13,598 dialogues with 79,952 questions in total. 9.3K dialogues are based on the questions from QuAC; 80 are from TREC CAsT; and 4.4K are from NQ.  $9\%$  of questions in QReCC do not have answers. We still retained the question rewrites even if no answer was found on the web. 112 questions were annotated with links to web pages without answer texts, e.g. "May I have a link to road signs in Singapore?"
We prepared three standard dataset splits and ensured that they are balanced in terms of the standard dialogue statistics and the types of QR (see Table 2). We distinguish four types of QR. They differ with respect to the intervention required to resolve contextual dependencies in dialogue. These
Figure 2: The 10 most frequently replaced tokens in QReCC.
types can be automatically identified by measuring the difference between an original question  $Q$  and a question rewrite  $R$  that are represented as sets using the bag-of-words:
- Insertion - new tokens are added to the original question to produce the rewrite (e.g., "What are some of the main types"  $\rightarrow$  "What are some of the main types of Yoga?"):
$$
Q \backslash R = \varnothing \wedge R \backslash Q \neq \varnothing
$$
- Removal - some tokens are removed from the question to produce the rewrite (e.g., "Can you tell me about the C++ language mentioned"  $\rightarrow$  "Can you tell me about the C++ language"):
$$
Q \backslash R \neq \varnothing \wedge R \backslash Q = \varnothing
$$
- Replacement - some tokens are added and some are removed to produce the rewrite (e.g., "Does it help in reducing stress"  $\rightarrow$  "Does Yoga help in reducing stress"):
$$
Q \backslash R \neq \emptyset \land R \backslash Q \neq \emptyset
$$
- Copy - no modification is needed, i.e., the original question is already contextually independent (e.g., "What are common poses in Kundalini Yoga?"):
$$
Q \backslash R = \varnothing \wedge R \backslash Q = \varnothing , \text {i . e .}, Q = R
$$
The majority of questions in QReCC (52%) require Replacement. Figure 2 shows the tokens that are most frequently replaced in QR. All of them are pronouns that require anaphora resolution. By specifically targeting more rare types of question rewriting in our data collection task we managed to increase the proportion of the Insertion cases in our dataset. This allows us to train and evaluate the ability of the model to reconstruct missing context, which cannot be achieved using traditional co-reference resolution approaches.
5 Document Collection
We download the web pages using the answer provenance links provided by the annotators from the Internet Archive Wayback Machine. Then, we complement the relevant pages with randomly sampled web pages that constitute  $1\%$  of the Common Crawl dataset identified as English pages. The final collection consists of approximately 14K pages from the Wayback Machine and 9.9M random web pages from the Common Crawl dataset. The scripts for reproducing the passage collection are on GitHub. See Appendix A.2 for more details.
After downloading the pages we extract the textual content from the HTML and split texts into passages of least 220 tokens. After segmentation, we have a total of 54M passages which we index using Anserini (Yang et al., 2017).
We search the passage collection using the human annotated answers to augment the dataset with alternative sources of correct answers. For each document returned, we identify the span in the document that has the highest token overlap (F1) with the human answer. We consider all documents with  $\mathrm{F}1 \geq 0.8$  as relevant. Verifying adequacy of this simple heuristic by human annotators is left for future work.
6 Question Rewriting Metrics Validation
BLEU has typically been used in previous work for measuring the quality of QR (Elgohary et al., 2019; Lin et al., 2020). We conduct a systematic evaluation and compare BLEU with alternative metrics, previously applied in summarization and translation, to ensure the most reliable metrics we can obtain for the model selection. Our evaluation shows that BLEU does not compare favourably with other metrics in evaluating the quality of QR.
Task. We took a random sample of 10K questions and used a seq-to-seq model (Nallapati et al., 2016) trained with questions and conversation context from the QReCC dataset to generate question rewrites. These generated rewrites were compared to the ground truth rewrites produced by human annotators. Different annotators graded each model-generated rewrite with a binary label: 0 (incorrect rewrite) or 1 (correct rewrite). For a question rewrite to be correct it does not have to exactly
match the ground truth rewrite, but it should correctly capture the conversational context and be a self-contained question. For example, the model-generated rewrite "What are the global warming dangers?" is a correct rewrite with the ground truth rewrite being "What are the dangers of global warming?". In addition, we also assess the variance of the human assessments. The Pearson correlation between any two annotators on average is 0.94. We observed the mean and the variance to be 0.083 and 0.076 respectively. Performing a two-tail statistical significance test shows the P-value to be 0.0201.
We use several automated metrics to compare the rewrites with the ground truth and compute their Pearson correlation with the human judgements (see Table 3 for results).
Exact Match is a binary variable that indicates the token set overlap applied after the standard preprocessing: lower-casing, stemming, punctuation and stopwords removal.
ROUGE (Lin, 2004) reflects similarity between two texts in terms of n-gram overlap (R-1 for unigrams; R-2 for bigrams and R-L for the longest common n-gram). We report the mean for precision (P), recall (R) and F-measure (F).
METEOR (Denkowski and Lavie, 2014) is a machine translation metric based on exact, stem, synonym, and paraphrase matches between words and phrases.
BLEU (Papineni et al., 2002) is a text similarity metric that uses a modified form of precision and n-grams from candidate and reference texts.
Embeddings group several unsupervised approaches that produce a sentence-level vector representation: Universal Sentence Encoder (Cer et al., 2018) and InferSent (Conneau et al., 2017).
Search Results - we use both question rewrites in Google Search and compare the overlap between the produced page ranks in terms of the standard IR metrics: Recall@k for the top-k links, Average Recall (AR) and Normalized Discounted Cumulative Gain (NDCG).
The best performing metric in our experiments (i.e., closest to the human judgement) is the set
2We use the version of a web page, which is the closest to the end date of the dialogue collection (November 24, 2019).
Table 3: Comparison of different evaluation metrics in terms of Pearson correlation with the human judgment of the question rewriting quality.
Metrics	Pearson	Metrics	Pearson
Exact Match	0.56	ROUGE-1 P	0.51
Embeddings	USE	0.67	ROUGE-1 R	0.63
InferSent	0.48	ROUGE-1 F	0.61
Search Results	R@1	0.66	ROUGE-2 P	0.54
R@2	0.72	ROUGE-2 R	0.57
R@3	0.73	ROUGE-2 F	0.57
R@4	0.74	ROUGE-L P	0.50
R@5	0.77	ROUGE-L R	0.61
R@10	0.80	ROUGE-L F	0.58
AR	0.79	METEOR	0.59
NDCG	0.74	BLEU	0.58
Table 4: Evaluation results of QR models (mean with  $95\%$  confidence intervals). *Human QR metrics are computed across 5 different random samples of 1000 question rewrites from the intersection of QReCC and CANARD conversations.
Model/Metrics	ROUGE-1 R	USE	R@10
AllenAI Coref (Lee et al., 2018)	67.1% ± 10E-4%	82.3% ± 10E-3%	56.1% ± 10E-4%
Generator (Radford et al., 2019)	73.4% ± 0.6%	86.2% ± 0.9%	69.1% ± 0.2%
Generator + Multiple-choice (Wolf et al., 2019b)	74.1% ± 0.5%	86.3% ± 0.4%	70.2% ± 0.1%
PointerGenerator (Elgohary et al., 2019)	80.2% ± 0.8%	89.1% ± 1.1%	75.3% ± 0.3%
GECOR (Quan et al., 2019)	84.1% ± 0.3%	91.8% ± 0.2%	78.1% ± 0.2%
CopyTransformer (Gehrmann et al., 2018)	86.1% ± 0.5%	92.8% ± 0.3%	79.4% ± 0.3%
Transformer++	89.5% ± 0.4%	95.2% ± 0.2%	83.2% ± 0.3%
Human*	94.6% ± 0.2%	97.3% ± 0.1%	87.2% ± 0.1%
overlap of the web search results (R@10). The best metrics independent of QA are Universal Sentence Embedding (USE) and unigram recall (ROUGE-1 R). We provide more details of the metrics performance illustrated with examples and the discussion in Appendix C. We use the set of all three best evaluation metrics to select the optimal QR model for our baseline approach.
7 Baseline Approach
We extend BERTserini (Yang et al., 2019), an efficient approach to open-domain QA, with a QR model to incorporate conversational context. This approach consists of three stages: (1) QR, (2) PR and (3) RC. First, a model is trained to generate a stand-alone question given a follow-up question and the preceding question-answer pairs. In the second stage, PR, the top- $k$  relevant passages are retrieved from the index using BM25 using the rewritten question. Finally, in RC, a model is trained to extract an answer span from a passage or predict if the passage is irrelevant. The scores obtained
from PR and RC are then combined as a weighted sum to produce the final score. The span with the highest score is chosen as the final answer.
7.1 Question Rewriting
We evaluate a co-reference model and several generative models on the QR subtask using the question rewrites in QReCC and the set of QR metrics selected in Section 6. The best performing model is then used in a combination with BERTserini to set the baseline results for the end-to-end QA task. All our Transformer-based models were initialized with the pretrained weights of GPT-2 (English medium-size) (Radford et al., 2019) and further fine-tuned on question rewrites from the QReCC training set (see Appendix A.1).
AllenAI Coref is the state-of-the-art model for coreference resolution task (Lee et al., 2018). We adapt it for QR with a heuristic that substitutes all coreference mentions with the corresponding antecedents from the cluster.