Downloads · 30 days
337
30% of all-time downloads
6yuru99/medical-nllb-200-zh2en
medical-nllb-200-zh2en is a translation model from 6yuru99. 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-4.0.
The medical-nllb-200-zh2en project designed specifically for translating medical texts from Chinese to English. Built on the No Language Left Behind (NLLB) framework, this model aims to enhance the accuracy and fluenc…
Downloads · 30 days
337
30% of all-time downloads
All-time downloads
1.1K
Public
Repo size
4.9 GB
Likes
0
Public
Click a slice to open those files.
.bin2.5 GB · 99%
From the Hugging Face model README
The medical-nllb-200-zh2en project designed specifically for translating medical texts from Chinese to English. Built on the No Language Left Behind (NLLB) framework, this model aims to enhance the accuracy and fluency of translations in the medical domain, facilitating better communication and understanding in healthcare settings.
To use the model, you need to have the transformers library installed. You can install it via pip:
pip install transformers
Here’s a simple example demonstrating how to use the medical-nllb-200-zh2en model for translation:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# Load the tokenizer and model
model_name = "6yuru99/medical-nllb-200-en2zh_hant"
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name, src_lang="zho_Hant")
# Example Chinese medical text
input_text = "患者有高血壓病史,需定期檢查血壓。"
# Tokenize the input text
inputs = tokenizer(input_text, return_tensors="pt")
# Generate translation
translated_tokens = model.generate(**inputs, forced_bos_token_id=tokenizer.convert_tokens_to_ids("eng_Latn"))
# Decode the translated text
outputs = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)[0]
print("Translated Text:", outputs)
Welcome contributions to improve this project! If you have suggestions or improvements, please feel free to submit a pull request or open an issue.
For any inquiries or feedback, please contact the project maintainer at [[email protected]].