Skip to main content

A ML preprocessing library.

Project description

lib_ml_remla_team14_a2

lib_ml_remla_team14_a2 contains pre-processing logic for data used in our ML training pipeline.

Features

  • Tokenization of text data at a character level.
  • Padding of text sequences to uniform lengths.

Installation

Install lib_ml_remla_team14_a2 using pip:

pip install lib_ml_remla_team14_a2

Usage

Importing the Class

from lib_ml.preprocessing import TextPreprocessor

Initializing the Preprocessor'

You can customize the behavior of the TextPreprocessor by adjusting its configuration. Here's how to initialize it with the default settings:

preprocessor = TextPreprocessor()

Or customize its behavior:

config = {
    'lower': True,
    'char_level': True,
    'oov_token': '-n-',  # Token used for out-of-vocabulary characters
    'sequence_length': 150  # Adjust sequence length as needed
}
preprocessor = TextPreprocessor(config=config)

Preprocessing Text Data

Use the fit_text method to fit the tokenizer on your text data, and transform_text to convert text data into padded sequences:

texts = ["hello", "world"]
preprocessor.fit_text(texts)
processed_texts = preprocessor.transform_text(texts)

Output

The transform_text method returns an array of tokenized and padded sequences, ready for use in training or inference:

print(processed_texts)  # Output will be a NumPy array of processed text data

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

lib_ml_remla_team14_a2-1.0.5.dev2.tar.gz (173.1 kB view details)

Uploaded Source

Built Distribution

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

lib_ml_remla_team14_a2-1.0.5.dev2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file lib_ml_remla_team14_a2-1.0.5.dev2.tar.gz.

File metadata

File hashes

Hashes for lib_ml_remla_team14_a2-1.0.5.dev2.tar.gz
Algorithm Hash digest
SHA256 7771fe2bca31a4317a7ba7b3d38e010ffc25b7f77c5e5421280b1f03c40ef70f
MD5 686762af20ef5eab000fc81113ea9140
BLAKE2b-256 5b56bc404857075b8eb8a5dd558f41851dd9585a855f2e7e231bfe5930faf727

See more details on using hashes here.

File details

Details for the file lib_ml_remla_team14_a2-1.0.5.dev2-py3-none-any.whl.

File metadata

File hashes

Hashes for lib_ml_remla_team14_a2-1.0.5.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 e5b94fbd416d6ed51ad2d538905a7a1be069fd1b95358c6e056e50fb69194391
MD5 820a575dfcfe7257b45a8b97979524ea
BLAKE2b-256 ba60fa60ac7aeef8b10719980da2107df22675db6f2c9c4a1f7fafeabd16965b

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