03-ai-classification.md
AI Agent Target: Explains the workflow for
classify_questions_ai.pyandgenerate_question_embeddings.pyfor automated data augmentation.
Human Target: 使用 Python 腳本自動分類問題與產生向量嵌入的指南。
classify_questions_ai.py 使用指南此腳本使用生成式 AI (如 Gemini) 讀取問題文字,並自動將其分類至預定義的領域 (領域 1-6)。
前置作業:
secrets.json 中有效的 AI API 金鑰工作流程:
topic 為 null 的問題。classified_ids.json,避免失敗時重複處理。generate_question_embeddings.py使用本地或雲端嵌入模型產生 768 維的向量嵌入。
pgvector 擴展儲存於 Supabase PostgreSQL 資料庫中。