Skip to main content

ai-data-preprocessing-queue

Maintainability Coverage Status Known Vulnerabilities

What it does

This tool is intended for preparing data for further processing. It contains different text processing steps that can be enabled or disabled dynamically.

Installation

pip install ai-data-preprocessing-queue

How to use

from ai_data_preprocessing_queue import Pipeline

state = {}
pre_processor_dict = {
  'to_lower' : None,
  'spellcheck' : 'test\r\ntesting'
}
pipeline = Pipeline(pre_processor_dict)
value = pipeline.consume('Input text', state)

state is optional here and can be used to cache preprocessing data between pipeline calls.

The preprocessors that the pipeline should use have to be transmitted as keys within a dictionary. Some preprocessors also require additional data to function. The data must be converted into string form and assigned to its preprocessor within the dictionary.

This dictionary then needs to be transmitted to the pipeline through its constructor.

Note: Pipeline has to be instantiated only once and can be reused.

Existing preprocessors

To Lower Case

Name: to_lower

Required additional data: -

Converts the text to lower case characters.

Remove Numbers

Name: remove_numbers

Required additional data: -

Removes all numbers from the text.

Remove Punctuation

Name: remove_punctuation

Required additional data: -

Removes all special characters from the text.

Text only

Name: text_only

Required additional data: -

Removes all special characters and numbers from the text.

Spellcheck (Levenshtein)

Name: spellcheck

Required additional data: A string containing words, separated by newline, i.e. "word1\r\nword2"

Takes a list of words representing the correct spelling. Words within the given text that are close to a word from this list will be replaced with the listed word.

Regex replacement

Name: regex_replacement

Required additional data: CSV data in string form with the following line format: <pattern>,<replacement>,<order>

  • pattern: a regex pattern that is to be found within the text
  • replacement: the word/text by which any match should be replaced
  • order: the order in which the regex entries are supposed to be applied (lowest number will be applied first!)

This preprocessor will search for occurrences of specific entities in your text and replace them by a specified pattern.

Token Replacement

Name: token_replacement

Required additional data: CSV data in string form with the following line format: <text>,<replacement>,<order>

  • text: one or multiple words to search within the text
  • replacement: the word/text by which any match should be replaced
  • order: the order in which the entries are supposed to be applied (largest number will be applied first!)

With this preprocessor you can replace specific words and abbreviations within the text with specified tokens. It is also possible to replace abbreviations ending with a dot. Other special characters are not supported, though.

Remove signature

Name: remove_signature

Removes greeting expressions and everything following them, as well as thank you expressions. Should be used before the other processing steps.

How to start developing

With VS Code

Just install VS Code with the Dev Containers extension. All required extensions and configurations are prepared automatically.

With PyCharm

  • Install the latest PyCharm version
  • Install PyCharm plugin BlackConnect
  • Install PyCharm plugin Mypy
  • Configure the Python interpreter/venv
  • pip install requirements-dev.txt
  • pip install black[d]
  • Ctl+Alt+S => Check Tools => BlackConnect => Trigger when saving changed files
  • Ctl+Alt+S => Check Tools => BlackConnect => Trigger on code reformat
  • Ctl+Alt+S => Click Tools => BlackConnect => "Load from pyproject.yaml" (ensure line length is 120)
  • Ctl+Alt+S => Click Tools => BlackConnect => Configure path to the blackd.exe at the "local instance" config (e.g. C:\Python310\Scripts\blackd.exe)
  • Ctl+Alt+S => Click Tools => Actions on save => Reformat code
  • Restart PyCharm

How to publish

  • Update the version in setup.py and commit your change
  • Create a tag with the same version number
  • Let GitHub do the rest

Metadata

Release files for ai-data-preprocessing-queue 1.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-data-preprocessing-queue 1.7.2
File Size Uploaded Provenance Actions
ai_data_preprocessing_queue-1.7.2.tar.gz 15.4 kB Without provenance Details for ai_data_preprocessing_queue-1.7.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ai-data-preprocessing-queue 1.7.2
File Interpreter ABI Platform Actions
ai_data_preprocessing_queue-1.7.2-py3-none-any.whl Python 3 none any Details for ai_data_preprocessing_queue-1.7.2-py3-none-any.whl

Total release size: 28.1 kB

Release files / ai_data_preprocessing_queue-1.7.2.tar.gz

Download URL ai_data_preprocessing_queue-1.7.2.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9092fb72ef25a31d284e3d73f1d228a47d4cd3587317b0926f6a66809a2dd895
BLAKE2b-256 checksum
How to use checksums
cb80febdd64abd67719d9bf876d0dff472b38746c5d111f41fbe8148e686d729
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / ai_data_preprocessing_queue-1.7.2-py3-none-any.whl

Download URL ai_data_preprocessing_queue-1.7.2-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e54c58a8951e2689ef108075473e52d6d30a5f6088d4a05dad73236e8e8111ab
BLAKE2b-256 checksum
How to use checksums
301b6e53756281ed8a7127f4c4126da9390cfdcb081bef71d4ec290f2a1210bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for ai-data-preprocessing-queue 1.7.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page