pyaiml21.utils.text_preprocessors.normalize_user_input

pyaiml21.utils.text_preprocessors.normalize_user_input(s: str) List[List[str]][source][source]

Perform latin-alphabet normalisation, split to sentences and each to words.

Word normalisation consists of UNICODE normalisation and converting to uppercase.

Parameters

s – user input to normalize

Returns

list of sentences, each sentence is a list of words

Example:
>>> text = "Hello. How ARE you...."
>>> expected = [["HELLO"], ["HOW", "ARE", "YOU"]]
>>> normalize_user_input(text) == expected
True