OpenSTBench 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,181 @@
1
+ Metadata-Version: 2.4
2
+ Name: OpenSTBench
3
+ Version: 0.2.0
4
+ Summary: Open speech and translation benchmarking toolkit supporting MT, ASR, TTS, SimulST, VC, and paralinguistics with optimized CJK language support
5
+ Author-email: Yanjie An <691476922@qq.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/sjtuayj/OpenSTBench
8
+ Project-URL: Repository, https://github.com/sjtuayj/OpenSTBench
9
+ Project-URL: Documentation, https://github.com/sjtuayj/OpenSTBench#readme
10
+ Project-URL: Bug Tracker, https://github.com/sjtuayj/OpenSTBench/issues
11
+ Keywords: translation,evaluation,BLEU,COMET,BLEURT,ASR,speech-synthesis,voice-conversion,UTMOS,WER,machine-translation,multilingual,CJK,emotion,paralinguistics,CLAP,audio-events
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Requires-Python: >=3.8
18
+ Description-Content-Type: text/markdown
19
+ Requires-Dist: torch>=1.9.0
20
+ Requires-Dist: torchaudio>=0.9.0
21
+ Requires-Dist: numpy
22
+ Requires-Dist: sacrebleu>=2.0.0
23
+ Requires-Dist: pandas
24
+ Requires-Dist: tqdm
25
+ Requires-Dist: scipy
26
+ Requires-Dist: soundfile
27
+ Requires-Dist: textgrid
28
+ Requires-Dist: transformers
29
+ Requires-Dist: matplotlib
30
+ Requires-Dist: resemblyzer
31
+ Provides-Extra: comet
32
+ Requires-Dist: unbabel-comet>=2.2.2; extra == "comet"
33
+ Provides-Extra: whisper
34
+ Requires-Dist: openai-whisper; extra == "whisper"
35
+ Provides-Extra: speech-quality
36
+ Requires-Dist: jiwer; extra == "speech-quality"
37
+ Provides-Extra: emotion
38
+ Requires-Dist: funasr; extra == "emotion"
39
+ Requires-Dist: modelscope; extra == "emotion"
40
+ Provides-Extra: paralinguistics
41
+ Requires-Dist: transformers; extra == "paralinguistics"
42
+ Provides-Extra: all
43
+ Requires-Dist: unbabel-comet>=2.2.2; extra == "all"
44
+ Requires-Dist: openai-whisper; extra == "all"
45
+ Requires-Dist: jiwer; extra == "all"
46
+ Requires-Dist: funasr; extra == "all"
47
+ Requires-Dist: modelscope; extra == "all"
48
+ Requires-Dist: transformers; extra == "all"
49
+
50
+ # OpenSTBench
51
+
52
+ English | [Chinese](./README_zh.md)
53
+
54
+ [![PyPI version](https://badge.fury.io/py/OpenSTBench.svg)](https://pypi.org/project/OpenSTBench/)
55
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
56
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
57
+
58
+ OpenSTBench is an evaluation toolkit centered on translation and speech translation. It provides a unified way to score text translation quality, speech output quality, preservation-related properties, and streaming latency.
59
+
60
+ ## What It Can Be Used For
61
+
62
+ This project is best suited for these directions:
63
+
64
+ - MT or S2TT text-side evaluation with `BLEU`, `chrF++`, `COMET`, and `BLEURT`
65
+ - S2ST evaluation by combining text quality, speech quality, speaker similarity, and latency
66
+ - Streaming or simultaneous speech translation latency evaluation with a custom agent
67
+ - Preservation analysis for speech translation outputs, including speaker similarity, emotion, and paralinguistic similarity
68
+
69
+ ## Core Modules
70
+
71
+ | Module | Main Use | Typical Metrics |
72
+ | :--- | :--- | :--- |
73
+ | `TranslationEvaluator` | Text-side translation quality | `sacreBLEU`, `chrF++`, `COMET`, `BLEURT` |
74
+ | `SpeechQualityEvaluator` | Naturalness and text-speech consistency | `UTMOS`, `WER_Consistency`, `CER_Consistency` |
75
+ | `SpeakerSimilarityEvaluator` | Speaker preservation | `wavlm_similarity`, `resemblyzer_similarity` |
76
+ | `EmotionEvaluator` | Emotion preservation or classification accuracy | `Emotion2Vec_Cosine_Similarity`, `Audio_Emotion_Accuracy` |
77
+ | `ParalinguisticEvaluator` | Non-verbal and paralinguistic preservation | `Paralinguistic_Fidelity_Cosine`, `Acoustic_Event_Preservation_Rate`, `Acoustic_Event_Preservation_Macro_F1`, `Acoustic_Event_Preservation_Macro_Recall`, `Event_Aligned_Preservation_Rate`, `Conditional_Relative_Onset_Error` |
78
+ | `LatencyEvaluator` | Streaming / simultaneous translation latency | `StartOffset`, `ATD`, `CustomATD`, `RTF`, `Model_Generate_RTF` |
79
+
80
+ ## Installation
81
+
82
+ Basic install:
83
+
84
+ ```bash
85
+ pip install OpenSTBench
86
+ ```
87
+
88
+ Optional extras:
89
+
90
+ ```bash
91
+ pip install "OpenSTBench[comet]"
92
+ pip install "OpenSTBench[whisper]"
93
+ pip install "OpenSTBench[speech_quality]"
94
+ pip install "OpenSTBench[emotion]"
95
+ pip install "OpenSTBench[paralinguistics]"
96
+ pip install "OpenSTBench[all]"
97
+ ```
98
+
99
+ If you need BLEURT:
100
+
101
+ ```bash
102
+ pip install git+https://github.com/lucadiliello/bleurt-pytorch.git
103
+ ```
104
+
105
+ ## Import
106
+
107
+ PyPI package name:
108
+
109
+ ```python
110
+ OpenSTBench
111
+ ```
112
+
113
+ Python import name:
114
+
115
+ ```python
116
+ openstbench
117
+ ```
118
+
119
+ Example:
120
+
121
+ ```python
122
+ from openstbench import TranslationEvaluator, SpeechQualityEvaluator
123
+ ```
124
+
125
+ ## Quick Start
126
+
127
+ Quick-start scripts live under `examples/`.
128
+
129
+ Python examples:
130
+
131
+ - `examples/python/translation_eval.py`
132
+ - `examples/python/speech_quality_eval.py`
133
+ - `examples/python/speaker_similarity_eval.py`
134
+ - `examples/python/emotion_eval.py`
135
+ - `examples/python/paralinguistic_eval.py`
136
+ - `examples/python/paralinguistic_identity_baseline.py`
137
+ - `examples/python/latency_eval.py`
138
+
139
+ Shell examples:
140
+
141
+ - `examples/bash/install_extras.sh`
142
+ - `examples/bash/run_latency_cli.sh`
143
+
144
+ Latency output distinguishes two RTF variants:
145
+
146
+ - `Real_Time_Factor_(RTF)`: system-level RTF. This includes agent policy overhead, pre/post-processing, and other runtime costs around model inference.
147
+ - `Model_Generate_RTF`: model-level RTF. This is reported only when the agent explicitly records model inference time via `record_model_inference_time(...)` or returns it in `Segment.config["model_inference_time"]`.
148
+
149
+ ## Input Conventions
150
+
151
+ Common text inputs support:
152
+
153
+ - Python `List[str]`
154
+ - `.txt` files with one sample per line
155
+ - `.json` files
156
+
157
+ Common audio inputs support:
158
+
159
+ - folder path
160
+ - Python `List[str]`
161
+ - `.txt` files
162
+ - `.json` files
163
+
164
+ ## Notes
165
+
166
+ - For `zh` / `ja` / `ko`, the toolkit uses CJK-aware handling for text-side evaluation.
167
+ - `SpeechQualityEvaluator` returns `CER_Consistency` for `zh` / `ja` / `ko`, and `WER_Consistency` for most other languages.
168
+ - `ParalinguisticEvaluator` always supports `Paralinguistic_Fidelity_Cosine`, a continuous CLAP-based audio similarity score between source and target speech.
169
+ - The discrete preservation branch is an utterance-level single-label task. With source-side gold labels, it reports `Acoustic_Event_Preservation_Rate`, `Acoustic_Event_Preservation_Macro_F1`, and `Acoustic_Event_Preservation_Macro_Recall`.
170
+ - If `source_onsets_ms` are available, the evaluator can also report alignment-aware metrics: `Event_Aligned_Preservation_Rate` and `Conditional_Relative_Onset_Error`.
171
+ - Alignment is computed on relative onset position, not absolute wall-clock time. This makes it suitable for cross-lingual S2ST where source and target utterance durations naturally differ.
172
+ - If target-side onset timestamps are not provided, the default localizer estimates them with CLAP sliding-window scoring conditioned on the target event label.
173
+ - These alignment metrics should be interpreted as weak, coarse-grained alignment signals rather than timestamp-accurate event localization benchmarks.
174
+ - If source-side gold labels are not available, the evaluator can still run in prediction-only mode and reports `Predicted_Event_Consistency_Rate`, `Predicted_Event_Consistency_Macro_F1`, and `Predicted_Event_Consistency_Macro_Recall`.
175
+ - The default discrete predictor is a closed-set CLAP classifier over `candidate_labels`. Users may replace it with any custom predictor object that implements `predict(audio_paths, candidate_labels)`.
176
+ - The default event localizer is also replaceable. Custom localizers only need to implement `localize(audio_paths, labels, candidate_labels)`.
177
+ - Dataset-specific label mapping is intentionally outside the core package. Pass `candidate_labels` and `label_normalizer` at call time so the same evaluator works across datasets without changing core code.
178
+ - For offline environments, `clap_model_path` accepts either a Hugging Face repo id or a local model directory or snapshot.
179
+ - In S2S latency evaluation, alignment prefers the model's native transcript when available. If the model is audio-only, the evaluator can optionally use ASR fallback to prepare alignment text.
180
+ - For S2S forced alignment, pass language-appropriate MFA models through `alignment_acoustic_model` and `alignment_dictionary_model`. The defaults are English.
181
+ - Some modules rely on optional dependencies or local model paths in offline environments.
@@ -0,0 +1,18 @@
1
+ openstbench/__init__.py,sha256=Ghp94XhK7HHbl0lD-wTH8WVgUOea9Td0TpMlQ2kqq-0,4531
2
+ openstbench/dataset.py,sha256=clWzabMDrWE0_IQwJCY0Dlzsu0uW3rCbHG7Gm3kuqZw,6178
3
+ openstbench/emotion_evaluator.py,sha256=pIcnayhmaq_UGlTaGZ4FGHvjxFtjP4E1QTrXehWrpo0,11577
4
+ openstbench/paralinguistic_evaluator.py,sha256=e70KGvynRoq5oWGmjy0y2C2WXAERJbxP0dF3ydxvcL8,53756
5
+ openstbench/speaker_similarity_evaluator.py,sha256=PR085aCI4e4CkO14z1gDs5OPqRJ9Q806p8Q0zqTbbkg,6310
6
+ openstbench/speech_quality_evaluator.py,sha256=ncyOMnnUaqginr_WY2B91p64M46bRpVKmTaEndACRXg,7109
7
+ openstbench/translation_evaluator.py,sha256=Dgf_73AZh6wOBbJOEFPJbqJLP1OtIMeOdScTsuA4fPo,9740
8
+ openstbench/latency/__init__.py,sha256=2AXvZVDzy7FMU7K3ZPBTGD8YwvW4xKv93qomlUsrgdA,219
9
+ openstbench/latency/agent.py,sha256=L_L614GpJVP-SJ5ppi-BZdTp6Dyc9KInOAbt7DXp0vQ,3420
10
+ openstbench/latency/basics.py,sha256=-LYlm3hu-CESA2MHtnlw3uSMWw6MiNhJMu6zgtbnCec,1730
11
+ openstbench/latency/cli.py,sha256=pmv-VxVWr1lvAx4UMMRGwS3cE-MYMjEx6sUHXIwfJ94,11104
12
+ openstbench/latency/instance.py,sha256=iimE6UxNtPqoLKXscb-56604Ao_axuTPFKWZLvO8BIY,7171
13
+ openstbench/latency/metrics.py,sha256=lEl7Ull7enGEAxOoeKbvTIJ32kHjdAW9KzLYIvK_RZI,16498
14
+ openstbench/latency/utils.py,sha256=AWKgRagXjvZZ0Dc7RyinY4lH-whCs0YUdys9m3qB4NQ,9324
15
+ openstbench-0.2.0.dist-info/METADATA,sha256=uaJCE1ZnL51atSCRHqSKJqBGzKKCydeku8h0pkW_Tcg,8469
16
+ openstbench-0.2.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
17
+ openstbench-0.2.0.dist-info/top_level.txt,sha256=ze2cgr1EJqh_5WKmpXXSrEMZZbPvJ-u-hwtrwXeJ-d0,12
18
+ openstbench-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ openstbench