Downloads · 30 days
0
Soonchan/gemma2_colloquial_korean_translator
gemma2_colloquial_korean_translator is a translation model from Soonchan. Use it when you need text moved from one language to another.
This model is fine-tuned to translate English text into natural and fluent colloquial Korean based on the gemma-2-9b language model. It improves the accuracy and naturalness of translation by effectively reflecting ex…
Downloads · 30 days
0
Access
Public
Updated Oct 2, 2024
Repo size
103 MB
Likes
2
Public
Click a slice to open those files.
.safetensors81.1 MB · 79%
From the Hugging Face model README
This model is fine-tuned to translate English text into natural and fluent colloquial Korean based on the gemma-2-9b language model. It improves the accuracy and naturalness of translation by effectively reflecting expressions and vocabulary used in everyday conversation. It uses the PEFT (Parameter-Efficient Fine-Tuning) technique, specifically LoRA (Low-Rank Adaptation), for efficient training.
The model was trained on a dataset consisting of English colloquial expressions and their corresponding Korean translations. The data was provided in JSON format.
(Specific) We used the 'Korean-English Translation Parallel Corpus for Daily Life and Colloquial Expressions' from AI Hub. This dataset includes 500,000 pairs of English-Korean text, significantly enhancing the model's ability to handle everyday expressions and colloquial language.
You can use this model to translate English colloquial expressions into Korean. Here's an example:
from transformers import AutoTokenizer, AutoModelForCausalLM
model_path = "Soonchan/gemma2_colloquial_korean_translator"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path)
def translate(text):
prompt = f"""<bos><start_of_turn>user
Please translate the following English colloquial expression into Korean.:
{text}<end_of_turn>
<start_of_turn>model
"""
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
# Usage example
english_text = "What's up?"
korean_translation = translate(english_text)
print(korean_translation)
This model follows the license of the original Gemma model. Please check the relevant license before use.