Dealing with partial inputs

Tips and questions about scripting your Verbot®.

Moderator: Staff

Dealing with partial inputs

Postby Jishk » Fri Jul 15, 2011 2:58 am

I just thought this was neat, and figured I would share. The idea here was that it seemed harder to intelligently deal with partial inputs... either rules had to have very broad inputs (with just a word or two) that picked up on other unrelated sentences that didn't have more specific inputs, or that the user had to be a little more specific.

ex:
User: play some music
Bot: *plays music* Oh, you like music?
User: Stop. (User is intending to stop the music)
Bot: (* response, because no rule just has the word stop as an input).


OR (with a broad "one word" input for in the rule)

User: play some music
Bot: *plays music* Oh, you like music?
User: Stop talking, you're ruining the music!
Bot: *stops music* I guess you didn't like it.


Here's my resolution for that, which seems to be working really well so far.

Code: Select all
Rule name: |(verb)|
Input: |[only_verb=(verb)]|
Output: <mem.get only_verb> what?

Child Rule name: [object]
Input: (verb) [object]
Input: [object]
Output: <send <mem.get only_verb> <mem.get object>>


I sort of tried to make it respond contextually to partial inputs, like anyone else would.

User: Stop!
Bot: Stop what?
User: The music
Bot: <send stop the music> I guess you didn't like it...


I hope you can see what I'm getting at. Different outputs can be made with conditionals on what only_verb is (ex. "Go back to what?, "Search for what?"). You could even fill out the list of verbs much much more, so that words that aren't included in any command trigger the question, but still get the user to the "*" response. Let me know if you want me to explain any of it, give examples of other rules involved, etc. I just thought it was neat, and hope it's been helpful to someone out there. :)

Any advice? How do you handle partial inputs like that?
Jishk
ChatterBot
ChatterBot
 
Posts: 27
Joined: Mon Jun 07, 2010 3:28 am
Location: GA

Postby JonC » Fri Jul 15, 2011 4:05 pm

Nice work Jishk.
You might also want to read:
http://www.verbots.com/forums/viewtopic.php?t=2632
and:
http://www.verbots.com/forums/viewtopic.php?t=2843

which are much on the same ideas.
JonC
SupremeBot
SupremeBot
 
Posts: 665
Joined: Wed Apr 02, 2008 6:34 am
Location: Leicestershire, Great Britain


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron