def preprocess_multirc(examples: Dataset, *, clean_paragraphs: bool = True) -> Dict[str, List[str]]:
    """Compose strings in form of paragraphs and the folllowing questions.

    Args:
        examples: A given dataset.
        clean_paragraphs: Whether replace spaces and digits with a single space.

    Returns:
        Dict[str, List[str]]: Composed strings.

    """
    paragraphs: List[str] = examples["paragraph"]
    questions: List[str] = examples["question"]

    if clean_paragraphs:
        paragraphs = [re.sub(r"\s+", " ", re.sub(r"\(\d{1,2}\)", "", paragraph).strip()) for paragraph in paragraphs]

    contexts = [f"{paragraph} {question}" for paragraph, question in zip(paragraphs, questions)]

    return {"context": contexts}
Compose strings in form of paragraphs and the folllowing questions.

    Args:
        examples: A given dataset.
        clean_paragraphs: Whether replace spaces and digits with a single space.

    Returns:
        Dict[str, List[str]]: Composed strings.

    
deeppavlov/dataset_readers/huggingface_dataset_reader.py