Spaces:
Running
Running
Update speechscore.py
Browse files- speechscore.py +6 -3
speechscore.py
CHANGED
|
@@ -72,7 +72,8 @@ class ScoresList:
|
|
| 72 |
|
| 73 |
for score in self.scores:
|
| 74 |
result_score = score.scoring(data, window, score_rate, round_digits)
|
| 75 |
-
|
|
|
|
| 76 |
else:
|
| 77 |
if os.path.isdir(test_path):
|
| 78 |
audio_list = self.get_audio_list(test_path)
|
|
@@ -85,14 +86,16 @@ class ScoresList:
|
|
| 85 |
data = self.audio_reader(test_path+'/'+audio_id, None)
|
| 86 |
for score in self.scores:
|
| 87 |
result_score = score.scoring(data, window, score_rate, round_digits)
|
| 88 |
-
|
|
|
|
| 89 |
results[audio_id] = results_id
|
| 90 |
|
| 91 |
elif os.path.isfile(test_path):
|
| 92 |
data = self.audio_reader(test_path, reference_path)
|
| 93 |
for score in self.scores:
|
| 94 |
result_score = score.scoring(data, window, score_rate, round_digits)
|
| 95 |
-
|
|
|
|
| 96 |
|
| 97 |
if return_mean:
|
| 98 |
mean_result = compute_mean_results(*results.values(), round_digits=round_digits)
|
|
|
|
| 72 |
|
| 73 |
for score in self.scores:
|
| 74 |
result_score = score.scoring(data, window, score_rate, round_digits)
|
| 75 |
+
if result_score is not None:
|
| 76 |
+
results[score.name] = result_score
|
| 77 |
else:
|
| 78 |
if os.path.isdir(test_path):
|
| 79 |
audio_list = self.get_audio_list(test_path)
|
|
|
|
| 86 |
data = self.audio_reader(test_path+'/'+audio_id, None)
|
| 87 |
for score in self.scores:
|
| 88 |
result_score = score.scoring(data, window, score_rate, round_digits)
|
| 89 |
+
if result_score is not None:
|
| 90 |
+
results_id[score.name] = result_score
|
| 91 |
results[audio_id] = results_id
|
| 92 |
|
| 93 |
elif os.path.isfile(test_path):
|
| 94 |
data = self.audio_reader(test_path, reference_path)
|
| 95 |
for score in self.scores:
|
| 96 |
result_score = score.scoring(data, window, score_rate, round_digits)
|
| 97 |
+
if result_score is not None:
|
| 98 |
+
results[score.name] = result_score
|
| 99 |
|
| 100 |
if return_mean:
|
| 101 |
mean_result = compute_mean_results(*results.values(), round_digits=round_digits)
|