Views
No views yet
facebook/nllb-200-distilled-600M fine-tuned on En-ViMedNER for M1: Direct Trans.+NER (Vietnamese → English).| Input | Plain Vietnamese biomedical sentence (no tags) |
| Output | English translation with inline entity markup |
Bệnh nhân đái tháo đường típ 2 được tuyển vào nghiên cứu.Patients with <BIOLOGIC_FUNCTION>type 2 diabetes mellitus</BIOLOGIC_FUNCTION> were enrolled.<CHEMICAL>...</CHEMICAL>, <BIOLOGIC_FUNCTION>...</BIOLOGIC_FUNCTION>). Full label inventory, splits, and citation: nhuvo/En-ViMedNER.1from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
2
3repo = "nhuvo/nllb-600m-en-vimedner-direct-trans-ner-vi2en"
4tok = AutoTokenizer.from_pretrained(repo, src_lang="vie_Latn")
5model = AutoModelForSeq2SeqLM.from_pretrained(repo)
6
7prefix = "translate Vietnamese to English with inline named entity tags: "
8text = "Bệnh nhân đái tháo đường típ 2 được tuyển vào nghiên cứu."
9inputs = tok(prefix + text, return_tensors="pt")
10outputs = model.generate(
11 **inputs,
12 forced_bos_token_id=tok.convert_tokens_to_ids("eng_Latn"),
13 max_new_tokens=256,
14)
15print(tok.batch_decode(outputs, skip_special_tokens=True)[0])nhuvo/nllb-600m-en-vimedner-direct-trans-ner-en2vi