
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
Recall-Oriented Understudy for Gisting Evaluation (ROUGE) Evaluation Functions with TypeScript support
A JavaScript implementation of the Recall-Oriented Understudy for Gisting Evaluation (ROUGE) evaluation metric for summaries. This package implements the following metrics:
Note: This is a fork of the original ROUGE.js by kenlimmj. This fork adds TypeScript types and other improvements.
ROUGE is somewhat a standard metric for evaluating the performance of auto-summarization algorithms. However, with the exception of MEAD (which is written in Perl. Yes. Perl.), requesting a copy of ROUGE to work with requires one to navigate a barely functional webpage, fill up forms, and sign a legal release somewhere along the way while at it. These definitely exist for good reason, but it gets irritating when all one wishes to do is benchmark an algorithm.
Nevertheless, the paper describing ROUGE is available for public consumption. The appropriate course of action is then to convert the equations in the paper to a more user-friendly format, which takes the form of the present repository. So there. No more forms. See how life could have been made a lot easier for everyone if we were all willing to stop writing legalese or making people click submit buttons?
This package is available on NPM:
npm install js-rouge
To use it:
import { n, l, s } from 'js-rouge'; // ES Modules
// OR
const { n, l, s } = require('js-rouge'); // CommonJS
To run tests:
npm test
js-rouge provides three main functions:
n(candidate, reference, opts)l(candidate, reference, opts)s(candidate, reference, opts)All functions take a candidate string, a reference string, and an optional configuration object.
import { l as rougeL } from 'js-rouge';
const reference = 'police killed the gunman';
const candidate = 'police kill the gunman';
const score = rougeL(candidate, reference, { beta: 0.5 });
console.log('score:', score); // => 0.75
The package also exports utility functions, including jackknife resampling as described in the original paper:
import { n as rougeN, jackKnife } from 'js-rouge';
const reference = 'police killed the gunman';
const candidates = [
'police kill the gunman',
'the gunman kill police',
'the gunman police killed',
];
// Standard evaluation taking the arithmetic mean
jackKnife(candidates, reference, rougeN);
// A function that returns the max value in an array
const distMax = (arr) => Math.max(...arr);
// Modified evaluation taking the distribution maximum
jackKnife(candidates, reference, rougeN, distMax);
This package is written in TypeScript and includes type definitions. All functions and utilities are fully typed.
Development will be maintained under the Semantic Versioning guidelines as much as possible in order to ensure transparency and backwards compatibility.
Releases will be numbered with the following format:
<major>.<minor>.<patch>
And constructed with the following guidelines:
For more information on SemVer, visit http://semver.org/.
Have a bug or a feature request? Please open a new issue.
Please submit all pull requests against the main branch. All code should pass ESLint validation and tests.
The amount of data available for writing tests is unfortunately woefully inadequate. We've tried to be as thorough as possible, but that eliminates neither the possibility of nor existence of errors. The gold standard is the DUC data-set, but that too is form-walled and legal-release-walled, which is infuriating. If you have data in the form of a candidate summary, reference(s), and a verified ROUGE score you do not mind sharing, we would love to add that to the test harness.
MIT
FAQs
Recall-Oriented Understudy for Gisting Evaluation (ROUGE) Evaluation Functions with TypeScript support
The npm package js-rouge receives a total of 40,533 weekly downloads. As such, js-rouge popularity was classified as popular.
We found that js-rouge demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.