Browse plugins

plugin-enrich-summarize

A Flatfile plugin for text summarization and key phrase extraction

Install
npm i @flatfile/plugin-enrich-summarize
Package:
@flatfile/plugin-enrich-summarize 116 installs
Dependencies
@flatfile/plugin-record-hook@^1.7.0, compromise@^14.14.0

@flatfile/plugin-enrich-summarize

This plugin provides automatic text summarization capabilities for Flatfile using natural language processing. It uses the compromise library to generate summaries and extract key phrases from specified fields.

Event Type: commit:created

Supported Field Types: string

Features

  • Automatic text summarization
  • Key phrase extraction
  • Configurable summary length or percentage
  • Custom field mapping for content, summary, and key phrases
  • Error handling for missing content

Parameters

sheetSlug - string - (required)

The slug of the sheet to apply summarization.

contentField - string - (required)

The field containing the full text content.

summaryField - string - (required)

The field to store the generated summary.

keyPhrasesField - string - (required)

The field to store extracted key phrases.

summaryLength - number - (optional)

Number of sentences in the summary. Default is 2.

summaryPercentage - number - (optional)

Percentage of content to include in summary.

Usage

install

npm install @flatfile/plugin-enrich-summarize

import

import { FlatfileListener } from "@flatfile/listener";
import { summarize } from "@flatfile/plugin-enrich-summarize";

listener.js

const listener = new FlatfileListener();

listener.use(
  summarize({
    sheetSlug: "articles",
    contentField: "full_text",
    summaryField: "summary",
    keyPhrasesField: "key_phrases",
    summaryLength: 3
  })
);