baidu-baike-data

TotalClaw 作者 totalclaw

百度百科组件是一款旨在查询各种名词的权威百科解释的知识服务工具。其核心功能是给定用户提供的特定“名词”(物体、人、地点、概念、事件等),返回来自百度百科的标准化、详细的词条解释。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~ide-rea-baidu-baike-data
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~ide-rea-baidu-baike-data/file -o ide-rea-baidu-baike-data.md
# Baidu Baike

Query encyclopedia entries from Baidu Baike.

## Two Usage Scenarios

### Scenario 1: Direct Search
Get default matching entry for a keyword.
```bash
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.
```bash
# 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
```bash
export BAIDU_API_KEY="your_api_key"
```

## Workflow
1. Extract noun from query
2. For ambiguous terms, call LemmaList first
3. User selects entry from list
4. Call LemmaContent with selected ID
5. Return structured data

---

## 中文说明

# 百度百科

从百度百科查询百科词条。

## 两种使用场景

### 场景 1:直接搜索
获取关键词的默认匹配词条。
```bash
python3 scripts/baidu_baike.py --search_type=lemmaTitle --search_key="keyword"
```

### 场景 2:同名词消歧
当某词有多个词条时,列出它们并按 ID 选择。
```bash
# 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:列出同名标题的词条
- LemmaContent:按标题或 ID 获取词条详情

## 设置
```bash
export BAIDU_API_KEY="your_api_key"
```

## 工作流
1. 从查询中提取名词
2. 对于歧义词,先调用 LemmaList
3. 用户从列表中选择词条
4. 用选定的 ID 调用 LemmaContent
5. 返回结构化数据