This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spacy | |
# Load a pre-trained NLP model from spaCy | |
nlp = spacy.load("en_core_web_sm") | |
# Define a function to handle user input and generate a response | |
def respond(input): | |
# Parse the user input using the NLP model | |
doc = nlp(input) |