Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 3 POS for classification Robots and chat bots receive different commands to do certain tasks. Write a simple pragram that receive interactions in the
Problem POS for classification
Robots and chat bots receive different commands to do certain tasks.
Write a simple pragram that receive interactions in the form of a sentence and return:
A tuple of command objectegGrab book if the sentence is a command
None if the sentence is not a command
To write this function, you can utilize a Partofspeech tagger or namedentity recognizer from libraries like NLTK and Spacy.
Consider the following EXAMPLE sentences:
Commands:
Grab the book
Fetch the ball
Open the jar
Not commands:
Hey, how is it going?
How is your day today?
Do you like the weather?
This list is not exhaustive, your function should be able to handle more cases.
Expected outcome:
A function that performs the task
Test the function with the above provided Commands Not Commands examples and print the output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started