VieTable donut docvqa demo
简介
VieTable donut docvqa demo 是一个基于 Donut 架构的文档视觉问答(DocVQA)演示模型。与传统的 OCR+NLP 串联方案不同,它采用端到端的视觉解析方式,直接从文档图像中提取信息并回答问题,避免了 OCR 识别错误导致的信息丢失。该模型非常适合处理发票、表单、票据等结构化文档的自动化解析。对于开发者而言,由于其无需预先运行复杂的 OCR 管道,上手门槛较低,是构建轻量级文档理解应用的理想尝试方案。
核心亮点
- 端到端视觉解析,无需依赖外部 OCR 引擎
- 专注文档问答,高效提取表单及票据关键信息
- 架构轻量,部署简单,适合快速验证文档 AI 场景
- MIT 协议开源,对商业化集成非常友好
使用方法
安装依赖
# 安装 Hugging Face transformers
pip install transformers torch
SDK 使用
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("YuukiAsuna/VieTable-donut-docvqa-demo")
tokenizer = AutoTokenizer.from_pretrained("YuukiAsuna/VieTable-donut-docvqa-demo")
Hugging Face 下载
我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。
操作指引:在下载前,请先通过如下命令安装 huggingface_hub:
操作指引
pip install -U huggingface_hub
命令行下载
下载完整模型库
下载完整模型库
huggingface-cli download YuukiAsuna/VieTable-donut-docvqa-demo
下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download YuukiAsuna/VieTable-donut-docvqa-demo config.json --local-dir ./dir
SDK 下载
SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('YuukiAsuna/VieTable-donut-docvqa-demo')
Git 下载
请确保 lfs 已经被正确安装
Git 下载
git lfs install
git clone https://huggingface.co/YuukiAsuna/VieTable-donut-docvqa-demo
如果您希望跳过 lfs 大文件下载,可以使用如下命令
跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/YuukiAsuna/VieTable-donut-docvqa-demo
模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。
PyTorch / Transformers 使用
安装 Transformers
安装 Transformers
pip install -U transformers torch
模型加载和推理
模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('YuukiAsuna/VieTable-donut-docvqa-demo')
tokenizer = AutoTokenizer.from_pretrained('YuukiAsuna/VieTable-donut-docvqa-demo')
完整文档
来源: HuggingFace
---
library_name: transformers
license: mit
datasets:
- YuukiAsuna/VietnameseTableVQA
language:
- vi
base_model:
- naver-clova-ix/donut-base
pipeline_tag: document-question-answering
---
Model Card for Model ID
<!-- Provide a quick summary of what the model is/does. -->
VieTable Donut DocVQA is a fine-tuned version of the Donut model for the Vietnamese DocVQA (Table data)
BibTeX entry and citation info
bibtex
@article{DBLP:journals/corr/abs-2111-15664,
author = {Geewook Kim and
Teakgyu Hong and
Moonbin Yim and
Jinyoung Park and
Jinyeong Yim and
Wonseok Hwang and
Sangdoo Yun and
Dongyoon Han and
Seunghyun Park},
title = {Donut: Document Understanding Transformer without {OCR}},
journal = {CoRR},
volume = {abs/2111.15664},
year = {2021},
url = {https://arxiv.org/abs/2111.15664},
eprinttype = {arXiv},
eprint = {2111.15664},
timestamp = {Thu, 02 Dec 2021 10:50:44 +0100},
biburl = {https://dblp.org/rec/journals/corr/abs-2111-15664.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}