OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Punctuation Restoration

Punctuation Restoration is an MIT-licensed Python implementation of transformer-based models that restore punctuation in English and Bangla text. The repository includes datasets, training and inference scripts, and a testing module.

Independent OpenViST project profile, based on linked sources.

Punctuation Restoration — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when you need a code-based workflow for training or applying punctuation-restoration models to English or Bangla text files.

Who it is for

  • Researchers reproducing or adapting a punctuation-restoration experiment.
  • Developers adding punctuation restoration to English or Bangla text-processing workflows.

Documented uses

  • Train a punctuation-restoration model using the included English or Bangla datasets.
  • Process an unpunctuated text file and save punctuation-restored output.
  • Test a trained model on processed data.
Before you choose

Requirements & limits

  • The repository provides separate datasets and documented training settings for English and Bangla.
  • Its model architecture combines a transformer encoder, bidirectional LSTM and linear prediction layer.
  • The documented setup requires PyTorch and repository dependencies; the example training commands specify CUDA.
  • Inference removes punctuation already present in the input.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Run inference on an English text file

Use the documented inference module to produce punctuated English text in an output file.

Before you start

  • PyTorch installed and the remaining dependencies installed with pip install -r requirements.txt.
  • An English pretrained model and its weight file.
  • An input text file.

Steps

  1. Install PyTorch following its installation instructions, then install the repository dependencies.

  2. Prepare the pretrained model and weight file for English inference.

  3. Run the command below, adjusting file paths to the chosen input and output files.

    Documented command
    python inference.py --pretrained-model=roberta-large --weight-path=roberta-large-en.pt --language=en --in-file=data/test_en.txt --out-file=data/test_en_out.txt

Expected outcome

The inference module writes punctuated text to the specified output file.

Guide limitations

  • The README says punctuation already present in the input is removed before inference.
  • The example depends on the named English model weights being available.
Source-based practical guide

Train a Bangla punctuation-restoration model

Train a Bangla model with the repository’s documented parameter settings.

Before you start

  • PyTorch and the dependencies installed with pip install -r requirements.txt.
  • The Bangla datasets in data/bn and the repository data directory.
  • CUDA, as specified by the documented training command.

Steps

  1. Install PyTorch following its installation instructions and install the repository dependencies.

  2. Use the Bangla datasets provided in data/bn.

  3. Run the command below.

    Documented command
    python src/train.py --cuda=True --pretrained-model=xlm-roberta-large --freeze-bert=False --lstm-dim=-1 --language=bangla --seed=1 --lr=5e-6 --epoch=10 --use-crf=False --augment-type=all --augment-rate=0.15 --alpha-sub=0.4 --alpha-del=0.4 --data-path=data --save-path=out

Expected outcome

The training script is configured to train a Bangla punctuation-restoration model and save its output under `out`.

Guide limitations

  • The documented command specifies CUDA.
  • The guide covers the documented training stage; using a trained model for inference is a separate workflow.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
29 November 2026
Original website title
maveryn/punctuation-restoration · Official homepage title · retained in its source language