Update eval.py
Browse files
eval.py
CHANGED
@@ -11,7 +11,7 @@ from slugify import slugify
|
|
11 |
from transformers import AutoFeatureExtractor, AutoModelForCTC, pipeline, Wav2Vec2Processor, Wav2Vec2ProcessorWithLM, Wav2Vec2FeatureExtractor
|
12 |
# from pyctcdecode import BeamSearchDecoderCTC
|
13 |
|
14 |
-
from cardinal_numbers import convert_nums
|
15 |
|
16 |
|
17 |
def log_results(result: Dataset, args: Dict[str, str]):
|
@@ -40,6 +40,8 @@ def log_results(result: Dataset, args: Dict[str, str]):
|
|
40 |
|
41 |
with open(f"{dataset_id}_eval_results.txt", "w") as f:
|
42 |
f.write(result_str)
|
|
|
|
|
43 |
|
44 |
# log all results in text file. Possibly interesting for analysis
|
45 |
if log_outputs is not None:
|
@@ -250,3 +252,4 @@ if __name__ == "__main__":
|
|
250 |
args = parser.parse_args()
|
251 |
|
252 |
main(args)
|
|
|
|
11 |
from transformers import AutoFeatureExtractor, AutoModelForCTC, pipeline, Wav2Vec2Processor, Wav2Vec2ProcessorWithLM, Wav2Vec2FeatureExtractor
|
12 |
# from pyctcdecode import BeamSearchDecoderCTC
|
13 |
|
14 |
+
from .cardinal_numbers import convert_nums
|
15 |
|
16 |
|
17 |
def log_results(result: Dataset, args: Dict[str, str]):
|
|
|
40 |
|
41 |
with open(f"{dataset_id}_eval_results.txt", "w") as f:
|
42 |
f.write(result_str)
|
43 |
+
with open(f"{dataset_id}_eval_results.tsv", "w") as f:
|
44 |
+
f.write("\t".join([args.model_id, args.config, args.filter, args.split, lm, wer_result, cer_result]))
|
45 |
|
46 |
# log all results in text file. Possibly interesting for analysis
|
47 |
if log_outputs is not None:
|
|
|
252 |
args = parser.parse_args()
|
253 |
|
254 |
main(args)
|
255 |
+
|