/ Модель

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

Контекст
1 024 токена
Лицензия
Apache 2.0
Архитектура
gpt2 · dense
Опубликована
2 мар 2022

gpt-fr-cased-small

Генерация текстаТекст → текст3 профессии

Компактная GPT-2-модель для генерации французского текста, суммирования и ответов на вопросы.

6 694скачиваний за 30 дней9лайковвеса обновлены20 окт 2022

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

GPT-fr-cased-small — авторегрессионная языковая модель семейства GPT-2 для генерации текста на французском языке, разработанная Quantmetry и Laboratoire de Linguistique Formelle (LLF). Это версия с 12 слоями, 12 головами внимания и 124 млн параметров; размер контекста составляет 1 024 токена. Модель обучена на крупном корпусе французских текстов, объединяющем Wikipedia, OpenSubtitle и Gutenberg, и доступна в форматах PyTorch, TensorFlow и Flax.

Модель предназначена для генерации французского текста и может применяться в сценариях, где ответ формируется на естественном языке, включая автоматическое суммирование и ответы на вопросы. В оценке на тестовой выборке французской Wikipedia указана zero-shot perplexity 109,2. Модель может воспроизводить предвзятость обучающих данных и генерировать оскорбительный или стереотипный контент. Лицензия — Apache-2.0.

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

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

Ограничения

Модель может отражать гендерные и другие общественные предубеждения обучающего корпуса, а также генерировать оскорбительный контент. Контекст ограничен 1 024 токенами; качество может быть недостаточным для задач, требующих высокой точности.

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

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

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

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

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

Открыть на Hugging Face

Model description

GPT-fr 🇫🇷 is a GPT model for French developped by Quantmetry and the Laboratoire de Linguistique Formelle (LLF). We train the model on a very large and heterogeneous French corpus. We release the weights for the following configurations:

Model nameNumber of layersAttention HeadsEmbedding DimensionTotal Parameters
gpt-fr-cased-small1212768124 M
gpt-fr-cased-base24141,7921,017 B

Intended uses & limitations

The model can be leveraged for language generation tasks. Besides, many tasks may be formatted such that the output is directly generated in natural language. Such configuration may be used for tasks such as automatic summary or question answering. We do hope our model might be used for both academic and industrial applications.

How to use

The model might be used through the astonishing 🤗 Transformers librairie:

from transformers import GPT2Tokenizer, GPT2LMHeadModel

# Load pretrained model and tokenizer
model = GPT2LMHeadModel.from_pretrained("asi/gpt-fr-cased-small")
tokenizer = GPT2Tokenizer.from_pretrained("asi/gpt-fr-cased-small")

# Generate a sample of text
model.eval()
input_sentence = "Longtemps je me suis couché de bonne heure."
input_ids = tokenizer.encode(input_sentence, return_tensors='pt')

beam_outputs = model.generate(
    input_ids, 
    max_length=100, 
    do_sample=True,   
    top_k=50, 
    top_p=0.95, 
    num_return_sequences=1
)

print("Output:\n" + 100 * '-')
print(tokenizer.decode(beam_outputs[0], skip_special_tokens=True))

Limitations and bias

Large language models tend to replicate the biases found in pre-training datasets, such as gender discrimination or offensive content generation.

To limit exposition to too much explicit material, we carefully choose the sources beforehand. This process — detailed in our paper — aims to limit offensive content generation from the model without performing manual and arbitrary filtering.

However, some societal biases, contained in the data, might be reflected by the model. For example on gender equality, we generated the following sentence sequence "Ma femme/Mon mari vient d'obtenir un nouveau poste. A partir de demain elle/il sera _______" and observed the model generated distinct positions given the subject gender. We used top-k random sampling strategy with k=50 and stopped at the first punctuation element. The positions generated for the wife is 'femme de ménage de la maison' while the position for the husband is 'à la tête de la police'. We do appreciate your feedback to better qualitatively and quantitatively assess such effects.

Training data

We created a dedicated corpus to train our generative model. Indeed the model uses a fixed-length context size of 1,024 and require long documents to be trained. We aggregated existing corpora: Wikipedia, OpenSubtitle (Tiedemann, 2012), Gutenberg. Corpora are filtered and separated into sentences. Successive sentences are then concatenated within the limit of 1,024 tokens per document.

Training procedure

We pre-trained the model on a TPU v2-8 using the amazing Google Colab inter-server.

Eval results

We packaged GPT-fr with a dedicated language model evaluation benchmark. In line with the WikiText benchmark in English, we collected over 70 million tokens from the set of verified good and featured articles on French Wikipedia. The model reaches a zero-shot perplexity of 109.2 on the test set.

BibTeX entry and citation info

Along with the model hosted by HuggingFace transformers library, we maintain a git repository. If you use GPT-fr for your scientific publications or your industrial applications, please cite the following paper:

@inproceedings{simoulin:hal-03265900,
  TITLE = {{Un mod{\`e}le Transformer G{\'e}n{\'e}ratif Pr{\'e}-entrain{\'e} pour le \_\_\_\_\_\_ fran{\c c}ais}},
  AUTHOR = {Simoulin, Antoine and Crabb{\'e}, Benoit},
  URL = {https://hal.archives-ouvertes.fr/hal-03265900},
  BOOKTITLE = {{Traitement Automatique des Langues Naturelles}},
  ADDRESS = {Lille, France},
  EDITOR = {Denis, Pascal and Grabar, Natalia and Fraisse, Amel and Cardon, R{\'e}mi and Jacquemin, Bernard and Kergosien, Eric and Balvet, Antonio},
  PUBLISHER = {{ATALA}},
  PAGES = {246-255},
  YEAR = {2021},
  KEYWORDS = {fran{\c c}ais. ; GPT ; G{\'e}n{\'e}ratif ; Transformer ; Pr{\'e}-entra{\^i}n{\'e}},
  PDF = {https://hal.archives-ouvertes.fr/hal-03265900/file/7.pdf},
  HAL_ID = {hal-03265900},
  HAL_VERSION = {v1},
}

References

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

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

GPU в ailist

Универсальный рантайм

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

Подбираем GPU…

Ревизия весов
dd06887

0 моделей