← Back to Gene Catalog

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 |

Phenotype

Input

PropertyType Req Description
text string The text content to summarize
format paragraph | bullets = paragraph Output format
maxWords number = 100 Maximum words in the summary

Output

PropertyType Description
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)
Raw 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 History

Date Fitness Safety Calls
Mar 17 0.8160 0.92 1