1.2 KiB
1.2 KiB
name, description, homepage, metadata
| name | description | homepage | metadata | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| baidu-baike-data | 百度百科组件是一个知识服务工具,用于查询各种名词的权威百科解释。 | https://baike.baidu.com/ |
|
Baidu Baike
Query encyclopedia entries from Baidu Baike.
Two Usage Scenarios
Scenario 1: Direct Search
Get default matching entry for a keyword.
python3 scripts/baidu_baike.py --search_type=lemmaTitle --search_key="keyword"
Scenario 2: Homonym Resolution
When term has multiple entries, list them and select by ID.
# List entries with same name
python3 scripts/baidu_baike.py --search_type=lemmaList --search_key="keyword" --top_k=5
# Get specific entry by ID
python3 scripts/baidu_baike.py --search_type=lemmaId --search_key="entry_id"
API
- LemmaList: List entries with same title
- LemmaContent: Get entry details by title or ID
Setup
export BAIDU_API_KEY="your_api_key"
Workflow
- Extract noun from query
- For ambiguous terms, call LemmaList first
- User selects entry from list
- Call LemmaContent with selected ID
- Return structured data