CoolFace
Modelpublic

consciousAI/question-answering-roberta-base-s

sourceHugging Faceapache-2.0updated 4y agoView on Hugging Face
3likes51downloads
Model Card

Question Answering

The model is intended to be used for Q&A task, given the question & context, the model would attempt to infer the answer text, answer span & confidence score.<br> Model is encoder-only (roberta-base) with QuestionAnswering LM Head, fine-tuned on SQUADx dataset with exact_match: 86.14 & f1: 92.330 performance scores.

Live Demo: Question Answering Encoders vs Generative

Please follow this link for Encoder based Question Answering V2 <br>Please follow this link for Generative Question Answering

Example code:

from transformers import pipeline

model_checkpoint = "consciousAI/question-answering-roberta-base-s"

context = """
๐Ÿค— Transformers is backed by the three most popular deep learning libraries โ€” Jax, PyTorch and TensorFlow โ€” with a seamless integration
between them. It's straightforward to train your models with one before loading them for inference with the other.
"""
question = "Which deep learning libraries back ๐Ÿค— Transformers?"

question_answerer = pipeline("question-answering", model=model_checkpoint)
question_answerer(question=question, context=context)

Training and evaluation data

SQUAD Split

Training procedure

Preprocessing:

  1. 1.SQUAD Data longer chunks were sub-chunked with input context max-length 384 tokens and stride as 128 tokens.
  2. 2.Target answers readjusted for sub-chunks, sub-chunks with no-answers or partial answers were set to target answer span as (0,0)

Metrics:

  1. 1.Adjusted accordingly to handle sub-chunking.
  2. 2.n best = 20
  3. 3.skip answers with length zero or higher than max answer length (30)

Training hyperparameters

Custom Training Loop: The following hyperparameters were used during training:

  • โ€”learning_rate: 2e-5
  • โ€”trainbatchsize: 32
  • โ€”evalbatchsize: 32
  • โ€”optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • โ€”lrschedulertype: linear
  • โ€”num_epochs: 2

Training results

EpochF1Exact Match
1.091.308584.5412
2.092.330486.1400

Framework versions

  • โ€”Transformers 4.23.0.dev0
  • โ€”Pytorch 1.12.1+cu113
  • โ€”Datasets 2.5.2
  • โ€”Tokenizers 0.13.0