{"id":20543149,"url":"https://github.com/opennmt/tokenizer","last_synced_at":"2025-10-08T19:07:51.020Z","repository":{"id":37405556,"uuid":"81958932","full_name":"OpenNMT/Tokenizer","owner":"OpenNMT","description":"Fast and customizable text tokenization library with BPE and SentencePiece support","archived":false,"fork":false,"pushed_at":"2025-04-15T15:40:45.000Z","size":1774,"stargazers_count":316,"open_issues_count":10,"forks_count":74,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-09-08T15:03:30.753Z","etag":null,"topics":["bpe","cpp","icu","machine-translation","natural-language-processing","python","sentencepiece","tokenization","tokenizer","unicode"],"latest_commit_sha":null,"homepage":"https://opennmt.net/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenNMT.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-02-14T15:23:39.000Z","updated_at":"2025-09-08T09:50:46.000Z","dependencies_parsed_at":"2024-06-18T16:46:08.989Z","dependency_job_id":"dcd23df8-a73a-49ea-8e88-2982cbd46a6e","html_url":"https://github.com/OpenNMT/Tokenizer","commit_stats":{"total_commits":588,"total_committers":15,"mean_commits":39.2,"dds":0.4948979591836735,"last_synced_commit":"1bc1231297d9e18386cdfce89a47c8c59458c22b"},"previous_names":[],"tags_count":82,"template":false,"template_full_name":null,"purl":"pkg:github/OpenNMT/Tokenizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNMT%2FTokenizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNMT%2FTokenizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNMT%2FTokenizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNMT%2FTokenizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenNMT","download_url":"https://codeload.github.com/OpenNMT/Tokenizer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNMT%2FTokenizer/sbom","scorecard":{"id":105449,"data":{"date":"2025-08-11","repo":{"name":"github.com/OpenNMT/Tokenizer","commit":"75117755d6c7a24d46509f867726e446be05317f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/OpenNMT/Tokenizer/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/OpenNMT/Tokenizer/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:91: update your workflow using https://app.stepsecurity.io/secureworkflow/OpenNMT/Tokenizer/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:95: update your workflow using https://app.stepsecurity.io/secureworkflow/OpenNMT/Tokenizer/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:100: update your workflow using https://app.stepsecurity.io/secureworkflow/OpenNMT/Tokenizer/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:118: update your workflow using https://app.stepsecurity.io/secureworkflow/OpenNMT/Tokenizer/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:131: update your workflow using https://app.stepsecurity.io/secureworkflow/OpenNMT/Tokenizer/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:136: update your workflow using https://app.stepsecurity.io/secureworkflow/OpenNMT/Tokenizer/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/OpenNMT/Tokenizer/ci.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:57","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T11:00:20.348Z","repository_id":37405556,"created_at":"2025-08-15T11:00:20.349Z","updated_at":"2025-08-15T11:00:20.349Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000701,"owners_count":26082805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bpe","cpp","icu","machine-translation","natural-language-processing","python","sentencepiece","tokenization","tokenizer","unicode"],"created_at":"2024-11-16T01:36:00.988Z","updated_at":"2025-10-08T19:07:50.987Z","avatar_url":"https://github.com/OpenNMT.png","language":"C++","readme":"[![CI](https://github.com/OpenNMT/Tokenizer/workflows/CI/badge.svg)](https://github.com/OpenNMT/Tokenizer/actions?query=workflow%3ACI) [![PyPI version](https://badge.fury.io/py/pyonmttok.svg)](https://badge.fury.io/py/pyonmttok) [![Forum](https://img.shields.io/discourse/status?server=https%3A%2F%2Fforum.opennmt.net%2F)](https://forum.opennmt.net/)\n\n# Tokenizer\n\nTokenizer is a fast, generic, and customizable text tokenization library for C++ and Python with minimal dependencies.\n\n## Overview\n\nBy default, the Tokenizer applies a simple tokenization based on Unicode types. It can be customized in several ways:\n\n* **Reversible tokenization**\u003cbr/\u003eMarking joints or spaces by annotating tokens or injecting modifier characters.\n* **Subword tokenization**\u003cbr/\u003eSupport for training and using BPE and SentencePiece models.\n* **Advanced text segmentation**\u003cbr/\u003eSplit digits, segment on case or alphabet change, segment each character of selected alphabets, etc.\n* **Case management**\u003cbr/\u003eLowercase text and return case information as a separate feature or inject case modifier tokens.\n* **Protected sequences**\u003cbr/\u003eSequences can be protected against tokenization with the special characters ｟ and ｠.\n\nSee the [available options](docs/options.md) for an overview of supported features.\n\n## Using\n\nThe Tokenizer can be used in Python, C++, or command line. Each mode exposes the same set of options.\n\n### Python API\n\n```bash\npip install pyonmttok\n```\n\n```python\n\u003e\u003e\u003e import pyonmttok\n\u003e\u003e\u003e tokenizer = pyonmttok.Tokenizer(\"conservative\", joiner_annotate=True)\n\u003e\u003e\u003e tokens = tokenizer(\"Hello World!\")\n\u003e\u003e\u003e tokens\n['Hello', 'World', '￭!']\n\u003e\u003e\u003e tokenizer.detokenize(tokens)\n'Hello World!'\n```\n\nSee the [Python API description](bindings/python) for more details.\n\n### C++ API\n\n```cpp\n#include \u003conmt/Tokenizer.h\u003e\n\nusing namespace onmt;\n\nint main() {\n  Tokenizer tokenizer(Tokenizer::Mode::Conservative, Tokenizer::Flags::JoinerAnnotate);\n  std::vector\u003cstd::string\u003e tokens;\n  tokenizer.tokenize(\"Hello World!\", tokens);\n}\n```\n\nSee the [Tokenizer class](include/onmt/Tokenizer.h) for more details.\n\n### Command line clients\n\n```bash\n$ echo \"Hello World!\" | cli/tokenize --mode conservative --joiner_annotate\nHello World ￭!\n$ echo \"Hello World!\" | cli/tokenize --mode conservative --joiner_annotate | cli/detokenize\nHello World!\n```\n\nSee the `-h` flag to list the available options.\n\n## Development\n\n### Dependencies\n\n* [ICU](http://site.icu-project.org/)\n\n### Compiling\n\n*CMake and a compiler that supports the C++11 standard are required to compile the project.*\n\n```\ngit submodule update --init\nmkdir build\ncd build\ncmake ..\nmake\n```\n\nIt will produce the dynamic library `libOpenNMTTokenizer` and tokenization clients in `cli/`.\n\n* To compile only the library, use the `-DLIB_ONLY=ON` flag.\n\n### Testing\n\nThe tests are using [Google Test](https://github.com/google/googletest) which is included as a Git submodule. Run the tests with:\n\n```\nmkdir build\ncd build\ncmake -DBUILD_TESTS=ON ..\nmake\ntest/onmt_tokenizer_test ../test/data\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopennmt%2Ftokenizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopennmt%2Ftokenizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopennmt%2Ftokenizer/lists"}