Skip to content

DoanhPM/VNBS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VNBS - Vietnamese News Briefing System

Project IT4868 - Web Mining

📰 Hệ Thống Thu Thập và Điểm Tin Tự Động

🎯 Tổng quan

Hệ thống tự động thu thập, phân loại và tổng hợp tin tức tiếng Việt từ 20+ nguồn báo điện tử. Sử dụng mô hình PhoBert và ViT5 để phân loại và tạo điểm tin thông minh theo 15 chủ đề. Pipeline hệ thống

✨ Tính năng chính

  • Thu thập tự động từ RSS feeds của 23 báo điện tử
  • Phân loại chủ đề tự động bằng PhoBERT fine-tuned (15 chủ đề)
  • Tính điểm nổi bật đa tiêu chí cho bài viết
  • Tạo điểm tin tự nhiên bằng ViT5 fine-tuned
  • Giao diện web trực quan với Streamlit
  • Hệ thống cache tối ưu hiệu suất
  • Lựa chọn thông minh 10 bài nổi bật nhất

🚀 Cài đặt và chạy

Bước 1: Cài đặt môi trường

git clone https://github.com/DoanhPM/VNBS.git
cd webmining
python -m venv venv

#(Windows)
venv\Scripts\activate
#(Linux/Mac)
source venv/bin/activate

pip install -r requirements.txt

Bước 2: Chuẩn bị mô hình

models/
├── bertpho_news_classifier/    # Model phân loại
└── vit5_briefing_final/        # Model điểm tin

Bước 3: Thu thập dữ liệu

#Auto crawl 5p/lần
python run_crawler.py

Bước 4: Chạy chương trình

# Chạy qua CLI
python run.py 3  # Phân tích 3 giờ gần nhất

# Chạy web
cd web
streamlit run app.py

⚙️ Cấu hình

File cấu hình chính: crawl/rss_sources.py

RSS_SOURCES = [
    "https://vtv.vn/rss/home.rss",
    "https://nhandan.vn/rss/home.rss",
    ...
]

Tham số hệ thống: pipeline/analyzer.py

# Số bài cho điểm tin
MIN_BRIEFING_ITEMS = 5          # Ít nhất 5 bài mới tạo điểm tin
MAX_ARTICLES_FOR_BRIEFING = 10  # Lấy 10 bài điểm cao nhất
MAX_ARTICLES_TO_DISPLAY = 5     # Hiển thị 5 bài trong UI

# Cache
CACHE_TTL = 1800                # 30 phút
CACHE_DIR = "data/cache"

📁 Cấu trúc dự án

│   .gitignore
│   requirements.txt
│   run.py
│   run_crawler.py
│   __init__.py
│
├───crawl
│       cleaner.py
│       crawl_rss.py
│       rss_sources.py
│       __init__.py
│
├───data
│   │   news.jsonl
│   │
│   └───cache
│
├───Finetune
│   │   build_dataset.py
│   │   crawl.py
│   │   FineTune.ipynb
│   │   README.md
│   │   requirements.txt
│   │   rss_config.json
│   │   stats.py
│   │
│   ├───data
│   │       briefing_annotation.xlsx
│   │       briefing_train.jsonl
│   │       cls_train.jsonl
│   │       cls_val.jsonl
│   │       facts.jsonl
│   │       grouped.jsonl
│   │       news.jsonl
│   │       seen_urls.json
│   │
│   └───prepare
│           01_group_news.py
│           02_extract_facts.py
│           03_create_excel_for_briefing.py
│           04_excel_to_jsonl.py
│
├───models
│   │
│   ├───bertpho_news_classifier
│   │       added_tokens.json
│   │       bpe.codes
│   │       config.json
│   │       model.safetensors
│   │       special_tokens_map.json
│   │       tokenizer_config.json
│   │       training_args.bin
│   │       vocab.txt
│   │
│   └───vit5_briefing_final
│           config.json
│           generation_config.json
│           model.safetensors
│           special_tokens_map.json
│           spiece.model
│           tokenizer.json
│           tokenizer_config.json
│
├───pipeline
│       analyzer.py
│       article_scorer.py
│       briefing.py
│       briefing_optimizer.py
│       cache.py
│       topic_classifier.py
│       __init__.py
│
└───web
        app.py