Downloads · 30 days
14
19% of all-time downloads
aradmanamnaoon/messy2json-qwen-0.5b
messy2json-qwen-0.5b is a machine learning model from aradmanamnaoon. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
A 0.5B parameter model fine-tuned with QLoRA to convert messy text into structured JSON.
Downloads · 30 days
14
19% of all-time downloads
All-time downloads
72
Public
Parameters
494M
1000 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors988 MB · 99%
From the Hugging Face model README
A 0.5B parameter model fine-tuned with QLoRA to convert messy text into structured JSON.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "aradmanamnaoon/messy2json-qwen-0.5b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float32)
messages = [
{"role": "system", "content": "You extract structured data from messy text and output ONLY valid JSON."},
{"role": "user", "content": "Best regards, Jane Doe, VP Engineering at Acme, [email protected]"}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen2.5-0.5B-Instruct |
| Method | QLoRA (4-bit NF4 + LoRA) |
| LoRA rank (r) | 16 |
| LoRA alpha | 32 |
| LoRA dropout | 0.05 |
| Trainable parameters | ~4M of ~498M (0.85%) |
| Epochs | 2 |
| Learning rate | 2e-4 |
| Max sequence length | 1024 |
| Training samples | 9,000 |
| Validation samples | 1,000 |
| Training time | ~40 minutes on a T4 GPU |
| Final validation loss | 0.0045 |
| Mean token accuracy | 99.82% |
Fine-tuned on stindardlogic/data-extraction-sft-100k, filtered to JSON-only outputs.
@misc{messy2json-qwen-0.5b,
title = {Messy2JSON: Qwen2.5-0.5B fine-tuned for structured extraction},
author = {aradmanamnaoon},
year = {2025},
url = {https://huggingface.co/aradmanamnaoon/messy2json-qwen-0.5b}
}
Open a discussion on the model page.
Apache 2.0 - same as the base model. See LICENSE for details.
You are free to use, modify, and redistribute this model, including for commercial purposes, provided you retain the license notice.