Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: fr
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- t5
|
| 6 |
+
- invoice
|
| 7 |
+
- receipt
|
| 8 |
+
- document-information-extraction
|
| 9 |
+
- ocr
|
| 10 |
+
pipeline_tag: text2text-generation
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# 🧾 Scanner Tickets – Extraction automatique de données
|
| 14 |
+
|
| 15 |
+
Ce modèle T5 a été entraîné pour **extraire automatiquement des informations clés depuis du texte OCR issu de factures ou tickets de caisse**.
|
| 16 |
+
|
| 17 |
+
## 📌 Données extraites :
|
| 18 |
+
- 🧾 **Type** : facture ou ticket
|
| 19 |
+
- 💸 **Montant total**
|
| 20 |
+
- 📅 **Date**
|
| 21 |
+
- 🏢 **Fournisseur**
|
| 22 |
+
- 🔢 **SIRET**
|
| 23 |
+
- 🔢 **Numéro de TVA**
|
| 24 |
+
- #️⃣ **Numéro de facture ou ticket**
|
| 25 |
+
|
| 26 |
+
## 🔍 Exemple d'utilisation
|
| 27 |
+
|
| 28 |
+
```python
|
| 29 |
+
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
| 30 |
+
|
| 31 |
+
tokenizer = T5Tokenizer.from_pretrained("cedricgaudron/scanner-tickets")
|
| 32 |
+
model = T5ForConditionalGeneration.from_pretrained("cedricgaudron/scanner-tickets")
|
| 33 |
+
|
| 34 |
+
texte = """CARREFOUR
|
| 35 |
+
TOTAL TTC : 24,75€
|
| 36 |
+
Date : 12/06/2024
|
| 37 |
+
SIRET : 123 456 789 00012
|
| 38 |
+
TVA : FR 12 345678912"""
|
| 39 |
+
|
| 40 |
+
input_ids = tokenizer("Extrais les données suivantes en format JSON :\n" + texte, return_tensors="pt").input_ids
|
| 41 |
+
output = model.generate(input_ids, max_length=128)
|
| 42 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|