jpreprocess
Library Listed
Japanese text preprocessor for Text-to-Speech application (OpenJTalk rewrite in rust language).
- Downloads
- 14,491
- Dependents
- 7
- Stars
- 61
- Forks
- 7
- Contributors
- 4
- Commits
- 808
- Latest release
- 0.15.0 ·
About
日本語音声合成の前処理を行うライブラリです.日本語文を解析し,フルコンテキストラベルを生成します.
OpenJTalkの前処理部分をRustで書き直したものです.なお,(前処理ではない)音声合成部分については,jpreprocess/jbonsaiにて再実装・最適化を行っています.
実装の概要
日本語の音声合成にはいくつかの手法がありますが,著名なライブラリであるOpenJTalkでは,以下の三段階で合成する方法がとられています.
- 形態素解析:巨大な辞書を用いて,文章を単語ごとに分けます.さらに辞書には各単語の品詞,読み,アクセント等が書かれていますので,これらの情報を抜き出します.OpenJTalkでは形態素解析ライブラリMecabを用いています.
- 文章の前処理:単語には前後の単語によって読みが変わるものがあります.数字の読み(10000→いちまん,など)は代表的ですが,他にもアクセント位置が移動したり,母音が無声化したりすることがあります.前処理ではこれらをルールベースで処理して反映します.
- 音声合成:2.までで判明した読み・アクセント・品詞などの情報をもとに,音声波形を合成します.OpenJTalkではこの部分を同グループが開発したhts_engine APIが担っています.
最近では,これをさらに発展させ,1.と2.はそのままMecab/OpenJTalkを用いつつ,音声合成部分のみを深層学習モデルに置き換えて性能を向上させることが行われています.
このような背景を踏まえ,本リポジトリでは1.と2.の部分に絞ってRustで再実装しています(ただし,1.は,その実質を形態素解析ライブラリ Linderaに依存しています).さらに,2.の出力は,jlabelのjlabel::Label構造体として取り出すことができ,必要であれば従来通りのテキスト形式のフルコンテキストラベルに変換することができます.
残る3.の部分については,jpreprocess/jbonsaiにて再実装・最適化を行っています.したがって,jpreprocessとjbonsaiを組み合わせると,(広義)Open JTalk類似の音声合成を行うことができます.具体的な実装方法については,discordjs-japan/om-syrinxが参考になるかもしれません(jbonsaiのストリーミング合成機能を利用しているため,やや複雑になっています).
Read the full README
目標
- (形態素解析部分)
- Raspberry piなどメモリの限られた環境で使うことを考慮し,独自の辞書形式(jpreprocess辞書)によりメモリ上の辞書ファイルのサイズを削減する.
- 一方,他の形態素解析エンジンとの互換性を維持するため,文字列(CSV)での入力も可能にする.
- (前処理部分)
- OpenJTalkのコードをそのまま読み替えるのではなく,できるだけ読みやすく,書きやすい構造にする.
- バグと思われる一部の挙動を除き,OpenJTalkと全く同じ出力(フルコンテキストラベル)を得ることができる.
- たとえば「特殊助動詞」や紛らわしい2,2,3桁区切りの数字の読み方は,OpenJTalkと異なります.
- ただし,OpenJTalkになかった機能を追加する場合もあります.その場合でも,OpenJTalkと同じ結果を得る手段が残るようにします.
Crates
ドキュメンテーションについては,docs.rsを参照してください.
jpreprocess
主要なインターフェースです.入力された日本語文の正規化を含みますが,それ以外の部分はLindera,jpreprocess-njd,jpreprocess-jpcommonなどのラッパーになっています.形態素解析の結果は,jpreprocess-coreで規定されるデータ構造で保持します.
例:
use jpreprocess::*;
let system = SystemDictionaryConfig::File(path).load()?;
let jpreprocess = JPreprocess::with_dictionaries(system, None);
let jpcommon_label = jpreprocess
.extract_fullcontext("日本語文を解析し、音声合成エンジンに渡せる形式に変換します.")?;
assert_eq!(
jpcommon_label[2].to_string(),
concat!(
"sil^n-i+h=o",
"/A:-3+1+7",
"/B:xx-xx_xx",
"/C:02_xx+xx",
"/D:02+xx_xx",
"/E:xx_xx!xx_xx-xx",
"/F:7_4#0_xx@1_3|1_12",
"/G:4_4%0_xx_1",
"/H:xx_xx",
"/I:3-12@1+2&1-8|1+41",
"/J:5_29",
"/K:2+8-41"
)
);
jpreprocess-core
発音,単語,品詞,JPCommon等のデータ構造と,それに関連する関数群,エラーを表現する構造を含みます.なお,posはPart Of Speechの頭字語で,「品詞」を表します.
jpreprocess-dictionary
「jpreprocess辞書」の生成と読み込みを行います.また,実行時には読み込んだ辞書がLinderaの辞書か,jpreprocess辞書かどうかを自動で判定します.
jpreprocess辞書は,辞書に文字列として記述された品詞等の単語情報を前処理し,jprpeprocess-coreのデータ形式に高速に展開できるバイナリ形式にしたものです.その他の部分(double array等)はLinderaの辞書とほとんどの部分で同じですが,Open JTalkとの互換性のため,同一の重みをもつ単語の優先順位がLinderaと逆順になっています.
加えて,Lindera辞書/jpreprocess辞書のビルドを行うためのdict_toolsツールもここで実装されています.
jpreprocess-naist-jdic
実行時のバイナリに,naist-jdic辞書から生成したjpreprocess辞書を組み込みます.jpreprocessクレートでnaist-jdic featureを有効にすると利用できます.
なお,naist-jdic featureを有効化すると,マシンにもよりますがビルドに数分かかることがあります.
jpreprocess-njd
OpenJTalkでいうNJDNode,NJDの構造を定義し,NJDに対する変換処理を行います.
具体的には,数字の読み方を変換したり(たとえば「10,120」を「いちまんひゃくにじゅう」),アクセント位置を推定したりします.
jpreprocess-jpcommon
OpenJTalkでいうJPCommonLabelの構造を定義し,NJDからJPCommon,さらにJPCommonからフルコンテキストラベルへの変換を行います.
jpreprocess-window
jpreprocess-njdの変換処理で使われる,mutableなwindowを実装します.
Copyrights
This software includes source code from:
- OpenJTalk. Copyright (c) 2008-2016 Nagoya Institute of Technology Department of Computer Science
- Lindera. Copyright (c) 2019 by the project authors
License
BSD-3-Clause
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- None found
- No native code found
- Python bindings
- No Python binding crate found
- License
- BSD-3-Clause
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
Japanese text preprocessor for Text-to-Speech application (OpenJTalk rewrite in rust language). |
14,491 downloads over 30 days | 7 | 61 | 0.15.0 | GPU support unknown | No native code found | BSD-3-Clause |
|
sherpa-onnx Featured
Safe Rust wrapper for sherpa-onnx speech recognition toolkit |
259,599 downloads over 30 days | 28 | 15,834 | 2.0.1 | GPU support unknown | Binds native code: sherpa-onnx, sherpa-onnx-sys | Apache-2.0 |
|
A simple text-to-speech client for Azure TTS API. Python bindings |
488 binary downloads per release | Not applicable | 496 | 6.1.0 | GPU support unknown | No native code found | MIT |
|
A Rust implementation of the Qwen3 Text-to-Speech (TTS) model inference. |
204 binary downloads per release | Not applicable | 237 | Not measured | Not measured | None stated | |
|
cohere-transcribe-rs Listed
Rust implementation for the CohereLabs/cohere-transcribe-03-2026 speech-to-text model. Includes a CLI and an OpenAI-compatible API server. |
0 downloads over 30 days | 0 | 101 | 0.1.1 | CUDA | Binds native code: torch-sys (feature tch-backend). Build uses a native toolchain: cmake | Apache-2.0 |
|
transcribe-cpp New
Rust bindings for transcribe.cpp, a C/C++ speech-to-text library built on ggml |
50,251 downloads over 30 days | 3 | 2,149 | 0.4.1 | CUDA, Metal, ROCm, Vulkan | Binds native code: transcribe, transcribe-cpp-sys, transcribe_cpp. Build uses a native toolchain: cmake | MIT |
|
voxr New
Audio and speech on boostr: compressed-audio decode, resampling, DSP and grapheme to phoneme, with speech synthesis (Kokoro, VITS), voice cloning (VoxCPM2), transcription with word timings (Whisper), voice activity (Silero) and audio-text scoring (CLAP), on CPU or CUDA. |
642 downloads over 30 days | 2 | 2 | 0.9.1 | CUDA | No native code found | Apache-2.0 |
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- It has 3 active dependents and 3 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 61 stars, 7 forks and 4 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.
What else the check found
- The last activity is on 25 Jun 2026, 137 days ago. The rules expect an update within 365 days. Dormancy rule
Exact rules: Listed, Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.15.0 base 140, raised to the 365-day floor: E = 365 daysdormancy: last activity 2026-06-25, 137 days ago, E = 365: activefeatured: not featured: active_users 3 < 11 and new_adopters 3 < 9 and repository route stars 61 (needs 4539), forks 7 (needs 434), contributors 4 (needs 79)listed: listed: no archive, new or featured rule applies
Crates8 crates
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption3 active dependents, 3 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 3 | crates.io database dump | Yes | |
| New dependents (365 days) | 3 | crates.io database dump | Yes | |
| Peak active dependents | 4 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 4 months ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2026-06-25 | GitHub repository | Yes | |
| Latest release | 2026-06-11 | crates.io database dump | Yes | |
| First release | 2023-06-01 | crates.io database dump | Yes | |
| Latest version | 0.15.0 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 0 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 14 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution24 releases, 14,491 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 24 | crates.io database dump | Yes | |
| Downloads over 30 days | 14491 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository61 stars, 7 forks, 4 contributors, 808 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 61 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 7 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 4 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 808 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | BSD-3-Clause | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 7 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.