/ Модель

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

Контекст
514 токенов
Параметры
305 млн
Архитектура
xlm-roberta · dense

xlm-roberta-base-finetuned-ner-amharic

Разметка токеновТекст → label3 профессии

Модель на базе XLM-RoBERTa извлекает именованные сущности из амхарских новостных текстов и предназначена прежде всего для исследований.

129скачиваний за 30 дней1лайквеса обновлены22 фев 2022

Бенчмарки

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

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

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

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

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

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

Это модель распознавания именованных сущностей на основе XLM-RoBERTa-base, дообученная Майклом Бёкманом в Университете Витватерсранда на амхарской части набора MasakhaNER. Она размечает токены текста и предназначена для извлечения сущностей из новостных статей на амхарском языке, а также для исследований в области интерпретируемости и переноса обучения.

Модель содержит 305,2 млн параметров, использует архитектуру XLM-RoBERTa для классификации токенов и принимает контекст длиной до 514 токенов. В карточке указаны PyTorch и лицензия Apache License 2.0. При оценке на тестовой части MasakhaNER качество измерялось агрегированным F1; модель показала лучший результат среди пяти запусков с разными случайными начальными значениями.

Обучение проводилось на одном сравнительно небольшом наборе новостных данных, поэтому качество может снижаться на других жанрах и распределениях. Модель хуже справлялась с датами, длинными сущностями и сущностями, отсутствовавшими в обучающих данных; результаты на других языках также могут быть хуже. Автор не рекомендует использовать её в производстве или в важных сценариях, влияющих на людей, без тщательной проверки.

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

  • извлечение именованных сущностей из новостей на амхарском языке
  • разметка токенов амхарского текста для NER
  • исследование переноса обучения для распознавания сущностей
  • анализ ошибок NER на амхарском языке

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

xlm-roberta-base-finetuned-ner-amharic

This is a token classification (specifically NER) model that fine-tuned xlm-roberta-base on the MasakhaNER dataset, specifically the Amharic part.

More information, and other similar models can be found in the main Github repository.

About

This model is transformer based and was fine-tuned on the MasakhaNER dataset. It is a named entity recognition dataset, containing mostly news articles in 10 different African languages. The model was fine-tuned for 50 epochs, with a maximum sequence length of 200, 32 batch size, 5e-5 learning rate. This process was repeated 5 times (with different random seeds), and this uploaded model performed the best out of those 5 seeds (aggregate F1 on test set).

This model was fine-tuned by me, Michael Beukman while doing a project at the University of the Witwatersrand, Johannesburg. This is version 1, as of 20 November 2021. This model is licensed under the Apache License, Version 2.0.

Contact & More information

For more information about the models, including training scripts, detailed results and further resources, you can visit the the main Github repository. You can contact me by filing an issue on this repository.

Training Resources

In the interest of openness, and reporting resources used, we list here how long the training process took, as well as what the minimum resources would be to reproduce this. Fine-tuning each model on the NER dataset took between 10 and 30 minutes, and was performed on a NVIDIA RTX3090 GPU. To use a batch size of 32, at least 14GB of GPU memory was required, although it was just possible to fit these models in around 6.5GB's of VRAM when using a batch size of 1.

Data

The train, evaluation and test datasets were taken directly from the MasakhaNER Github repository, with minimal to no preprocessing, as the original dataset is already of high quality. The motivation for the use of this data is that it is the "first large, publicly available, high­ quality dataset for named entity recognition (NER) in ten African languages" (source). The high-quality data, as well as the groundwork laid by the paper introducing it are some more reasons why this dataset was used. For evaluation, the dedicated test split was used, which is from the same distribution as the training data, so this model may not generalise to other distributions, and further testing would need to be done to investigate this. The exact distribution of the data is covered in detail here.

Intended Use

This model are intended to be used for NLP research into e.g. interpretability or transfer learning. Using this model in production is not supported, as generalisability and downright performance is limited. In particular, this is not designed to be used in any important downstream task that could affect people, as harm could be caused by the limitations of the model, described next.

Limitations

This model was only trained on one (relatively small) dataset, covering one task (NER) in one domain (news articles) and in a set span of time. The results may not generalise, and the model may perform badly, or in an unfair / biased way if used on other tasks. Although the purpose of this project was to investigate transfer learning, the performance on languages that the model was not trained for does suffer.

Because this model used xlm-roberta-base as its starting point (potentially with domain adaptive fine-tuning on specific languages), this model's limitations can also apply here. These can include being biased towards the hegemonic viewpoint of most of its training data, being ungrounded and having subpar results on other languages (possibly due to unbalanced training data).

As Adelani et al. (2021) showed, the models in general struggled with entities that were either longer than 3 words and entities that were not contained in the training data. This could bias the models towards not finding, e.g. names of people that have many words, possibly leading to a misrepresentation in the results. Similarly, names that are uncommon, and may not have been found in the training data (due to e.g. different languages) would also be predicted less often.

Additionally, this model has not been verified in practice, and other, more subtle problems may become prevalent if used without any verification that it does what it is supposed to.

Privacy & Ethical Considerations

The data comes from only publicly available news sources, the only available data should cover public figures and those that agreed to be reported on. See the original MasakhaNER paper for more details.

No explicit ethical considerations or adjustments were made during fine-tuning of this model.

Metrics

The language adaptive models achieve (mostly) superior performance over starting with xlm-roberta-base. Our main metric was the aggregate F1 score for all NER categories.

These metrics are on the test set for MasakhaNER, so the data distribution is similar to the training set, so these results do not directly indicate how well these models generalise. We do find large variation in transfer results when starting from different seeds (5 different seeds were tested), indicating that the fine-tuning process for transfer might be unstable.

The metrics used were chosen to be consistent with previous work, and to facilitate research. Other metrics may be more appropriate for other purposes.

Caveats and Recommendations

In general, this model performed worse on the 'date' category compared to others, so if dates are a critical factor, then that might need to be taken into account and addressed, by for example collecting and annotating more data.

Model Structure

Here are some performance details on this specific model, compared to others we trained. All of these metrics were calculated on the test set, and the seed was chosen that gave the best overall F1 score. The first three result columns are averaged over all categories, and the latter 4 provide performance broken down by category.

This model can predict the following label for a token (source):

AbbreviationDescription
OOutside of a named entity
B-DATEBeginning of a DATE entity right after another DATE entity
I-DATEDATE entity
B-PERBeginning of a person’s name right after another person’s name
I-PERPerson’s name
B-ORGBeginning of an organisation right after another organisation
I-ORGOrganisation
B-LOCBeginning of a location right after another location
I-LOCLocation
Model NameStaring pointEvaluation / Fine-tune LanguageF1PrecisionRecallF1 (DATE)F1 (LOC)F1 (ORG)F1 (PER)
xlm-roberta-base-finetuned-ner-amharic (This model)baseamh72.6370.4974.9176.0075.0052.0078.00
xlm-roberta-base-finetuned-amharic-finetuned-ner-amharicamhamh79.5576.7182.6270.0084.0062.0091.00
xlm-roberta-base-finetuned-swahili-finetuned-ner-amharicswaamh70.3469.7270.9772.0075.0051.0073.00

Usage

To use this model (or others), you can do the following, just changing the model name (source):

from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline
model_name = 'mbeukman/xlm-roberta-base-finetuned-ner-amharic'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForTokenClassification.from_pretrained(model_name)

nlp = pipeline("ner", model=model, tokenizer=tokenizer)
example = "ቀዳሚው የሶማሌ ክልል በአወዳይ ከተማ ለተገደሉ የክልሉ ተወላጆች ያከናወነው የቀብር ስነ ስርዓትን የተመለከተ ዘገባ ነው ፡፡"

ner_results = nlp(example)
print(ner_results)

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

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

GPU в ailist

Универсальный рантайм · token-classification

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

Подбираем GPU…

Класс архитектуры
XLMRobertaForTokenClassification
Ревизия весов
0826f5a

0 моделей