/ Модель

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

Лицензия
Apache 2.0
Архитектура
otter-bi-encoder · dense
Библиотека
transformers
Опубликована
8 янв 2026

otter-bi-mmbert

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

Мультиязычный биэнкодер для извлечения именованных сущностей по типам, заданным текстом, без фиксированной схемы меток.

66скачиваний за 30 дней3лайкавеса обновлены27 авг 2026

Бенчмарки

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

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

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

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

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

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

Otter Bi MM BERT — мультиязычная модель распознавания именованных сущностей, разработанная автором репозитория whoisjones. Она принимает текст и названия типов сущностей на естественном языке, например «person» или «chemical compound», и возвращает символьные диапазоны найденных сущностей без фиксированного набора меток и отдельной настройки под каждую схему. Модель использует биэнкодер: текст и названия типов кодируются отдельно, а представления меток можно повторно использовать для обработки корпуса с неизменным набором типов.

Текстовый энкодер основан на jhu-clsp/mmBERT-base, энкодер меток — на google-bert/bert-base-multilingual-uncased. Максимальная длина последовательности составляет 1024 токена, максимальная длина диапазона — 30 токенов. Модель подходит для мультиязычного извлечения сущностей с пользовательскими типами и обработки больших корпусов, когда набор типов повторяется. Лицензия — Apache-2.0.

Порог по умолчанию равен 0,2 и был выбран по макро-F1 на наборе оценки; результат чувствителен к количеству и формулировкам типов, поэтому порог может потребовать повторной калибровки на данных конкретной области. README отмечает, что модели семейства cross-encoder сильнее, тогда как bi-encoder экономичнее при многократном применении одного набора меток.

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

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

Ограничения

Точность зависит от формулировки и количества заданных типов; порог обнаружения может потребовать калибровки на данных целевой области. Максимальная длина последовательности — 1024 токена, а длина диапазона сущности ограничена 30 токенами.

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

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

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

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

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

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

Открыть на Hugging Face

🦦 otter-bi-mmbert

Otter is a multilingual, open-type named entity recognizer. You give it a piece of text and a list of entity types in plain language -- ["person", "band", "chemical compound"] -- and it returns the character spans of the entities of those types. There is no fixed label set and no fine-tuning step: the types are part of the input.

Bi-encoder. The text and the entity type names are encoded separately, and candidate spans are scored against the label embeddings. Label embeddings depend only on the label set, so they can be computed once and reused across a whole corpus -- the cheaper option when the same types are applied to many inputs.

Usage

from transformers import AutoModel

model = AutoModel.from_pretrained("whoisjones/otter-bi-mmbert", trust_remote_code=True)
model.eval()

entities = model.predict(
    "Angela Merkel besuchte gestern das Brandenburger Tor in Berlin.",
    labels=['person', 'organization', 'location'],
)

for entity in entities:
    print(f"{entity['text']!r:25} {entity['label']:15} {entity['score']:.2f}")
'Angela Merkel'           person          0.84
'Brandenburger Tor'       location        0.30

Each entity is a dict with text, label, start, end (character offsets into the input string) and score. Pass a list of strings to run on a batch; you then get one list of entities per input, in the same order:

model = model.to("cuda")

texts = ["Angela Merkel besuchte das Brandenburger Tor.", "Sony was founded in Tokyo."]
results = model.predict(texts, labels=["person", "organization", "location"], batch_size=16)

Threshold

predict keeps spans scoring above threshold, which defaults to config.prediction_threshold (0.2 for this checkpoint, chosen by calibrating macro-F1 across the evaluation suite). Lower it for higher recall, raise it for higher precision:

entities = model.predict(text, labels=labels, threshold=0.1)

Because the label set is part of the input, the useful threshold shifts with how many types you ask for and how specific they are. If you have a few hundred annotated sentences from your own domain, re-calibrating on those is worth more than any default.

Writing good label names

The label is read as natural language, so it carries meaning. "politician" and "person" select different spans, and a phrase like "chemical compound" works as well as a single word. Prefer the wording you would use to describe the type to a person.

Reusing label embeddings

The type encoder only sees the label names, so its output can be computed once and reused for every batch:

type_inputs = model.encode_labels(labels)   # do this once

predict does this per call; drop down to forward if you are running over a large corpus with a fixed label set.

Fine-tuning

collate_fn.py in this repository holds the training and evaluation collators. See the GitHub repository for the full training pipeline, the evaluation suite, and the data preparation scripts.

Model family

ModelArchitectureEncoder
whoisjones/otter-bi-mmbertbi-encodermmBERT-base
whoisjones/otter-cross-mmbertcross-encodermmBERT-base
whoisjones/otter-bi-rembertbi-encoderRemBERT
whoisjones/otter-cross-rembertcross-encoderRemBERT

The cross-encoders are the stronger models; the bi-encoders are cheaper when one label set is applied across a large corpus.

License

Apache 2.0.

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

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

GPU в ailist

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

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

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
OtterBiEncoderModel
Ревизия весов
53e10a0

0 моделей