• This repository has been archived on 16/Nov/2021
  • Stars
    star
    243
  • Rank 166,458 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Punctuation restoration and spell correction experiments.

fastPunct : Punctuation restoration and spell correction experiments.

Downloads

Installation:

pip install --upgrade fastpunct

Supported languages:

english

Usage:

As a python module

from fastpunct import FastPunct
# The default language is 'english'
fastpunct = FastPunct()
fastpunct.punct([
                "john smiths dog is creating a ruccus",
                "ys jagan is the chief minister of andhra pradesh",
                 "we visted new york last year in may"
                 ])
                 
# ["John Smith's dog is creating a ruccus.",
# 'Ys Jagan is the chief minister of Andhra Pradesh.',
# 'We visted New York last year in May.']

# punctuation correction with optional spell correction (experimental)

fastpunct.punct([
                  'johns son peter is marring estella in jun',
                   'kamal hassan is a gud actr'], correct=True)
                   
# ["John's son Peter is marrying Estella in June.",
# 'Kamal Hassan is a good actor.']

As a docker container

# Start the docker container
docker run -it -p8080:8080 -eBATCH_SIZE=4 notaitech/fastpunct:english

# Run prediction
curl -d '{"data": ["i was hungry i ordered a pizza my name is batman"]}' -H "Content-Type: application/json" "http://localhost:8080/sync"

# {"prediction": ["I was hungry, I ordered a pizza, my name is Batman."], "success": true}