Chaotic-chaos / my_punctuator_cpp

Depoly my punctuator via Libtorch using Wenet style. The first time I wrote C++.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build myPunctuator as a python's cpp extension

Installation

# clone this repository
git clone https://github.com/Chaotic-chaos/my_punctuator_cpp.git

# perpare an environment
python -m vnev venv # or whatever ways u'd like

# move into the right directory
cd punctuator_installer/

# start the building and installation
python setup.py install

Usage

Initiate the module

import punctuator

model = punctuator()

Setup the model

model = model.setup_model("path/to/model.pth")

Inference && Decode

res = model.decode("<string of the word_ids>")

# maximum snetence length is 512

For more details please refer to use_sample.py

Reference

Tech details

About

Depoly my punctuator via Libtorch using Wenet style. The first time I wrote C++.


Languages

Language:C++ 58.4%Language:CMake 21.7%Language:Python 19.8%