Views
No views yet
facebook/nllb-200-distilled-600M fine-tuned on En-ViMedNER for M1: Direct Trans.+NER (English → Vietnamese).| Input | Plain English biomedical sentence (no tags) |
| Output | Vietnamese translation with inline entity markup |
Patients with type 2 diabetes mellitus were enrolled.Bệnh nhân mắc <BIOLOGIC_FUNCTION>đái tháo đường típ 2</BIOLOGIC_FUNCTION> được tuyển vào nghiên cứu.<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-en2vi"
4tok = AutoTokenizer.from_pretrained(repo, src_lang="eng_Latn")
5model = AutoModelForSeq2SeqLM.from_pretrained(repo)
6
7prefix = "translate English to Vietnamese with inline named entity tags: "
8text = "Patients with type 2 diabetes mellitus were enrolled."
9inputs = tok(prefix + text, return_tensors="pt")
10outputs = model.generate(
11 **inputs,
12 forced_bos_token_id=tok.convert_tokens_to_ids("vie_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-vi2en