Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

preprocess_tr-0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

preprocess_tr-0.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file preprocess_tr-0.1.tar.gz.

File metadata

  • Download URL: preprocess_tr-0.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for preprocess_tr-0.1.tar.gz
Algorithm Hash digest
SHA256 5e6a1a0b47b98ec84ea934c522938b08e42687fb9547a113c4c2d95ecb03bf4b
MD5 56adbb086a459360c92042679a5b8eae
BLAKE2b-256 aa62ae58189dfa95763151555f9bae3eb96ab1eb1ce0ac35c6b4c78b26ff2a7b

See more details on using hashes here.

File details

Details for the file preprocess_tr-0.1-py3-none-any.whl.

File metadata

  • Download URL: preprocess_tr-0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for preprocess_tr-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d4695d1441c641ddd25e24946e7ca105d36e2607a695089b4759853150032c2
MD5 44c9dda3ec9c9e7e817d346135054c33
BLAKE2b-256 4dc177b08567c29609d79c62cd341996a6fa5abd5a5b6cc1879a6d0b8bf5cb2c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page