Skip to main content

TextPreprocessing

This is the beta release of TextPreprocessing library. This library currenly capable of cleansing your text data for modal training.

TextPreprocessing library can do the below actions:

* Expand general abbreviations

* Clear email ids in the text data

* Clear web URLs

* Clear html tags present in the text dataset

* Clear ordianl, cardinal numbers, date, person name, etc.

* Clear gibberish charsets

* Removes english stop words

* Lemetize the text

* Correct spelling errors.

We are enhancing this package on a regular basis and adding more flexible components to it in the upcoming releases. Please do update this package on frequently.

How to install this package?


pip install TextPreprocessing



  • Post installing the package, please install spacy en_core_web_md library.

python spacy download en_core_web_md

How to use the package?


>>> from TextPreprocessing.preprocess import preprocess

>>> obj = preprocess()

>>> obj.__version__

'3.0.0'

>>> entities_ignore_list = ["PERSON", "ORDINAL", "CARDINAL", "DATE", "TIME", "PRODUCT"]

>>> obj.load_language_model("en_core_web_md") // Add any spacy language model

>>> obj.set_entity_ignore_list(entities_ignore_list) // Add the list of entities needs to excluded from your dataset.

>>> texts = ["""Good morning Natalia A, here are the detailed items listed below:  Loan ID: PNIO-UIZD Store Invoice: NOT SENT (ONLY Affirm Transaction ID) Transaction ID: 0011473451  Please let me know of any other info needed to assist you in regards to this unfulfilled purchase.  Sincerely,  William Langford  Again, here is the credentials required to process my request, reference #: 210916-000538""", """Adam,  Sorry, I was out of town with limited network access but getting back to you now.  I don’t think I made myself clear enough before, I have had MyC loud Version 5 installed for over a year on the PR4100 but, there was a new version 5 update automatically installed on October 30, 2021 with version 5.18.117 and since that update, we have not been able to access the PR4100 locally through the network.  We can however access the PR4100 using the mycloud.com web access.  The PR4100 is connected to the internet with the Google Nest router and we are able to access the dashboard pages with no issues.  Please find the attached error we get after accessing the PR4100 a second time after reboot and any time thereafter.  



Thank you in advance.  

Brent D. Beck

d.b.beck77@gmail.com

https://www.facebook.com/db.beck77

"""]

>>> obj.reset_start()

>>> results = list(map(lambda x: obj.cleanup(x, len(texts)), texts))

1/2

2/2



>>> print(results)

Output


['good morning detailed item list loan i d no did store voice send affirm transaction i d transaction i d 0011473451 let know into need assist regard unfulfilled purchase sincerely credentials require process request reference 210916 0538', 'sorry town limit network access get donaTMt think clear my loud version instal year new version update automatically instal version 18 117 update able access locally network access cloud com web access connect internet goose nest outer able access dashboard page issue find attach error access time report time thank advance']



Metadata

Release files for TextPreprocessing 3.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TextPreprocessing 3.4.0
File Size Uploaded
TextPreprocessing-3.4.0.tar.gz 8.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for TextPreprocessing 3.4.0
File Interpreter ABI Platform
TextPreprocessing-3.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / TextPreprocessing-3.4.0.tar.gz

Download URL TextPreprocessing-3.4.0.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d7c5e175ea9ee5f74fb73e84a9938001b9c5db4ce81be315eb6e67fe2cddf82b
BLAKE2b-256 checksum
How to use checksums
e2e386e8260bb50a0310a5ee559966a9440a45e4d3086899a4905f2d0fc545d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.5.0 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.7

Release files / TextPreprocessing-3.4.0-py3-none-any.whl

Download URL TextPreprocessing-3.4.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c540f9c60b385a854f695cf5aa2291c5af4bca70a9d791ec50f6d4d821ceb3a
BLAKE2b-256 checksum
How to use checksums
ef1740ff86a83fa8639a544277e1150ca693e7214d1ae9c1f116a3fa58756a9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.5.0 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.7

Release history Release notifications | RSS feed

This release

3.4.0 This release

2 release files

3.3.2

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page