Skip to main content

No project description provided

Project description

This project is derived from the Python port of Zemberek by Loodos, which is itself based on the original Zemberek Java project by Ahmet A. Akın and Mehmet D. Akın.

Goal of pre_bpe_morph

This package recognizes verbs, nouns, and named entities and their suffixes. Before BPE, this package removes suffixes and replaces them with their respective special tokens for identifiability. It also precedes a word type (Verb/Noun/NamedEntity) before any set of suffixes. The goal is to simplify Turkish grammar rules for small language models.

Usage

from pre_bpe_morph_tr import MorphTokenizer
tokenizer=MorphTokenizer("<|", "|>")

tokenizer.tokenize("gülüveriniz")
# response: ['g', 'ü', 'l', '<|Verb|>', '<|Hastily|>', '<|Req|>']

tokenizer.detokenize(['k', 'o', 'ş', '<|Verb|>', '<|Fut|>', '<|A1sg|>'])
# response: "koşacağım"

Developed for language model

Since this is developed for LM training, I tried to avoid preprocessing text (like converting "hal" to "hâl", or lowercasing words). The text should remain unchanged when encoded and then decoded.

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

pre_bpe_morph_tr-0.1.1.tar.gz (97.1 kB view details)

Uploaded Source

Built Distribution

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

pre_bpe_morph_tr-0.1.1-py3-none-any.whl (120.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pre_bpe_morph_tr-0.1.1.tar.gz
  • Upload date:
  • Size: 97.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for pre_bpe_morph_tr-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c24d3f500163e6a379554688acb7b893d58c5f28abfe361c2d85b2d83f9cbac5
MD5 b998689bee3436a7378671de7a5e8938
BLAKE2b-256 c3c41965f3e4d2c550845aa6fff7fc0bbb31233a1aeffd46f2d09fc0303f9452

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pre_bpe_morph_tr-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0175e555202432e364965f73d8826dd104ffcca17444bccbbfcda16bdbe001b2
MD5 5a36739553f849f8a4bb4e92b5cf3fc2
BLAKE2b-256 157dd1051668a72534dd4851da27362d5454e7af6ad7a1eeb09ea5a42d465c57

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