/ Модель

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

Параметры
608 млн
Лицензия
Своя лицензия
Архитектура
t5 · dense
Опубликована
21 мая 2022

t5_large_NCC_modern

Языковая модель4 профессии

Норвежская encoder-decoder модель T5, дополнительно обученная на букмоле и нюнорске для дообучения под задачи перевода и обработки текста.

12скачиваний за 30 дней0лайковвеса обновлены13 окт 2022

Бенчмарки

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

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

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

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

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

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

North-T5-NCC-modern — норвежская модель семейства T5, разработанная автором набора North-T5. Это encoder-decoder модель sequence-to-sequence с примерно 608,4 млн параметров, основанная на mT5 и дополнительно обученная на сбалансированном корпусе букмола и нюнорска. В корпус входят материалы NCC, MC4 и англоязычная Википедия; значительную часть дополнительного корпуса составляют газеты и отчёты.

Модель предназначена для дообучения под задачи обработки естественного языка, включая перевод между букмолом и нюнорском, классификацию и вопросы-ответы. Дополнительное обучение на современном стандартном тексте может быть полезно для сценариев, где важен такой стиль. Доступны версии весов для Flax, PyTorch и TensorFlow.

Для решения конкретных задач модель обычно требуется дообучить. Автор отмечает, что оценка качества ещё не завершена; приведённые результаты предварительные, а сама модель не прошла тщательное тестирование и может содержать ошибки и смещения. Лицензия указана как other, а использование — на собственный риск.

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

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

Ограничения

Для конкретных задач модель обычно нужно дообучить. Оценка качества предварительная; модель недостаточно тщательно протестирована и может содержать ошибки и смещения.

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

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

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

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

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

Открыть на Hugging Face

The North-T5-models are a set of Norwegian and Scandinavian sequence-to-sequence-models. It builds upon the flexible T5 and T5X and can be used for a variety of NLP tasks ranging from classification to translation.

Small 60MBase 220MLarge 770MXL 3BXXL 11B
North-T5‑NCC🤗🤗🤗🤗🤗
North-T5‑NCC‑lm🤗🤗🤗🤗🤗
North-T5‑NCC‑modern🤗🤗✔🤗
North-T5‑NCC‑modern‑lm🤗🤗🤗🤗
North-T5‑NCC‑scand🤗🤗🤗🤗
North-T5‑scand🤗🤗🤗
North-byT5‑NCC🤗🤗🤗
North-T5‑scand3M🤗🤗🤗

T5X Checkpoint

The original T5X checkpoint is also available for this model in the Google Cloud Bucket.

Performance

A thorough evaluation of the North-T5 models is planned, and I strongly recommend external researchers to make their own evaluation. The main advantage with the T5-models are their flexibility. Traditionally, encoder-only models (like BERT) excels in classification tasks, while seq-2-seq models are easier to train for tasks like translation and Q&A. Despite this, here are the results from using North-T5 on the political classification task explained here.

Model:F1
mT5-base73.2
mBERT-base78.4
NorBERT-base78.2
North-T5-small80.5
nb-bert-base81.8
North-T5-base85.3
North-T5-large86.7
North-T5-xl88.7
North-T5-xxl91.8

These are preliminary results. The results from the BERT-models are based on the test-results from the best model after 10 runs with early stopping and a decaying learning rate. The T5-results are the average of five runs on the evaluation set. The small-model was trained for 10.000 steps, while the rest for 5.000 steps. A fixed learning rate was used (no decay), and no early stopping. Neither was the recommended rank classification used. We use a max sequence length of 512. This method simplifies the test setup and gives results that are easy to interpret. However, the results from the T5 model might actually be a bit sub-optimal.

Sub-versions of North-T5

The following sub-versions are available. More versions will be available shorter.

ModelDescription
North‑T5‑NCCThis is the main version. It is trained an additonal 500.000 steps on from the mT5 checkpoint. The training corpus is based on the Norwegian Colossal Corpus (NCC). In addition there are added data from MC4 and English Wikipedia.
North‑T5‑NCC‑lmThe model is pretrained for an addtional 100k steps on the LM objective discussed in the T5 paper. In a way this turns a masked language model into an autoregressive model. It also prepares the model for some tasks. When for instance doing translation and NLI, it is well documented that there is a clear benefit to do a step of unsupervised LM-training before starting the finetuning.
North‑T5‑NCC‑modernThe model is pretrained for an additional 200k steps on a blanaced Bokmål and Nynorsk corpus. While this was originally done for doing translation between Bokmål and Nynorsk, it might also give improved results on tasks where you know that the input/output is modern "standard" text. A significant part of the training corpus is newspapers and reports.
North‑T5‑NCC‑modern‑lmTrained as above but with an additional 100k "language model"-pretraining.
North‑T5‑NCC‑scandThe model is pretrained for an additional 200k steps on a Scandinavian corpus (Bokmål, Nynorsk, Danish, Swedish and Icelandic (+ a tiny bit Faeroyish)). The model was trained for increasing the understanding of what effect such training has on various languages.
North‑T5‑scandPretrained for 1,700,000 steps starting with the mT5 checkpoing. The purpose of the mode is studying the difference of different training regimes for Scandinavian language model.
North‑byT5‑baseThis is a vocabulary free version of T5. It is trained exactly like North-T5, but instead of the 250,112 vocabulary, this model operates directly on the raw text. The model architecture might be of particulary interest for tasks involving for instance spelling correction, OCR-cleaning, handwriting recognition etc. However, it will - by design - have amuch shorter maximum sequence length.

Fine-tuned versions

As explained below, the model really needs to be fine-tuned for specific tasks. This procedure is relatively simple, and the models are not very sensitive to the hyper-parameters used. Usually a decent result can be obtained by using a fixed learning rate of 1e-3. Smaller versions of the model typically needs to be trained for a longer time. It is easy to train the base-models in a Google Colab.

Since some people really want to see what the models are capable of, without going through the training procedure, I provide a couple of test models. These models are by no means optimised, and are just for demonstrating how the North-T5 models can be used.

  • Nynorsk Translator. Translates any text from Norwegian Bokmål to Norwegian Nynorsk. Please test the Streamlit-demo and the HuggingFace repo
  • DeUnCaser. The model adds punctation, spaces and capitalisation back into the text. The input needs to be in Norwegian but does not have to be divided into sentences or have proper capitalisation of words. You can even remove the spaces from the text, and make the model reconstruct it. It can be tested with the Streamlit-demo and directly on the HuggingFace repo

Training details

All models are built using the Flax-based T5X codebase, and all models are initiated with the mT5 pretrained weights. The models are trained using the T5.1.1 training regime, where they are only trained on an unsupervised masking-task. This also means that the models (contrary to the original T5) needs to be finetuned to solve specific tasks. This finetuning is however usually not very compute intensive, and in most cases it can be performed even with free online training resources.

All the main model model versions are trained for 500.000 steps after the mT5 checkpoint (1.000.000 steps). They are trained mainly on a 75GB corpus, consisting of NCC, Common Crawl and some additional high quality English text (Wikipedia). The corpus is roughly 80% Norwegian text. Additional languages are added to retain some of the multilingual capabilities, making the model both more robust to new words/concepts and also more suited as a basis for translation tasks.

While the huge models almost always will give the best results, they are also both more difficult and more expensive to finetune. I will strongly recommended to start with finetuning a base-models. The base-models can easily be finetuned on a standard graphic card or a free TPU through Google Colab.

All models were trained on TPUs. The largest XXL model was trained on a TPU v4-64, the XL model on a TPU v4-32, the Large model on a TPU v4-16 and the rest on TPU v4-8. Since it is possible to reduce the batch size during fine-tuning, it is also possible to finetune on slightly smaller hardware. The rule of thumb is that you can go "one step down" when finetuning. The large models still rewuire access to significant hardware, even for finetuning.

Formats

All models are trained using the Flax-based T5X library. The original checkpoints are available in T5X format and can be used for both finetuning or interference. All models, except the XXL-model, are also converted to Transformers/HuggingFace. In this framework, the models can be loaded for finetuning or inference both in Flax, PyTorch and TensorFlow format.

Future

I will continue to train and release additional models to this set. What models that are added is dependent upon the feedbacki from the users

Thanks

This release would not have been possible without getting support and hardware from the TPU Research Cloud at Google Research. Both the TPU Research Cloud Team and the T5X Team has provided extremely useful support for getting this running.

Freddy Wetjen at the National Library of Norway has been of tremendous help in generating the original NCC corpus, and has also contributed to generate the collated coprus used for this training. In addition he has been a dicussion partner in the creation of these models.

Also thanks to Stefan Schweter for writing the script for converting these models from T5X to HuggingFace and to Javier de la Rosa for writing the dataloader for reading the HuggingFace Datasets in T5X.

Warranty

Use at your own risk. The models have not yet been thougroughly tested, and may contain both errors and biases.

Contact/About

These models were trained by Per E Kummervold. Please contact me on per@capia.no.

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

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

GPU в ailist

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

Нельзя запустить

У модели не указана задача.

Класс архитектуры
T5ForConditionalGeneration
Ревизия весов
7750b91

0 моделей