Spaces:
Running
Running
Update speechscore.py
Browse files- speechscore.py +8 -2
speechscore.py
CHANGED
@@ -71,12 +71,18 @@ class ScoresList:
|
|
71 |
result_score = score.scoring(data, window, score_rate)
|
72 |
results_id[score.name] = result_score
|
73 |
results[audio_id] = results_id
|
74 |
-
|
|
|
75 |
data = self.audio_reader(test_path, reference_path)
|
76 |
for score in self.scores:
|
77 |
result_score = score.scoring(data, window, score_rate)
|
78 |
results[score.name] = result_score
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
80 |
if return_mean:
|
81 |
mean_result = compute_mean_results(*results.values())
|
82 |
results['Mean_Score'] = mean_result
|
|
|
71 |
result_score = score.scoring(data, window, score_rate)
|
72 |
results_id[score.name] = result_score
|
73 |
results[audio_id] = results_id
|
74 |
+
|
75 |
+
elif os.path.isfile(test_path):
|
76 |
data = self.audio_reader(test_path, reference_path)
|
77 |
for score in self.scores:
|
78 |
result_score = score.scoring(data, window, score_rate)
|
79 |
results[score.name] = result_score
|
80 |
+
else:
|
81 |
+
data = test_path
|
82 |
+
for score in self.scores:
|
83 |
+
result_score = score.scoring(data, window, score_rate)
|
84 |
+
results[score.name] = result_score
|
85 |
+
|
86 |
if return_mean:
|
87 |
mean_result = compute_mean_results(*results.values())
|
88 |
results['Mean_Score'] = mean_result
|