Harveenchadha
commited on
Commit
•
03a785f
1
Parent(s):
5a0f85e
Update evaluations/eval.py
Browse files- evaluations/eval.py +9 -9
evaluations/eval.py
CHANGED
@@ -14,8 +14,8 @@ from datasets import Audio, Dataset, load_dataset, load_metric
|
|
14 |
from transformers import AutoFeatureExtractor, pipeline
|
15 |
|
16 |
|
17 |
-
indic_normalizer_factory = IndicNormalizerFactory()
|
18 |
-
indic_normalizer = indic_normalizer_factory.get_normalizer('hi')
|
19 |
|
20 |
def log_results(result: Dataset, args: Dict[str, str]):
|
21 |
"""DO NOT CHANGE. This function computes and logs the result metrics."""
|
@@ -71,11 +71,11 @@ def normalize_text(text: str) -> str:
|
|
71 |
|
72 |
return text
|
73 |
|
74 |
-
def normalize_text_indic(text:str) -> str:
|
75 |
-
lang='hi'
|
76 |
-
normalized = indic_normalizer.normalize(text)
|
77 |
-
processed = ' '.join(trivial_tokenize(normalized, lang))
|
78 |
-
return processed
|
79 |
|
80 |
|
81 |
def main(args):
|
@@ -105,8 +105,8 @@ def main(args):
|
|
105 |
|
106 |
batch["prediction"] = prediction["text"]
|
107 |
batch["target"] = normalize_text(batch["sentence"])
|
108 |
-
batch["prediction"] = normalize_text_indic(batch["prediction"] )
|
109 |
-
batch["target"] = normalize_text_indic(batch["target"] )
|
110 |
return batch
|
111 |
|
112 |
# run inference on all examples
|
|
|
14 |
from transformers import AutoFeatureExtractor, pipeline
|
15 |
|
16 |
|
17 |
+
#indic_normalizer_factory = IndicNormalizerFactory()
|
18 |
+
#indic_normalizer = indic_normalizer_factory.get_normalizer('hi')
|
19 |
|
20 |
def log_results(result: Dataset, args: Dict[str, str]):
|
21 |
"""DO NOT CHANGE. This function computes and logs the result metrics."""
|
|
|
71 |
|
72 |
return text
|
73 |
|
74 |
+
#def normalize_text_indic(text:str) -> str:
|
75 |
+
# lang='hi'
|
76 |
+
# normalized = indic_normalizer.normalize(text)
|
77 |
+
# processed = ' '.join(trivial_tokenize(normalized, lang))
|
78 |
+
# return processed
|
79 |
|
80 |
|
81 |
def main(args):
|
|
|
105 |
|
106 |
batch["prediction"] = prediction["text"]
|
107 |
batch["target"] = normalize_text(batch["sentence"])
|
108 |
+
#batch["prediction"] = normalize_text_indic(batch["prediction"] )
|
109 |
+
#batch["target"] = normalize_text_indic(batch["target"] )
|
110 |
return batch
|
111 |
|
112 |
# run inference on all examples
|