p2002814 commited on
Commit
a1fcb70
·
1 Parent(s): ba9863e

better readme

Browse files
Files changed (1) hide show
  1. README.md +36 -42
README.md CHANGED
@@ -11,84 +11,78 @@ pinned: false
11
 
12
  # 🧠 Argument Mining Backend (FastAPI)
13
 
14
- Ce backend expose une API REST pour prédire les relations argumentatives (Support / Attack) entre des phrases.
15
- Il est conçu pour être utilisé avec un frontend (par exemple un site en Next.js).
16
 
17
  ---
18
 
19
- ## 🚀 Fonctionnalités
20
- - Endpoint `/predict-text` : prédiction sur deux arguments donnés à la main.
21
- - Endpoint `/predict-csv` : prédiction sur un fichier CSV contenant des paires d’arguments.
22
- - Prétraitement basique du texte avant passage au modèle.
 
 
 
23
  - Chargement d’un modèle sauvegardé (`model.pkl`, `.pt`, etc.).
 
 
 
24
 
25
  ---
26
 
27
  ## 📦 Installation
28
 
29
- 1. Cloner le dépôt :
30
 
31
  ```bash
32
  git clone https://github.com/<ton-user>/argument-backend.git
33
  cd argument-backend
34
  ```
35
 
36
- ### Option 1 : via pip (classique)
37
 
38
- ```bash
39
- python -m venv venv
40
- source venv/bin/activate # Linux / Mac
41
- venv\Scripts\activate # Windows
42
-
43
- pip install -r requirements.txt
44
- ```
45
-
46
- ### Option 2 : via Conda (recommandé)
47
-
48
- Créer l’environnement à partir du fichier environment.yml :
49
 
50
  ```bash
51
  conda env create -f environment.yml
52
  conda activate argument-backend
53
  ```
54
 
55
- 3. Installer les dépendances :
56
 
57
  ```bash
 
 
 
 
58
  pip install -r requirements.txt
59
  ```
60
 
61
- ## ▶️ Lancer en local
62
 
63
  ```bash
64
  uvicorn app:app --reload --host 0.0.0.0 --port 8000
65
  ```
66
 
67
- L’API sera dispo sur : http://127.0.0.1:8000
68
- Et la doc Swagger automatique ici : http://127.0.0.1:8000/docs
69
 
70
- ## 📂 Structure du projet
71
 
 
72
  argument-backend/
73
- │── app.py # API FastAPI
74
- │── model_utils.py # Chargement du modèle + prédiction
75
- │── requirements.txt # Dépendances Python
76
- │── model.pkl # (à ajouter) modèle sauvegardé
77
-
78
- ## 🌍 Déploiement sur Render
79
-
80
- Pousser ce repo sur GitHub.
81
-
82
- Sur Render
83
- , créer un New Web Service → connecter le repo.
84
 
85
- Paramètres Render :
86
 
87
- - Environment: Python 3.x
88
- - Build Command: pip install -r requirements.txt
89
- - Start Command:
90
- uvicorn app:app --host 0.0.0.0 --port 10000
91
 
92
- Une fois déployé, Render donnera une URL publique du type :
93
- https://argument-backend.onrender.com
94
 
 
 
11
 
12
  # 🧠 Argument Mining Backend (FastAPI)
13
 
14
+ Argument Mining Backend is a REST API designed to predict argumentative relations (Support / Attack) between sentences and analyze text using the ABA (Assumption-Based Argumentation) framework.
15
+ It is intended to be used alongside a frontend application (e.g., Next.js or React).
16
 
17
  ---
18
 
19
+ ## 🚀 Features
20
+ - Endpoint `/predict-text` : Predict the relation between two manually provided arguments.
21
+ - Endpoint `/predict-csv` : Predict relations from a CSV file containing argument pairs.
22
+ - Endpoint `/aba-upload` : Upload a text file to generate and analyze an ABA+ framework.
23
+ - Endpoint `/aba-example` : Run ABA analysis on predefined example text.
24
+ - Endpoint `/aba-exemple/{filename}` : Analyze ABA with a predefined text file.
25
+ - Text preprocessing before feeding data into the model.
26
  - Chargement d’un modèle sauvegardé (`model.pkl`, `.pt`, etc.).
27
+ - Load saved machine learning models (.pt, .pkl, etc.) for inference.
28
+ - Automatic Swagger documentation for easy API exploration.
29
+ - CORS middleware for cross-origin requests.
30
 
31
  ---
32
 
33
  ## 📦 Installation
34
 
35
+ ## Clone the repository
36
 
37
  ```bash
38
  git clone https://github.com/<ton-user>/argument-backend.git
39
  cd argument-backend
40
  ```
41
 
42
+ ## Setup environment
43
 
44
+ ### Option 1: Using Conda (recommended)
 
 
 
 
 
 
 
 
 
 
45
 
46
  ```bash
47
  conda env create -f environment.yml
48
  conda activate argument-backend
49
  ```
50
 
51
+ ### Option 2: Using Python venv
52
 
53
  ```bash
54
+ python -m venv venv
55
+ source venv/bin/activate # Linux / Mac
56
+ venv\Scripts\activate # Windows
57
+
58
  pip install -r requirements.txt
59
  ```
60
 
61
+ ## ▶️ Running Locally
62
 
63
  ```bash
64
  uvicorn app:app --reload --host 0.0.0.0 --port 8000
65
  ```
66
 
67
+ - API will be available at: http://127.0.0.1:8000
68
+ - Swagger UI documentation: http://127.0.0.1:8000/docs
69
 
70
+ ## 📂 Project Structure
71
 
72
+ ```bash
73
  argument-backend/
74
+ │── app.py # FastAPI application entrypoint
75
+ │── aba # ABA framework modules
76
+ │── relations # Argument relation prediction modules
77
+ │── models # Saved ML models (.pth, .pkl, etc.)
78
+ ```
 
 
 
 
 
 
79
 
80
+ ## ⚡Notes
81
 
82
+ - Designed for seamless integration with a frontend application for visualizing argument graphs.
83
+ - Supports batch prediction with CSV files (limited to 100 rows per request).
84
+ - ABA+ framework generation supports assumptions, arguments, attacks, and reverse attacks.
 
85
 
86
+ ## 🌐 Live Demo
 
87
 
88
+ Check the live frontend here: [Arguments Visualization](https://arguments-visualisation.vercel.app/)