File size: 2,569 Bytes
c09e844
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---

title: Product Rating Prediction System
emoji: ⭐
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
license: mit
---


# ⭐ Product Rating Prediction System

A production-ready AI-powered system for predicting product ratings from Vietnamese customer comments using PhoBERT.

## 🎯 Features

- πŸ€– **Deep Learning Model**: PhoBERT-based sentiment analysis
- πŸ’¬ **Single & Batch Predictions**: Process one comment or thousands via CSV
- πŸ“Š **Visual Analytics**: Word clouds and rating distribution charts
- πŸ” **Secure Authentication**: JWT-based user management
- 🌐 **Full-Stack Web App**: FastAPI backend + Jinja2 frontend
- πŸ—„οΈ **External Database**: PostgreSQL support for scalability

## πŸš€ Quick Start

### For Users
1. Click the link above to access the live application
2. Register a new account
3. Upload a CSV file with comments or enter a single comment
4. View predictions, visualizations, and download results

### For Developers
This Space requires environment variables to connect to an external PostgreSQL database. See [HUGGING_FACE_DEPLOYMENT.md](HUGGING_FACE_DEPLOYMENT.md) for setup instructions.

## πŸ“š API Documentation

Once the app is running, access:
- **Swagger UI**: `/docs`
- **ReDoc**: `/redoc`

## πŸ”§ Technology Stack

- **Backend**: FastAPI, SQLAlchemy, Uvicorn
- **ML/NLP**: PyTorch, Transformers, PhoBERT
- **Frontend**: Jinja2, TailwindCSS, Chart.js
- **Database**: PostgreSQL (external)
- **Security**: JWT, bcrypt

## πŸ“– Documentation

- [Deployment Guide](HUGGING_FACE_DEPLOYMENT.md)
- [Environment Variables](HF_ENV_VARIABLES.md)
- [Architecture](ARCHITECTURE.md)

## 🐳 Docker

This Space uses the Docker SDK to support heavy ML models (>500MB). The container runs on port 7860 as required by Hugging Face Spaces.

## πŸ”’ Privacy & Security

- All passwords are hashed with bcrypt
- JWT tokens for secure authentication
- External PostgreSQL database with SSL
- No data stored in the container (stateless)

## πŸ“Š Model Information

- **Base Model**: PhoBERT (Vietnamese BERT)
- **Task**: Sentiment Analysis β†’ Rating Prediction (1-5 stars)
- **Language**: Vietnamese
- **Model Size**: ~500MB

## πŸ†˜ Support

For issues or questions:
1. Check the logs tab above
2. Review [HUGGING_FACE_DEPLOYMENT.md](HUGGING_FACE_DEPLOYMENT.md)
3. Open an issue in the repository

## πŸ“„ License

MIT License - See LICENSE file for details

---

**Built with ❀️ using FastAPI, PhoBERT, and Hugging Face Spaces**