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.13.tar.gz (348.3 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.13-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.13.tar.gz.

File metadata

  • Download URL: lib_ml_remla_team14_a2-1.0.13.tar.gz
  • Upload date:
  • Size: 348.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.18

File hashes

Hashes for lib_ml_remla_team14_a2-1.0.13.tar.gz
Algorithm Hash digest
SHA256 d26c12bce27d144cc8708b69daa043aac5be3e01b9fffa5a41a3fa1a5a3e4d57
MD5 955356d880aa62db5aa80576c0dd7b4b
BLAKE2b-256 6d4bcf1b134b8334fa5ca405ccbf66c910919b86f968ae7741c8824cc5f4767a

See more details on using hashes here.

File details

Details for the file lib_ml_remla_team14_a2-1.0.13-py3-none-any.whl.

File metadata

File hashes

Hashes for lib_ml_remla_team14_a2-1.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 fce779458a835fd639905e9e753fbf415b857750b424e2e00d81014f208ad143
MD5 c90fe8db2434c68ef8158282a6ca1f62
BLAKE2b-256 c77d185dfed4358f99391f925593a9a4e65bdf223e186a14aaf0695333abd31a

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