hotel-intel 資料中心
hotel-intel 資料中心
Section titled “hotel-intel 資料中心”台灣飯店情報中心。自動化 Python pipeline 收集 Google 評論,產出:
- 統計數據:地區/全國飯店業統計(商務談判關鍵數據,不公開)。
- SEO 素材:評論關鍵字與內容萃取,供外部網站產出飯店文章。
是整個套裝的資料層,餵給 topreview-hotel 情報層。
技術棧:Python 3.10+ / psycopg2 / PostgreSQL / Loguru / ruff。
深度文件在 repo:
~/Code/hotel-intel/(CLAUDE.md、01–07 框架、docs/data-pipeline-guide.md)。
Pipeline 流程
Section titled “Pipeline 流程”兩條:
統計 pipeline:ingest → verify → reviews → compute → stats → city-industry
Content pipeline(內容清洗,6 步) — 操作手冊見 repo docs/data-pipeline-guide.md:
ingest_worker.py— Serper API 發現地點 → shops 表crawl_hotel_content.py— 爬官網 + 外部搜索 →{id}.jsonclean_hotel_content.py— regex 清洗(in-place)llm_clean_chunk.py— LLM 分段分類 →{id}.cleaned.jsonimport_hotels_chromadb.py— 匯入 rag-service ChromaDBscore_content_richness.py— 評分回寫 DB
備份(PostgreSQL → GFS)
Section titled “備份(PostgreSQL → GFS)”走共用框架 ~/Code/backup-toolkit/(hotel-intel 是第一個 consumer)。
| 動作 | 指令 |
|---|---|
| 每天自動 | cron 30 3 * * * → scripts/backup-db-gfs.sh |
| 手動備份 | make backup-db-gfs |
| 健康檢查 | make backup-health |
| 還原 | make restore-db-gfs(詳見 backup-toolkit/CLAUDE.md) |
鐵則:還原進現有 DB 前,先確認當天已備份。面對 schema drift 用
--fresh-db,別對現 DB 用--clean。
待補(給維護者)
Section titled “待補(給維護者)”- pipeline 各步驟的觸發方式與排程(是否經 llm-task-web 排程)
- 評論資料如何交給 topreview-hotel(接點)
- backup 主動告警(目前
backup-health無 wire 進 notify,長期 follow-up)