Run this model with HF Jobs
Run firqaaa/id_core_web_trf on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/firqaaa/id_core_web_trf. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/firqaaa/id_core_web_trf on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use firqaaa/id_core_web_trf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- spaCy
How to use firqaaa/id_core_web_trf with spaCy:
!pip install https://huggingface.co/firqaaa/id_core_web_trf/resolve/main/id_core_web_trf-any-py3-none-any.whl # Using spacy.load(). import spacy nlp = spacy.load("id_core_web_trf") # Importing as module. import id_core_web_trf nlp = id_core_web_trf.load() - Transformers
How to use firqaaa/id_core_web_trf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="firqaaa/id_core_web_trf")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("firqaaa/id_core_web_trf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
id_core_web_trf
An Indonesian transformer spaCy pipeline, built the way en_core_web_trf relates to en_core_web_sm. One transformer, indolem/indobert-base-uncased, is shared by all trained components, which are trained together on the same data as id_core_web_sm 0.6.1. It uses the small model's tokenizer, lemma fallback and entity rules.
Against id_core_web_sm 0.6.1, NER is much better: +9.4 F on the 18-label NER-18 test and +5 to +11 F on each of the five human-annotated test sets. Tagging, lemmas and parsing are worse: β1.4 to β2.4 UPOS, and β1.9 LAS on GSD and CSUI (+1.0 on PUD). It is also about 6 times slower on CPU and 30 times larger. Use it when entities matter most; for everything else, id_core_web_sm is the better choice.
Components:
- a tokenizer that follows Universal Dependencies word segmentation (the same as
id_core_web_sm); - a transformer (IndoBERT, 12 layers, lowercase input);
- a morphologizer (UPOS + morphological features);
- a lemmatizer and a dependency parser;
- named entity recognition with the 18 OntoNotes labels.
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).
| Version | 0.1.0 |
| spaCy | β₯ 3.8.18, < 3.9; spacy-transformers β₯ 2.0.3, < 2.1 |
| Size | 414 MB wheel (id_core_web_sm: 14.0 MB) |
| Speed | ~2.7k words/s on an Apple M3 Pro CPU (id_core_web_sm: ~17k). Much faster on a GPU (spacy.prefer_gpu()). |
Install and use
pip install https://huggingface.co/firqaaa/id_core_web_trf/resolve/main/id_core_web_trf-0.1.0-py3-none-any.whl
This installs spacy-transformers (and PyTorch) as dependencies.
Renamed on 2026-12-04 from id_core_news_trf to id_core_web_trf, to match the en_core_web_* models it follows. The old repo address redirects here. 0.1.0 is a new model, not an update of the 2024 one that this repo held before (version 0.0.4, spaCy 3.7, with an XPOS tagger). That model's wheel, id_core_news_trf-any-py3-none-any.whl, is still in this repo, so its install link keeps working, and its files are in the repo's history.
import spacy
nlp = spacy.load("id_core_web_trf")
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
| Component | Notes |
|---|---|
transformer |
indolem/indobert-base-uncased (IndoLEM; BERT base, trained on 220M words of Indonesian Wikipedia, news and web text). Fine-tuned with all components. The model lowercases its input, so it cannot see capital letters. |
| Tokenizer | UD-style segmentation, the same as id_core_web_sm. 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). |
morphologizer |
UPOS + UD features (not XPOS: the UD Indonesian treebanks use different XPOS tagsets). |
trainable_lemmatizer |
UD Indonesian lemmas, with affixes stripped (dibaca β baca). |
id_lemma_fallback |
For 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. |
parser |
UD dependency relations; also sets sentence boundaries. |
ner |
All 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_ner |
Rules 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. Evaluation is on raw text, so the pipeline's own tokenizer is included, which is how en_core_web_sm is reported. One training run (seed 0); id_core_web_sm 0.6.1 is shown for comparison.
Tagging, lemmas and parsing (UD r2.19 test sets):
| Test set | Token F | UPOS | Feats | Lemma | Lemma (case-insensitive) | UAS | LAS | Sentence F |
|---|---|---|---|---|---|---|---|---|
| GSD | 99.64 | 91.02 | 92.21 | 77.67 | 94.32 | 83.96 | 73.52 | 86.11 |
id_core_web_sm 0.6.1 |
99.64 | 93.30 | 94.32 | 80.40 | 97.92 | 84.27 | 75.40 | 88.42 |
| CSUI | 98.99 | 92.16 | 92.33 | 88.22 | 92.77 | 76.79 | 66.95 | 87.12 |
id_core_web_sm 0.6.1 |
98.99 | 94.55 | 94.59 | 92.56 | 96.83 | 78.85 | 68.89 | 85.44 |
| PUD | 99.43 | 91.81 | 89.83 | 88.08 | 89.61 | 83.45 | 67.79 | 93.46 |
id_core_web_sm 0.6.1 |
99.43 | 93.16 | 91.23 | 90.43 | 92.09 | 81.79 | 66.82 | 90.79 |
The tokenizer is the small model's, so Token F is the same. 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.
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 set | F1 | id_core_web_sm 0.6.1 |
|---|---|---|
| NER UI (IndoLEM, fold 01) | 91.35 | 84.24 |
| NER UGM (IndoLEM, fold 01) | 81.37 | 76.34 |
| NERGRIT (IndoNLU) | 78.69 | 68.00 |
| Luthfi et al. (2014) Wikipedia gold | 83.24 | 72.57 |
| NERP (IndoNLU), truecased | 81.69 | 73.97 |
| Average | 83.27 | 75.02 |
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 an LLM, 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 labels | 86.06 (precision 87.49, recall 84.67; id_core_web_sm 0.6.1: 76.67) |
| PERCENT, MONEY, PERSON, CARDINAL, LANGUAGE, QUANTITY | 99.3, 98.0, 93.3, 91.8, 91.4, 90.0 |
| GPE, DATE, ORG, ORDINAL | 88.5, 85.3, 81.7, 80.4 |
| NORP, WORK_OF_ART, TIME, FAC, PRODUCT, LOC | 72.9, 71.7, 66.7, 66.1, 63.6, 60.8 |
| EVENT, LAW | 57.6, 32.0: unreliable |
Batch 3, translated text (UD Indonesian-PUD test, 1,000 sentences, 1,976 entities, annotated the same way): 81.15 F (precision 82.75, recall 79.61; id_core_web_sm 0.6.1: 70.56).
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 overstates some labels and understates others, so don't read its numbers as accuracy. For this model it gives 81.9 (id_core_web_sm 0.6.1: 76.7), against 86.1 on the NER-18 test.
Training
spaCy's quickstart config for Indonesian (accuracy, GPU, transformer), filled with spacy init fill-config, without the tagger (the UD data has no shared XPOS tagset). All components train together on one corpus: UD Indonesian-GSD and -CSUI train plus the IDN Tagged Corpus (POS only), and the NER training data of id_core_web_sm 0.6.1. Training ran on a Colab T4 GPU for about 3.5 hours, with a learning rate of 5e-5 (warmup, then linear decay) and early stopping after 1,600 steps without improvement. It was evaluated every 200 steps on GSD dev plus the LLM-annotated NER dev set. The best checkpoint was step 11,400 of 13,000.
That trained model was then wrapped in id_core_web_sm's tokenizer, lemma fallback and rules. On the dev sets this was chosen over the model as trained, with spaCy's default tokenizer: GSD dev lemma 90.05 β 91.81, LAS 70.18 β 71.62, sentence F 86.18 β 86.21, with NER about the same (human-annotated dev splits 84.17 β 84.12). Compared with id_core_web_sm 0.6.1 on the same dev sets:
| Dev set | This model | id_core_web_sm 0.6.1 |
|---|---|---|
| GSD dev UPOS / lemma / LAS | 89.89 / 91.81 / 71.62 | 92.94 / 96.46 / 74.59 |
| NER, LLM-annotated dev set | 83.86 | 73.60 |
| NER, human-annotated dev splits (NERGRIT, NER UI, NER UGM, NERP), average | 84.12 | 76.79 |
Training data and licences
| Data | Used for | Licence |
|---|---|---|
indolem/indobert-base-uncased (Koto et al. 2020) |
Pretrained transformer | MIT |
| UD Indonesian-GSD and -CSUI r2.19 (train) | Tokenizer word list, tagging, lemmas, parsing | CC BY-SA 4.0 |
| IDN Tagged Corpus (Dinakaramani et al. 2014), mapped to UPOS | Extra POS data | CC BY-NC-SA 4.0 |
| NERGRIT, NERP (IndoNLU); NER UI, NER UGM (IndoLEM) | NER (NERP truecased) | Not stated by the authors |
| Wikidata place names | Splitting PLACE into GPE / LOC / FAC in the training data | CC0 |
spaCy lookup tables (spacy-lookups-data) |
Tokenizer word list; lemma fallback (Indonesian lemma lookup table) | MIT |
| 4,675 UD Indonesian-GSD and -CSUI train sentences, annotated with the 18 labels by an LLM, not human-verified | NER training | CC BY-SA 4.0 (the UD text's licence) |
| 2,000 Indonesian Wikipedia sentences picked for rare labels, annotated the same way | NER training | 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 / DATE | Labels only; no model text is in the pipeline |
Test sentences from every frozen test set were removed from all training data.
Limitations
- Tagging, lemmas and parsing are below
id_core_web_smon GSD and CSUI (UPOS β2.3 and β2.4, case-insensitive lemma β3.6 and β4.1, LAS β1.9 on both). The transformer is uncased, which most likely hurts proper nouns and lemmas. - The lemmatizer leaves some affixed verbs unchanged (
meresmikanstaysmeresmikan;id_core_web_smgivesresmi). The cliticnyaoccasionally gets an empty lemma: 29 of about 41,000 test tokens. - LAW and EVENT are unreliable (32.0 and 57.6 F on the NER-18 test), and LOC, PRODUCT, FAC and TIME are weak (60.8β66.7).
- Slow and large: about 6 times slower than
id_core_web_smon CPU, and 414 MB. - One training run.
id_core_web_sm's scores vary by about Β±1β2 F between seeds, so single differences smaller than that are not reliable. - The NER-18 test and dev sets, and 6,675 training sentences, were annotated by an LLM, not by humans. The human-annotated 3-label test sets improved too, but the 18-label scores are provisional.
- 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.
Source
The full code, data pipeline and reports are in the project repository under id-core-web-trf/ (this model) and id-core-web-sm/ (shared code, data and reports): the data inventory, conventions, NER guideline, the NER-18 test report (docs/11) and the quickstart config comparison (docs/15).
- Downloads last month
- -
Model tree for firqaaa/id_core_web_trf
Base model
indolem/indobert-base-uncasedSpace using firqaaa/id_core_web_trf 1
Evaluation results
- UPOS accuracy on UD Indonesian-GSD r2.19 (test)self-reported0.910
- Feats accuracy on UD Indonesian-GSD r2.19 (test)self-reported0.922
- Lemma accuracy on UD Indonesian-GSD r2.19 (test)self-reported0.777
- Lemma accuracy (case-insensitive) on UD Indonesian-GSD r2.19 (test)self-reported0.943
- UAS on UD Indonesian-GSD r2.19 (test)self-reported0.840
- LAS on UD Indonesian-GSD r2.19 (test)self-reported0.735
- Sentence F1 on UD Indonesian-GSD r2.19 (test)self-reported0.861
- UPOS accuracy on UD Indonesian-CSUI r2.19 (test)self-reported0.922