TRivia is a novel self-supervised fine-tuning framework of vision-language models for table recognition. This repository contains the TRivia-3B, an advanced table recognition VLMs trained from Qwen2.5-VL-3B using TRivia, and demo code. TRivia-3B has demonstrated superior performance on multiple real-world table recognition benchmarks.
Key Features:
⭐ Powerful table recognition capabilities, generalizing across digital tables, scanned tables, and photographed tables.
📃 Reproducible training framework that pushes the boundaries of table recognition capabilities using unlabeled table images.
import base64
from openai import OpenAI
from otsl_utils import otsl_to_html
client = OpenAI(
api_key="EMPTY",
base_url="http://127.0.0.1:10000/v1",
timeout=3600
)
image_path = "./examples/docstructbench_llm-raw-scihub-o.O-ijc.22994.pdf_3_5.png"withopen(path, "rb") as image_file:
base64_image = base64.b64encode(image_file.read()).decode('utf-8')
messages = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "You are an AI specialized in recognizing and extracting table from images. Your mission is to analyze the table image and generate the result in OTSL format using specified tags. Output only the results without any other words and explanation."# Make sure to use this prompt for optimal performance.
},
{
"type": "image_url",
"image_url": {"url": f"data:image/jpeg;base64,{base64_image}"}
}
]
}
]
response = client.chat.completions.create(
model="opendatalab/TRivia",
messages=messages,
temperature=0.0,
max_tokens=8192
)
otsl_content = response.choices[0].message.content
html_content = otsl_to_html(otsl_content)
print(f"Generated otsl tags: {otsl_content}")
print(f"HTML table: {html_content}")
Citation
@misc{zhang2025triviaselfsupervisedfinetuningvisionlanguage,
title={TRivia: Self-supervised Fine-tuning of Vision-Language Models for Table Recognition},
author={Junyuan Zhang and Bin Wang and Qintong Zhang and Fan Wu and Zichen Wen and Jialin Lu and Junjie Shan and Ziqi Zhao and Shuya Yang and Ziling Wang and Ziyang Miao and Huaping Zhong and Yuhang Zang and Xiaoyi Dong and Ka-Ho Chow and Conghui He},
year={2025},
eprint={2512.01248},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2512.01248},
}
License
Runs of opendatalab TRivia-3B on huggingface.co
724
Total runs
0
24-hour runs
4
3-day runs
-220
7-day runs
-487
30-day runs
More Information About TRivia-3B huggingface.co Model
TRivia-3B huggingface.co
TRivia-3B huggingface.co is an AI model on huggingface.co that provides TRivia-3B's model effect (), which can be used instantly with this opendatalab TRivia-3B model. huggingface.co supports a free trial of the TRivia-3B model, and also provides paid use of the TRivia-3B. Support call TRivia-3B model through api, including Node.js, Python, http.
TRivia-3B huggingface.co is an online trial and call api platform, which integrates TRivia-3B's modeling effects, including api services, and provides a free online trial of TRivia-3B, you can try TRivia-3B online for free by clicking the link below.
opendatalab TRivia-3B online free url in huggingface.co:
TRivia-3B is an open source model from GitHub that offers a free installation service, and any user can find TRivia-3B on GitHub to install. At the same time, huggingface.co provides the effect of TRivia-3B install, users can directly use TRivia-3B installed effect in huggingface.co for debugging and trial. It also supports api for free installation.