(s)
| 19 | |
| 20 | |
| 21 | def normalize_answer(s): |
| 22 | def remove_articles(text): |
| 23 | return re.sub(r"\b(a|an|the)\b", " ", text) |
| 24 | |
| 25 | def white_space_fix(text): |
| 26 | return " ".join(text.split()) |
| 27 | |
| 28 | def remove_punc(text): |
| 29 | exclude = set(string.punctuation) |
| 30 | return "".join(ch for ch in text if ch not in exclude) |
| 31 | |
| 32 | def lower(text): |
| 33 | return text.lower() |
| 34 | |
| 35 | return white_space_fix(remove_articles(remove_punc(lower(s)))) |
| 36 | |
| 37 | |
| 38 | def f1_score(prediction, ground_truth): |
no test coverage detected