A Flatfile plugin for text summarization and key phrase extraction
npm i @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
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.
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
})
);