# Load spaCy English model
import spacy


nlp = spacy.load("en_core_web_sm")


def remove_stop_words(text):

    import re
    text = re.sub(r'[^\w\s]',' ', text)
    
    T = []
    
    for t in text.split():
        if t not in T:
            T.append(t)
        
    doc = nlp(' '.join(T))
 
    # Remove stopwords
    filtered_words = [token.text for token in doc if not token.is_stop]
        
    return ' '.join(filtered_words)