/ Модель

Характеристики

Контекст
514 токенов
Параметры
138 млн
Лицензия
MIT
Архитектура
camembert · dense
Библиотека
transformers
Опубликована
10 янв 2023

QAmembert

Ответы на вопросыТекст → текст5 профессий

Дообученная CamemBERT для ответов на вопросы по французскому тексту с возможностью определить, что ответа в контексте нет.

152скачиваний за 30 дней14лайковвеса обновлены26 ноя 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

QAmembert — модель CATIE-AQ для ответов на вопросы по текстовому контексту на французском языке. Это CamemBERT base, дообученная на объединённом наборе frenchQA из более чем 221 тысяч пар контекстов, вопросов и ответов. Данные включают примеры, где ответ содержится в контексте, и примеры без ответа в контексте, поэтому модель может возвращать отсутствие ответа.

Модель построена на архитектуре CamemBERT и содержит 137,8 млн параметров. Она предназначена для извлечения ответа из предоставленного текста, например, для вопросов по документам или статьям. В карточке приведены результаты оценки на французских наборах FQuaD, qwant/squadfr и frenchQA; контекст — до 514 токенов.

Модель распространяется под лицензией MIT. Она рассчитана на французский язык и на вопросы, связанные с переданным контекстом; качество на других языках и вне подобных сценариев не подтверждено.

Сценарии применения

  • извлечение ответа на вопрос из французской статьи
  • ответы на вопросы по содержимому французских документов
  • поиск факта в переданном французском тексте
  • определение отсутствия ответа в контексте
  • создание французского вопросно-ответного интерфейса

Ограничения

Модель ориентирована на французский язык и на извлечение ответов из предоставленного контекста; для других языков и открытых вопросов без контекста её пригодность не подтверждена. Максимальная длина контекста — 514 токенов.

Для каких профессий подходит5

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

QAmembert

Model Description

We present QAmemBERT, which is a CamemBERT base fine-tuned for the Question-Answering task for the French language on four French Q&A datasets composed of contexts and questions with their answers inside the context (= SQuAD 1.0 format) but also contexts and questions with their answers not inside the context (= SQuAD 2.0 format). All these datasets were concatenated into a single dataset that we called frenchQA. This represents a total of over 221,348 context/question/answer triplets used to finetune this model and 6,376 to test it.
Our methodology is described in a blog post available in English or French.

Datasets

DatasetFormatTrain splitDev splitTest split
piafSQuAD 1.09 224 Q & AXX
piaf_v2SQuAD 2.09 224 Q & AXX
fquadSQuAD 1.020 731 Q & A3 188 Q & A (not used in training because it serves as a test dataset)2 189 Q & A (not used in our work because not freely available)
fquad_v2SQuAD 2.020 731 Q & A3 188 Q & A (not used in training because it serves as a test dataset)X
lincoln/newsquadfrSQuAD 1.01 650 Q & A455 Q & A (not used in our work)X
lincoln/newsquadfr_v2SQuAD 2.01 650 Q & A455 Q & A (not used in our work)X
pragnakalp/squad_v2_french_translatedSQuAD 2.079 069 Q & AXX
pragnakalp/squad_v2_french_translated_v2SQuAD 2.079 069 Q & AXX

All these datasets were concatenated into a single dataset that we called frenchQA.

Evaluation results

The evaluation was carried out using the evaluate python package.

FQuaD 1.0 (validation)

The metric used is SQuAD 1.0.

ModelExact_matchF1-score
etalab-ia/camembert-base-squadFR-fquad-piaf53.6078.09
QAmembert (previous version)54.2677.87
QAmembert (this version)53.9878.00
QAmembert-large55.9581.05

qwant/squad_fr (validation)

The metric used is SQuAD 1.0.

ModelExact_matchF1-score
etalab-ia/camembert-base-squadFR-fquad-piaf60.1778.27
QAmembert (previous version)60.4077.27
QAmembert (this version)60.9577.30
QAmembert-large65.5881.74

frenchQA

This dataset includes question with no answers in the context. The metric used is SQuAD 2.0.

ModelExact_matchF1-scoreAnswer_f1NoAnswer_f1
etalab-ia/camembert-base-squadFR-fquad-piafn/an/an/an/a
QAmembert (previous version)60.2871.2975.9266.65
QAmembert (this version)77.1486.8875.6698.11
QAmembert-large77.1488.7478.8398.65

Usage

Example with answer in the context

from transformers import pipeline

qa = pipeline('question-answering', model='CATIE-AQ/QAmembert', tokenizer='CATIE-AQ/QAmembert')

result = qa({
    'question': "Combien de personnes utilisent le français tous les jours ?",
    'context': "Le français est une langue indo-européenne de la famille des langues romanes dont les locuteurs sont appelés francophones. Elle est parfois surnommée la langue de Molière.  Le français est parlé, en 2023, sur tous les continents par environ 321 millions de personnes : 235 millions l'emploient quotidiennement et 90 millions en sont des locuteurs natifs. En 2018, 80 millions d'élèves et étudiants s'instruisent en français dans le monde. Selon l'Organisation internationale de la francophonie (OIF), il pourrait y avoir 700 millions de francophones sur Terre en 2050."
})

if result['score'] < 0.01:
    print("La réponse n'est pas dans le contexte fourni.")
else :
    print(result['answer'])
235 millions
# details
result
{'score': 0.9945194721221924,
 'start': 269,
 'end': 281,
 'answer': '235 millions'}

Example with answer not in the context

from transformers import pipeline

qa = pipeline('question-answering', model='CATIE-AQ/QAmembert', tokenizer='CATIE-AQ/QAmembert')

result = qa({
    'question': "Quel est le meilleur vin du monde ?",
    'context': "La tour Eiffel est une tour de fer puddlé de 330 m de hauteur (avec antennes) située à Paris, à l’extrémité nord-ouest du parc du Champ-de-Mars en bordure de la Seine dans le 7e arrondissement. Son adresse officielle est 5, avenue Anatole-France.  
Construite en deux ans par Gustave Eiffel et ses collaborateurs pour l'Exposition universelle de Paris de 1889, célébrant le centenaire de la Révolution française, et initialement nommée « tour de 300 mètres », elle est devenue le symbole de la capitale française et un site touristique de premier plan : il s’agit du quatrième site culturel français payant le plus visité en 2016, avec 5,9 millions de visiteurs. Depuis son ouverture au public, elle a accueilli plus de 300 millions de visiteurs."
})

if result['score'] < 0.01:
    print("La réponse n'est pas dans le contexte fourni.")
else :
    print(result['answer'])
La réponse n'est pas dans le contexte fourni.
# details
result
{'score': 3.619904940035945e-13,
 'start': 734,
 'end': 744,
 'answer': 'visiteurs.'}

Try it through Space

A Space has been created to test the model. It is available here.

Environmental Impact

Carbon emissions were estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019). The hardware, runtime, cloud provider, and compute region were utilized to estimate the carbon impact.

  • Hardware Type: A100 PCIe 40/80GB
  • Hours used: 5h and 36 min
  • Cloud Provider: Private Infrastructure
  • Carbon Efficiency (kg/kWh): 0.076kg (estimated from electricitymaps ; we take the average carbon intensity in France for the month of March 2023, as we are unable to use the data for the day of training, which are not available.)
  • Carbon Emitted (Power consumption x Time x Carbon produced based on location of power grid): 0.1 kg eq. CO2

Citations

QAmemBERT

@misc {qamembert2023,  
    author       = { {ALBAR, Boris and BEDU, Pierre and BOURDOIS, Loïck} },  
    organization  = { {Centre Aquitain des Technologies de l'Information et Electroniques} },  
    title        = { QAmembert (Revision 9685bc3) },  
    year         = 2023,  
    url          = { https://huggingface.co/CATIE-AQ/QAmembert},  
    doi          = { 10.57967/hf/0821 },  
    publisher    = { Hugging Face }  
}

PIAF

@inproceedings{KeraronLBAMSSS20,
  author    = {Rachel Keraron and
               Guillaume Lancrenon and
               Mathilde Bras and
               Fr{\'{e}}d{\'{e}}ric Allary and
               Gilles Moyse and
               Thomas Scialom and
               Edmundo{-}Pavel Soriano{-}Morales and
               Jacopo Staiano},
  title     = {Project {PIAF:} Building a Native French Question-Answering Dataset},
  booktitle = {{LREC}},
  pages     = {5481--5490},
  publisher = {European Language Resources Association},
  year      = {2020}
}

FQuAD

@article{dHoffschmidt2020FQuADFQ,
  title={FQuAD: French Question Answering Dataset},
  author={Martin d'Hoffschmidt and Maxime Vidal and Wacim Belblidia and Tom Brendl'e and Quentin Heinrich},
  journal={ArXiv},
  year={2020},
  volume={abs/2002.06071}
}

lincoln/newsquadfr

Hugging Face repository: https://hf.co/datasets/lincoln/newsquadfr

pragnakalp/squad_v2_french_translated

Hugging Face repository: https://hf.co/datasets/pragnakalp/squad_v2_french_translated

CamemBERT

@inproceedings{martin2020camembert,
  title={CamemBERT: a Tasty French Language Model},
  author={Martin, Louis and Muller, Benjamin and Su{\'a}rez, Pedro Javier Ortiz and Dupont, Yoann and Romary, Laurent and de la Clergerie, {\'E}ric Villemonte and Seddah, Djam{\'e} and Sagot, Beno{\^\i}t},
  booktitle={Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics},
  year={2020}
}

License

MIT

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · question-answering

Можно запустить

Подбираем GPU…

Класс архитектуры
CamembertForQuestionAnswering
Ревизия весов
dd4f267

0 моделей