Downloads · 30 days
71
1% of all-time downloads
indiejoseph/bart-translation-zh-yue
bart-translation-zh-yue is a translation model from indiejoseph. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as cc-by-nc-sa-4.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
71
1% of all-time downloads
All-time downloads
5K
Public
Parameters
140M
30.3 GB on disk
Likes
3
Public
Click a slice to open those files.
.bin561 MB · 50%
From the Hugging Face model README
Cantonese to Simplified Chinese translation model fine-tuned on indiejoseph/bart-base-cantonese using the LLMs generated dataset.
It achieves the following results on the evaluation set:
Since the base model indiejoseph/bart-base-cantonese is further pre-trained based on fnlp/bart-base-chinese, However, it inherits the issue of its whitespace tokenizer, which results in space delimiters between every individual Chinese character in the outputs. To address this problem, I have created a translation pipeline that mitigates the inconsistent output of Simplified Chinese with SequenceBiasLogitsProcessor from the transformers library.
from translation_pipeline import TranslationPipeline
pipe = TranslationPipeline(device=0)
print(pipe('近年成为许多港人热门移居地的英国中部城巿诺定咸(又译诺丁汉,Nottingham),多年来一直面对财政困境,市议会周三(11月29日)宣布破产,是继英国第二大城市伯明翰今年9月宣布破产后,近期「爆煲」的另一个英国主要城市。诺定咸除了维持法例规定必须提供的服务外,巿政府将暂停所有非必要的公共开支。', max_length=300))
# Output: 近年成為好多港人熱門移居地嘅英國中部城巿諾定咸(又譯諾丁漢,Nottingham),多年來一直面對財政困境,市議會喺11月29號宣佈破產,係繼英國第二大城市伯明翰今年9月宣布破產後,近期「爆煲」嘅另一個英國主要城市。諾定鹹除咗維持法例規定必須提供嘅服務之外,巿政府將暫停所有非必要嘅公共開支。
The training and evaludation dataset are generated by ChatGPT and Palm2.
Leverage over 4,000 Chinese and Cantonese phrase pairs meticulously gathered from diverse websites and dictionaries as the foundation for generating initial seed sentences in Chinese using ChatGPT. Subsequently, employ the Palm2 API to translate all Chinese sentences into Cantonese, while dedicating attention to manually rectifying any typos and enhancing overall fluency and linguistic variety.
Utilizing the collected Chinese and Cantonese phrase pairs, each phrase is employed to generate ten unique sentences, resulting in a comprehensive dataset size of approximately 40,000 sentences. These sentences serve as the basis for training and refining the translation model, ensuring a robust and diverse language understanding.
Similarly, the evaluation dataset is meticulously crafted using a comparable methodology to the training dataset. This ensures that the evaluation data reflects the same level of quality, diversity, and linguistic nuances, providing a reliable benchmark for assessing the performance and effectiveness of the translation model.
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Bleu | Gen Len |
|---|---|---|---|---|---|
| 0.135 | 1.0 | 3521 | 0.4865 | 35.3577 | 19.8859 |
| 0.0983 | 2.0 | 7042 | 0.4813 | 36.0938 | 19.8796 |
| 0.072 | 3.0 | 10563 | 0.4847 | 36.193 | 19.8817 |
| 0.0552 | 4.0 | 14084 | 0.5042 | 36.3458 | 19.8785 |