sr_nerel_teslaxlm

sr_nerel_teslaxlm is TE-SLA's flagship spaCy pipeline for Serbian named entity recognition (NER) and Wikidata entity linking (NEL). It detects locations, organizations, persons, and roles in Serbian Latin- and Cyrillic-script text and assigns Wikidata identifiers to recognized mentions when the entity is covered by the pipeline's knowledge base.

The pipeline is built on TE-SLA/TeslaXLM and contains the complete trained transformer, tokenizer, sentence segmenter, NER component, entity linker, and knowledge base. Loading the package does not download the TeslaXLM base model.

Model details

Feature Value
Package sr_nerel_teslaxlm
Version 1.0.0
Language Serbian (sr)
Framework spaCy 3.8.11
Base transformer te-sla/TeslaXLM
Architecture Transformer with sentence segmentation, NER, and entity linking
Training condition Expanded Tesla-NeReL corpus with the rebuilt mixed-script base KB
Training window 10 sentences
NER labels LOC, ORG, PERS, ROLE
Entity identifiers Wikidata QIDs
License CC BY-SA 4.0

Installation

pip install "https://huggingface.co/te-sla/sr_nerel_teslaxlm/resolve/main/sr_nerel_teslaxlm-1.0.0-py3-none-any.whl"

The release is tested with:

Python 3.11
spaCy 3.8.11
spacy-transformers 1.3.9
transformers 4.49.0

Install the appropriate CPU or CUDA build of PyTorch for the target machine.

Usage

import spacy

nlp = spacy.load("sr_nerel_teslaxlm")
doc = nlp("Beograd je glavni grad Srbije.")

for ent in doc.ents:
    print(ent.text, ent.label_, ent.kb_id_)

Expected output:

Beograd LOC Q3711
Srbije LOC Q403

Evaluation

The two tables below use different evaluation settings and should not be combined into a single score.

Tesla-NeReL expanded standard test

These are official spacy evaluate scores. NEL is spaCy's entity-linker nel_micro_f.

Metric Precision Recall F1
NER 87.10% 92.62% 89.77%
NEL micro 88.39% 73.96% 80.53%

Sentence segmentation F1 is 93.74%. Evaluation speed was approximately 1,960 words per second in the recorded evaluation environment.

NER F1 by entity type:

Label Precision Recall F1
LOC 95.40% 94.23% 94.81%
ORG 88.22% 85.37% 86.77%
PERS 75.55% 96.32% 84.68%
ROLE 89.66% 90.23% 89.95%

Combined external gold evaluation

The external scorer requires an exact entity span and label for NER. End-to-end NEL additionally requires the exact Wikidata KB ID.

Metric Precision Recall F1
NER 88.53% 87.83% 88.18%
End-to-end NEL 85.23% 54.68% 66.62%

Conditional linker accuracy is 62.02%. Oracle-NER linker accuracy is 57.13%. The external gold set pools the DigitalneIkone_zg and srpGeography evaluation sources.

Raw evaluation JSON files are included in the evaluation/ directory.

Training data

TODO(PAPER): Add the paper-approved corpus description, provenance, split sizes, annotation process, synthetic-data generation method, and licensing.

The released run uses the expanded Tesla-NeReL training corpus and a mixed-script base knowledge base built from that corpus. The base KB contains 9,236 Wikidata entities and 49,752 alias rows. No additional kb_synt alias expansion is used in this flagship run.

Knowledge base

The entity linker includes its knowledge base inside the spaCy package. The KB contains Wikidata QIDs, aliases, priors, and 1,024-dimensional entity vectors. Aliases cover both Serbian Latin and Cyrillic script forms.

Mentions not resolved to a covered entity may receive NIL.

Intended use

  • Serbian NER and Wikidata entity linking.
  • Information extraction and corpus enrichment.
  • Digital humanities and educational-text analysis.
  • Research comparisons for Serbian and South Slavic NER/NEL.

Validate performance on the target domain before production deployment.

Limitations

TODO(PAPER): Replace or extend this section with the paper-approved limitations and ethics statement.

  • Entity linking is limited by KB coverage and alias quality.
  • ORG and PERS linking are weaker than LOC and ROLE linking.
  • Exact-span evaluation penalizes partially correct multi-word entities.
  • Performance may shift on domains unlike the training and external-gold data.
  • Predictions and Wikidata links should be reviewed for high-impact uses.

Authors and citation

TODO(PAPER): Insert the complete author list, paper title, venue, year, DOI or canonical URL, and BibTeX citation.

Acknowledgments

TODO(PAPER): Insert the paper-approved funding and acknowledgment text.

The model was developed by TE-SLA, Text Embeddings – Serbian Language Applications.

License

This release is licensed under CC BY-SA 4.0. TeslaXLM is also distributed under CC BY-SA 4.0.

Downloads last month
5
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for te-sla/sr_nerel_teslaxlm

Finetuned
te-sla/TeslaXLM
Finetuned
(1)
this model

Evaluation results

  • NER F1 on Tesla-NeReL with synthetic training examples
    self-reported
    0.898