Spaces:
Sleeping
Sleeping
p2002814
commited on
Commit
·
a1fcb70
1
Parent(s):
ba9863e
better readme
Browse files
README.md
CHANGED
|
@@ -11,84 +11,78 @@ pinned: false
|
|
| 11 |
|
| 12 |
# 🧠 Argument Mining Backend (FastAPI)
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
|
| 17 |
---
|
| 18 |
|
| 19 |
-
## 🚀
|
| 20 |
-
- Endpoint `/predict-text` :
|
| 21 |
-
- Endpoint `/predict-csv` :
|
| 22 |
-
-
|
|
|
|
|
|
|
|
|
|
| 23 |
- Chargement d’un modèle sauvegardé (`model.pkl`, `.pt`, etc.).
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
---
|
| 26 |
|
| 27 |
## 📦 Installation
|
| 28 |
|
| 29 |
-
|
| 30 |
|
| 31 |
```bash
|
| 32 |
git clone https://github.com/<ton-user>/argument-backend.git
|
| 33 |
cd argument-backend
|
| 34 |
```
|
| 35 |
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
| 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 |
-
|
| 56 |
|
| 57 |
```bash
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
pip install -r requirements.txt
|
| 59 |
```
|
| 60 |
|
| 61 |
-
## ▶️
|
| 62 |
|
| 63 |
```bash
|
| 64 |
uvicorn app:app --reload --host 0.0.0.0 --port 8000
|
| 65 |
```
|
| 66 |
|
| 67 |
-
|
| 68 |
-
|
| 69 |
|
| 70 |
-
## 📂 Structure
|
| 71 |
|
|
|
|
| 72 |
argument-backend/
|
| 73 |
-
│── app.py
|
| 74 |
-
│──
|
| 75 |
-
│──
|
| 76 |
-
│──
|
| 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 |
-
|
| 86 |
|
| 87 |
-
-
|
| 88 |
-
-
|
| 89 |
-
-
|
| 90 |
-
uvicorn app:app --host 0.0.0.0 --port 10000
|
| 91 |
|
| 92 |
-
|
| 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/)
|