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.
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.
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
Install PyTorch following its installation instructions, then install the repository dependencies.
Prepare the pretrained model and weight file for English inference.
Run the command below, adjusting file paths to the chosen input and output files.
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.
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/bnand the repository data directory. - CUDA, as specified by the documented training command.
Steps
Install PyTorch following its installation instructions and install the repository dependencies.
Use the Bangla datasets provided in
data/bn.Run the command below.
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.
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

