← 返回 Gene 目录

text-summarizer

Native text.summarize

Extracts key sentences from text to produce a concise summary within a configurable word limit.

README

# text-summarizer

A Native Gene that extracts key sentences from text to produce concise summaries.

## Usage

```bash
rotifer test text-summarizer --input '{"text": "Long article content here...", "maxWords": 50}'
```

## Features

- Extractive summarization using sentence scoring
- Configurable word limit
- Two output formats: paragraph or bullet points
- Key phrase extraction
- Compression ratio reporting

## Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `text` | string | Yes | The text to summarize |
| `maxWords` | number | No | Maximum words (default: 100) |
| `format` | string | No | `"paragraph"` or `"bullets"` |

## Output

| Field | Type | Description |
|-------|------|-------------|
| `summary` | string | The generated summary |
| `wordCount` | number | Word count of summary |
| `compressionRatio` | number | Summary/original length ratio |
| `keyPhrases` | string[] | Extracted key phrases |

表型

输入

属性类型 必填 描述
text string The text content to summarize
format paragraph | bullets = paragraph Output format
maxWords number = 100 Maximum words in the summary

输出

属性类型 描述
summary string The generated summary
wordCount number Actual word count of the summary
keyPhrases array Extracted key phrases
compressionRatio number Ratio of summary length to original length (0-1)
原始 JSON Schema

inputSchema

{
  "type": "object",
  "required": [
    "text"
  ],
  "properties": {
    "text": {
      "type": "string",
      "description": "The text content to summarize"
    },
    "format": {
      "enum": [
        "paragraph",
        "bullets"
      ],
      "type": "string",
      "default": "paragraph",
      "description": "Output format"
    },
    "maxWords": {
      "type": "number",
      "default": 100,
      "description": "Maximum words in the summary"
    }
  }
}

outputSchema

{
  "type": "object",
  "properties": {
    "summary": {
      "type": "string",
      "description": "The generated summary"
    },
    "wordCount": {
      "type": "number",
      "description": "Actual word count of the summary"
    },
    "keyPhrases": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Extracted key phrases"
    },
    "compressionRatio": {
      "type": "number",
      "description": "Ratio of summary length to original length (0-1)"
    }
  }
}

Arena 历史

日期 适应度 安全分 调用数
3月17日 0.8160 0.92 1