建立完整的商品評論情感分析系統,讓使用者能夠:
- 自動收集電商平台的商品評論
- 進行中文評價的情感分析(正面/負面/中性)
- 提供詳細的視覺化分析報告
- 為商家提供有價值的報告
- Python 3.8+
- pandas & numpy
- scikit-learn
- jieba
- matplotlib & seaborn
- beautifulsoup4
src/
├── data_collector.py # 資料收集
├── sentiment_analyzer.py # 情感分析
├── visualizer.py # 視覺化
└── utils.py
sentiment-analysis/
├── data/ # 資料
│ ├── raw/
│ ├── processed/ # 處理
│ └── models/ # 模型
├── notebooks/ # Jupyter Notebooks
├── src/ # Core
├── config/
├── tests/ # 測試
├── api/ # (Future) API
├── frontend/ # (Future) 前端介面
└── deployment/ # (Future) 部署
# clone project
git clone [your-repo-url]
cd sentiment-analysis-project
# venv
python -m venv venv
source venv/bin/activate # for Linux/Mac
# or venv\Scripts\activate # for Windows
# requirements
pip install -r requirements.txt# start Jupyter Notebook
jupyter notebook
# 1. notebooks/01_data_collection.ipynb - collect data
# 2. notebooks/02_data_exploration.ipynb - (future)explore
# 3. notebooks/03_data_preprocessing.ipynb - (future)preprocessing
# 4. notebooks/04_model_training.ipynb - (future)模型訓練
# 5. notebooks/05_results_analysis.ipynb - (future)結果from src.data_collector import ReviewCollector
from src.sentiment_analyzer import SentimentAnalyzer
# 收集評價
collector = ReviewCollector()
reviews = collector.collect_reviews("iPhone 15", max_reviews=100)
# 情感分析
analyzer = SentimentAnalyzer()
results = analyzer.predict(reviews['review'].tolist())- 商品評論資料收集(mock datas)
- 中文文本預處理
- 多種視覺化圖表
- 完整的 Jupyter 分析
- 情感分析模型訓練
- 真實網站爬蟲功能
- (更進階) NLP 模型
- 商品分析
- RESTful API
- Web 前端介面
- Docker 容器化部署
- Cloud Service 整合
- 即時監控 dashboard
- 正面: 65%
- 中性: 25%
- 負面: 10%
- 消費者最關心的是產品品質和CP值
- 負面評論主要集中在客服和物流體驗
- 評論情感與評分有70%的一致性