siwarroth commited on
Commit
71fb82a
·
verified ·
1 Parent(s): 11f6c89

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +101 -101
README.md CHANGED
@@ -1,101 +1,101 @@
1
- ---
2
- language: en
3
- license: mit
4
- tags:
5
- - absa
6
- - aspect-based-sentiment-analysis
7
- - deberta
8
- - natural-language-processing
9
- model_name: DeBERTa-v3 ABSA (Aspect Term Extraction & Polarity Classification)
10
- ---
11
-
12
- # DeBERTa-v3 for Aspect-Based Sentiment Analysis (ABSA)
13
-
14
- This repository contains a fine-tuned DeBERTa-v3 model specifically trained for **Aspect Term Extraction (ATE)** and **Polarity Classification (PC)** using the `PyABSA` library.
15
-
16
- ## Model Description
17
-
18
- The model is designed to:
19
- 1. **Extract Aspects**: Automatically identify specific features or topics mentioned in a sentence (e.g., "food", "service", "battery life").
20
- 2. **Classify Sentiment**: Determine the sentiment expressed towards each identified aspect (Positive, Negative, or Neutral).
21
-
22
- It is based on the `microsoft/deberta-v3-base` architecture, which provides superior performance in NLU tasks compared to BERT or RoBERTa.
23
-
24
- ## Installation
25
-
26
- To use this model, you need to install `pyabsa` and its dependencies:
27
-
28
- ```bash
29
- pip install pyabsa transformers torch
30
- ```
31
-
32
- ## Usage
33
-
34
- You can use the following snippet to run inference locally:
35
-
36
- ```python
37
- import os
38
- from pyabsa import AspectTermExtraction as ATEPC
39
-
40
- # Initialize the Aspect Extractor
41
- # PyABSA will handle downloading and loading the model automatically if linked to HF
42
- model = ATEPC.AspectExtractor(checkpoint="your-username/deberta-absa")
43
-
44
- text = "The food was delicious but the service was extremely slow."
45
- result = model.predict(text, print_result=True)
46
-
47
- # Process results
48
- for aspect, sentiment in zip(result['aspect'], result['sentiment']):
49
- print(f"Aspect: {aspect} | Sentiment: {sentiment}")
50
- ```
51
-
52
- ## Input/Output Format
53
-
54
- ### Input
55
- The model accepts a raw text string (sentence or paragraph).
56
- Example: `"The pizza was amazing but the staff was rude."`
57
-
58
- ### Output
59
- The model returns a structured result containing:
60
- - **Aspects**: The specific entities or features identified (e.g., `["pizza", "staff"]`).
61
- - **Sentiments**: The sentiment polarity for each aspect (e.g., `["positive", "negative"]`).
62
-
63
- ### Detailed Output
64
- For advanced users, the model provides a more granular output including token-level information and sentiment probabilities:
65
-
66
- ```json
67
- {
68
- "sentence": "The pizza was amazing",
69
- "tokens": ["The", "pizza", "was", "amazing"],
70
- "IOB": ["O", "B-ASP", "O", "O"],
71
- "aspect": ["pizza"],
72
- "position": [[1]],
73
- "sentiment": ["positive"],
74
- "probs": [[0.0002, 0.0003, 0.9994]],
75
- "confidence": [0.9994]
76
- }
77
- ```
78
-
79
- - **IOB**: Inside-Outside-Beginning tags for Aspect Term Extraction.
80
- - **Probs**: Probability distribution across `[negative, neutral, positive]`.
81
- - **Position**: Token offset of the aspect in the sentence.
82
-
83
- The model was trained on a combined dataset including **SemEval 2014**, **SemEval 2015**, and **SemEval 2016** (Laptops and Restaurants), focusing on robust aspect extraction and high-precision sentiment classification.
84
-
85
- ## Performance
86
-
87
- | Task | Accuracy / F1 |
88
- | --- | --- |
89
- | Aspect Extraction (ATE F1) | 85.85% |
90
- | Polarity Classification (APC Accuracy) | 89.86% |
91
- | Polarity Classification (APC F1) | 84.08% |
92
-
93
- ## Authors
94
-
95
- This work was developed and fine-tuned by:
96
- - **Othmen Siwar**
97
- - **Bouallégue Abir**
98
-
99
- ## Citation
100
-
101
- If you use this model, please cite the original PyABSA repository and the DeBERTa paper.
 
1
+ ---
2
+ language: fr
3
+ license: mit
4
+ tags:
5
+ - absa
6
+ - aspect-based-sentiment-analysis
7
+ - deberta
8
+ - natural-language-processing
9
+ model_name: DeBERTa-v3 ABSA (Extraction de Termes d'Aspect et Classification de Polarité)
10
+ ---
11
+
12
+ # DeBERTa-v3 pour l'Analyse de Sentiment Basée sur les Aspects (ABSA)
13
+
14
+ Ce dépôt contient un modèle DeBERTa-v3 ajusté (fine-tuned) spécifiquement pour l'**Extraction de Termes d'Aspect (ATE)** et la **Classification de Polarité (PC)** en utilisant la bibliothèque `PyABSA`.
15
+
16
+ ## Description du Modèle
17
+
18
+ Le modèle est conçu pour :
19
+ 1. **Extraire les Aspects** : Identifier automatiquement les caractéristiques ou sujets spécifiques mentionnés dans une phrase (ex: "nourriture", "service", "autonomie de la batterie").
20
+ 2. **Classer le Sentiment** : Déterminer le sentiment exprimé envers chaque aspect identifié (Positif, Négatif ou Neutre).
21
+
22
+ Il est basé sur l'architecture `microsoft/deberta-v3-base`, qui offre des performances supérieures dans les tâches de NLU par rapport à BERT ou RoBERTa.
23
+
24
+ ## Installation
25
+
26
+ Pour utiliser ce modèle, vous devez installer `pyabsa` et ses dépendances :
27
+
28
+ ```bash
29
+ pip install pyabsa transformers torch
30
+ ```
31
+
32
+ ## Utilisation
33
+
34
+ Vous pouvez utiliser l'extrait suivant pour exécuter une inférence localement :
35
+
36
+ ```python
37
+ import os
38
+ from pyabsa import AspectTermExtraction as ATEPC
39
+
40
+ # Initialiser l'extracteur d'aspects
41
+ # PyABSA gérera automatiquement le téléchargement et le chargement du modèle s'il est lié à HF
42
+ model = ATEPC.AspectExtractor(checkpoint="votre-nom-d-utilisateur/deberta-absa")
43
+
44
+ text = "La nourriture était délicieuse mais le service était extrêmement lent."
45
+ result = model.predict(text, print_result=True)
46
+
47
+ # Traiter les résultats
48
+ for aspect, sentiment in zip(result['aspect'], result['sentiment']):
49
+ print(f"Aspect: {aspect} | Sentiment: {sentiment}")
50
+ ```
51
+
52
+ ## Format d'Entrée/Sortie
53
+
54
+ ### Entrée
55
+ Le modèle accepte une chaîne de texte brut (une phrase ou un paragraphe).
56
+ Exemple : `"La pizza était incroyable mais le personnel était impoli."`
57
+
58
+ ### Sortie
59
+ Le modèle renvoie un résultat structuré contenant :
60
+ - **Aspects** : Les entités ou caractéristiques spécifiques identifiées (ex: `["pizza", "personnel"]`).
61
+ - **Sentiments** : La polarité du sentiment pour chaque aspect (ex: `["positive", "negative"]`).
62
+
63
+ ### Sortie Détaillée
64
+ Pour les utilisateurs avancés, le modèle fournit une sortie plus granulaire incluant des informations au niveau des jetons et des probabilités de sentiment :
65
+
66
+ ```json
67
+ {
68
+ "sentence": "La pizza était incroyable",
69
+ "tokens": ["La", "pizza", "était", "incroyable"],
70
+ "IOB": ["O", "B-ASP", "O", "O"],
71
+ "aspect": ["pizza"],
72
+ "position": [[1]],
73
+ "sentiment": ["positive"],
74
+ "probs": [[0.0002, 0.0003, 0.9994]],
75
+ "confidence": [0.9994]
76
+ }
77
+ ```
78
+
79
+ - **IOB** : Balises Inside-Outside-Beginning pour l'extraction de termes d'aspect.
80
+ - **Probs** : Distribution de probabilité sur `[négatif, neutre, positif]`.
81
+ - **Position** : Décalage du jeton de l'aspect dans la phrase.
82
+
83
+ Le modèle a été entraîné sur un jeu de données combiné incluant **SemEval 2014**, **SemEval 2015** et **SemEval 2016** (Ordinateurs portables et Restaurants), en se concentrant sur une extraction d'aspect robuste et une classification de sentiment de haute précision.
84
+
85
+ ## Performance
86
+
87
+ | Tâche | Précision / F1 |
88
+ | --- | --- |
89
+ | Extraction d'Aspect (ATE F1) | 85.85% |
90
+ | Classification de Polarité (APC Accuracy) | 89.86% |
91
+ | Classification de Polarité (APC F1) | 84.08% |
92
+
93
+ ## Auteurs
94
+
95
+ Ce travail a été développé et affiné par :
96
+ - **Othmen Siwar**
97
+ - **Bouallégue Abir**
98
+
99
+ ## Citation
100
+
101
+ Si vous utilisez ce modèle, veuillez citer le dépôt PyABSA original et l'article DeBERTa.