DeepSegment: A sentence segmenter that actually works!
Note: For the original implementation please use the "master" branch of this repo.
The Demo for deepsegment (en) + deeppunct is available at http://bpraneeth.com/projects/deeppunct
Code documentation available at http://bpraneeth.com/docs
Installation:
pip install --upgrade deepsegment
Supported languages:
en - english (Trained on data from various sources)
fr - french (Only Tatoeba data)
it - italian (Only Tatoeba data)
Usage:
from deepsegment import DeepSegment
# The default language is 'en'
segmenter = DeepSegment('en')
segmenter.segment('I am Batman i live in gotham')
# ['I am Batman', 'i live in gotham']
Using with tf serving docker image
docker pull bedapudi6788/deepsegment_en:v2
docker run -d -p 8500:8500 bedapudi6788/deepsegment_en:v2
from deepsegment import DeepSegment
# The default language is 'en'
segmenter = DeepSegment('en', tf_serving=True)
segmenter.segment('I am Batman i live in gotham')
# ['I am Batman', 'i live in gotham']
Finetuning DeepSegment
Since one-size will never fit all, finetuning deepsegment's default models with your own data is encouraged.
from deepsegment import finetune, generate_data
x, y = generate_data(['my name', 'is batman', 'who are', 'you'], n_examples=10000)
vx, vy = generate_data(['my name', 'is batman'])
# NOTE: name, epochs, batch_size, lr are optional arguments.
finetune('en', x, y, vx, vy, name='finetuned_model_name', epochs=number_of_epochs, batch_size=batch_size, lr=learning_rate)
Using with a finetuned checkpoint
from deepsegment import DeepSegment
segmenter = DeepSegment('en', checkpoint_name='finetuned_model_name')
Training deepsegment on custom data: https://colab.research.google.com/drive/1CjYbdbDHX1UmIyvn7nDW2ClQPnnNeA_m
Similar Projects:
https://github.com/bminixhofer/nnsplit (with bindings for Python, Rust and Javascript.)
Metadata
Release files for deepsegment 2.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| deepsegment-2.3.1.tar.gz | 8.3 kB | Without provenance | Details for deepsegment-2.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| deepsegment-2.3.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for deepsegment-2.3.1-py2.py3-none-any.whl |
Total release size: 28.6 kB
Release files / deepsegment-2.3.1.tar.gz
| Download URL | deepsegment-2.3.1.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b93341d0a8ae82fc69cf53647562d575113d0da421ebed097faddca2040a70e8
|
|
BLAKE2b-256 checksum How to use checksums |
65c9f7e03bf5aec372951d9086ddd538e51a372f8e10b7f1b7816fcd7acb2207
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.0
|
Release files / deepsegment-2.3.1-py2.py3-none-any.whl
| Download URL | deepsegment-2.3.1-py2.py3-none-any.whl |
|---|---|
| Size | 20.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
04943b1f908d4e482ca5388f5f6d595772da86bda82a9cbbecd08d8a8ae3e039
|
|
BLAKE2b-256 checksum How to use checksums |
c7a4dccb2a9356db844d7380d97fbaaa865f5ab8a929c7ffd2d77216367d30b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.0
|
Security for deepsegment 2.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.