Skip to main content

Python port of open source text processing library for Turkish, zemberek-nlp

Project description

ZEMBEREK-PYTHON

Python implementation of Natural Language Processing library for Turkish, zemberek-nlp. It is based on zemberek 0.17.1 and is completely written in Python meaning there is no need to setup a Java development environment to run it.

Source Code

https://github.com/Loodos/zemberek-python

Dependencies

  • antlr4-python3-runtime==4.8
  • numpy>=1.19.0

Supported Modules

Currently, following modules are supported.

  • Core (Partially)

  • TurkishMorphology (Partially)

    • Single Word Analysis
    • Diacritics Ignored Analysis
    • Word Generation
    • Sentence Analysis
    • Ambiguity Resolution
  • Tokenization

    • Sentence Boundary Detection
    • Tokenization
  • Normalization (Partially)

    • Spelling Suggestion
    • Noisy Text Normalization

Installation

You can install the package with pip

pip install zemberek-python

Examples

Example usages can be found in examples.py

Notes

There are some minor changes in codes where original contains some Java specific functionality and data structures. We used Python equivalents as much as we could but sometimes we needed to change them. And it affects the performance and accuracy a bit.

In MultiLevelMphf class, in the original Java implementation, there are some integer multiplication operations which I tried to reimplement using vanilla Python 'int', but the results were not the same. Then I tried it with numpy.int32 and numpy.float32, since default java int and float types are 4 byte. The results were the same with Java, however, oftenly these operations produced RuntimeWarning as the multiplication caused overflow. In Java there were no overflow warnings whatsoever. I could not find a reasonable explanation to this situation, nor I could find a better way to implement it. So I suppressed overflow warnings for MultiLevelMphf. Therefore, please be aware that, this is not a healthy behaviour, and you should be careful using this code.

Credits

This project is Python port of zemberek-nlp.

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

zemberek-python-0.2.3.tar.gz (95.1 MB view details)

Uploaded Source

Built Distribution

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

zemberek_python-0.2.3-py3-none-any.whl (95.1 MB view details)

Uploaded Python 3

File details

Details for the file zemberek-python-0.2.3.tar.gz.

File metadata

  • Download URL: zemberek-python-0.2.3.tar.gz
  • Upload date:
  • Size: 95.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for zemberek-python-0.2.3.tar.gz
Algorithm Hash digest
SHA256 b9638941e9a50907779a70479b94913cf6bb904bb1decb132a55d0fb5b6fe7a5
MD5 241e404553c6912491c63ee8b397a819
BLAKE2b-256 bb623d15fcd07414636b3a684e648c4246774098ee49064799797d0ae22363ff

See more details on using hashes here.

File details

Details for the file zemberek_python-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for zemberek_python-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 65c2cf482c2401ddf832be3ba6a4c202df36d1af2e1c5a31a77564e4f3b18785
MD5 4eb926eb2b729d6dd35906268bdf9fd1
BLAKE2b-256 399ae7bc329bbe0625681d95891db72492d9825dfa095154c9677664474e0a31

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