Skip to main content

heliport

License PyPi-version Python-version Supported-languages

A language identification tool which aims for both speed and accuracy, with support for 220 languages(or add your own languages!).

This tool is an efficient HeLI-OTS port to Rust, achieving 25x speedups while having almost identical output.

Installation

From PyPi

Install it in your environment

pip install heliport

NOTE: Since version 0.8 models do not need to be downloaded anymore.

From source

Install the requirements:

Clone the repo, build the package and binarize the model

git clone https://github.com/ZJaume/heliport
cd heliport
pip install .

Usage

CLI

Just run the heliport identify command that reads lines from stdin

cat sentences.txt | heliport identify
eng
cat
rus
...
Identify languages of input text

Usage: heliport identify [OPTIONS] [INPUT_FILE] [OUTPUT_FILE]

Arguments:
  [INPUT_FILE]   Input file, default: stdin
  [OUTPUT_FILE]  Output file, default: stdout

Options:
  -j, --threads <THREADS>                Number of parallel threads to use.
                                         0 means no multi-threading
                                         1 means running the identification in a separated thread
                                         >1 run multithreading [default: 0]
  -b, --batch-size <BATCH_SIZE>          Number of text segments to pre-load for parallel processing [default:
                                         100000]
  -c, --ignore-confidence                Ignore confidence thresholds. Predictions under the thresholds will not be
                                         labeled as 'und'
  -s, --print-scores                     Print confidence score (higher is better) or raw score (lower is better) in
                                         case '-c' is provided
  -n, --not-strict                       Do not be strict when loading confidence thresholds (do not fail if one
                                         language is missing)
  -p, --precision <PRECISION>            Number of decimals precision when printing scores [default: 4]
  -m, --model-dir <MODEL_DIR>            Model directory containing binarized model or plain text model. Default is
                                         Python module path or './LanguageModels' if relevant languages are requested
  -l, --relevant-langs <RELEVANT_LANGS>  Load only relevant languages. Specify a comma-separated list of language
                                         codes. Needs plain text model directory
  -h, --help                             Print help

Python package

>>> from heliport import Identifier
>>> i = Identifier()
>>> i.identify("L'aigua clara")
'cat'

For further information of the avaliable functions and parameters, please take a look at the module docs:

>>> import heliport
>>> help(heliport)

Rust crate

use std::path::PathBuf;
use heliport::identifier::Identifier;
use heliport::lang::Lang;

let identifier = Identifier::load(
    PathBuf::from("/path/to/model_dir",
    None,
    );
let lang, score = identifier.identify("L'aigua clara");
assert_eq!(lang, Lang::cat);

Differences with HeLI-OTS

Although heliport currently uses the same models as HeLI-OTS 2.0 and the identification algorithm is almost the same, there are a few differences (mainly during pre-processing) that may cause different results. However, in most case, these should not deacrease accuracy and should not happen frequently.

Note: Both tools have a pre-processing step for each identified text to remove all non-alphabetic characters.

The implementation differences that can change results are:

  • HeLI during preprocessing removes urls and words beginning with @, while heliport does not.
  • Since 1.5, during preprocessing, HeLI repeats every word that does not start with capital letter, This is probably to penalize proper nouns. However, in our tests, we have not find a significant improvement with this. Therefore,to avoid multiplying the cost of prediction by almost x2, this has not been implemented. In the future it might end up being implemented if there is need for it and can be implemented efficiently.
  • Rust and Java implementations have small precision differences due to Rust accumulating probabilities with double precision floats.

Benchmarks

Speed benchmarks with 100k random sentences from OpenLID, all the tools running single-threaded:

tool time (s)
CLD2 1.12
HeLI-OTS 60.37
lingua all high preloaded 56.29
lingua all low preloaded 23.34
fasttext openlid193 8.44
heliport 2.33

Connecting Europe Facility

All documents and software contained in this repository reflect only the authors' view. The Innovation and Networks Executive Agency of the European Union is not responsible for any use that may be made of the information it contains.

Metadata

Release files for heliport 1.0.1

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

Source distribution (sdist)

Source distribution for heliport 1.0.1
File Size Uploaded
heliport-1.0.1.tar.gz 54.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for heliport 1.0.1
File
heliport-1.0.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl PyPy 3.11 PyPy 3.11 7.3 Linux glibc 2.17+ x86-64 Details
heliport-1.0.1-cp315-cp315t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.15 CPython 3.15 free-threading Linux glibc 2.17+ x86-64 Details
heliport-1.0.1-cp315-cp315-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.17+ x86-64 Details
heliport-1.0.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 Details
heliport-1.0.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64 Details
heliport-1.0.1-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
heliport-1.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
heliport-1.0.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
heliport-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
heliport-1.0.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
heliport-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
heliport-1.0.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details

Total release size: 1.1 GB

Release files / heliport-1.0.1.tar.gz

Download URL heliport-1.0.1.tar.gz
Size 54.1 MB
Tags Source
SHA-256 checksum
How to use checksums
9053fc4ae98f3120935627a415764683482dd1845e7df8df6fdfa0a6a3bd4761
BLAKE2b-256 checksum
How to use checksums
d027679e34edac0476181ee07cb8c4426945b531bbe7bbde41bd2fcf0bd9747c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / heliport-1.0.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL heliport-1.0.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 87.4 MB
Tags Linux glibc 2.17+ x86-64 PyPy 3.11 PyPy 3.11 7.3
SHA-256 checksum
How to use checksums
9ef74b4052f3936aabf4cf9704acc4f48443e9653ab452b6c1bc7e0b296af92e
BLAKE2b-256 checksum
How to use checksums
b9252fb80e6c26859a4addd73b2dcd7a3b7695c7d40f390ab9fec2afff6c294b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / heliport-1.0.1-cp315-cp315t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL heliport-1.0.1-cp315-cp315t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 87.4 MB
Tags CPython 3.15 CPython 3.15 free-threading Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
f50625b146c0ab123d7886126b6cb15a5e85cccc98968f8136fa23560fa3edeb
BLAKE2b-256 checksum
How to use checksums
e94ae9e6762dcd8515990245829e98270309b0e02a568cb20899787fb5dfd8ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / heliport-1.0.1-cp315-cp315-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL heliport-1.0.1-cp315-cp315-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 87.4 MB
Tags CPython 3.15 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
f7ca6238b10fc78083f511bbee496b7f5ab559d363070035d11936d0e0e852ac
BLAKE2b-256 checksum
How to use checksums
f7a0d6d795e4894c7bad2d204692a376b5ec2e2c58387f9bb7c5fa8f508cdf0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / heliport-1.0.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL heliport-1.0.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 87.4 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
15870cee3aedee8bf81c2c15a9c1cd49ff39da6fa0cb5921b0fe703a9efb8e3a
BLAKE2b-256 checksum
How to use checksums
42c407bd1734be4f103733257cfc5ae9a10fee4d033c9783099474ee9895ef9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / heliport-1.0.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL heliport-1.0.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 87.4 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b40de201cd118b904c767ae9dbdf871df6e97de5a26759a3ec4c4ba8ea36fd57
BLAKE2b-256 checksum
How to use checksums
1fa9a3e2240611bc6fe3f196d5a09eb3c0ee85d344d3371d8051f29af65e2a57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / heliport-1.0.1-cp314-cp314-macosx_11_0_arm64.whl

Download URL heliport-1.0.1-cp314-cp314-macosx_11_0_arm64.whl
Size 87.2 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
62c3cbaa89fbee45d36ee964d0ad1d6212a03b55d70ee004049588363fb7fdf2
BLAKE2b-256 checksum
How to use checksums
615eaa6449a14d60bf7dcd70f8a492f0ce1c5ebcfbf9a87a63d09b0583d980f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / heliport-1.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL heliport-1.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 87.4 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
05c9d3f92e0d9e6bfe81a57ce6047f75558ca04832becf67b11759e5ff049f72
BLAKE2b-256 checksum
How to use checksums
aa8c11f172cd59a81d5a3d6c9a154b7d8eeba63c1e9ea273d1e2ac18964e0bb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / heliport-1.0.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL heliport-1.0.1-cp313-cp313-macosx_11_0_arm64.whl
Size 87.2 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a65bc5091bc2d18fde7d20ca83eded852c50d1fd6c8fc8083b6a15a674d299ab
BLAKE2b-256 checksum
How to use checksums
0291987c841ca9a8f931fe463e3675e60c83228d8b891f1db910c7bac54dc141
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / heliport-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL heliport-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 87.4 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
fc3e40282dc619884492b0db5d58fbb216919365d835bcdd01d7b39099acc6a5
BLAKE2b-256 checksum
How to use checksums
d1fa28b2695790223b0464e3b270110736dabf2cb816155028cf1b6ac2670808
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / heliport-1.0.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL heliport-1.0.1-cp312-cp312-macosx_11_0_arm64.whl
Size 87.2 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a3171c1ca99d8f5578f0490db700be4c79318dfee863f0ee7ea901693ab7d460
BLAKE2b-256 checksum
How to use checksums
7eb9b06e29d15d49f35653480ff05666666d3a7368abfbfa26091355ef834eb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / heliport-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL heliport-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 87.4 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
019cd89289ca40a727fdc934522fc4a951652ad2f2726533badde531748145bd
BLAKE2b-256 checksum
How to use checksums
932f8dc6bd09d18f982b6fe8b34febd55b76efccfc9e3eb8d94ccaa34c3c2efa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / heliport-1.0.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL heliport-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
Size 87.2 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a5c07d6b6cf57dce609512107802cc36af315d1836a6b235b0b3a1c3b74af3b0
BLAKE2b-256 checksum
How to use checksums
a94e86518bd893748778c0683ff703a2109fd1b320c49d4f2d86f7ad3bff8c6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.0.1 This release

13 release files

1.0.0

9 release files

0.7.0

8 release files

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