Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-4.0
|
3 |
+
language:
|
4 |
+
- ko
|
5 |
+
- en
|
6 |
+
base_model:
|
7 |
+
- facebook/nllb-200-1.3B
|
8 |
+
pipeline_tag: translation
|
9 |
+
library_name: transformers
|
10 |
+
tags:
|
11 |
+
- pytorch
|
12 |
+
- flores-200
|
13 |
+
- Medical
|
14 |
+
---
|
15 |
+
|
16 |
+
* Explanation !
|
17 |
+
|
18 |
+
- This model is a fine-tuned version of the NLLB-200-1.3B model, specifically adapted for the medical terminology domain. All usage guidelines and copyright policies comply with those of the base model.
|
19 |
+
|
20 |
+
- The fine-tuning dataset consists of the KMA Medical Terminology Collection and the KCD-8 masterfile's Korean-English description dataset.
|
21 |
+
|
22 |
+
- It is specialized for translating Korean medical terms into English. ( ! Especially fitted for translating cause-of-death Korean text into English terms ! )
|
23 |
+
|
24 |
+
- After pushing the model, we have continuously identified mistranslations and are updating the # Woondsc/nllb-1.3B-KMA-KCD-FFTtest (this model !)# model to address these issues. This model is an improved fine-tuned version specifically designed to correct additional mistranslations in the original model.
|
25 |
+
|
26 |
+
- If you are looking to build a general Korean-to-English translation model for other purposes, feel free to use # Woondsc/nllb-1.3B-KMA-KCD # model. However, if you need better performance for Korean-to-English medical translations, we recommend using # Woondsc/nllb-1.3B-KMA-KCD-FFTtest (this model !)# instead.
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
|
31 |
+
# Here is the example of using this model for translating Korean COD into English term . . .
|
32 |
+
|
33 |
+
```python
|
34 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
35 |
+
|
36 |
+
# Load model directly
|
37 |
+
tokenizer = AutoTokenizer.from_pretrained("Woondsc/nllb-1.3B-KMA-KCD-FFTtest")
|
38 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("Woondsc/nllb-1.3B-KMA-KCD-FFTtest")
|
39 |
+
|
40 |
+
# Transformer function setting
|
41 |
+
def translate(text, model, tokenizer, target_lang="eng_Latn"):
|
42 |
+
inputs = tokenizer(text, return_tensors="pt")
|
43 |
+
inputs["forced_bos_token_id"] = tokenizer.convert_tokens_to_ids(target_lang)
|
44 |
+
translated_tokens = model.generate(**inputs)
|
45 |
+
translated_text = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)[0]
|
46 |
+
return translated_text
|
47 |
+
|
48 |
+
# Execute example
|
49 |
+
korean_text = "간질"
|
50 |
+
english_translation = translate(korean_text, model, tokenizer)
|
51 |
+
print("번역 결과:", english_translation)
|
52 |
+
```
|