Downloads · 30 days
99
34% of all-time downloads
ivlcic/xlmr-ner-slavic-pline
xlmr-ner-slavic-pline is a token classification model from ivlcic. Use it when you need labels on individual words, such as names. The card lists the license as apache-2.0.
This is a Huggingface's transformer library pipeline-frendly model ivlcic/xlmr-ner-slavic
Downloads · 30 days
99
34% of all-time downloads
All-time downloads
294
Public
Parameters
277M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 98%
From the Hugging Face model README
This is a Huggingface's transformer library pipeline-frendly model ivlcic/xlmr-ner-slavic
Usage:
ner = pipeline(
task="token-classification",
model="ivlcic/xlmr-ner-slavic-pline",
tokenizer="ivlcic/xlmr-ner-slavic-pline",
aggregation_strategy="simple",
)
text = " Janez Novak... Metka Kralj,,. in Boris A. Novak živijo v Ljubljani in delajo za Microsoft."
tokens = re.findall(r"\s+|\w+|[^\w\s]", text, flags=re.UNICODE)
result = ner(tokens, is_split_into_words=True, delimiter="")
for r in result[0]:
print(f'[{text[r['start']:r['end']]}]({r["entity_group"]}@{r["start"]}:{r["end"]})')
Should output something like:
[Janez Novak]([email protected]|1:12)
[Metka Kralj]([email protected]|16:27)
[Boris A. Novak]([email protected]|34:48)
[Ljubljani]([email protected]|58:67)
[Microsoft]([email protected]|81:90)