/ Модель

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

Лицензия
Apache 2.0
Библиотека
onnxruntime
Опубликована
7 сен 2026

bashkir-lid

Классификация текстаТекст → label6 профессий

Компактный ONNX-классификатор определяет, является ли текст башкирским, для фильтрации корпусов и локальной проверки текста.

65скачиваний за 30 дней0лайковвеса обновлены1 окт 2026

Бенчмарки

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

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

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

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

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

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

Bashkir LID — компактный бинарный классификатор языка башкирского текста от автора репозитория failed09. Он относит входной текст к башкирскому языку (ba) или к категории «не башкирский» (non_ba), поэтому подходит для фильтрации корпусов, предварительной проверки текста после OCR и локальных приложений с инференсом на CPU. Модель использует символьные TF-IDF признаки char_wb с n-граммами длиной 2–5 и словные n-граммы длиной 1–2; линейный SGD-классификатор экспортирован в ONNX и запускается через ONNX Runtime.

В карточке приведены результаты на тестах со слабыми или вручную заданными метками: 93,25% точности на наборе из 4 000 предложений. При пороге 0,50 классификатор сохранил 73% башкирских примеров и не пропустил ни одного из 3 000 небашкирских в указанном тесте. Это бинарный языковой фильтр, а не многоязычный детектор: он не определяет, какой именно язык стоит за меткой non_ba. Короткие строки, татарский и другой близкородственный текст, смешанные языки, имена и OCR-шум могут вызывать ошибки; оценки модели не следует считать откалиброванными вероятностями. Лицензия репозитория — Apache-2.0; исходные обучающие тексты не распространяются, и для них могут действовать условия исходных источников.

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

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

Ограничения

Модель выдает только бинарную метку ba/non_ba и не распознает конкретный небашкирский язык; короткие и смешанные тексты, татарский, имена и OCR-шум неоднозначны. Оценки основаны на слабой или вручную заданной разметке, а порог 0,50 может отбрасывать часть настоящего башкирского текста.

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

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

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

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

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

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

Открыть на Hugging Face

Bashkir LID (Binary BA vs NON_BA)

Compact ONNX language gate that decides whether text is Bashkir, for corpus filtering and local CPU inference.

Overview

A compact binary language gate for Bashkir (ba vs non_ba), designed for corpus filtering, OCR triage and local applications that need lightweight CPU inference. It was trained with hard negatives from sister Turkic languages, Russian and technical/noisy text, with special attention to Bashkir/Tatar separation.

At a glance
TaskBinary language identification (ba vs non_ba)
Default artifactmodel.onnx + lid.py
SourceBashkir, Turkic, Russian and technical text (not redistributed)
Version / licensev3 / Apache-2.0

Contents

Files and Configurations

FilePurpose
model.onnxExported classifier graph and weights (opset 17)
vectorizer.jsonDual-channel character and word feature vocabularies
lid.pyPortable ONNX Runtime adapter
config.jsonRuntime contract
META.jsonModel passport, validation results and artifact hashes
__init__.pyPackage marker
LICENSEFull license text
SHA256SUMSRelease checksums

Training texts and the original joblib pipeline are not distributed.

Model Architecture

PropertyDescription
TaskBinary language identification: ba or non_ba
FeaturesDual-channel TF-IDF: char_wb (2–5) + word (1–2), 240,000 features
ClassifierLinear SGD classifier exported to ONNX with Sigmoid normalization
RuntimeONNX Runtime on CPU
PreprocessingUnicode lowercase and dual-channel sparse features, provided by lid.py
OutputsClass labels (ba, non_ba) and probabilities

The ONNX graph takes sparse feature tensors (char_ids, char_counts, word_ids, word_counts); the adapter handles preprocessing, batching and checksum validation. No custom ONNX operators or Transformers installation are required.

Examples

TextPredictionba probability
Мин башҡорт телен яратам.ba0.998
Бары бала бара.ba0.927
Сегодня хорошая погода.non_ba0.044
SELECT id FROM users WHERE active = TRUE;non_ba0.011

Note the second row: valid Bashkir text does not always contain Bashkir-specific letters.

Method

The model is a dual-channel linear classifier: TF-IDF char_wb (2–5) and word (1–2) features are fused and passed to an SGD classifier exported to ONNX. It was trained with hard negatives from sister Turkic languages, Russian and technical/noisy text. Training texts are not distributed in this repository.

training data (Bashkir + hard negative Turkic/Russian/noise)
  ├── 1. extract character n-grams: char_wb (2–5)
  ├── 2. extract word n-grams: words (1–2)
  ├── 3. feature union & TF-IDF vectorization
  ├── 4. train SGDClassifier with log-loss
  └── 5. export calibrated ONNX graph (fast single-pass classification)

Evaluation

On a weak-label 4,000-sentence benchmark the model reached 93.25% binary accuracy: at the default 0.50 threshold it retained 730/1,000 Bashkir examples and rejected 3,000/3,000 non-Bashkir examples. A hand-authored adversarial suite passed 26/26 (Tatar, Kazakh, Chuvash, Russian with Bashkir inserts, code and noise), and an independent 100-example stress set reached 97/100. Labels are weak or manually constructed, not an expert-reviewed Gold benchmark; exact numbers are recorded in META.json.

Operating thresholds

predict() selects ba when its probability is at least 0.50. Measured operating points (from META.json):

BA probability thresholdBA recallNon-BA false acceptance
0.5073.0% (730/1,000)0/3,000
0.4078.3% (783/1,000)2/3,000
0.3580.8% (808/1,000)4/3,000

Use 0.50 for the strictest rejection of non-Bashkir text. Use 0.35–0.40 when preserving more Bashkir text matters, preferably with dictionary and quality checks. The price of the strict gate is false rejection of some valid Bashkir sentences, especially short or BA/Tatar-like sentences.

Quality and Use

This is a binary gate, not a general multilingual language detector. It does not identify which non-BA language was found. Tatar and other languages, short strings, names, OCR artifacts and mixed-language text can be ambiguous.

Limitations

  • Binary decision only: ba vs non_ba, with no language label for rejects.
  • Weak-label benchmark; not an expert-reviewed Gold evaluation.
  • Confidence values are model scores, not calibrated human probabilities.
  • Empty strings, OCR fragments and technical noise should be handled with explicit pipeline rules.
  • For high-recall corpus construction, combine with the multiclass LID, dictionaries, quality rules and human review.

Related Resources

  • Bashkir Multiclass LID — distinguishes ba, tt, ru and other; use it when you need the language label instead of a pass/reject gate.

Usage

pip install huggingface_hub onnxruntime numpy
import sys
from huggingface_hub import snapshot_download

model_dir = snapshot_download(
    "failed09/bashkir-lid",
    allow_patterns=[
        "lid.py", "config.json", "META.json", "model.onnx", "vectorizer.json"
    ],
    revision="main",  # pin a reviewed commit for reproducible deployments
)
sys.path.insert(0, model_dir)
from lid import LanguageIdentifier

lid = LanguageIdentifier(model_dir=model_dir)
texts = ["Мин башҡорт телен яратам.", "Сегодня хорошая погода."]
print(lid.predict(texts).tolist())
print(lid.predict_proba(texts))
print(lid.classes.tolist())  # probability-column order

After downloading, inference runs locally without network access. For a local checkout with the model files alongside lid.py, LanguageIdentifier() also works without extra arguments.

License

The code and model export are released under the Apache-2.0 license. Training texts are not included in this repository.

Citation

@software{failed09_bashkir_lid_2026,
  title = {Bashkir LID},
  author = {failed09},
  year = {2026},
  publisher = {Hugging Face},
  url = {https://huggingface.co/failed09/bashkir-lid},
  note = {Compact binary Bashkir language gate}
}

Open Bashkir Data and Sources 🐝

This release is part of an open-source effort to support the development, preservation and practical use of the Bashkir language. Other related models, datasets and tools are available on the author's Hugging Face profile.

The author does not claim ownership or authorship of the source texts or other materials used to derive this release; rights and licensing remain with the original authors, publishers and dataset providers. Source texts are not redistributed in this repository, so users should follow the licenses and attribution requirements of the relevant upstream resources.

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

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

GPU в ailist

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

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

Модель выложена только в формате ONNX.

Ревизия весов
ae54ac4

0 моделей