readme: ---
  language: fr
  license: cc-by-nc-sa-3.0
  datasets:
  - fquad
  - piaf
  widget:
  - text: "Quand et où est sorti Toy Story ?"
    context: "Pixar Animation Studios, ou simplement Pixar dans le langage courant, est une société américaine de production de films en images tridimensionnelles de synthèse. Elle a acquis sa notoriété grâce à Toy Story, premier long métrage de ce type, sorti aux États-Unis en 1995. À ce jour, le studio d'animation a remporté dix-neuf Oscars, quatre Golden Globes et trois Grammy Awards ainsi que de nombreuses autres récompenses. Le studio travaille avec PhotoRealistic RenderMan, sa propre version de l'interface de programmation de rendu RenderMan utilisée pour créer des images de haute qualité. Ses studios de production et son siège social se trouvent au Pixar Campus situé à Emeryville près de San Francisco en Californie."
  - text: "Quel est le premier long métrage du studio ?"
    context: "Pixar Animation Studios, ou simplement Pixar dans le langage courant, est une société américaine de production de films en images tridimensionnelles de synthèse. Elle a acquis sa notoriété grâce à Toy Story, premier long métrage de ce type, sorti aux États-Unis en 1995. À ce jour, le studio d'animation a remporté dix-neuf Oscars, quatre Golden Globes et trois Grammy Awards ainsi que de nombreuses autres récompenses. Le studio travaille avec PhotoRealistic RenderMan, sa propre version de l'interface de programmation de rendu RenderMan utilisée pour créer des images de haute qualité. Ses studios de production et son siège social se trouvent au Pixar Campus situé à Emeryville près de San Francisco en Californie."
  ---
  
  DistilCamemBERT-QA
  ==================
  
  We present DistilCamemBERT-QA, which is [DistilCamemBERT](https://huggingface.co/cmarkea/distilcamembert-base) 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](https://huggingface.co/etalab-ia/camembert-base-squadFR-fquad-piaf) based on [CamemBERT](https://huggingface.co/camembert-base) 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](https://huggingface.co/cmarkea/distilcamembert-base-qa) to two other modelizations working on the french language. The first one [etalab-ia/camembert-base-squadFR-fquad-piaf](https://huggingface.co/etalab-ia/camembert-base-squadFR-fquad-piaf) is based on well named [CamemBERT](https://huggingface.co/camembert-base), the french RoBERTa model and the second one [fmikaelian/flaubert-base-uncased-squad](https://huggingface.co/fmikaelian/flaubert-base-uncased-squad) is based on [FlauBERT](https://huggingface.co/flaubert/flaubert_base_uncased) 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](https://huggingface.co/cmarkea/distilcamembert-base-qa) | **216.96** | 25.66 | 62.65 | 59.82 |
  | [etalab-ia/camembert-base-squadFR-fquad-piaf](https://huggingface.co/etalab-ia/camembert-base-squadFR-fquad-piaf) | 432.17 | **59.76** | **79.57** | **69.23** |
  | [fmikaelian/flaubert-base-uncased-squad](https://huggingface.co/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
  ------------------------------
  
  ```python
  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éalisate