gpt-3.5-turbo-0301· OpenAI WildChat-4.8M (AI2)
code to demonstrate pos(part of speech) using spicy
- User
code to demonstrate pos(part of speech) using spicy
- Assistant
import spacy
nlp = spacy.load("en_core_web_sm")
sentence = "The cat sat on the mat."
doc = nlp(sentence)
for token in doc: print(token.text, token.pos_)
Output:
The DET
cat NOUN
sat VERB
on ADP
the DET
mat NOUN
- User
hello
- Assistant
Hello! How can I assist you today?