GGUF - French Emotion Recognition Model: french-emotion-recognition-GGUF

This repository contains GGUF quantized versions of the JusteLeo/french-emotion-recognition model.


🇬🇧 English Version

Model Description

This repository provides GGUF quantized versions of the JusteLeo/french-emotion-recognition model. The GGUF format allows the model to run very efficiently on a CPU, making it ideal for local applications or environments with limited resources.

The model is designed to take a French sentence as input and output one of the following seven emotions: joie(joy) , colere(anger), tristesse(sadness), peur(fear), surprise(surprise), dégout(disgust), neutre(neutral).

Available Quantizations

Multiple quantization levels are provided. Lower quantization (e.g., Q3) results in a smaller file and lower resource usage, but at the cost of some accuracy. Higher quantization (e.g., Q6, Q8) preserves more quality but requires more resources.

Quantization Type Size (Est.) Recommendation
Q3_K 193 MB For minimum file size. Performance loss is noticeable.
Q4_K_M 229 MB Recommended balance between performance and file size.
Q5_K_M 260 MB Higher quality than Q4_K_M with a moderate size increase.
Q8_0 379 MB High-quality quantization, close to the original.

How to Use

Prompt Format

The model was fine-tuned without a specific instruction template. To get an emotion classification, simply provide the French sentence as the prompt. The model will generate the corresponding emotion as its response.

Usage with llama-cpp-python

For programmatic use, you can use the llama-cpp-python library.

1. Installation

pip install llama-cpp-python

2. Example Code Make sure you have downloaded the .gguf file of your choice from the "Files and versions" tab.

from llama_cpp import Llama

# Load the GGUF model
# Replace with the path to your downloaded .gguf file
llm = Llama(model_path="./french-emotion-recognition-q4_k_m.gguf", verbose=False)

# --- Examples ---
prompts = [
    "Je suis fou de joie, j'ai eu une promotion !", # "I'm overjoyed, I got a promotion!"
    "Il m'a encore menti, je suis vraiment furieux.", # "He lied to me again, I'm furious."
    "Le film était juste correct, sans plus.", # "The movie was just okay, nothing more."
]

for prompt in prompts:
    # The model directly outputs the emotion
    output = llm(
        prompt,
        max_tokens=10, # Enough for the emotion name
        stop=["\n"], # Stop generation after the emotion
        echo=False # Do not repeat the prompt in the output
    )
    emotion = output['choices'][0]['text'].strip()
    print(f"Sentence: '{prompt}'")
    print(f"Predicted Emotion: {emotion}")
    print("-" * 20)

Usage with LM Studio

LM Studio provides an easy-to-use GUI for running GGUF models on your local machine.

  1. Download and open LM Studio.
  2. Use the search bar (magnifying glass icon) on the main page.
  3. Search for JusteLeo/french-emotion-recognition-GGUF.
  4. From the right-hand side, download the quantization file you prefer (e.g., Q4_K_M).
  5. Go to the chat section (speech bubble icon), select the downloaded model at the top, and start interacting.
  6. Simply type the French sentence you want to analyze, and the model will respond with the detected emotion.

Limitations and Bias

  • Synthetic Data: This model was trained on a synthetic dataset. While effective for clear-cut cases, it may not generalize perfectly to complex, real-world sentences with slang, idioms, or subtext.
  • Limited Emotional Scope: The model is restricted to the 7 emotions it was trained on. It cannot identify more nuanced feelings or mixed emotions.
  • No Sarcasm Detection: The model is not trained to understand sarcasm or irony and will likely misclassify such inputs based on their literal meaning.

Acknowledgements

A big thank you to the llama.cpp team for their outstanding work that makes LLM inference accessible on consumer hardware.


🇫🇷 Version Française

Description du Modèle

Ce dépôt fournit des versions quantifiées au format GGUF du modèle JusteLeo/french-emotion-recognition. Le format GGUF permet d'exécuter le modèle de manière très efficace sur CPU, ce qui le rend idéal pour des applications locales ou des environnements avec des ressources limitées.

Le modèle est conçu pour prendre une phrase en français en entrée et retourner l'une des sept émotions suivantes : joie, colere, tristesse, peur, surprise, dégout, neutre.

Quantifications Disponibles

Plusieurs niveaux de quantification sont proposés. Une quantification basse (ex: Q3) résulte en un fichier plus petit et une consommation de ressources moindre, mais au prix d'une perte de précision. Une quantification plus élevée (ex: Q6, Q8) préserve mieux la qualité mais demande plus de ressources.

Type de Quantification Taille (Est.) Recommandation
Q3_K 193 Mo Pour une taille de fichier minimale. Perte de performance notable.
Q4_K_M 229 Mo Équilibre recommandé entre performance et taille de fichier.
Q5_K_M 260 Mo Qualité supérieure à Q4_K_M pour une augmentation modérée de la taille.
Q8_0 379 Mo Quantification de haute qualité, proche de l'original.

Comment l'utiliser ?

Format du Prompt

Le modèle a été affiné sans template d'instruction spécifique. Pour obtenir une classification d'émotion, fournissez simplement la phrase en français comme prompt. Le modèle générera l'émotion correspondante en réponse.

Utilisation avec llama-cpp-python

Pour un usage programmatique, vous pouvez utiliser la bibliothèque llama-cpp-python.

1. Installation

pip install llama-cpp-python

2. Code d'exemple Assurez-vous d'avoir téléchargé le fichier .gguf de votre choix depuis l'onglet "Files and versions".

from llama_cpp import Llama

# Charger le modèle GGUF
# Remplacez par le chemin vers votre fichier .gguf téléchargé
llm = Llama(model_path="./french-emotion-recognition-q4_k_m.gguf", verbose=False)

# --- Exemples ---
prompts = [
    "Je suis fou de joie, j'ai eu une promotion !",
    "Il m'a encore menti, je suis vraiment furieux.",
    "Le film était juste correct, sans plus.",
]

for prompt in prompts:
    # Le modèle répond directement avec l'émotion
    output = llm(
        prompt,
        max_tokens=10, # Assez pour l'émotion
        stop=["\n"], # Arrêter la génération après l'émotion
        echo=False # Ne pas répéter le prompt dans la sortie
    )
    emotion = output['choices'][0]['text'].strip()
    print(f"Phrase : '{prompt}'")
    print(f"Émotion prédite : {emotion}")
    print("-" * 20)

Utilisation avec LM Studio

LM Studio offre une interface graphique simple pour exécuter des modèles GGUF sur votre machine locale.

  1. Téléchargez et ouvrez LM Studio.
  2. Utilisez la barre de recherche (icône loupe) sur la page d'accueil.
  3. Recherchez JusteLeo/french-emotion-recognition-GGUF.
  4. Sur le côté droit, téléchargez le fichier de quantification de votre choix (par ex., Q4_K_M).
  5. Allez dans la section "Chat" (icône bulle), sélectionnez le modèle téléchargé en haut de la page, et commencez à interagir.
  6. Écrivez simplement la phrase en français que vous souhaitez analyser, et le modèle répondra avec l'émotion détectée.

Limitations et Biais

  • Données Synthétiques : Ce modèle a été entraîné sur un jeu de données synthétique. Bien qu'efficace pour des cas clairs, il pourrait ne pas généraliser parfaitement à des phrases complexes du monde réel contenant de l'argot, des expressions idiomatiques ou du sous-entendu.
  • Portée Émotionnelle Limitée : Le modèle est restreint aux 7 émotions sur lesquelles il a été entraîné. Il ne peut pas identifier des sentiments plus nuancés ou des émotions mixtes.
  • Pas de Détection du Sarcasme : Le modèle n'est pas entraîné pour comprendre le sarcasme ou l'ironie et classera probablement mal de telles entrées en se basant sur leur sens littéral.

Remerciements

Un grand merci à l'équipe de llama.cpp pour leur travail exceptionnel qui rend l'inférence de LLMs accessible sur du matériel grand public.

Downloads last month
61
GGUF
Model size
0.4B params
Architecture
lfm2
Hardware compatibility
Log In to view the estimation

4-bit

5-bit

6-bit

8-bit

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for JusteLeo/french-emotion-recognition-GGUF

Base model

LiquidAI/LFM2-350M
Quantized
(1)
this model