This model represents the latest iteration (v0.2) in panagoa's series of NLLB-200 adaptations for Kabardian language. Building upon the previous v0.1 version, this model incorporates additional fine-tuning and improvements to enhance translation quality, accuracy, and fluency specifically for the Kabardian language. The model is classified as a Text2Text Generation model, potentially offering broader text generation capabilities beyond direct translation.
This enhanced model (v0.2) has been fine-tuned with additional training data and potentially improved techniques compared to v0.1, building upon the strong foundation of the NLLB-200 architecture. The specific improvements likely focus on addressing limitations identified in earlier versions and expanding the model's capabilities for Kabardian language processing.
1from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
2
3model_name = "panagoa/nllb-200-1.3b-kbd-v0.2"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
6
7# Example: Translating to Kabardian
8src_lang = "eng_Latn" # English
9tgt_lang = "kbd_Cyrl" # Kabardian in Cyrillic script
10
11text = "Welcome to our community. We are happy to share our culture and language with you."
12inputs = tokenizer(f"{src_lang}: {text}", return_tensors="pt")
13translated_tokens = model.generate(
14 **inputs,
15 forced_bos_token_id=tokenizer.lang_code_to_id[tgt_lang],
16 max_length=50
17)
18translation = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)[0]
19print(translation)
20
21# Example: Translating from Kabardian
22kbd_text = "Ди щӀыналъэм и дахагъэр пхуэӀуэтэщӀынукъым."
23inputs = tokenizer(f"{tgt_lang}: {kbd_text}", return_tensors="pt")
24translated_tokens = model.generate(
25 **inputs,
26 forced_bos_token_id=tokenizer.lang_code_to_id[src_lang],
27 max_length=50
28)
29translation = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)[0]
30print(translation)
This model is part of panagoa's ongoing effort to improve NLP capabilities for the Kabardian language. As the latest version in this collection, it represents the current recommended model for Kabardian language translation and text generation tasks. For comparative analysis or specific requirements, earlier versions (pre-trained and v0.1) remain available.