French word segmentation
Usually when extracting text from open source OCRs like Tesseract, we're most likely to encounter linked words duo to OCR quality extraction.
For example : instead of extracting "Très bon service", one might get sudenlly "Très bonservice". So when doing feature engineering with BOW, TFIDF or even word2vec models, the algorithm will consider that "bonservice" as a unique feature, while it is not.
To deal with this problem, I built a module dealing with semantic word segmentation without any predefined corpus.
Installation
Use the package manager pip to install fr_word_segment.
pip3 install fr-word-segment
python3 -m spacy download fr
Usage
from fr_word_segment import wordseg
# suppose that a french spellchecker detect this token as misspelled
token = "soitmoinscompliqué"
# apply segmentation function on the given token
result = wordseg.segment_token(token)
# show results
print("raw token is {}".format(token)) # "soitmoinscompliqué"
print("processed token is {}".format(result)) # "soit moins compliqué"
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
Metadata
Release files for fr-word-segment 0.1.3
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 |
|---|---|---|---|---|
| fr_word_segment-0.1.3.tar.gz | 7.0 kB | Without provenance | Details for fr_word_segment-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fr_word_segment-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for fr_word_segment-0.1.3-py3-none-any.whl |
Total release size: 15.9 kB
Release files / fr_word_segment-0.1.3.tar.gz
| Download URL | fr_word_segment-0.1.3.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8740d6a110994ca9368891fbdcf1a6d4e03a22fc462f69d08329893fb2766985
|
|
BLAKE2b-256 checksum How to use checksums |
37946d912d1ba5d63b00772d0ca62356d4cd366addba66717e3ab2f9d573c381
|
| 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.8
|
Release files / fr_word_segment-0.1.3-py3-none-any.whl
| Download URL | fr_word_segment-0.1.3-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
46910181fed43e0543a3c1c098faa42f4fb8d7ddb0cc772c41892720202dbd6d
|
|
BLAKE2b-256 checksum How to use checksums |
3ff0b36b01dcc644c7e508381075061376d8b1607af1c3963408e147c51b030c
|
| 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.8
|
Security for fr-word-segment 0.1.3
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.