Extract keywords
extract_keywordsExtract important keywords from Chinese text using TF-IDF or TextRank ranking. Set top_k, filter by part-of-speech, and optionally include weights for each keyword.
Instructions
Extract the most important keywords from Chinese text.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "<text>"
},
"name": "extract_keywords"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Chinese text to process. | |
| top_k | No | Maximum number of keywords. | |
| method | No | tfidf: rank by TF-IDF against jieba's built-in IDF table; textrank: graph-based ranking of co-occurring words. | tfidf |
| allow_pos | No | Only keep words with these POS tags, e.g. ["n", "ns", "vn"]. Default: no filter for tfidf, ["ns", "n", "vn", "v"] for textrank. | |
| with_weight | No | Include each keyword's score. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | Yes | ||
| keywords | Yes | Keywords, highest score first. |