Skip to main content

Language identification plugin for polars

Project description

polars-whichlang

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.0.tar.gz (27.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.0-cp39-abi3-win_amd64.whl (4.3 MB view details)

Uploaded CPython 3.9+Windows x86-64

polars_whichlang-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

polars_whichlang-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.7 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

polars_whichlang-0.1.0-cp39-abi3-macosx_11_0_arm64.whl (4.3 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

polars_whichlang-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for polars_whichlang-0.1.0.tar.gz
Algorithm Hash digest
SHA256 272e1517b9e68a3a5c015fca4d77927633f06decbabe0c8611b08269b5148d3e
MD5 601ca8aa2bd3ed930f3b42efcd694f94
BLAKE2b-256 9bc5baa985502277b0481feb94d04e2def81156c5a860e79b2cae63ca0609f75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_whichlang-0.1.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3848f5e433318020bbb8fb9d23a873d1f41f3d6380c09b9fd67bd6d8683351e6
MD5 7555ab719de017518b2f54fac0f8c533
BLAKE2b-256 3c229b816b9425dc973f3d09bdffbb19cda76425ddbcecd7a93cb0ad8b01a48f

See more details on using hashes here.

File details

Details for the file polars_whichlang-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polars_whichlang-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5b1deccd523faf69cfb66af71f27f9a9fe4f176bdb3edd011d8a2b565be917ab
MD5 1d51ba66457f1b782cf2596a3ffa4aae
BLAKE2b-256 b1b320c63aa6578cfd1dc589e4bcdab557dfd29a598536197e09b8aae43d81e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_whichlang-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ccc1d4b9cf023c7065304f4640c0ea31259c9ef75f4c4bfe23ebc2511c75a0d7
MD5 fc926d501ae06419d500976c86fcce45
BLAKE2b-256 f9a96717533edcb2b032401b0f00536871889856ce8669c003379efa82b15004

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_whichlang-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fa6607df72805eb3a5188f75cfbcbb790890b0b73a7543bc7aa4dbe886a309c5
MD5 8197ce2e713e5b5e219464873f41dcf2
BLAKE2b-256 a6f934c59070c837870ba95c928bad0ad84ea528f39978f5a149bae311266941

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_whichlang-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 43e677ab403af716573c71ba20b1ce7ded78ff9e64230d364ca149cd3385c003
MD5 2283acf9f0f636c2ef9dd64ab977ffab
BLAKE2b-256 7a67409179b66b2a32c93643a0b7b82816e6794b6bfa48bc912e08c4aafde9d0

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