From 0a83ef51463cd0a49dd9e954369c5897d89c2e42 Mon Sep 17 00:00:00 2001 From: Adrien Renaud Date: Mon, 1 Feb 2021 09:28:54 +0100 Subject: [PATCH] Added CamemBERT support for question answering. --- docs/_docs/16-qa-specifics.md | 1 + .../question_answering/question_answering_model.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/_docs/16-qa-specifics.md b/docs/_docs/16-qa-specifics.md index 5d4c1f69..39942329 100644 --- a/docs/_docs/16-qa-specifics.md +++ b/docs/_docs/16-qa-specifics.md @@ -27,6 +27,7 @@ New model types are regularly added to the library. Question Answering tasks cur | ----------- | --------------------------------------- | | ALBERT | albert | | BERT | bert | +| CamemBERT | camembert | | DistilBERT | distilbert | | ELECTRA | electra | | Longformer | longformer | diff --git a/simpletransformers/question_answering/question_answering_model.py b/simpletransformers/question_answering/question_answering_model.py index 984b086a..812e1c1b 100755 --- a/simpletransformers/question_answering/question_answering_model.py +++ b/simpletransformers/question_answering/question_answering_model.py @@ -46,6 +46,9 @@ BertConfig, BertForQuestionAnswering, BertTokenizer, + CamembertConfig, + CamembertForQuestionAnswering, + CamembertTokenizer, DistilBertConfig, DistilBertForQuestionAnswering, DistilBertTokenizer, @@ -120,6 +123,7 @@ def __init__(self, model_type, model_name, args=None, use_cuda=True, cuda_device "auto": (AutoConfig, AutoTokenizer, AutoModelForQuestionAnswering), "bart": (BartConfig, BartForQuestionAnswering, BartTokenizer), "bert": (BertConfig, BertForQuestionAnswering, BertTokenizer), + "camembert": (CamembertConfig, CamembertForQuestionAnswering, CamembertTokenizer), "distilbert": (DistilBertConfig, DistilBertForQuestionAnswering, DistilBertTokenizer), "electra": (ElectraConfig, ElectraForQuestionAnswering, ElectraTokenizer), "longformer": (LongformerConfig, LongformerForQuestionAnswering, LongformerTokenizer),