Aryan Mishra commited on
Commit
ae0eb95
Β·
1 Parent(s): e5158d5

docs: improve README with comprehensive project documentation

Browse files
Files changed (1) hide show
  1. README.md +98 -38
README.md CHANGED
@@ -1,53 +1,113 @@
1
- ## Project Overview
2
- Multilingual Aspect-Based Sentiment Analysis (ABSA) supporting English, Hindi, and Hinglish. It leverages XLM-RoBERTa and IndicBERT to perform aspect term extraction and sentiment classification for multilingual product reviews.
3
 
4
- ## Repo Structure
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  Multilingual-Absa/
6
- β”œβ”€β”€ .github/
7
- β”‚ └── workflows/ # CI/CD pipelines
8
- β”œβ”€β”€ config/ # Configuration files
9
- β”‚ β”œβ”€β”€ docker/ # docker-compose.yml, docker-compose.prod.yml
10
- β”‚ └── dvc.yaml # DVC pipeline config
11
- β”œβ”€β”€ src/ # ML source code
12
- β”œβ”€β”€ api/ # API source code
13
- β”œβ”€β”€ dashboard/ # Frontend dashboard
14
- β”œβ”€β”€ tests/ # All tests
15
- β”œβ”€β”€ scripts/ # Utility/automation scripts
16
- β”œβ”€β”€ notebooks/ # Jupyter notebooks
17
- β”œβ”€β”€ docs/ # Documentation
18
- β”œβ”€β”€ data/ # Gitignored, DVC-tracked only
19
- β”œβ”€β”€ models/ # Gitignored, DVC-tracked only
20
- β”œβ”€β”€ .dvcignore
21
- β”œβ”€β”€ .env.example # Template only
22
- β”œβ”€β”€ .gitignore
23
- β”œβ”€β”€ .gitattributes
24
- β”œβ”€β”€ AGENTS.md
25
- β”œβ”€β”€ README.md
26
- β”œβ”€β”€ requirements.txt
27
- β”œβ”€β”€ railway.json # GITIGNORED, stays local only
28
- └── dvc.lock
29
-
30
- ## Setup
 
31
  ```bash
32
- # 1. Clone and install
33
  git clone <repository-url>
 
 
 
 
 
34
  pip install -r requirements.txt
 
35
 
36
- # 2. Copy env template
 
37
  cp .env.example .env
38
- # Fill in your values in .env
 
39
 
40
- # 3. Run with Docker
41
- docker-compose -f config/docker/docker-compose.yml up
 
 
 
42
  ```
43
 
44
- ## ML Pipeline (DVC)
 
 
45
  ```bash
46
- dvc repro # Run full pipeline
47
- dvc push # Push data/models to remote
 
48
  ```
49
 
50
- ## API
 
 
51
  ```bash
52
- cd api && uvicorn main:app --reload
 
53
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Multilingual Aspect-Based Sentiment Analysis (ABSA)
 
2
 
3
+ ![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)
4
+ ![FastAPI](https://img.shields.io/badge/FastAPI-0.111.0-00a393.svg)
5
+ ![React](https://img.shields.io/badge/React-18-61dafb.svg)
6
+ ![DVC](https://img.shields.io/badge/DVC-3.51.1-945dd6.svg)
7
+ ![MLflow](https://img.shields.io/badge/MLflow-2.13.0-0194E2.svg)
8
+
9
+ A production-ready, highly optimized Aspect-Based Sentiment Analysis (ABSA) system designed to process multilingual product reviews in **English, Hindi, and Hinglish**. It accurately extracts aspects and classifies their underlying sentiments.
10
+
11
+ The system leverages state-of-the-art models like **XLM-RoBERTa** and **IndicBERT**, optimized using ONNX runtime, and includes a highly robust, zero-download, pure-Python rule-based fallback engine for instant inference.
12
+
13
+ ## ✨ Key Features
14
+
15
+ - **Multilingual Support**: First-class support for English, Hindi, and code-mixed Hinglish.
16
+ - **Dual Inference Engine**:
17
+ - **Neural Path**: Uses custom fine-tuned, INT8-quantized ONNX models (XLM-RoBERTa based) for extremely fast and accurate token classification and sequence classification.
18
+ - **Rule-Based Fallback**: An instantaneous, pure-Python fallback leveraging a curated multi-lingual lexicon to handle aspect extraction and sentiment scoring without any heavy downloads.
19
+ - **Modern Tech Stack**:
20
+ - **Backend**: Asynchronous, high-performance API built with FastAPI.
21
+ - **Frontend**: A sleek, responsive dashboard built with React and TailwindCSS. Features real-time predictions, batch analytics, and system monitoring.
22
+ - **MLOps Integrated**: Complete integration with DVC (Data Version Control) for pipeline reproducibility, MLflow for experiment tracking, and Evidently AI for data drift monitoring.
23
+ - **Scalable Architecture**: Support for async tasks via Celery + Redis, robust data storage via PostgreSQL, and metric exporting using Prometheus.
24
+
25
+ ## πŸ—οΈ Repository Structure
26
+
27
+ ```text
28
  Multilingual-Absa/
29
+ β”œβ”€β”€ .github/workflows/ # CI/CD pipelines
30
+ β”œβ”€β”€ api/ # FastAPI backend and inference services
31
+ β”œβ”€β”€ config/ # DVC and Docker configuration files
32
+ β”œβ”€β”€ dashboard/ # React frontend for inference & monitoring
33
+ β”œβ”€β”€ data/ # Dataset directory (DVC-tracked)
34
+ β”œβ”€β”€ docs/ # Extended documentation
35
+ β”œβ”€β”€ mlflow/ # MLflow tracking
36
+ β”œβ”€β”€ models/ # Model artifacts (DVC-tracked)
37
+ β”œβ”€β”€ monitoring/ # Monitoring configurations (Prometheus, Evidently)
38
+ β”œβ”€β”€ notebooks/ # Exploratory Data Analysis & Prototyping
39
+ β”œβ”€β”€ scripts/ # Utility and automation scripts
40
+ β”œβ”€β”€ src/ # Machine Learning pipeline source code
41
+ β”œβ”€β”€ tests/ # Unit and integration test suite
42
+ └── requirements.txt # Python dependencies
43
+ ```
44
+
45
+ ## πŸš€ Getting Started
46
+
47
+ ### Prerequisites
48
+ - Python 3.10+
49
+ - Node.js (for Dashboard)
50
+ - Docker & Docker Compose (Optional, but recommended)
51
+
52
+ ### 1. Local Setup
53
+
54
+ Clone the repository and install the backend dependencies:
55
  ```bash
 
56
  git clone <repository-url>
57
+ cd Multilingual-Absa
58
+
59
+ # Create a virtual environment and install dependencies
60
+ python -m venv .venv
61
+ source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
62
  pip install -r requirements.txt
63
+ ```
64
 
65
+ Set up your environment variables:
66
+ ```bash
67
  cp .env.example .env
68
+ # Edit .env with your specific configurations
69
+ ```
70
 
71
+ ### 2. Run with Docker (Recommended)
72
+
73
+ The easiest way to get the entire stack (API, Dashboard, Redis, Postgres) running is via Docker Compose:
74
+ ```bash
75
+ docker-compose -f config/docker/docker-compose.yml up --build
76
  ```
77
 
78
+ ### 3. Manual ML Pipeline Execution (DVC)
79
+
80
+ To reproduce the ML pipeline or sync artifacts:
81
  ```bash
82
+ dvc pull # Pull data/models from remote storage
83
+ dvc repro # Run the full end-to-end ML training pipeline
84
+ dvc push # Push newly generated artifacts to remote
85
  ```
86
 
87
+ ### 4. Running the Application Locally
88
+
89
+ **Start the API Server:**
90
  ```bash
91
+ cd api
92
+ uvicorn main:app --reload --host 0.0.0.0 --port 8000
93
  ```
94
+ *API Documentation will be available at `http://localhost:8000/docs`.*
95
+
96
+ **Start the Dashboard:**
97
+ ```bash
98
+ cd dashboard
99
+ npm install
100
+ npm run dev
101
+ ```
102
+ *Access the dashboard at `http://localhost:5173`.*
103
+
104
+ ## πŸ”¬ How it Works
105
+
106
+ 1. **Prediction API**: When a review is submitted, the language is auto-detected.
107
+ 2. **Inference**: The `ABSAPipeline` attempts to load INT8 quantized ONNX models for extraction and sentiment scoring.
108
+ 3. **Fallback Mechanism**: If the custom models are not downloaded, the engine automatically falls back to a dictionary/rule-based engine tailored for product reviews, guaranteeing zero downtime and instant availability.
109
+ 4. **Monitoring**: All predictions are logged. Performance metrics and data drift are tracked via Evidently and Prometheus.
110
+
111
+ ## πŸ›‘οΈ License
112
+
113
+ This project is licensed under the MIT License - see the LICENSE file for details.