I write "hi hello", after cleaning whitespace using chatterbot.preprocessors.clean_whitespace I want to show my input as "hihello", bt chatterbot replies me another answer. How can I print my input after preprocessing?
Asked
Active
Viewed 222 times
1 Answers
0
The clean_whitespace
preprocessor in ChatterBot won't remove all white space, just preceding, trailing, and consecutive spaces. It cleans the white space, it doesn't remove it entirely.
It sounds like you want to create your own preprocessor. This can be as simple as creating a function like this:
def remove_whitespace(chatbot, statement):
for character in ['\n', '\r', '\t', ' ']:
statement.text = statement.text.replace(character, '')
return statement

Gunther
- 2,474
- 4
- 31
- 45
-
Thank you, sir, but can I see the steps before and AFTER PREPROCESSING chatterbot input statement? – sharmishta sett Sep 14 '18 at 15:09