bert multi english german squad2

deutsche-telekom

Introduction

The BERT-MULTI-ENGLISH-GERMAN-SQUAD2 model is designed for multilingual question answering in both English and German. It utilizes a fine-tuned version of the bert-base-multilingual-cased model, combining datasets from English SQuAD2.0 and a German translation, deQuAD2.0.

Architecture

  • Model: bert-base-multilingual-cased
  • Languages Supported: English, German
  • Datasets Used: A combination of deQuAD2.0 (auto-translated and professionally edited) and SQuAD2.0.
  • Infrastructure: Trained using 8 V100 GPUs.

Training

The model was trained on the merged dataset of English SQuAD2.0 and German deQuAD2.0. The German dataset was auto-translated and then refined by professional editors. The training set contains 130k samples, and the evaluation was conducted on a test set of 11k samples.

Evaluation

  • English SQuAD2.0:

    • HasAns_exact: 85.80
    • HasAns_f1: 90.92
    • NoAns_exact: 94.77
    • NoAns_f1: 94.77
    • Overall Exact: 90.29
    • Overall F1: 92.85
  • German deQuAD2.0:

    • HasAns_exact: 63.81
    • HasAns_f1: 72.47
    • NoAns_exact: 82.03
    • NoAns_f1: 82.03
    • Overall Exact: 72.82
    • Overall F1: 77.20

Guide: Running Locally

To use the model locally:

  1. Install the Hugging Face Transformers library:

    pip install transformers
    
  2. Use the model in a pipeline:

    from transformers import pipeline
    
    qa_pipeline = pipeline(
        "question-answering",
        model="deutsche-telekom/bert-multi-english-german-squad2",
        tokenizer="deutsche-telekom/bert-multi-english-german-squad2"
    )
    
    contexts = ["Die Allianz Arena ist ein Fußballstadion im Norden von München ...", 
                "Harvard is a large, highly residential research university ..."]
    questions = ["Wo befindet sich die Allianz Arena?", 
                 "What is the world's largest academic and private library system?"]
    
    qa_pipeline(context=contexts, question=questions)
    
  3. Consider using cloud services like AWS, Google Cloud, or Azure to access GPUs for faster inference.

License

The model is released under the MIT License.
Copyright (c) 2021 Fang Xu, Deutsche Telekom AG.

More Related APIs in Question Answering