OpenSTBench 1.1.0__tar.gz → 1.2.0__tar.gz

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.
Files changed (25) hide show
  1. {openstbench-1.1.0/src/OpenSTBench.egg-info → openstbench-1.2.0}/PKG-INFO +4 -1
  2. {openstbench-1.1.0 → openstbench-1.2.0}/pyproject.toml +4 -3
  3. {openstbench-1.1.0 → openstbench-1.2.0/src/OpenSTBench.egg-info}/PKG-INFO +4 -1
  4. {openstbench-1.1.0 → openstbench-1.2.0}/src/OpenSTBench.egg-info/requires.txt +3 -0
  5. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/__init__.py +1 -1
  6. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/speech_quality_evaluator.py +17 -2
  7. {openstbench-1.1.0 → openstbench-1.2.0}/LICENSE +0 -0
  8. {openstbench-1.1.0 → openstbench-1.2.0}/README.md +0 -0
  9. {openstbench-1.1.0 → openstbench-1.2.0}/setup.cfg +0 -0
  10. {openstbench-1.1.0 → openstbench-1.2.0}/src/OpenSTBench.egg-info/SOURCES.txt +0 -0
  11. {openstbench-1.1.0 → openstbench-1.2.0}/src/OpenSTBench.egg-info/dependency_links.txt +0 -0
  12. {openstbench-1.1.0 → openstbench-1.2.0}/src/OpenSTBench.egg-info/top_level.txt +0 -0
  13. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/_model_loading.py +0 -0
  14. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/emotion_evaluator.py +0 -0
  15. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/latency/__init__.py +0 -0
  16. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/latency/agent.py +0 -0
  17. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/latency/basics.py +0 -0
  18. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/latency/cli.py +0 -0
  19. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/latency/instance.py +0 -0
  20. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/latency/metrics.py +0 -0
  21. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/latency/utils.py +0 -0
  22. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/paralinguistic_evaluator.py +0 -0
  23. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/speaker_similarity_evaluator.py +0 -0
  24. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/temporal_consistency_evaluator.py +0 -0
  25. {openstbench-1.1.0 → openstbench-1.2.0}/src/openstbench/translation_evaluator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: OpenSTBench
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Unified multidimensional evaluation toolkit for S2TT and S2ST systems in offline and streaming speech translation settings
5
5
  Author-email: Yanjie An <691476922@qq.com>
6
6
  License: MIT
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3
17
17
  Requires-Python: <3.11,>=3.9
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
+ Requires-Dist: setuptools==80.9.0
20
21
  Requires-Dist: torch<2.7,>=2.6
21
22
  Requires-Dist: torchaudio<2.7,>=2.6
22
23
  Requires-Dist: numpy
@@ -36,6 +37,7 @@ Provides-Extra: whisper
36
37
  Requires-Dist: openai-whisper; extra == "whisper"
37
38
  Provides-Extra: speech-quality
38
39
  Requires-Dist: jiwer; extra == "speech-quality"
40
+ Requires-Dist: opencc-python-reimplemented; extra == "speech-quality"
39
41
  Provides-Extra: emotion
40
42
  Requires-Dist: funasr; extra == "emotion"
41
43
  Requires-Dist: modelscope; extra == "emotion"
@@ -45,6 +47,7 @@ Provides-Extra: all
45
47
  Requires-Dist: unbabel-comet>=2.2.2; extra == "all"
46
48
  Requires-Dist: openai-whisper; extra == "all"
47
49
  Requires-Dist: jiwer; extra == "all"
50
+ Requires-Dist: opencc-python-reimplemented; extra == "all"
48
51
  Requires-Dist: funasr; extra == "all"
49
52
  Requires-Dist: modelscope; extra == "all"
50
53
  Requires-Dist: transformers; extra == "all"
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "OpenSTBench"
7
- version = "1.1.0"
7
+ version = "1.2.0"
8
8
  description = "Unified multidimensional evaluation toolkit for S2TT and S2ST systems in offline and streaming speech translation settings"
9
9
  readme = {file = "README.md", content-type = "text/markdown"}
10
10
  requires-python = ">=3.9,<3.11"
@@ -29,6 +29,7 @@ classifiers = [
29
29
  ]
30
30
 
31
31
  dependencies = [
32
+ "setuptools==80.9.0",
32
33
  "torch>=2.6,<2.7",
33
34
  "torchaudio>=2.6,<2.7",
34
35
  "numpy",
@@ -53,10 +54,10 @@ Documentation = "https://github.com/sjtuayj/OpenSTBench#readme"
53
54
  [project.optional-dependencies]
54
55
  comet = ["unbabel-comet>=2.2.2"]
55
56
  whisper = ["openai-whisper"]
56
- speech_quality = ["jiwer"]
57
+ speech_quality = ["jiwer", "opencc-python-reimplemented"]
57
58
  emotion = ["funasr", "modelscope"]
58
59
  paralinguistics = ["transformers"]
59
- all = ["unbabel-comet>=2.2.2", "openai-whisper", "jiwer", "funasr", "modelscope", "transformers"]
60
+ all = ["unbabel-comet>=2.2.2", "openai-whisper", "jiwer", "opencc-python-reimplemented", "funasr", "modelscope", "transformers"]
60
61
 
61
62
  [tool.setuptools]
62
63
  package-dir = {"" = "src"}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: OpenSTBench
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Unified multidimensional evaluation toolkit for S2TT and S2ST systems in offline and streaming speech translation settings
5
5
  Author-email: Yanjie An <691476922@qq.com>
6
6
  License: MIT
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3
17
17
  Requires-Python: <3.11,>=3.9
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
+ Requires-Dist: setuptools==80.9.0
20
21
  Requires-Dist: torch<2.7,>=2.6
21
22
  Requires-Dist: torchaudio<2.7,>=2.6
22
23
  Requires-Dist: numpy
@@ -36,6 +37,7 @@ Provides-Extra: whisper
36
37
  Requires-Dist: openai-whisper; extra == "whisper"
37
38
  Provides-Extra: speech-quality
38
39
  Requires-Dist: jiwer; extra == "speech-quality"
40
+ Requires-Dist: opencc-python-reimplemented; extra == "speech-quality"
39
41
  Provides-Extra: emotion
40
42
  Requires-Dist: funasr; extra == "emotion"
41
43
  Requires-Dist: modelscope; extra == "emotion"
@@ -45,6 +47,7 @@ Provides-Extra: all
45
47
  Requires-Dist: unbabel-comet>=2.2.2; extra == "all"
46
48
  Requires-Dist: openai-whisper; extra == "all"
47
49
  Requires-Dist: jiwer; extra == "all"
50
+ Requires-Dist: opencc-python-reimplemented; extra == "all"
48
51
  Requires-Dist: funasr; extra == "all"
49
52
  Requires-Dist: modelscope; extra == "all"
50
53
  Requires-Dist: transformers; extra == "all"
@@ -1,3 +1,4 @@
1
+ setuptools==80.9.0
1
2
  torch<2.7,>=2.6
2
3
  torchaudio<2.7,>=2.6
3
4
  numpy
@@ -16,6 +17,7 @@ resemblyzer
16
17
  unbabel-comet>=2.2.2
17
18
  openai-whisper
18
19
  jiwer
20
+ opencc-python-reimplemented
19
21
  funasr
20
22
  modelscope
21
23
  transformers
@@ -32,6 +34,7 @@ transformers
32
34
 
33
35
  [speech_quality]
34
36
  jiwer
37
+ opencc-python-reimplemented
35
38
 
36
39
  [whisper]
37
40
  openai-whisper
@@ -9,7 +9,7 @@ actually accessed.
9
9
  from importlib import import_module
10
10
  from typing import Dict, Tuple
11
11
 
12
- __version__ = "1.1.0"
12
+ __version__ = "1.2.0"
13
13
 
14
14
  __all__ = [
15
15
  "TranslationEvaluator",
@@ -15,6 +15,11 @@ try:
15
15
  except ImportError:
16
16
  whisper = None
17
17
 
18
+ try:
19
+ from opencc import OpenCC
20
+ except ImportError:
21
+ OpenCC = None
22
+
18
23
  class SpeechQualityEvaluator:
19
24
  DEFAULT_WHISPER_MODEL = "medium"
20
25
  """
@@ -40,6 +45,8 @@ class SpeechQualityEvaluator:
40
45
  self.whisper_language = self._normalize_whisper_language(whisper_language)
41
46
  self.utmos_path = utmos_model_path
42
47
  self.utmos_ckpt = utmos_ckpt_path
48
+ self.zh_converter = OpenCC("t2s") if OpenCC is not None else None
49
+ self._warned_missing_opencc = False
43
50
 
44
51
  self.whisper_model = None
45
52
  self.utmos_model = None
@@ -148,8 +155,15 @@ class SpeechQualityEvaluator:
148
155
  return sum(scores) / len(scores) if scores else 0.0
149
156
 
150
157
  def _preprocess_for_wer(self, text: str, lang: str) -> str:
158
+ normalized_lang = self._normalize_whisper_language(lang) or str(lang).strip().lower()
151
159
  text = self.wer_transform(text)
152
- if lang in ["zh", "ja", "ko"]:
160
+ if normalized_lang == "zh":
161
+ if self.zh_converter is not None:
162
+ text = self.zh_converter.convert(text)
163
+ elif not self._warned_missing_opencc:
164
+ print("Warning: OpenCC is not installed; Chinese CER will not normalize traditional/simplified variants.")
165
+ self._warned_missing_opencc = True
166
+ if normalized_lang in ["zh", "ja", "ko"]:
153
167
  text = text.replace(" ", "")
154
168
  return " ".join(list(text))
155
169
  return text
@@ -194,7 +208,8 @@ class SpeechQualityEvaluator:
194
208
 
195
209
  if clean_refs:
196
210
  error_rate = jiwer.wer(clean_refs, clean_hyps)
197
- metric_name = "CER_Consistency" if target_lang in ['zh', 'ja', 'ko'] else "WER_Consistency"
211
+ normalized_target_lang = self._normalize_whisper_language(target_lang) or str(target_lang).strip().lower()
212
+ metric_name = "CER_Consistency" if normalized_target_lang in ['zh', 'ja', 'ko'] else "WER_Consistency"
198
213
  results[metric_name] = round(error_rate, 4)
199
214
  else:
200
215
  print(" ⚠️ The provided generated text is empty after cleaning, cannot compute distribution error rate.")
File without changes
File without changes
File without changes