/ Модель

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

Контекст
512 токенов
Архитектура
distilbert · dense

typo-detector-distilbert-en

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

Англоязычная модель на базе DistilBERT для обнаружения опечаток с помощью токенной классификации.

68скачиваний за 30 дней11лайковвеса обновлены16 июн 2021

Бенчмарки

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

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

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

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

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

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

m3hrdadfi/typo-detector-distilbert-en — модель на базе DistilBERT для обнаружения опечаток в английском тексте. Она обучена на корпусе NeuSpell и применяется для токенной классификации: модель отмечает токены, распознанные как TYPO. В карточке приведены метрики на оценочной выборке: F1 для класса TYPO составляет 0,989.

Модель использует архитектуру DistilBertForTokenClassification, доступна в форматах PyTorch и TensorFlow и принимает последовательности длиной до 512 токенов. Её можно подключить через Transformers pipeline для token-classification, например, для поиска вероятных опечаток в пользовательском тексте. Лицензия в предоставленных данных не указана.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Typo Detector

Dataset Information

For this specific task, I used NeuSpell corpus as my raw data.

Evaluation

The following tables summarize the scores obtained by model overall and per each class.

#precisionrecallf1-scoresupport
TYPO0.9923320.9859970.989154416054.0
micro avg0.9923320.9859970.989154416054.0
macro avg0.9923320.9859970.989154416054.0
weighted avg0.9923320.9859970.989154416054.0

How to use

You use this model with Transformers pipeline for NER (token-classification).

Installing requirements

pip install transformers

Prediction using pipeline

import torch
from transformers import AutoConfig, AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline


model_name_or_path = "m3hrdadfi/typo-detector-distilbert-en"
config = AutoConfig.from_pretrained(model_name_or_path)
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
model = AutoModelForTokenClassification.from_pretrained(model_name_or_path, config=config)
nlp = pipeline('token-classification', model=model, tokenizer=tokenizer, aggregation_strategy="average")
sentences = [
 "He had also stgruggled with addiction during his time in Congress .",
 "The review thoroughla assessed all aspects of JLENS SuR and CPG esign maturit and confidence .",
 "Letterma also apologized two his staff for the satyation .",
 "Vincent Jay had earlier won France 's first gold in gthe 10km biathlon sprint .",
 "It is left to the directors to figure out hpw to bring the stry across to tye audience .",
]

for sentence in sentences:
    typos = [sentence[r["start"]: r["end"]] for r in nlp(sentence)]

    detected = sentence
    for typo in typos:
        detected = detected.replace(typo, f'<i>{typo}</i>')

    print("   [Input]: ", sentence)
    print("[Detected]: ", detected)
    print("-" * 130)

Output:

   [Input]:  He had also stgruggled with addiction during his time in Congress .
[Detected]:  He had also <i>stgruggled</i> with addiction during his time in Congress .
----------------------------------------------------------------------------------------------------------------------------------
   [Input]:  The review thoroughla assessed all aspects of JLENS SuR and CPG esign maturit and confidence .
[Detected]:  The review <i>thoroughla</i> assessed all aspects of JLENS SuR and CPG <i>esign</i> <i>maturit</i> and confidence .
----------------------------------------------------------------------------------------------------------------------------------
   [Input]:  Letterma also apologized two his staff for the satyation .
[Detected]:  <i>Letterma</i> also apologized <i>two</i> his staff for the <i>satyation</i> .
----------------------------------------------------------------------------------------------------------------------------------
   [Input]:  Vincent Jay had earlier won France 's first gold in gthe 10km biathlon sprint .
[Detected]:  Vincent Jay had earlier won France 's first gold in <i>gthe</i> 10km biathlon sprint .
----------------------------------------------------------------------------------------------------------------------------------
   [Input]:  It is left to the directors to figure out hpw to bring the stry across to tye audience .
[Detected]:  It is left to the directors to figure out <i>hpw</i> to bring the <i>stry</i> across to <i>tye</i> audience .
----------------------------------------------------------------------------------------------------------------------------------

Questions?

Post a Github issue on the TypoDetector Issues repo.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
DistilBertForTokenClassification
Ревизия весов
902f1d7

0 моделей