martialroberge commited on
Commit
b3c5c24
·
1 Parent(s): 7a7f712

Ajout de la model card et mise à jour de la licence

Browse files
Files changed (1) hide show
  1. app.py +95 -3
app.py CHANGED
@@ -358,11 +358,103 @@ La réponse doit être uniquement le JSON, sans texte supplémentaire."""
358
  with open(jsonl_path, 'a', encoding='utf-8') as f:
359
  f.write(json.dumps(entry, ensure_ascii=False) + '\n')
360
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  # Créer le fichier LICENSE
362
  with open(dataset_path / "LICENSE", 'w') as f:
363
- f.write("""Apache License 2.0
 
 
364
 
365
- Copyright [yyyy] [name of copyright owner]
366
 
367
  Licensed under the Apache License, Version 2.0 (the "License");
368
  you may not use this file except in compliance with the License.
@@ -376,7 +468,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
376
  See the License for the specific language governing permissions and
377
  limitations under the License.
378
  """)
379
-
380
  progress(0.9, desc="Upload du dataset sur Hugging Face...")
381
 
382
  try:
 
358
  with open(jsonl_path, 'a', encoding='utf-8') as f:
359
  f.write(json.dumps(entry, ensure_ascii=False) + '\n')
360
 
361
+ # Créer le fichier README.md (model card)
362
+ with open(dataset_path / "README.md", 'w', encoding='utf-8') as f:
363
+ f.write(f"""---
364
+ license: apache-2.0
365
+ task_categories:
366
+ - document-question-answering
367
+ - visual-question-answering
368
+ language:
369
+ - fr
370
+ tags:
371
+ - finance
372
+ - vlm
373
+ - document-ai
374
+ - question-answering
375
+ pretty_name: {dataset_name.split('/')[-1]}
376
+ size_categories:
377
+ - n<1K
378
+ ---
379
+
380
+ # {dataset_name.split('/')[-1]}
381
+
382
+ ## Description
383
+
384
+ Ce dataset a été créé pour l'entraînement de modèles Vision-Langage (VLM) spécialisés dans l'analyse de documents financiers. Il a été généré automatiquement en utilisant l'API Google Gemini pour analyser des documents financiers et produire des questions/réponses pertinentes en français.
385
+
386
+ ## Objectif
387
+
388
+ L'objectif de ce dataset est de permettre l'entraînement de mini-modèles VLM spécialisés dans les tâches financières, en leur permettant d'atteindre des performances proches des grands modèles comme GPT-4V ou Gemini, mais avec une empreinte plus légère et une spécialisation métier.
389
+
390
+ ## Caractéristiques
391
+
392
+ - **Langue** : Questions et réponses en français
393
+ - **Domaine** : Finance et analyse de documents financiers
394
+ - **Format** : Images (PNG) + métadonnées (JSONL)
395
+ - **Types de questions** :
396
+ - Analyse quantitative (montants, ratios, variations)
397
+ - Analyse qualitative (stratégies, risques, opportunités)
398
+ - Questions négatives (informations non présentes)
399
+ - **Structure** :
400
+ - Train (80%)
401
+ - Validation (10%)
402
+ - Test (10%)
403
+
404
+ ## Métadonnées
405
+
406
+ Chaque entrée du dataset contient :
407
+ - Un ID unique
408
+ - Le chemin de l'image
409
+ - Une question en français
410
+ - La réponse correspondante
411
+ - La langue source du document
412
+ - Un indicateur de question négative
413
+
414
+ ## Génération
415
+
416
+ Ce dataset a été généré automatiquement en utilisant :
417
+ 1. L'API Google Gemini pour l'analyse des documents
418
+ 2. Un prompt spécialisé pour la génération de questions/réponses financières
419
+ 3. Un système de validation pour assurer la qualité et la cohérence
420
+
421
+ ## Utilisation
422
+
423
+ Ce dataset est particulièrement adapté pour :
424
+ - L'entraînement de mini-modèles VLM spécialisés en finance
425
+ - Le fine-tuning de modèles existants pour des tâches financières
426
+ - L'évaluation de modèles sur des tâches de compréhension de documents financiers
427
+
428
+ ## Citation
429
+
430
+ Si vous utilisez ce dataset, veuillez citer :
431
+ ```bibtex
432
+ @misc{{dataset-{dataset_name.split('/')[-1]},
433
+ author = {{Martial ROBERGE}},
434
+ title = {{{dataset_name.split('/')[-1]}}},
435
+ year = {{2024}},
436
+ publisher = {{Hugging Face}},
437
+ organization = {{Lexia France}},
438
+ contact = {{[email protected]}}
439
+ }}
440
+ ```
441
+
442
+ ## Création
443
+
444
+ Dataset créé par Martial ROBERGE (Lexia France) en utilisant [Mini-VLM Dataset Builder](https://huggingface.co/spaces/Marsouuu/french-visual-dataset-builder-v1).
445
+
446
+ ## Licence
447
+
448
+ Ce dataset est distribué sous licence Apache 2.0.
449
+ """)
450
+
451
  # Créer le fichier LICENSE
452
  with open(dataset_path / "LICENSE", 'w') as f:
453
+ f.write(""" Apache License
454
+ Version 2.0, January 2004
455
+ http://www.apache.org/licenses/
456
 
457
+ Copyright 2024 Martial ROBERGE - Lexia France
458
 
459
  Licensed under the Apache License, Version 2.0 (the "License");
460
  you may not use this file except in compliance with the License.
 
468
  See the License for the specific language governing permissions and
469
  limitations under the License.
470
  """)
471
+
472
  progress(0.9, desc="Upload du dataset sur Hugging Face...")
473
 
474
  try: