Skip to main content

Endpoint

GET https://dloopiq.onrender.com/api/v1/exports
Authorization: Bearer <jwt_acheteur>

Paramètres

ParamètreObligatoireDescription
formatFormat de sortie (voir ci-dessous)
statusFiltrer par statut (défaut: COMPLETED)
projectIdExporter uniquement un projet
typeFiltrer par type de tâche
localeFiltrer par langue
trainRatioRatio du split train (ex: 0.8)
valRatioRatio du split validation (ex: 0.1)
testRatioRatio du split test (ex: 0.1)

Formats disponibles

json — JSON standard

curl "https://dloopiq.onrender.com/api/v1/exports?format=json" \
  -H "Authorization: Bearer eyJhbGci..."
[
  {
    "id": "cmpkb4ghw00016qduu44p7n2q",
    "type": "SENTIMENT_ANALYSIS",
    "content": "Ce produit est fantastique !",
    "label": "Positif",
    "confidence": 0.87,
    "locale": "fr",
    "validatedAt": "2026-05-25T10:05:00Z"
  }
]

jsonl — JSON Lines (une ligne par exemple)

Idéal pour le streaming et le fine-tuning GPT-style.
curl "https://dloopiq.onrender.com/api/v1/exports?format=jsonl" \
  -H "Authorization: Bearer eyJhbGci..."
{"id":"cmpkb...","type":"SENTIMENT_ANALYSIS","content":"Ce produit est fantastique !","label":"Positif"}
{"id":"cmpkb...","type":"BINARY_CHOICE","content":"Cette image est-elle appropriée ?","label":"Oui"}

csv — CSV classique

curl "https://dloopiq.onrender.com/api/v1/exports?format=csv" \
  -H "Authorization: Bearer eyJhbGci..." \
  -o export.csv
id,type,content,label,confidence,locale,validatedAt
cmpkb...,SENTIMENT_ANALYSIS,"Ce produit est fantastique !",Positif,0.87,fr,2026-05-25T10:05:00Z

openai — Format OpenAI Chat fine-tuning

Prêt pour openai api fine_tuning.jobs.create.
curl "https://dloopiq.onrender.com/api/v1/exports?format=openai" \
  -H "Authorization: Bearer eyJhbGci..."
{"messages":[{"role":"user","content":"Analyse le sentiment : Ce produit est fantastique !"},{"role":"assistant","content":"Positif"}]}
{"messages":[{"role":"user","content":"Analyse le sentiment : Service catastrophique"},{"role":"assistant","content":"Négatif"}]}

huggingface — HuggingFace Datasets

Compatible avec datasets.load_dataset('json', data_files=...).
curl "https://dloopiq.onrender.com/api/v1/exports?format=huggingface" \
  -H "Authorization: Bearer eyJhbGci..."
{"text": "Ce produit est fantastique !", "label": "Positif", "label_id": 0}
{"text": "Service catastrophique",       "label": "Négatif", "label_id": 1}

alpaca — Format Alpaca instruction-tuning

curl "https://dloopiq.onrender.com/api/v1/exports?format=alpaca" \
  -H "Authorization: Bearer eyJhbGci..."
{"instruction": "Analyse le sentiment du texte suivant.", "input": "Ce produit est fantastique !", "output": "Positif"}

Split train / val / test

# 80% train, 10% validation, 10% test
curl "https://dloopiq.onrender.com/api/v1/exports?format=jsonl&trainRatio=0.8&valRatio=0.1&testRatio=0.1" \
  -H "Authorization: Bearer eyJhbGci..."
La réponse contient 3 fichiers dans une archive ZIP :
export.zip
├── train.jsonl    (80%)
├── val.jsonl      (10%)
└── test.jsonl     (10%)
Les ratios doivent additionner à 1.0 exactement. Si seulement trainRatio est fourni, l’export retourne un fichier unique sans split.

Usage Python complet

import requests
import json

headers = {'Authorization': f'Bearer {JWT}'}

# Export HuggingFace avec split
response = requests.get(
    'https://dloopiq.onrender.com/api/v1/exports',
    params={
        'format': 'huggingface',
        'trainRatio': 0.8,
        'valRatio': 0.1,
        'testRatio': 0.1
    },
    headers=headers
)

with open('export.zip', 'wb') as f:
    f.write(response.content)

# Charger avec HuggingFace datasets
from datasets import load_dataset
ds = load_dataset('json', data_files={'train': 'train.jsonl', 'test': 'test.jsonl'})