Building Question-Answer Data Using Web Register Identification

Anni Eskelinen, Amanda Myntti, Erik Henriksson, Sampo Pyysalo, Veronika LaippalaCOLING 2024

Abstract

This article introduces a resource-efficient method for developing question-answer (QA) datasets by extracting QA pairs from web-scale data using machine learning (ML). Our method benefits from recent advances in web register (genre) identification and consists of two ML steps with an additional post-processing step. First, using XLM-R and the multilingual CORE web register corpus series with categories such as QA Forum, we train a multilingual classifier to retrieve documents that are likely to contain QA pairs from web-scale data. Second, we develop a NER-style token classifier to identify the QA text spans within these documents. To this end, we experiment with training on a semi-synthetic dataset built on top of the English LFQA, a small set of manually cleaned web QA pairs in English and Finnish, and a Finnish web QA pair dataset cleaned using ChatGPT. The evaluation of our pipeline demonstrates its capability to efficiently retrieve a substantial volume of QA pairs. While the approach is adaptable to any language given the availability of language models and extensive web data, we showcase its efficiency in English and Finnish, developing the first open, non-synthetic and non-machine translated QA dataset for Finnish – Turku WebQA – comprising over 200,000 QA pairs.

Introduction

The development of sophisticated AI assistants relies heavily on the availability of large-scale, high-quality question-answer (QA) datasets. While English-language models benefit from a wealth of such resources, lower-resource languages like Finnish often face a "data desert." Traditional methods to bridge this gap—such as machine translation of English datasets (e.g., SQuAD) or synthetic generation using Large Language Models (LLMs)—frequently result in unnatural phrasing or lack the nuance of authentic human interaction.

The challenge lies in extracting authentic human-to-human QA pairs from forums, FAQs, and help desks at a web-scale without the prohibitive cost of manual labeling. This research presents a pipeline that leverages web register identification to harvest hundreds of thousands of authentic QA pairs efficiently.

Methodology

The researchers developed a three-stage pipeline designed for computational efficiency and high data quality.

The three-stage pipeline for QA pair extraction.
  1. Document Filtering: To avoid the expense of scanning every web page, the pipeline uses a multilingual XLM-RoBERTa (XLM-R) classifier. This model identifies "QA-rich" registers (genres) based on the CORE corpus. Documents flagged as "QA Forum" or "FAQ" proceed to the next stage.
  2. Token Classification: Within the filtered documents, a Named Entity Recognition (NER)-style classifier labels specific text spans as Question (Q), Answer (A), or Other (O).
  3. Post-Processing: A sentence-averaging heuristic is applied to resolve label "flickering" (rapid switching between Q and A labels). Finally, subsequent questions and answers are paired into clean data points.

A key innovation in this methodology was the use of ChatGPT to annotate a small subset of Finnish web data for training the token classifier. This "LLM-in-the-loop" approach proved more effective than relying on larger semi-synthetic or translated datasets.

Datasets and Turku WebQA

The study utilized several massive web-scale crawls, including CC-Fi, mC4-Fi, and the Finnish Internet Parsebank for Finnish, alongside an 8-million document subset of Falcon RefinedWeb for English.

The primary output of this work is Turku WebQA, which contains 236,851 Finnish QA pairs and 87,049 English pairs. This represents the first large-scale, non-synthetic, and non-machine-translated QA resource for the Finnish language.

Results

The pipeline's performance was evaluated based on its ability to filter documents and accurately extract spans.

Performance metrics for the register-based document classifier.

As shown in the classification results, the document classifier achieved a high F1-weighted score of 0.98. The researchers prioritized precision (0.82 for the QA class) over recall (0.47) to ensure the resulting dataset remained high-quality and free of noise. Furthermore, the best Finnish token classifier reached an extraction accuracy of 85% by leveraging the ChatGPT-augmented training data.

Discussion and Limitations

While the pipeline successfully generated a massive volume of data, it has certain limitations. The 512-token limit of the XLM-R model means that QA pairs located at the end of very long documents may be missed. Additionally, the conservative filtering approach likely omitted many valid QA pairs in favor of maintaining high precision.

Future work involves applying this methodology to even lower-resource languages where data scarcity is more acute. The success of this approach suggests that using LLMs as "cleaners" for real web data is a superior strategy to using them as "creators" of entirely synthetic data for training robust NLP models.

Summary updated

BibTeX
@inproceedings{eskelinen2024building,
  author = {Anni Eskelinen and Amanda Myntti and Erik Henriksson and Sampo Pyysalo and Veronika Laippala},
  title = {{Building Question-Answer Data Using Web Register Identification}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=Y3n53cJ9rD},
}
Figure