compromise  by spencermountain

JavaScript NLP toolkit for text data transformation

Created 15 years ago
12,142 stars

Top 4.4% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

Compromise is a JavaScript library for making natural language text data actionable. It targets developers needing efficient text processing, offering a lightweight and fast solution for parsing, tagging, and transforming text in browsers or Node.js. Its benefit lies in simplifying NLP tasks with sensible, limited decisions, making text usable without complex AI models.

How It Works

The library conjugates a core lexicon (~14,000 words), making "limited and sensible decisions" for speed and a small footprint. It tokenizes text, applies part-of-speech tagging, and grammar interpretation. Its modular design includes compromise/one (tokenizer), compromise/two (tagger), and compromise/three (phrase tooling).

Quick Start & Requirements

Install via npm install compromise. Designed for client-side JavaScript and Node.js, it's ~250kb minified. No advanced prerequisites are mentioned. Documentation is available at docs.compromise.cool.

Highlighted Details

  • Multilingual: Basic support for French, German, Italian, and Spanish.
  • Modularity: Distinct builds (/one, /two, /three) for tokenization, tagging, and phrase manipulation.
  • Performance: Optimized for speed, suitable for keypress events and processing large text volumes (~1MB/sec).
  • Extensibility: Supports custom words, tags, and plugins.
  • Features: Handles verb conjugation, number parsing, contractions, and named entities.

Maintenance & Community

The project lists "many contributors" but lacks specific details on active maintenance, community channels, or a public roadmap.

Licensing & Compatibility

The README does not explicitly state a software license. This omission may hinder commercial adoption or integration into closed-source projects, requiring further investigation.

Limitations & Caveats

Key limitations include:

  • Slash Handling: Treats slashes as word separators.
  • Inter-Sentence Matching: Not supported by default.
  • Nested Match Syntax: Limited; requires sequential .match() calls for complex patterns.
  • Dependency Parsing: Lacks full sentence syntax tree understanding.
  • JavaScript Environment: Not a replacement for heavy Python NLP libraries; synchronous processing can be a consideration.
Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
3
Issues (30d)
1
Star History
19 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.