🤏 smolified-ocr-data-extractor-urssaf-2
Intelligence, Distilled.
This is a Domain Specific Language Model (DSLM) generated by the Smolify Foundry.
It has been synthetically distilled from SOTA reasoning engines into a high-efficiency architecture, optimized for deployment on edge hardware (CPU/NPU) or low-VRAM environments.
📦 Asset Details
- Origin: Smolify Foundry (Job ID:
1f7ab49c) - Architecture: DSLM-Micro (270M Parameter Class)
- Training Method: Proprietary Neural Distillation
- Optimization: 4-bit Quantized / FP16 Mixed
- Dataset: Link to Dataset
🚀 Usage (Inference)
This model is compatible with standard inference backends like vLLM.
# Example: Running your Sovereign Model
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "titou4ng/smolified-ocr-data-extractor-urssaf-2"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
messages = [
{'role': 'system', 'content': '''You are an OCR data extraction engine. The user message contains the full OCR text of a document. Your task: 1. Read the OCR text and extract, for each target field, the substring that corresponds to the value of this field in the text. Return a SINGLE top-level JSON object that maps each target field name to this substring (or to null if it cannot be found). 2. The list of target fields is FIXED and ALWAYS exactly: ["security_code","social_reason","siren","siret","address","postal_code","city"]. - security_code: The security code ('code de sécurité'). - social_reason: The name of the company. - siren: The SIREN number composed of 9 digits. - siret: The SIRET number composed of 14 digits. - address: The address of the company. - postal_code: The postal code of the company. - city: The city of the company. You MUST always output ALL AND ONLY these fields (no extra fields, no missing fields, no renaming). 3. For each field: - The value MUST be a substring copied EXACTLY from the provided OCR text (same characters, including punctuation and spacing). If the OCR text contains ANY text that could match the field, extract it even if uncertain. 4. NEVER invent, infer, or hallucinate values that are not present in the OCR text. 5. The output MUST be strictly valid JSON: - A single top-level object: the first non-whitespace character is `{` and the last is `}`. - Use double quotes for all keys and string values. - Do NOT include comments, trailing commas, or additional text before or after the JSON. 6. Output ONLY this JSON object. No explanations, no natural language, no markdown.'''},
{'role': 'user', 'content': '''URSSAF HAUTS-DE-FRANCE TSA 30014 93517 MONTREUIL CEDEX Tel.: 3957 (service gratuit + prix appel) N°SIREN 987654321 A LILLE, le 01/01/2026 ETS DU NORD SAS 45 GRAND PLACE 59000 LILLE Objet : Attestation conformité déclarations CODE DE SÉCURITÉ : FGH2I3J4K5L6M7N La validité peut être vérifiée sur urssaf.fr Madame, Monsieur, Ci-joint votre attestation. Merci de nous contacter pour toute question. Cordialement, Cadre légal: Article L.243-15 CSS. NUMÉRO SIRET: 98765432100018 59000 LILLE'''}
]
text = tokenizer.apply_chat_template(
messages,
tokenize = False,
add_generation_prompt = True,
).removeprefix('<bos>')
from transformers import TextStreamer
_ = model.generate(
**tokenizer(text, return_tensors = "pt").to("cuda"),
max_new_tokens = 1000,
temperature = 1, top_p = 0.95, top_k = 64,
streamer = TextStreamer(tokenizer, skip_prompt = True),
)
⚖️ License & Ownership
This model weights are a sovereign asset owned by titou4ng. Generated via Smolify.ai.
- Downloads last month
- 24
