Skip to main content

Language identification plugin for polars

Project description

polars-whichlang

PyPI version

This polars plugin is a wrapper for whichlang, a very fast and reasonably accurate language identification library written in rust.

It currently supports the following languages:

  • Arabic (ara)
  • Dutch (nld)
  • English (eng)
  • French (fra)
  • German (deu)
  • Hindi (hin)
  • Italian (ita)
  • Japanese (jpn)
  • Korean (kor)
  • Mandarin (cmn)
  • Portuguese (por)
  • Russian (rus)
  • Spanish (spa)
  • Swedish (swe)
  • Turkish (tur)
  • Vietnamese (vie)

Installation

pip install polars-whichlang

Examples

import polars as pl
from polars_whichlang import detect_lang

df = pl.DataFrame(
    {
        "index": [1, 2, 3, 4],
        "text": [
            "This is a test.", 
            "Đây là một bài kiểm tra.", 
            "Dies ist ein Test", 
            "这是一个测试"
        ],
    }
)

df.with_columns(detect_lang('text').alias('lang'))
shape: (4, 3)
┌───────┬──────────────────────────┬──────┐
│ index ┆ text                     ┆ lang │
│ ---   ┆ ---                      ┆ ---  │
│ i64   ┆ str                      ┆ str  │
╞═══════╪══════════════════════════╪══════╡
│ 1     ┆ This is a test.          ┆ eng  │
│ 2     ┆ Đây là một bài kiểm tra. ┆ vie  │
│ 3     ┆ Dies ist ein Test        ┆ deu  │
│ 4     ┆ 这是一个测试               ┆ cmn  │
└───────┴──────────────────────────┴──────┘

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

polars_whichlang-0.1.2.tar.gz (29.5 kB view details)

Uploaded Source

Built Distributions

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

polars_whichlang-0.1.2-cp39-abi3-win_amd64.whl (4.7 MB view details)

Uploaded CPython 3.9+Windows x86-64

polars_whichlang-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

polars_whichlang-0.1.2-cp39-abi3-macosx_11_0_arm64.whl (4.4 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

polars_whichlang-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

polars_whichlang-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file polars_whichlang-0.1.2.tar.gz.

File metadata

  • Download URL: polars_whichlang-0.1.2.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.12.6

File hashes

Hashes for polars_whichlang-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2a4b7987686f64c5bfcb736c7a3847c84a9eef54adf7ba0f518cdb211d6f98a5
MD5 bd2a55b2aaaf3dbead2f867ca3275212
BLAKE2b-256 a2f1edfe0d0ff5a07d059b75e02b89928f8ce11ad140f77036d15b9f95cb9f3c

See more details on using hashes here.

File details

Details for the file polars_whichlang-0.1.2-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for polars_whichlang-0.1.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 58ce12b6bc50c77073db4b451034420f312f368d648eab706cf13906d341b640
MD5 8ac70dd23bc752fb5cb3a7aa355a9218
BLAKE2b-256 1f2418a1d10ed4f6ce89e03d64150d468eece15f1dbc185df22437108a3ce8e1

See more details on using hashes here.

File details

Details for the file polars_whichlang-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for polars_whichlang-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c3ec4b07ae06c6a3c5cfb27bcc3a1504806d7775701824a8b95d47e39b4304b5
MD5 017cfc43d9dac3565a6f6b1e706c106f
BLAKE2b-256 d64124cfff168bac32fc4b5c7e7b3534d3022a387086898086ed51f0a1a342e6

See more details on using hashes here.

File details

Details for the file polars_whichlang-0.1.2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polars_whichlang-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 641c4a1814d1e57cf08c5603d7de7368f63637608431c897d4f525a141ff0646
MD5 788bc6487a2148b314101b0dd0497159
BLAKE2b-256 032c381b03def937fcddc90b8eb655ff80e76fdf5813cce8ee0294ff56cc61c0

See more details on using hashes here.

File details

Details for the file polars_whichlang-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for polars_whichlang-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 07a64a20b865d169bcbb778e29b5721feb3058794690539181d05dddc7861394
MD5 8b868742b436f3771b1839b7c07528b1
BLAKE2b-256 12da44774ebcb12f2180ae4d5d2ba0555e1ec5d53c40373ff539ac1ade946cba

See more details on using hashes here.

File details

Details for the file polars_whichlang-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polars_whichlang-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a88428e3dc7a07e663f97cc40a053bace90668d2ff8f2547fd5ddee126a9b4d2
MD5 18775c32f8ccc20fd7bc3e524045224c
BLAKE2b-256 7740c8f086714c7aa2daf5670103eec8e5c3bf53680a8e64b32beb2c79540a8e

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