/ Модель

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

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

gpt-fr-cased-base

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

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

709скачиваний за 30 дней29лайковвеса обновлены20 окт 2022

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

GPT-fr-cased-base — франкоязычная авторегрессионная модель генерации текста на архитектуре GPT-2, разработанная Quantmetry и Laboratoire de Linguistique Formelle (LLF). Она обучена на большом разнородном корпусе французских текстов, включающем Wikipedia, OpenSubtitles, Gutenberg и Common Crawl. Модель имеет 24 слоя, 14 голов внимания, размерность эмбеддингов 1 792 и около 1,017 млрд параметров; контекст составляет 1 024 токена. Доступны веса для PyTorch, TensorFlow и Flax.

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

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

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

Ограничения

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

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

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

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

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

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

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. We use the work from Shoeybi et al., (2019) and calibrate our model such that during pre-training or fine-tuning, the model can fit on a single NVIDIA V100 32GB GPU.

from transformers import GPT2Tokenizer, GPT2LMHeadModel

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

# 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 en tant _______". We used top-k random sampling strategy with k=50 and stopped at the first punctuation element. The positions generated for the wife is 'que professeur de français.' while the position for the husband is 'que chef de projet.'. 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 and Common Crawl (Li et al., 2019). 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 the new CNRS (French National Centre for Scientific Research) Jean Zay supercomputer. We perform the training within a total of 140 hours of computation on Tesla V-100 hardware (TDP of 300W). The training was distributed on 4 compute nodes of 8 GPUs. We used data parallelization in order to divide each micro-batch on the computing units. We estimated the total emissions at 580.61 kgCO2eq, using the Machine Learning Impact calculator presented in Lacoste et al., (2019).

Eval results

We packaged GPT-fr with a dedicated language model evaluation benchmark for French. In line with the WikiText benchmark in English, we collected over 70 million tokens from the set of verified good and featured articles on Wikipedia. The model reaches a zero-shot perplexity of 12.9 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…

Класс архитектуры
GPT2LMHeadModel
Ревизия весов
9b8cc95

0 моделей