Downloads · 30 days
27
11% of all-time downloads
OKanishcheva/ParlLangID-UA-RU
ParlLangID-UA-RU is a token classification model from OKanishcheva. Use it when you need labels on individual words, such as names. The card lists the license as mit.
[](https://huggingface.co/spaces/OKanishcheva/parl-langid-demo)
Downloads · 30 days
27
11% of all-time downloads
All-time downloads
236
Public
Parameters
177M
709 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors709 MB · 100%
From the Hugging Face model README
ParlLangID-UA-RU is a token-level language identification model designed for Ukrainian–Russian code-switched parliamentary texts. The model assigns a language label to each token in mixed-language sentences.
The model is based on the pretrained multilingual transformer BERT and fine-tuned for token classification on manually annotated parliamentary proceedings containing Ukrainian–Russian code-switching.
This model is intended to support research on:
The model can be used for:
Typical applications include:
The model was trained on a manually annotated dataset of Ukrainian–Russian parliamentary texts containing code-switching.
Each token in the dataset is labeled with its language.
Training data is publicly available at:
https://zenodo.org/records/14724542
| Label | Language |
|---|---|
| uk | Ukrainian |
| ru | Russian |
from transformers import AutoTokenizer, AutoModelForTokenClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("USERNAME/ParlLangID-UA-RU")
model = AutoModelForTokenClassification.from_pretrained("USERNAME/ParlLangID-UA-RU")
text = "Шановні колеги сегодня мы обсуждаем законопроект"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
predictions = torch.argmax(outputs.logits, dim=2)
tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
labels = predictions[0].tolist()
for token, label in zip(tokens, labels):
print(token, label)
## Interactive Demo
You can explore the model using an interactive visualization tool:
https://huggingface.co/spaces/OKanishcheva/parl-langid-demo
The demo highlights Ukrainian and Russian tokens in mixed-language text and provides language distribution statistics.