This is a text preprocessing package
Project description
Text Preprocessing Python Package
This python package is created by anonfolder. It provides various text preprcoessing utilities for natural language processing (NLP) tasks
Installation
Installation from Pypi
You can install this package using pip as follows:
pip install preprocess_tr
Installation from GitHub
If you want to install via github:
git clone https://github.com/troyhunterz/preprocess_tr
Requirements
You need to install this python packages:
pip install spacy==3.8.5
pip install -m spacy download en_core_web_md==3.8.0
pip install nltk==3.9.1
pip install beautifulsoup4==3.2.2
pip install textlob==0.19.0
Download NLTK Data
If you are using this package first time, then you need to download NLTK data as follows:
import preprocess_tr as ps
ps.download_nltk_pkgs
Uninstall the Package
To uninstall the package, use the following command:
pip uninstall preprocess_tr
How to Use the Package
Full Example: Cleaning Text
Here's an example of how you might use several functions together to clean text data:
import preprocess_tr as ps
def clean_text(text):
text = ps.to_lower_case(text)
text = ps.contraction_to_expansion(text)
text = ps.remove_emails(text)
text = ps.remove_urls(text)
text = ps.rm_html(text)
text = ps.rm_special_chars(text)
text = ps.lemmatize(text)
return text
text = "I'm loving this NLP tutorial! Contact me at example@example.com. Visit https://example.com."
cleaned_text = clean_text(text)
print(cleaned_text)
# Output: i am loving this nlp tutorial contact me at visit
One Short Feature Extraction
import preprocess_tr as ps
ps.extract_features('i love NLP')
Notes
- Be cautious when using heavy operations like lemmatize and spelling_correction on very large datasets, as they can be time-consuming
- The package supports custom cleaning and preprocessing pipeline bby using these modular functions together
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file preprocess_tr-0.1.1.tar.gz.
File metadata
- Download URL: preprocess_tr-0.1.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cf3cc1c44fe39b0c43ad5efe1a6c13d0f3b9488dcd525236d2e9bc8f15b418b
|
|
| MD5 |
d7fa6d8e6b68d63af0397dbf09522e38
|
|
| BLAKE2b-256 |
d97a08fb286551d8204ef7043f88880ebdc240e8daf7847523c8d48a037455b4
|
File details
Details for the file preprocess_tr-0.1.1-py3-none-any.whl.
File metadata
- Download URL: preprocess_tr-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ec98f87201310773cbcd3d959524f39122bfdfc1d8f567f4a5e7f795a6aa109
|
|
| MD5 |
fbee0966feea3d2dbccec18597da7073
|
|
| BLAKE2b-256 |
55df2a8a0f41f9931b5e62142ce3e165397778930769190188c13f2c1aa9ebf1
|