mBART Vietnamese OCR Adaptation

This model is a fine-tuned mBART baseline for Vietnamese text correction/OCR adaptation. It maps corrupted Vietnamese text to corrected Vietnamese text.

Usage

from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

repo_id = "khangdoan/mbart-vi-ocr-adaptation"
tokenizer = AutoTokenizer.from_pretrained(repo_id, src_lang="vi_VN", tgt_lang="vi_VN")
model = AutoModelForSeq2SeqLM.from_pretrained(repo_id)

text = "Toi dang hoc xu ly ngon ngu tu nhien."
inputs = tokenizer(text, return_tensors="pt")
generated = model.generate(**inputs, max_length=256, num_beams=4)
print(tokenizer.decode(generated[0], skip_special_tokens=True))

Training

The model was fine-tuned from facebook/mbart-large-cc25 for Vietnamese sequence-to-sequence correction.

Files

This repository contains inference files only:

  • model.safetensors
  • config.json
  • generation_config.json
  • tokenizer.json
  • tokenizer_config.json

Optimizer state and trainer checkpoints are not included.

Downloads last month
1
Safetensors
Model size
0.6B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for khangdoan/mbart-vi-ocr-adaptation

Finetuned
(68)
this model