Skip to main content

TozaText is a cleaning library for preprocessing raw Uzbek and multilingual text data.

Project description

🧹 TozaText

TozaText is a lightweight and extensible text-preprocessing pipeline built for cleaning noisy, transcribed, or user-generated text data.
It’s designed around a modifier-based architecture — each cleaning rule is a DocumentModifier that can be combined into a customizable Pipeline.


Features

  • Modular design – add or remove modifiers easily (e.g., repetition removal, transliteration)
  • Smart repetition cleaner – removes consecutive repeated words, even with punctuation or ellipses

Available Modifiers

TozaText currently includes the following modifiers out of the box:

Modifier Description Example Input Example Output
WordRepetitionFilter Removes consecutive repeated words, even when separated by punctuation or ellipses. bu. bu. bu. shu shu qila qila bu. shu qila
ParagraphRepetitionFilter Removes entire paragraphs if too many repeated paragraphs or characters are detected (useful for STT data with repeated intros). "Salom!\n\nSalom!\n\nSalom!" ""
TransliteratorModifier Converts Uzbek text between Cyrillic and Latin alphabets using UzTransliterator. "Салом дунё" "Salom dunyo"
UrlCleaner Remove or normalize URLs and links from text. "Bu sayt: https://example.com" "Bu sayt"
EmojiCleaner Strip or map emojis to descriptive tokens. "Zo‘r 😎" "Zo‘r"

All modifiers inherit from:

class DocumentModifier:
    def modify_document(self, text: str, *args, **kwargs) -> str:
        ...

Installation

git clone https://gitlab.adliya.uz/shohrux1sakov/tozatext.git
cd TozaText
pip install -e .

Code Example

from datasets import load_dataset
from TozaText import Pipeline, WordRepetitionFilter, ParagraphRepetitionFilter

data = load_dataset("aktrmai/youtube_transcribe_data", split="train")

pipeline = Pipeline([
    WordRepetitionFilter(),
    ParagraphRepetitionFilter(),
])

cleaned = pipeline.process_hf_dataset(data, column="text")

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

tozatext-0.1.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

tozatext-0.1.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file tozatext-0.1.1.tar.gz.

File metadata

  • Download URL: tozatext-0.1.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for tozatext-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a466784f81bc79f6dc3692f2ae00a5bbfbb971b273826b0fa15f1494d5d454a5
MD5 dcfa0d14cde4727d335adcd1590c2608
BLAKE2b-256 b4f38035a3653d7e7d966a430f0782a75ab9fc42f88f5f605361e3d6292f7150

See more details on using hashes here.

File details

Details for the file tozatext-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tozatext-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for tozatext-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b4aaa4fe87b0e72101702f1afbeadfba580b67a3209c2e618a6f5d4eb052c7b
MD5 7466a96b783b792e9f4d8dcd4501220a
BLAKE2b-256 a1bb9b503273d337c3e88b64f70e7f1e4946cac4b3369c6fcd2228b1a93de41b

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