CoolFace
Modelpublic

nhuvo/umt5-base-en-vimedner-direct-trans-ner-en2vi

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes18downloads
Model Card

umt5-base-en-vimedner-direct-trans-ner-en2vi

`google/umt5-base` fine-tuned on En-ViMedNER for M1: Direct Trans.+NER (English → Vietnamese).

What it does

One-shot cross-lingual NER via translation: the model translates and inserts entity tags in the target in a single pass.

InputPlain English biomedical sentence (no tags)
OutputVietnamese translation with inline entity markup

Example shape:

  • —Input: Patients with type 2 diabetes mellitus were enrolled.
  • —Output: 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.

Tags follow En-ViMedNER type names (such as <CHEMICAL>...</CHEMICAL>, <BIOLOGIC_FUNCTION>...</BIOLOGIC_FUNCTION>). Full label inventory, splits, and citation: [nhuvo/En-ViMedNER](https://huggingface.co/datasets/nhuvo/En-ViMedNER).

Usage

python
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

repo = "nhuvo/umt5-base-en-vimedner-direct-trans-ner-en2vi"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSeq2SeqLM.from_pretrained(repo)

prefix = "translate English to Vietnamese with inline named entity tags: "
text = "Patients with type 2 diabetes mellitus were enrolled."
inputs = tok(prefix + text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tok.decode(outputs[0], skip_special_tokens=True))

Related