normalize_answer#
- scikitplot.corpus.normalize_answer(text, *, mode='squad')[source]#
Normalise an answer string for comparison.
- Parameters:
- textstr
Answer text.
- mode{“squad”, “basic”, None}, default=”squad”
See the module documentation.
- Returns:
- str
- Raises:
- TypeError
If
textis not astr.- ValueError
For an unknown
mode.
- Parameters:
- Return type:
Examples
>>> normalize_answer("The Eiffel Tower!") 'eiffel tower' >>> normalize_answer("Straße", mode="basic") 'strasse'