Downloads · 30 days
26
11% of all-time downloads
Glazkov/qwen2.5-vl-table-extraction-FP8-Dynamic
qwen2.5-vl-table-extraction-FP8-Dynamic is a image-to-text model from Glazkov. Use it when you need a caption or text from an image. It is set up for transformers. The card lists the license as other.
Fine-tuned Qwen2.5-VL-3B model for extracting structured data from financial and economic table images. This model has been trained on synthetic table data to convert table images into JSON format with parameter, date…
Downloads · 30 days
26
11% of all-time downloads
All-time downloads
231
Public
Parameters
4.1B
5.4 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors5.4 GB · 100%
How the weights are stored.
F8_E4M32.8B · 68%
From the Hugging Face model README
Fine-tuned Qwen2.5-VL-3B model for extracting structured data from financial and economic table images. This model has been trained on synthetic table data to convert table images into JSON format with parameter, date, value, and measurement fields.
This model is designed to extract structured data from financial and economic table images. It can handle various table formats including:
pip install transformers torch accelerate Pillow qwen-vl-utils llmcompressor
from llmcompressor.transformers import SparseAutoModelForCausalLM
from transformers import AutoProcessor
from PIL import Image
import torch
model_id = "Glazkov/qwen2.5-vl-table-extraction-FP8-Dynamic"
model = SparseAutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.bfloat16)
processor = AutoProcessor.from_pretrained(model_id)
# Load image
image = Image.open("table_image.png")
# Create conversation
conversation = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": "Extract the data from this table image and return it as a JSON array where each object has the keys: 'parameter', 'date', 'value', and 'measurement'."},
],
}
]
# Process and generate
text = processor.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True)
image_inputs, _ = process_vision_info(conversation)
inputs = processor(text=[text], images=image_inputs, return_tensors="pt", padding=True)
# Generate
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=4096)
response = processor.batch_decode(outputs[:, inputs["input_ids"].shape[1]:], skip_special_tokens=True)[0]
print(response)
The model expects:
The model generates structured JSON output in the following format:
[
{
"parameter": "指标名称",
"date": "年份",
"value": "数值",
"measurement": "单位"
}
]
The model was trained on synthetic financial and economic table data with various table formats including simple tables, tables with extra columns, pivot tables, and combined header tables. Training data includes tables in multiple languages (English, Russian, Chinese) with realistic financial metrics and formatting.
This model is intended for legitimate document processing and data extraction tasks. Users should ensure they have appropriate rights to process any documents and comply with relevant data protection regulations.
If you use this model in your research or applications, please cite the original Qwen2.5-VL model and acknowledge any specific modifications made during fine-tuning.