CoolFace
Apppublic

gnudevx/Recommendation-System

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
README.md513 linesDownload Raw Back to root
1---2title: It Job Finder Ai Cv3emoji: 💼4colorFrom: blue5colorTo: green6sdk: docker7pinned: false8---9 10# 🤖 AI Recommendation System11 12<div align="center">13 14![Python](https://img.shields.io/badge/Python-3.11+-3776AB?style=for-the-badge&logo=python&logoColor=white)15![FastAPI](https://img.shields.io/badge/FastAPI-0.115.0-009688?style=for-the-badge&logo=fastapi&logoColor=white)16![MongoDB](https://img.shields.io/badge/MongoDB-7.x-47A248?style=for-the-badge&logo=mongodb&logoColor=white)17![Docker](https://img.shields.io/badge/Docker-Compose-2496ED?style=for-the-badge&logo=docker&logoColor=white)18![Sentence Transformers](https://img.shields.io/badge/SentenceTransformers-Embedding-orange?style=for-the-badge)19 20**Hệ thống Recommendation thông minh sử dụng Semantic Embedding + Vector Similarity Search cho bài toán gợi ý việc làm IT**21 22[Demo](#) · [Report Bug](https://github.com/ohure1297/Recommendation-System/issues) · [Contributing](#đóng-góp)23 24</div>25 26---27 28# 📋 Mục lục29 30- [Tổng quan dự án](#-tổng-quan-dự-án)31- [Tính năng nổi bật](#-tính-năng-nổi-bật)32- [Tech Stack](#-tech-stack)33- [Kiến trúc hệ thống](#-kiến-trúc-hệ-thống)34- [Luồng recommendation](#-luồng-recommendation)35- [Cấu trúc thư mục](#-cấu-trúc-thư-mục)36- [Giải thích thành phần](#-giải-thích-thành-phần)37- [Cài đặt & Chạy dự án](#-cài-đặt--chạy-dự-án)38- [API Documentation](#-api-documentation)39- [Design Patterns](#-design-patterns)40- [Challenges & Solutions](#-challenges--solutions)41 42---43 44# 🎯 Tổng quan dự án45 46**AI Recommendation System** là hệ thống recommendation thông minh giúp phân tích CV, vector hóa dữ liệu và tính toán semantic similarity nhằm gợi ý việc làm IT phù hợp với kỹ năng, kinh nghiệm và địa điểm của người dùng.47 48Hệ thống sử dụng:49 50- Sentence Transformers Embedding51- Cosine Similarity52- Vector-based Recommendation53- CV Parsing Pipeline54- Semantic Matching55 56Mục tiêu của dự án là cải thiện độ chính xác recommendation so với phương pháp keyword matching truyền thống.57 58---59 60## 🧠 Vấn đề được giải quyết61 62| Vấn đề                           | Giải pháp                                    |63| -------------------------------- | -------------------------------------------- |64| Keyword matching thiếu chính xác | Semantic Embedding                           |65| CV có format không đồng nhất     | CV preprocessing pipeline                    |66| Search không hiểu ngữ nghĩa      | Vector Similarity Search                     |67| Recommendation chưa cá nhân hóa  | Matching theo skills + experience + location |68| Dữ liệu location không đồng nhất | City normalization logic                     |69 70---71 72# ✨ Tính năng nổi bật73 74- 📄 CV Parsing & Processing75- 🔍 Semantic Job Recommendation76- 🧩 Vector Embedding Similarity Search77- 📍 Location-aware Recommendation78- ⚡ Fast Similarity Calculation79- 🐳 Dockerized Deployment80- 📊 Structured Recommendation Pipeline81- 🔄 Modular AI Processing Scripts82 83---84 85# 🛠 Tech Stack86 87## Core Framework88 89| Công nghệ | Vai trò            |90| --------- | ------------------ |91| FastAPI   | REST API framework |92| Uvicorn   | ASGI server        |93| Pydantic  | Data validation    |94 95---96 97## AI / Machine Learning98 99| Công nghệ             | Vai trò                       |100| --------------------- | ----------------------------- |101| sentence-transformers | Generate semantic embeddings  |102| scikit-learn          | Cosine similarity calculation |103| NumPy                 | Numerical computation         |104| Pandas                | Data preprocessing            |105 106---107 108## Database & Infrastructure109 110| Công nghệ      | Vai trò                       |111| -------------- | ----------------------------- |112| MongoDB        | Store jobs & CV data          |113| Docker         | Containerization              |114| Docker Compose | Multi-container orchestration |115 116---117 118# 🏗 Kiến trúc hệ thống119 120```text121┌────────────────────────────────────────────────────┐122│                CLIENT / FRONTEND                  │123└──────────────────────┬────────────────────────────┘124125126┌────────────────────────────────────────────────────┐127│               FASTAPI APPLICATION                 │128│                                                    │129│   ┌─────────────┐      ┌────────────────────┐      │130│   │  Upload CV  │      │ Recommendation API │      │131│   └──────┬──────┘      └──────────┬─────────┘      │132└──────────│────────────────────────│────────────────┘133           │                        │134           ▼                        ▼135┌──────────────────┐      ┌─────────────────────────┐136│  CV Processing   │      │ Similarity Calculation │137│  Pipeline        │      │ Cosine Similarity      │138└────────┬─────────┘      └──────────┬──────────────┘139         │                           │140         ▼                           ▼141┌────────────────────────────────────────────────────┐142│         Sentence Transformer Embeddings            │143└──────────────────────┬─────────────────────────────┘144145146┌────────────────────────────────────────────────────┐147│                    MongoDB                        │148│        CV Data + Job Data + Embeddings           │149└────────────────────────────────────────────────────┘150```151 152---153 154# 🔄 Luồng Recommendation155 156## CV Recommendation Pipeline157 158```text159CV Upload160161162Text Extraction163164165Data Cleaning166167168Skill Extraction169170171Experience Parsing172173174Location Normalization175176177Embedding Generation178179180Similarity Matching181182183Top-K Job Recommendation184```185 186---187 188## Semantic Matching Workflow189 190```text191User CV192193194Sentence Transformer195196197Vector Embedding198199200Cosine Similarity201202203Ranking Algorithm204205206Recommended Jobs207```208 209---210 211# 📁 Cấu trúc thư mục212 213```text214Recommendation-System/215216├── .dockerignore217├── .gitignore218219├── Dockerfile220├── docker-compose.yml221├── requirements.txt222├── README.md223224├── CV_based.py225├── cv_utils.py226├── cv_embedding_update.py227├── job_embedding_update.py228├── migrate_jobs.py229└── cities.py230```231 232---233 234# 🔍 Giải thích thành phần235 236## `CV_based.py` — Main Recommendation API237 238File trung tâm của hệ thống recommendation.239 240Chức năng:241 242- Upload & xử lý CV243- Recommendation pipeline244- Similarity matching245- API endpoints246- Response generation247 248---249 250## `cv_utils.py` — CV Processing Utilities251 252Chứa các utility functions:253 254- Extract text từ PDF255- Skill extraction256- Experience parsing257- Text preprocessing258- Data normalization259 260---261 262## `cv_embedding_update.py` — CV Embedding Pipeline263 264Sinh vector embeddings cho CV.265 266```python267embedding = model.encode(cv_text)268```269 270Embedding giúp hệ thống hiểu semantic meaning thay vì keyword matching đơn thuần.271 272---273 274## `job_embedding_update.py` — Job Embedding Pipeline275 276Tạo embeddings cho job descriptions để phục vụ recommendation.277 278Workflow:279 280```text281Job Description282283284Text Cleaning285286287Embedding Generation288289290Store Embedding291```292 293---294 295## `migrate_jobs.py` — Data Migration Script296 297Script phục vụ:298 299- Import jobs300- Data preprocessing301- Data normalization302- Database migration303 304---305 306## `cities.py` — Location Matching Logic307 308Xử lý location normalization và city matching.309 310Ví dụ:311 312```text313TP.HCM314Ho Chi Minh315HCM316 317→ Ho Chi Minh City318```319 320Giúp recommendation theo location chính xác hơn.321 322---323 324# 🚀 Cài đặt & Chạy dự án325 326## Yêu cầu327 328- Python 3.11+329- MongoDB330- Docker & Docker Compose331 332---333 334## 1. Clone repository335 336```bash337git clone https://github.com/ohure1297/Recommendation-System.git338 339cd Recommendation-System340```341 342---343 344## 2. Tạo virtual environment345 346```bash347python -m venv venv348```349 350---351 352## 3. Activate environment353 354### Windows355 356```bash357venv\Scripts\activate358```359 360### Linux / macOS361 362```bash363source venv/bin/activate364```365 366---367 368## 4. Install dependencies369 370```bash371pip install -r requirements.txt372```373 374---375 376## 5. Chạy hệ thống377 378```bash379uvicorn CV_based:app --reload380```381 382---383 384## 6. Chạy bằng Docker385 386```bash387docker-compose up --build388```389 390---391 392# 📡 API Documentation393 394Sau khi chạy server:395 396```text397http://localhost:8010/docs398```399 400---401 402# 🔌 API Endpoints403 404## `GET /`405 406Health check endpoint.407 408Response:409 410```json411{412  "message": "Recommendation API Running"413}414```415 416---417 418## `POST /recommend`419 420Request:421 422```json423{424  "cv_text": "Python backend developer with 3 years experience"425}426```427 428Response:429 430```json431{432  "recommendations": [433    {434      "job_title": "Backend Developer",435      "similarity_score": 0.91436    }437  ]438}439```440 441---442 443# 🎨 Design Patterns444 445## 1. Modular Script-based Architecture446 447Hệ thống được tổ chức theo từng processing modules riêng biệt:448 449- CV processing450- Embedding generation451- Similarity calculation452- Recommendation ranking453 454Giúp dễ maintain và mở rộng pipeline.455 456---457 458## 2. Separation of Concerns459 460| Module                  | Responsibility         |461| ----------------------- | ---------------------- |462| cv_utils.py             | CV processing          |463| cv_embedding_update.py  | CV embeddings          |464| job_embedding_update.py | Job embeddings         |465| migrate_jobs.py         | Data migration         |466| cities.py               | Location normalization |467 468---469 470## 3. Vector-based Recommendation471 472Recommendation dựa trên:473 474```text475Semantic Similarity476```477 478thay vì keyword matching truyền thống.479 480---481 482# 💡 Challenges & Solutions483 484| Challenges                           | Solutions                       |485| ------------------------------------ | ------------------------------- |486| CV format không đồng nhất            | CV preprocessing pipeline       |487| Recommendation thiếu chính xác       | Sentence Transformer embeddings |488| Search không hiểu ngữ nghĩa          | Vector similarity search        |489| Matching theo location khó chính xác | City normalization              |490| Recommendation ranking chưa tối ưu   | Similarity scoring              |491 492---493 494# 📈 Future Improvements495 496- [ ] Hybrid Recommendation System497- [ ] Deep Learning Ranking Model498- [ ] Real-time Recommendation499- [ ] Recommendation Analytics Dashboard500- [ ] Kubernetes Deployment501- [ ] CI/CD Pipeline502- [ ] Multi-language Recommendation503- [ ] Distributed Vector Search504 505---506 507# 👤 Author508 509**Ohure1297**510 511GitHub:512https://github.com/ohure1297513