cmarkea / distilcamembert-base-qa

huggingface.co
Total runs: 104
24-hour runs: -9
7-day runs: -7
30-day runs: 32
Model's Last Updated: October 26 2024
question-answering

Introduction of distilcamembert-base-qa

Model Details of distilcamembert-base-qa

DistilCamemBERT-QA

We present DistilCamemBERT-QA, which is DistilCamemBERT fine-tuned for the Question-Answering task for the french language. This model is built using two datasets, FQuAD v1.0 and Piaf, composed of contexts and questions with their answers inside the context.

This modelization is close to etalab-ia/camembert-base-squadFR-fquad-piaf based on CamemBERT model. The problem of the modelizations based on CamemBERT is at the scaling moment, for the production phase, for example. Indeed, inference cost can be a technological issue, especially in cross-encoding like this task. To counteract this effect, we propose this modelization which divides the inference time by 2 with the same consumption power, thanks to DistilCamemBERT.

Dataset

The dataset comprises FQuAD v1.0 and Piaf with 24'566 questions and answers for the training set and 3'188 for the evaluation set.

Evaluation results and benchmark

We compare DistilCamemBERT-QA to two other modelizations working on the french language. The first one etalab-ia/camembert-base-squadFR-fquad-piaf is based on well named CamemBERT , the french RoBERTa model and the second one fmikaelian/flaubert-base-uncased-squad is based on FlauBERT another french model based on BERT architecture this time.

For our benchmarks, we do a word-to-word comparison between words that are matching between the predicted answer and the ground truth. We also use f1-score, which measures the intersection quality between predicted responses and ground truth. Finally, we use inclusion score, which measures if the ground truth answer is included in the predicted answer. An AMD Ryzen 5 4500U @ 2.3GHz with 6 cores was used for the mean inference time measure.

model time (ms) exact match (%) f1-score (%) inclusion-score (%)
cmarkea/distilcamembert-base-qa 216.96 25.66 62.65 59.82
etalab-ia/camembert-base-squadFR-fquad-piaf 432.17 59.76 79.57 69.23
fmikaelian/flaubert-base-uncased-squad 875.84 0.22 5.21 3.68

Do not take into account the results of the FlauBERT model. The modeling seems to be a problem, as the results seem very low.

How to use DistilCamemBERT-QA
from transformers import pipeline

qa_engine = pipeline(
    "question-answering",
    model="cmarkea/distilcamembert-base-qa",
    tokenizer="cmarkea/distilcamembert-base-qa"
)

result = qa_engine(
    context="David Fincher, né le 28 août 1962 à Denver (Colorado), "
    "est un réalisateur et producteur américain. Il est principalement "
    "connu pour avoir réalisé les films Seven, Fight Club, L'Étrange "
    "Histoire de Benjamin Button, The Social Network et Gone Girl qui "
    "lui ont valu diverses récompenses et nominations aux Oscars du "
    "cinéma ou aux Golden Globes. Réputé pour son perfectionnisme, il "
    "peut tourner un très grand nombre de prises de ses plans et "
    "séquences afin d'obtenir le rendu visuel qu'il désire. Il a "
    "également développé et produit les séries télévisées House of "
    "Cards (pour laquelle il remporte l'Emmy Award de la meilleure "
    "réalisation pour une série dramatique en 2013) et Mindhunter, "
    "diffusées sur Netflix.",
    question="Quel est le métier de David Fincher ?"
)

result
{'score': 0.7981914281845093,
 'start': 61,
 'end': 98,
 'answer': ' réalisateur et producteur américain.'}
Optimum + ONNX
from optimum.onnxruntime import ORTModelForQuestionAnswering
from transformers import AutoTokenizer, pipeline

HUB_MODEL = "cmarkea/distilcamembert-base-qa"

tokenizer = AutoTokenizer.from_pretrained(HUB_MODEL)
model = ORTModelForQuestionAnswering.from_pretrained(HUB_MODEL)
onnx_qa = pipeline("question-answering", model=model, tokenizer=tokenizer)

# Quantized onnx model
quantized_model = ORTModelForQuestionAnswering.from_pretrained(
    HUB_MODEL, file_name="model_quantized.onnx"
)
Citation
@inproceedings{delestre:hal-03674695,
  TITLE = {{DistilCamemBERT : une distillation du mod{\`e}le fran{\c c}ais CamemBERT}},
  AUTHOR = {Delestre, Cyrile and Amar, Abibatou},
  URL = {https://hal.archives-ouvertes.fr/hal-03674695},
  BOOKTITLE = {{CAp (Conf{\'e}rence sur l'Apprentissage automatique)}},
  ADDRESS = {Vannes, France},
  YEAR = {2022},
  MONTH = Jul,
  KEYWORDS = {NLP ; Transformers ; CamemBERT ; Distillation},
  PDF = {https://hal.archives-ouvertes.fr/hal-03674695/file/cap2022.pdf},
  HAL_ID = {hal-03674695},
  HAL_VERSION = {v1},
}

Runs of cmarkea distilcamembert-base-qa on huggingface.co

104
Total runs
-9
24-hour runs
-15
3-day runs
-7
7-day runs
32
30-day runs

More Information About distilcamembert-base-qa huggingface.co Model

More distilcamembert-base-qa license Visit here:

https://choosealicense.com/licenses/cc-by-nc-sa-3.0

distilcamembert-base-qa huggingface.co

distilcamembert-base-qa huggingface.co is an AI model on huggingface.co that provides distilcamembert-base-qa's model effect (), which can be used instantly with this cmarkea distilcamembert-base-qa model. huggingface.co supports a free trial of the distilcamembert-base-qa model, and also provides paid use of the distilcamembert-base-qa. Support call distilcamembert-base-qa model through api, including Node.js, Python, http.

distilcamembert-base-qa huggingface.co Url

https://huggingface.co/cmarkea/distilcamembert-base-qa

cmarkea distilcamembert-base-qa online free

distilcamembert-base-qa huggingface.co is an online trial and call api platform, which integrates distilcamembert-base-qa's modeling effects, including api services, and provides a free online trial of distilcamembert-base-qa, you can try distilcamembert-base-qa online for free by clicking the link below.

cmarkea distilcamembert-base-qa online free url in huggingface.co:

https://huggingface.co/cmarkea/distilcamembert-base-qa

distilcamembert-base-qa install

distilcamembert-base-qa is an open source model from GitHub that offers a free installation service, and any user can find distilcamembert-base-qa on GitHub to install. At the same time, huggingface.co provides the effect of distilcamembert-base-qa install, users can directly use distilcamembert-base-qa installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

distilcamembert-base-qa install url in huggingface.co:

https://huggingface.co/cmarkea/distilcamembert-base-qa

Url of distilcamembert-base-qa

distilcamembert-base-qa huggingface.co Url

Provider of distilcamembert-base-qa huggingface.co

cmarkea
ORGANIZATIONS

Other API from cmarkea