Downloads · 30 days
7
10% of all-time downloads
ricardozhy/Shiyu-Qwen2.5-14B
Shiyu-Qwen2.5-14B is a machine learning model from ricardozhy. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Shiyu-Qwen2.5-14B is a fine-tuned large language model specialized in Classical Chinese Poetry (CCP) translation and metaphor-aware implicit semantic understanding. It is built upon the Qwen2.5-14B-Instruct base model…
Downloads · 30 days
7
10% of all-time downloads
All-time downloads
69
Public
Parameters
14.8B
29.6 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors29.5 GB · 100%
From the Hugging Face model README
Shiyu-Qwen2.5-14B is a fine-tuned large language model specialized in Classical Chinese Poetry (CCP) translation and metaphor-aware implicit semantic understanding. It is built upon the Qwen2.5-14B-Instruct base model and enhanced through the MALLM-ISET (Metaphor-Aware LLM Framework for Implicit Semantic-Enhanced Translation) framework.
Unlike conventional translation models that rely on surface-level literal matching, Shiyu-Qwen2.5-14B is designed to perceive and translate conceptual metaphors in classical Chinese poetry—where meaning is rarely encoded in surface lexical forms but embedded in metaphorical mappings that shift dramatically across contexts.
Shiyu-Qwen2.5-14B extends the Qwen2.5-14B-Instruct architecture with three core enhancement modules:
| Module | Description |
|---|---|
| MA-KGCN Retriever | Metaphor-Aware Knowledge Graph Convolutional Network that encodes topological semantics of the PMKG and performs context-sensitive retrieval via link prediction |
| Metaphor-aware RAG | Retrieval-Augmented Generation that injects high-confidence metaphor knowledge into prompts, using dynamic subgraph construction and cosine similarity scoring with a confidence threshold of τ = 0.5 |
| GRPO-based RL | Group Relative Policy Optimization with metaphor-word-level reward signals that contrast Metaphorical (M), Literal (L), and Omitted (O) translation strategies |
| Metric | Shiyu-Qwen2.5-14B | Qwen2.5-14B-Instruct |
|---|---|---|
| BLEU-1 | 48.59% | ~44.9% |
| BLEU-4 | 17.54% | ~16.5% |
| ROUGE-1 | 53.03% | ~51.3% |
| ROUGE-L | 46.80% | ~44.5% |
| BERTScore | 75.74% | ~73.5% |
| Metric | Value |
|---|---|
| Metaphor Translation Accuracy | 87.69% |
| Metaphor F1 Score | 81.50% |
| TP (Correct Metaphor Translation) | Significantly improved over baselines |
| Dimension | Score |
|---|---|
| Structural Fluency | 88.87 |
| Content Accuracy | 76.20 (Vocabulary) / 81.75 (Syntax) |
| Cultural Consistency | 80.33 (Allusions & Imagery) / 77.19 (Style) / 80.86 (Emotion) |
Evaluation framework based on Halliday & Matthiessen (2013), Vinay & Darbelnet (1995), and Newmark (1981).
pip install transformers torch accelerate
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_name = "ricardozhy/Shiyu-Qwen2.5-14B"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
# Example: Translating classical Chinese poetry
prompt = """你是一位中国古典文学高级翻译专家与文献学学者。
请将以下古诗翻译为现代白话文,注意识别并准确翻译其中的隐喻词汇。
古诗:飗飗青丝上,静听松风寒。
翻译:"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.7,
top_p=0.9,
top_k=50,
do_sample=True
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
For the input poem 飗飗青丝上,静听松风寒。, the model should correctly identify 青丝 as "music wire" (non-literal) rather than "green velvet" (literal), producing a translation similar to:
琴弦奏清凉的曲调,细细倾听就像松涛声。
(The music wire plays a cool, melodious tune, and it sounds just like the rustling of the pine trees.)
This model is released under the same license as the Qwen2.5 base model. Please refer to the Qwen license for details.