Skip to content

mateomorin/LabelGuard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LabelGuard 🛡️

LabelGuard is a discriminator to detect labels (texts) generated by AI for the French NACE (NAF). It outputs 1 if it considers the text synthetic, and 0 otherwise.

The last version of LabelGuard is accessible through this API (see /docs for more information about the input). API deployment is managed with LabelGuard-deployment.

This repository is the source code behind LabelGuard training. The current version of LabelGuard has been trained on 160,000 labels (1/2 real, 1/2 synthetic), and has the best validation FPR (40,000 points) among all the other candidates.

🏗️ Project Structure

LabelGuard/
├── app/                 # API
├── notebooks/           # Exploration
├── src/
│   ├── datasets/        # Data preprocessing (Qdrant and Parquet)
│   ├── embeddings/      # Embedding models (using external API)
│   ├── inference/       # Small example for LabelGuard inference
│   ├── models/          # Discriminators (embedding → binary)
│   └── training/        # Training script
└── tests/               # Pytest check

🛠️ Technical aspects

  • Database: QDrant is used to store and retrieve embeddings for training, mostly because it permits fast indexing and similarity search.

  • ML Lifecycle: MLFlow is used for model versioning and performance tracking during training.

  • Language model: The embedding model used is Qwen3-Embedding-8B.

⚙️ Installation

  1. Clone the repository:
git clone https://github.com/mateomorin/LabelGuard.git
cd LabelGuard
  1. Install dependances:
pip install uv
uv sync
  1. Set environnement variables for QDrant and MLFlow:
# Data (pour l'entrainement, choisir S3 ou Qdrant)
QDRANT_API_KEY
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN

# Embedding API
EMBEDDING_API_BASE_URL
EMBEDDING_API_KEY

# MLFlow
MLFLOW_TRACKING_URI
MLFLOW_TRACKING_USERNAME
MLFLOW_TRACKING_PASSWORD
MLFLOW_HTTP_REQUEST_TIMEOUT    # Optional

Développé dans le cadre d'un projet au sein du SSP Lab.

About

A discriminator to detect labels generated by AI

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors