Skip to main content

🇹🇷 turk-nlp-prep

Transformer tabanlı NLP modelleri (Turkish BERT, XLM-RoBERTa vb.) için C-seviyesinde optimize edilmiş, yüksek performanslı Türkçe veri ön işleme ve çoklu etiket (multi-label) kodlama kütüphanesi.

🚀 Özellikler

  • Akıllı Metin Normalizasyonu: Türkçe'ye özgü şapkalı harf (KÂĞIT -> kağıt) ve büyük/küçük harf (İ/I) dönüşümlerini hatasız yönetir.
  • Anti-Gürültü: Sosyal medya verilerindeki karakter uzamalarını (çoooook -> çook), HTML etiketlerini ve URL/E-posta sızıntılarını temizler.
  • Kesme İşareti Zekası: İstanbul'da gibi yapıları istanbul da olarak ayırarak kelime köklerinin (tokenizer tarafından) doğru tanınmasını sağlar.
  • O(1) Vektörizasyon (Advanced Indexing): Dinamik sınıf sayısına sahip çoklu etiketleri (multi-label) NumPy Advanced Indexing kullanarak milisaniyeler içinde ikili (binary) matrislere çevirir.
  • Tip Güvenliği & Hata Toleransı: Eğitimde görülmeyen yepyeni bir etiket (out-of-vocabulary label) geldiğinde sistemi çökertmez, sessizce izole eder.

📦 Kurulum

Projeyi klonladıktan sonra bağımlılıkları yüklemek için:

git clone [https://github.com/KULLANICI_ADIN/turk-nlp-prep.git](https://github.com/KULLANICI_ADIN/turk-nlp-prep.git)
cd turk-nlp-prep
pip install -r requirements.txt

(Not: Yakında PyPI üzerinden pip install turk-nlp-prep ile indirilebilir olacaktır.)

💻 Kullanım (Hızlı Başlangıç)

Kütüphane, Pandas DataFrame'leri ile tam uyumlu çalışacak şekilde tasarlanmıştır.

import pandas as pd
from turk_nlp_prep import TurkishTextNormalizer, MultiLabelMatrixEncoder

# 1. Örnek Veri Seti
df = pd.DataFrame({
    'metin': ["İSTANBUL'daki yeni YAZILIM yatırımları harikaaa!!! [www.ornek.com](https://www.ornek.com)"],
    'etiketler': [["Teknoloji", "Yazılım"]]
})

# 2. Modülleri Başlat (Esnek parametrelerle)
normalizer = TurkishTextNormalizer(remove_numbers=True, fix_elongations=True)
encoder = MultiLabelMatrixEncoder()

# 3. Boru Hattını (Pipeline) Çalıştır
df['temiz_metin'] = df['metin'].apply(normalizer.normalize)
hedef_matris = encoder.fit_transform(df['etiketler'].tolist())

print(df['temiz_metin'].iloc[0])
# Çıktı: "istanbul daki yeni yazılım yatırımları harikaa"

print(hedef_matris)
# Çıktı: [[1 1]] (Teknoloji ve Yazılım sınıfları aktif)

🧠 Sistem Mimarisi

  • TurkishTextNormalizer: Tüm regex (düzenli ifade) kurallarını __init__ bloğunda C seviyesinde önceden derleyerek (pre-compiled) döngü maliyetini sıfıra indirir.
  • MultiLabelMatrixEncoder: __slots__ bellek yönetimi ve np.int8 (8-bit) veri tipi kullanarak milyonlarca satırlık eğitim verilerinde RAM tüketimini minimize eder.

Metadata

Release files for turk-nlp-prep 0.1.0

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

Source distribution (sdist)

Source distribution for turk-nlp-prep 0.1.0
File Size Uploaded Provenance Actions
turk_nlp_prep-0.1.0.tar.gz 6.1 kB Without provenance Details for turk_nlp_prep-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for turk-nlp-prep 0.1.0
File Interpreter ABI Platform Actions
turk_nlp_prep-0.1.0-py3-none-any.whl Python 3 none any Details for turk_nlp_prep-0.1.0-py3-none-any.whl

Total release size: 13.0 kB

Release files / turk_nlp_prep-0.1.0.tar.gz

Download URL turk_nlp_prep-0.1.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
134ee99e721c28e33b99cd7dc8df11ac40a207cc607137115aba6097c4e2aa73
BLAKE2b-256 checksum
How to use checksums
efa4b6a731c2d159c341b6bb8a2a30984b5d2c6622e7af9e39ff7db87b0afc08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.8

Release files / turk_nlp_prep-0.1.0-py3-none-any.whl

Download URL turk_nlp_prep-0.1.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb367b5e3e2f20ef35ff026337623545208aee5e02f0defc2db091b84afd5627
BLAKE2b-256 checksum
How to use checksums
4bd2a51468b68b178e960689e6fdb744f130c577d9febae8f734894cbcaf95ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.8

Security for turk-nlp-prep 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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