feat: Add curated expert occupations with local data sources

- Add curated occupations seed files (210 entries in zh/en) with specific domains
- Add DBpedia occupations data (2164 entries) for external source option
- Refactor expert_source_service to read from local JSON files
- Improve keyword generation prompts to leverage expert domain context
- Add architecture analysis documentation (ARCHITECTURE_ANALYSIS.md)
- Fix expert source selection bug (proper handling of empty custom_experts)
- Update frontend to support curated/dbpedia/wikidata expert sources

Key changes:
- backend/app/data/: Local occupation data files
- backend/app/services/expert_source_service.py: Simplified local file reading
- backend/app/prompts/expert_transformation_prompt.py: Better domain-aware prompts
- Removed expert_cache.py (no longer needed with local files)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-04 16:34:35 +08:00
parent 8777e27cbb
commit 5571076406
15 changed files with 9970 additions and 380 deletions

View File

@@ -209,8 +209,9 @@ class ExpertTransformationDAGResult(BaseModel):
class ExpertSource(str, Enum):
"""專家來源類型"""
LLM = "llm"
CURATED = "curated" # 精選職業210筆含具體領域
DBPEDIA = "dbpedia"
WIKIDATA = "wikidata"
CONCEPTNET = "conceptnet"
class ExpertTransformationRequest(BaseModel):
@@ -226,7 +227,7 @@ class ExpertTransformationRequest(BaseModel):
# Expert source parameters
expert_source: ExpertSource = ExpertSource.LLM # 專家來源
expert_language: str = "zh" # 外部來源的語言
expert_language: str = "en" # 外部來源的語言 (目前只有英文資料)
# LLM parameters
model: Optional[str] = None