def prettify_response(response):
    """
    Prettify chatbot's answer removing excessive characters and capitalizing first words of sentences.
    Before: "hello world ! nice to meet you , buddy . do you like me ? I ' ve been missing you for a while . . ."
    After: "Hello world! Nice to meet you, buddy. Do you like me? I've been missing you for a while..."
    """
    response = response.replace(' \' ', '\'')

    for ch in set(_END_CHARS) | {','}:
        response = response.replace(' ' + ch, ch)

    response = _capitalize_first_chars(response)
    response = response.strip()

    return response

    Prettify chatbot's answer removing excessive characters and capitalizing first words of sentences.
    Before: "hello world ! nice to meet you , buddy . do you like me ? I ' ve been missing you for a while . . ."
    After: "Hello world! Nice to meet you, buddy. Do you like me? I've been missing you for a while..."
    
cakechat/utils/text_processing/str_processor.py