HoomanMLTK (Machine Learning ToolKit) is a personal machine learning toolkit that provides modular, reusable components for a variety of ML workflows.
This project is designed to centralize helpful utilities and abstractions developed during experimentation, prototyping, or production-level ML work.
| Domain | Tool / Class | Description |
|---|---|---|
nlp |
TextPreprocessor |
A flexible and efficient transformer for cleaning and preprocessing text data, built on top of NLTK, TextBlob, re, and contractions. It supports a wide range of text transformation tasks, including: - URL Removal: Removes URLs to clean up the text. - Contraction Expansion: Expands common contractions (e.g., "don't" → "do not"). - Punctuation Removal: Strips punctuation to reduce noise. - Spell Checking: Corrects spelling errors with TextBlob. - Stemming & Lemmatization: Reduces words to their base forms using NLTK's stemmers and lemmatizers. - Parallel Processing: Accelerates text transformations on large datasets. - Flexible Output: Return preprocessed text as a string or a list of tokens. |
Install the package from PyPI via:
pip install hoomanmltkOr install directly from GitHub (for latest changes):
pip install git+https://github.com/hoom4n/HoomanMLTK.gitfrom hoomanmltk.nlp import TextPreprocessor
texts = ["if i ever were to lose you" , "Take me on" , "Take on me"]
processor = TextPreprocessor(
url_remove=True,
expand_contractions=True,
remove_punctuation=True,
lemmatize=True,
output_mode="text"
)
cleaned = processor.fit_transform(texts)
print(cleaned)This project is licensed under the MIT License. See the LICENSE file for more details.