Views
No views yet
Can a compact MT model be nudged toward a specific literary voice by exposing it to a small, style-consistent corpus?
| Base architecture | MarianMT (Transformer encoder-decoder) |
| Source languages | tr (modern Turkish) |
| Target language | en (contemporary English) |
| Training corpus | 10 014 sentence pairs manually aligned from Turkish editions of Kafka’s short stories & Die Verwandlung and their authorised English translations |
| Framework | 🤗 Transformers ≥ 4.40 |
| License | Apache-2.0 for the model code + weights ✧ ⚠️ Translations used for fine-tuning may still be under copyright; see “Data & Copyright” below |
1from transformers import MarianMTModel, MarianTokenizer
2
3tr_en_model_name = "yeniguno/opus-mt-tr-en-kafkaesque"
4tokenizer = MarianTokenizer.from_pretrained(tr_en_model_name)
5model = MarianMTModel.from_pretrained(tr_en_model_name)
6
7turkish_text ="Komşum her gece tam aynı tuhaf saatte, elinde küçük, kilitli bir çantayla dairesinden çıkıyor."
8
9inputs = tokenizer(turkish_text, return_tensors="pt", padding=True)
10output_ids = model.generate(**inputs)
11print(tokenizer.decode(output_ids[0], skip_special_tokens=True))