punctuation-restore

A Node.js package that restores punctuation and casing to unpunctuated text using the punctuation_fullstop_truecase_english ONNX model: https://huggingface.co/1-800-BAD-CODE/punctuation_fullstop_truecase_english

A Node.js package that restores punctuation and casing to unpunctuated text using the punctuation_fullstop_truecase_english ONNX model from Hugging Face. It restores punctuation marks such as periods, commas, and question marks, handles casing, and supports batch processing of multiple texts through the ONNX runtime. Required models are downloaded automatically from Hugging Face on first use and saved locally to the ./models directory for reuse. The main PunctuationRestorer class exposes an async restore(texts) method that returns punctuated, cased sentences and handles model initialization and cleanup automatically.

Installation

npm install punctuation-restore