/ Модель

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

Лицензия
CC BY-NC-SA 4.0
Библиотека
spacy
Опубликована
15 фев 2024

id_core_news_sm

Разметка токеновТекст → label
106скачиваний за 30 дней4лайкавеса обновлены30 ноя 2026

Описание модели

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

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

idcorenewssm — небольшой конвейер spaCy для анализа текстов на индонезийском языке, опубликованный автором репозитория firqaaa. Он работает на CPU, занимает около 14 МБ в виде wheel и обрабатывает примерно 17 тысяч слов в секунду. В версии 0.3.0 и новее слои tok2vec используют предварительно обученные веса, полученные на корпусе примерно из 200 млн слов индонезийского текста.

Конвейер включает токенизатор с сегментацией слов по правилам Universal Dependencies, морфологическую разметку UPOS и признаков, лемматизацию, синтаксический анализ зависимостей, распознавание именованных сущностей с 18 метками OntoNotes и сегментацию предложений. Последняя отключена отдельно: границы предложений определяет парсер. Модель предназначена для извлечения сущностей и лингвистического анализа преимущественно формального письменного индонезийского текста, например новостей и Википедии.

Оценки на тестах UD показывают высокую точность токенизации, но качество отдельных задач различается; слабые категории NER включают PRODUCT, WORK_OF_ART, EVENT и LAW. Наборы для оценки 18 меток и часть обучающих данных размечены Claude и не проверены людьми, поэтому результаты по ним предварительные. На социальных сетях, неформальном тексте и региональных языках точность может быть ниже. Требуется spaCy версии не ниже 3.8 и ниже 3.9. Лицензия CC BY-NC-SA 4.0 запрещает коммерческое использование.

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

  • извлечение имён людей, организаций и мест из индонезийских новостей
  • разметка частей речи и морфологических признаков в индонезийском тексте
  • лемматизация индонезийских слов
  • анализ синтаксических зависимостей в индонезийских предложениях
  • токенизация индонезийского текста по правилам Universal Dependencies

Ограничения

Качество NER для PRODUCT, WORK_OF_ART, EVENT и LAW низкое; оценки на данных с 18 метками предварительны, поскольку разметку выполняла Claude и люди её не проверяли. Модель обучена преимущественно на формальном письменном индонезийском, поэтому на социальных сетях, неформальных текстах и региональных вариантах языка может работать хуже; коммерческое использование запрещено лицензией.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

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

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

Открыть на Hugging Face

id_core_news_sm

A small Indonesian spaCy pipeline built the way en_core_web_sm is: CPU-only, no word vectors, about 17k words/s. Since 0.3.0, its tok2vec layers start from weights pretrained on about 200M words of raw Indonesian text.

Components:

  • a tokenizer that follows Universal Dependencies word segmentation;
  • a morphologizer (UPOS + morphological features);
  • a lemmatizer and a dependency parser;
  • named entity recognition with the 18 OntoNotes labels;
  • a sentence segmenter, included but disabled, as in English. The parser sets sentence boundaries.

Research use only. Training data includes the IDN Tagged Corpus (CC BY-NC-SA 4.0). This model is licensed CC BY-NC-SA 4.0 and must not be used commercially. Several of the NER training sets have no stated licence (details).

Version0.6.1 (replaces 0.6.0)
spaCy≥ 3.8, < 3.9
Size14.0 MB wheel
Speed~17k words/s on an Apple M3 Pro CPU

Install and use

pip install https://huggingface.co/firqaaa/id_core_news_sm/resolve/main/id_core_news_sm-0.6.1-py3-none-any.whl

Earlier wheels are still in this repo: id_core_news_sm-0.6.0-py3-none-any.whl, id_core_news_sm-0.5.0-py3-none-any.whl, id_core_news_sm-0.4.1-py3-none-any.whl, id_core_news_sm-0.4.0-py3-none-any.whl, id_core_news_sm-0.3.0-py3-none-any.whl and id_core_news_sm-0.2.0-py3-none-any.whl.

import spacy

nlp = spacy.load("id_core_news_sm")
doc = nlp("Presiden Joko Widodo meresmikan Bandara Yogyakarta di Kabupaten Kulon Progo "
          "pada 28 Agustus 2020 dengan biaya Rp 11 triliun. Bukunya dibaca warga Tionghoa.")

print([(e.text, e.label_) for e in doc.ents])
# [('Joko Widodo', 'PERSON'), ('Bandara Yogyakarta', 'FAC'), ('Kabupaten Kulon Progo', 'GPE'),
#  ('28 Agustus 2020', 'DATE'), ('Rp 11 triliun', 'MONEY'), ('Tionghoa', 'NORP')]
print([(t.text, t.pos_, t.lemma_, t.dep_) for t in doc][:4])
# [('Presiden', 'PROPN', 'Presiden', 'nsubj'), ('Joko', 'PROPN', 'Joko', 'flat:name'), ...]

The wheel bundles the custom components: the tokenizer (id_ud_tokenizer.v1), the lemma fallback (id_lemma_fallback) and the rule entity component (id_rule_ner). To load the files in this repo directly instead of the wheel, import id_tokenizer.py, id_lemma.py and id_rules.py first.

What it does

ComponentNotes
tok2vecPretrained with spacy pretrain (character objective) on Indonesian Wikipedia plus a truecased sample of Indo4B, then trained with each component.
TokenizerUD-style segmentation. Clitics are split off (bukunya → buku nya, apakah → apa kah) only when a word list confirms the rest is a word, so hanya and punya stay whole. Hyphenated words stay whole (anak-anak, ke-3, 1990-an).
morphologizerUPOS + UD features (not XPOS: the UD Indonesian treebanks use different XPOS tagsets).
trainable_lemmatizerUD Indonesian lemmas, with affixes stripped (meresmikan → resmi).
id_lemma_fallbackFor words not seen in training: spaCy's Indonesian lemma lookup table, reduplication (anjing-anjing → anjing) and a verb affix stripper checked against a root list. For all words: full reduplications get the lemma of their half (toko-toko → toko) unless training keeps them whole. Sets one casing convention: proper-noun lemmas keep their case (Jakarta), all others are lowercase.
parserUD dependency relations; also sets sentence boundaries.
nerAll 18 OntoNotes labels: PERSON, NORP, FAC, ORG, GPE, LOC, PRODUCT, EVENT, WORK_OF_ART, LAW, LANGUAGE, DATE, TIME, PERCENT, MONEY, QUANTITY, ORDINAL, CARDINAL.
id_rule_nerRules for dates, times, money, percentages, quantities, ordinals, numbers, laws (UU No. 11 Tahun 2008), NORP, LANGUAGE, EVENT and WORK_OF_ART. It fills gaps left by ner, and fixes split date, number and law spans; it never overrides names.

Results

All scores are in % on frozen test sets that were never used for training or model selection (NER models are chosen on a Claude-annotated dev set and the human-annotated dev splits of the NER sets below). Evaluation is on raw text, so the pipeline's own tokenizer is included, which is how en_core_web_sm is reported.

Tagging, lemmas and parsing (UD r2.19 test sets):

Test setToken FUPOSFeatsLemmaLemma (case-insensitive)UASLASSentence F
GSD99.6493.3094.3280.4097.9284.2775.4088.42
CSUI98.9994.5594.5992.5696.8378.8568.8985.44
PUD99.4393.1691.2390.4392.0981.7966.8290.79

These are the released pipeline's scores. Lemma casing differs between treebanks. GSD lowercases every lemma; CSUI and PUD keep the case of proper nouns, as this pipeline does. So GSD's case-sensitive lemma score is low for reasons of convention only. The case-insensitive column measures the lemmatization itself. Over 3 seeds, compared with 0.3.0's recipe, case-insensitive lemma accuracy is up +0.7 (GSD), +0.6 (CSUI) and +1.4 (PUD), and PUD's case-sensitive score rose from 80.0 to 90.1. 0.4.1's reduplication rule adds +0.3 (GSD), +0.1 (CSUI) and +0.3 (PUD) case-insensitive. Against 0.2.0's recipe, LAS is up about +1 on average.

For comparison, en_core_web_sm 3.8 reports LAS 89.9 on OntoNotes. It has about 13 times more training data than the ~116k words of UD Indonesian.

NER on existing Indonesian test sets. These annotate only persons, organisations and places, so GPE, LOC and FAC are scored together as PLACE, and other labels are ignored:

Test setF1
NER UI (IndoLEM, fold 01)84.24
NER UGM (IndoLEM, fold 01)76.34
NERGRIT (IndoNLU)68.00
Luthfi et al. (2014) Wikipedia gold72.57
NERP (IndoNLU), truecased73.97

Single-run NER scores vary by about ±1–2 F. Over 3 seeds the recipe averages NER UI 84.64, NER UGM 77.12, NERGRIT 67.43, Luthfi 72.34 and NERP 73.00 (0.4.1's recipe: 83.18, 76.55, 65.38, 69.32, 73.56).

All 18 labels: the NER-18 test set. 931 sentences from the UD Indonesian-GSD and -CSUI test sets, 2,675 entities. It was annotated by Claude (Anthropic's model), not by humans: independent first passes, a blind second pass on 200 sentences (exact-match agreement 0.963), and a review of every sentence against the guideline. No human has verified it yet, so read these as provisional.

F1
All labels76.67 (precision 78.07, recall 75.33; 3 seeds of this recipe: 76.80; 0.6.0: 75.50; 0.4.1: 65.75)
PERCENT, MONEY, ORDINAL, DATE, CARDINAL98.5, 98.0, 89.1, 86.8, 85.8
GPE, PERSON, LANGUAGE, QUANTITY, ORG, TIME80.4, 78.7, 75.9, 77.8, 65.3, 63.2
LOC, NORP, FAC58.9, 54.2, 51.3
LAW, EVENT, WORK_OF_ART, PRODUCT41.7, 39.4, 31.0, 26.5: unreliable

Batch 3, translated text (UD Indonesian-PUD test, 1,000 sentences, 1,976 entities, annotated the same way): 70.56 F (3 seeds of this recipe: 71.31; 0.6.0: 69.69; 0.4.1's recipe: 61.21). It is reported separately, so the numbers above stay comparable with earlier versions.

LANGUAGE, LAW and TIME have fewer than 20 mentions each.

Silver dev set (development only, listed separately in the evaluation results). It has gold person, organisation and place spans plus rule and LLM labels, made the same way as the training data. It scored 0.4.1 at 80.8 overall, 15 points above the NER-18 test, and overstated the rare labels most (LAW and LANGUAGE 100, NORP 88). For 0.6.1 it gives 76.7, against 76.7 on the NER-18 test. Don't read its numbers as accuracy.

Training data and licences

DataUsed forLicence
UD Indonesian-GSD and -CSUI r2.19 (train)Tokenizer word list, tagging, lemmas, parsingCC BY-SA 4.0
IDN Tagged Corpus (Dinakaramani et al. 2014), mapped to UPOSExtra POS dataCC BY-NC-SA 4.0
NERGRIT, NERP (IndoNLU); NER UI, NER UGM (IndoLEM)NER (NERP truecased)Not stated by the authors
Wikidata place namesSplitting PLACE into GPE / LOC / FAC in the training dataCC0
spaCy lookup tables (spacy-lookups-data)Tokenizer word list; lemma fallback (Indonesian lemma lookup table)MIT
Indonesian Wikipedia, 2023-11-01 dump (105M words, filtered)tok2vec pretraining (raw text, no labels)CC BY-SA 3.0 / GFDL
Indo4B (IndoNLU): 99M words sampled from web, news and subtitle text, truecasedtok2vec pretraining (raw text, no labels)Stated CC0 by SEACrowd; the texts themselves are third-party
4,675 UD Indonesian-GSD and -CSUI train sentences, annotated with the 18 labels by Claude (Anthropic), not human-verifiedNER training (2,000 since 0.5.0, all since 0.6.0)CC BY-SA 4.0 (the UD text's licence)
2,000 Indonesian Wikipedia sentences picked for rare labels, annotated the same wayNER training (since 0.6.0)CC BY-SA 3.0 / 4.0
Qwen3 8B (local, via Ollama)Classified ~3,000 span types already marked in NERP as ORG / PRODUCT / EVENT / WORK_OF_ART / DATELabels only; no model text is in the pipeline

Test sentences from every frozen test set were removed from all training data, including the pretraining text.

Limitations

  • PRODUCT, WORK_OF_ART, EVENT and LAW are unreliable (26.5–41.7 F on the NER-18 test), and NORP and FAC are weak (54.2, 51.3). ORG (65.3) is the weakest of the frequent labels.
  • The NER-18 test and dev sets, and 6,675 training sentences, were annotated by Claude, not by humans. The human-annotated 3-label test sets improved too, but the 18-label scores are provisional.
  • Merging GPE, LOC and FAC back into one place label costs some place recall compared with a single PLACE label. 15–30% of training place mentions could not be typed, so they were left out of training.
  • Mostly formal written Indonesian (news, Wikipedia). Expect lower accuracy on social media, informal or regional-language text.
  • The two UD treebanks segment some words differently (e.g. hyphenated ranges, Tbk.); the tokenizer follows GSD.

Changes in 0.6.1

  • The rule component now follows guideline v0.2 span conventions (conventions="v0.2"). Approximators are inside number spans (sekitar Rp 9.000, lebih dari 20 persen), lalu / mendatang are inside full dates (14 Maret 2007 lalu), date ranges are one span, and a weekday with a time of day is TIME. The NER and UD models are those of 0.6.0.
  • NER-18 test: 76.67 F (0.6.0: 75.50); 3 seeds of the recipe: 76.80 (0.6.0's: 75.89). The new batch 3 (PUD, translated text) gives 70.56 (0.6.0: 69.69). The change was chosen on the Claude-annotated dev set: +1.0 over 3 seeds.
  • The human-annotated 3-label test sets are unchanged, because they score names only.

Changes in 0.6.0

  • The NER model is retrained with 4,675 more Claude-annotated sentences: the remaining UD GSD training sentences, and 2,000 Wikipedia sentences picked for PRODUCT, EVENT, WORK_OF_ART, LAW and FAC. That makes 6,675 Claude-annotated sentences alongside the older NER datasets.
  • NER-18 test: 75.50 F (0.5.0: 72.67); 3 seeds of the recipe: 75.89 ± 0.50 (0.5.0's recipe: 73.13). EVENT, LANGUAGE, NORP, WORK_OF_ART, PERSON and GPE gain most. LAW does not improve.
  • The human-annotated 3-label test sets hold or improve. NERGRIT +1.7 and Luthfi +0.7 against 0.5.0; NER UI, NER UGM and NERP are level (3-seed recipe means: +1.0, +1.4, −0.3, +0.4, −0.4).
  • Model selection now also uses the human-annotated NER dev splits: training on the Claude data alone scored higher on the Claude dev set but lost 8–22 points on human-annotated data.
  • Tagging, lemmas and parsing are unchanged.

Changes in 0.5.0

  • The NER model is retrained with 2,000 UD training sentences annotated with all 18 labels by Claude, and its checkpoint is chosen on a Claude-annotated dev set (740 sentences) instead of the silver dev set.
  • NER-18 test: 72.67 F (0.4.1: 65.75); 3 seeds of the recipe 73.13 ± 0.58 (0.4.1's recipe: 65.09). The largest gains are in the rare labels: LAW, LANGUAGE, PRODUCT, WORK_OF_ART and NORP.
  • The human-annotated 3-label test sets hold or improve: NERGRIT +3.1, NER UI +1.1, NER UGM +0.5, Luthfi +2.1, NERP +1.2 against 0.4.1 (3-seed recipe means: +1.1, +1.7, +0.1, +1.6, −0.2).
  • Tagging, lemmas and parsing are unchanged (same UD model as 0.4.1).

Changes in 0.4.1

  • id_lemma_fallback now also lemmatizes full reduplications seen in training (toko-toko → toko, hak-hak → hak), which the trained lemmatizer often left whole. Forms that training lemmatizes whole more often than as the half are kept.
  • Case-insensitive lemma accuracy +0.28 (GSD), +0.09 (CSUI) and +0.34 (PUD), the same on each of 3 seeds. All other scores, including NER, are identical to 0.4.0.

Changes in 0.4.0

  • Lemma casing follows one convention (UD/spaCy style): proper nouns keep their case, everything else is lowercase. The training lemmas were rewritten to it, because GSD and CSUI disagree.
  • New id_lemma_fallback for words not seen in training: lookup table, reduplication, and a verb affix stripper.
  • Case-insensitive lemma accuracy is up on all three UD test sets (+0.6 to +1.4 over 3 seeds); PUD's lemma score is up from 80 to 90. GSD's case-sensitive lemma score drops (to ~80) because its gold lemmas are all lowercase.
  • NER is unchanged from 0.3.0.

Changes in 0.3.0

  • tok2vec pretraining on Indonesian Wikipedia plus a truecased Indo4B sample (spacy pretrain, one pass over ~245M tokens).
  • NER training data: rules now run on the pipeline's own tokenization, so bracketed news dates (Senin (23/3/2016)) are labelled whole, and standalone (22/3) dates no longer include the brackets.
  • Scores are backed by 3-seed runs. Average LAS +0.9 and UPOS +0.3 over the three UD test sets, GSD sentence F +2.4; NER is flat to +1.7 F across the five test sets, except NER UI (−1.2).

Changes in 0.2.0 (from 0.0.4)

  • spaCy 3.8, and a new tokenizer that follows UD word segmentation (token F about 96 → 99.0–99.6 against UD).
  • A rule entity component, and the tagger (XPOS) removed.
  • Retrained on UD r2.19, with IDN POS data and truecased NERP added.
  • All scores are now reported on documented frozen test sets.

Source

The full code, data pipeline and reports are in the project repository under id-core-web-sm/: the data inventory, conventions, NER guideline, phase reports, the 3-seed noise study (docs/07), the pretraining report (docs/08) and the lemmatizer report (docs/09).

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

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

GPU в ailist

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

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

Модели spaCy требуют отдельного рантайма.

Ревизия весов
2849f5f

0 моделей