Summary.js
๐ Summary.JS is a Light Weight Article Summary Library for Vanilla JavaScript and Node.js
Install / Use
/learn @Lian-D/Summary.jsREADME
Summary.js
A lightweight paragraph summarizer library which can be manipulated to preferred specifications. Utilizing the lex rank algorithm to score sentences. Not as effective as using TensorFlow and NLM but provides a nice middle ground.
Total file size < 10 kb
Main
dist/
โโโ summary.js (UMD)
โโโ summary_minfied.js (UMD, compressed)
โโโ summary_legacy.js s (Old legacy summarizer)
โโโ summary_legacy_minfied.js (Old legacy summarizer, compressed)
โโโ summary_node.js (Node.js module)
Installation
Include files:
<script src="/path/to/summary.js"></script>
Usage
summarize(text, sentences, keywordsInt);
where text is the input text
sentences is the number of sentences you want to return
keywordsInt is the number of keywords you want to factor in during the scoring process
This will return an object:
{
keywords: an array of keywords,
text: the raw string summary
characterSummed: the number or words in this summary
characterOrig: the number of words in the original summary
reductionfactor: the % reduction factor
}
How does it work?
The core algorithm works in a couple of steps
- Calculate the occurrence of each word in the text.
- Detect which periods represent the end of a sentence. (e.g "Dr." does not).
- Split up the text into individual sentences.
- Rank sentences by the sum of their words' points and keyword points.
- Return X of the most highly ranked sentences in chronological order.
Contributing
Please read through our contributing guidelines.
Related Skills
node-connect
347.6kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.6kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.6kQQBot ๅฏๅชไฝๆถๅ่ฝๅใไฝฟ็จ <qqmedia> ๆ ็ญพ๏ผ็ณป็ปๆ นๆฎๆไปถๆฉๅฑๅ่ชๅจ่ฏๅซ็ฑปๅ๏ผๅพ็/่ฏญ้ณ/่ง้ข/ๆไปถ๏ผใ
