text_plain_output_1.png
import spacy

import spacy.cli
spacy.cli.download('en_core_web_sm')
nlp = spacy.load('en_core_web_sm')

def preprocess(text):
    doc = nlp(text)
    filtered_token = []
    for token in doc:
        if token.is_punct or token.is_space or token.is_bracket or token.is_stop:
            continue
        else:
            token = token.lemma_
            filtered_token.append(token)
    return filtered_token

tokens = preprocess('My best friend Anu, (who is three months older than me) is coming to my house tonight!!!.')
tokens