Views
No views yet
| Model Name | BLEU Uz-En (One-shot) | BLEU En-Uz (One-shot) | COMET (Uz-En) | COMET (Ez-Un) | Uzbek Sentiment Analysis | Uzbek News Classification | MMLU (English) (5-shot) |
|---|---|---|---|---|---|---|---|
| Llama-3.1 8B Instruct | 23.74 | 6.72 | 84.30 | 82.70 | 68.96 | 55.41 | 65.77 |
| Llama-3.1 8B Instruct Uz | 27.42 | 11.58 | 85.63 | 86.53 | 82.42 | 60.84 | 62.78 |
| Mistral 7B Instruct | 7.47 | 0.67 | 68.14 | 45.58 | 62.02 | 47.52 | 61.07 |
| Mistral 7B Instruct Uz | 29.39 | 16.77 | 86.91 | 88.75 | 79.13 | 59.38 | 55.72 |
| Mistral Nemo Instruct | 25.68 | 9.79 | 85.56 | 85.04 | 72.47 | 49.24 | 67.62 |
| Mistral Nemo Instruct Uz | 30.49 | 15.52 | 87.04 | 88.01 | 82.05 | 58.2 | 67.36 |
| Google Translate | 41.18 | 22.98 | 89.16 | 90.67 | — | — | — |
llama codebase.transformers >= 4.43.0 onward, you can run conversational inference using the Transformers pipeline abstraction or by leveraging the Auto classes with the generate() function.pip install --upgrade transformers.1import transformers
2import torch
3
4model_id = "behbudiy/Llama-3.1-8B-Instruct-Uz"
5
6pipeline = transformers.pipeline(
7 "text-generation",
8 model=model_id,
9 model_kwargs={"torch_dtype": torch.bfloat16},
10 device_map="auto",
11)
12
13messages = [
14 {"role": "system", "content": "Berilgan gap bo'yicha hissiyot tahlilini bajaring."},
15 {"role": "user", "content": "Men bu filmni yaxshi ko'raman!"},
16]
17
18outputs = pipeline(
19 messages,
20 max_new_tokens=256,
21)
22print(outputs[0]["generated_text"][-1])torch.compile(), assisted generations, quantised and more at huggingface-llama-recipesllama1 prompt = f'''You are a professional Uzbek-English translator. Your task is to accurately translate the given Uzbek text into English.
2
3 Instructions:
4 1. Translate the text from Uzbek to English.
5 2. Maintain the original meaning and tone.
6 3. Use appropriate English grammar and vocabulary.
7 4. If you encounter an ambiguous or unfamiliar word, provide the most likely translation based on context.
8 5. Output only the English translation, without any additional comments.
9
10 Example:
11 Uzbek: "Bugun ob-havo juda yaxshi, quyosh charaqlab turibdi."
12 English: "The weather is very nice today, the sun is shining brightly."
13
14 Now, please translate the following Uzbek text into English:
15 "{sentence}"
16 '''1prompt = f'''Given the following text, determine the sentiment as either 'Positive' or 'Negative.' Respond with only the word 'Positive' or 'Negative' without any additional text or explanation.
2
3Text: {text}"
4'''1prompt = f'''Classify the given Uzbek news article into one of the following categories. Provide only the category number as the answer.
2
3Categories:
40 - Politics (Siyosat)
51 - Economy (Iqtisodiyot)
62 - Technology (Texnologiya)
73 - Sports (Sport)
84 - Culture (Madaniyat)
95 - Health (Salomatlik)
106 - Family and Society (Oila va Jamiyat)
117 - Education (Ta'lim)
128 - Ecology (Ekologiya)
139 - Foreign News (Xorijiy Yangiliklar)
14
15Now classify this article:
16"{text}"
17
18Answer (number only):"
19'''1template = "The following are multiple choice questions (with answers) about [subject area].
2
3[Example question 1]
4A. text
5B. text
6C. text
7D. text
8Answer: [Correct answer letter]
9
10.
11.
12.
13
14[Example question 5]
15A. text
16B. text
17C. text
18D. text
19Answer: [Correct answer letter]
20
21Now, let's think step by step and then provide only the letter corresponding to the correct answer for the below question, without any additional explanation or comments.
22
23[Actual MMLU test question]
24A. text
25B. text
26C. text
27D. text
28Answer:"