This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-10-14 15:11:23

maxamillion321
Scratcher
Registered: 2011-06-17
Posts: 500+

Respond help

I making a project of Siri and I need help for making her respond and I'm wondering if this is the right way. Is this the right way?

when gf clicked
ask [What can I help you with?] and wait
if <(answer) = [Hello]>
say [Hello!]
end

Last edited by maxamillion321 (2012-10-14 15:11:39)

Offline

 

#2 2012-10-14 19:15:54

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Respond help

yes, but such a rigid answer format is unlikely to be user friendly.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#3 2012-10-16 12:28:08

Prestige
Scratcher
Registered: 2008-12-15
Posts: 100+

Re: Respond help

You may want to pick out certain keywords or phrases.., and put these in a list. For example, if the user says the word time in their sentence then see what 'time' corresponds to in the list and give a generic answer about time (for example the current time). As Wes64 said, specific keywords probably won't work well because people tend to ask things in different ways!


"Don't insult someone until you've walked a mile in their shoes. That way, if they don't like what you have to say, you'll be a mile away and still have their shoes  smile  "

Offline

 

#4 2012-10-16 12:57:38

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Respond help

http://en.wikipedia.org/wiki/Natural_la … processing

This is where you want to listen to your English teacher. When listening, look for patterns, like: "subject verb object" is a common way we write sentences. "I program in Scratch." "I" being the subject, "program" being the verb, "Scratch" being the object. With that pattern, you can pick out certain words the program responds with. So when it "reads" what I've written, it'll pick out "I", so you probably want the program to respond with "You", and then look and add the verb "program" and then the object as well: "Scratch." The result will be: "You program Scratch" which is wrong since we don't program Scratch, we program in it, so you also want to get the preposition "in" and add that to get "You program in Scratch".

With this method you can make simple responses to simple statements.

Code:

You: I program in Scratch
Bot: You program in Scratch

You: You are awesome
Bot: I am awesome

Then gradually add more replacements instead of just switching the subject (I and you) to switching the verb (are, am) to even more complicated stuff where it responds to questions like "How long have you been running?" (this is actually an extremely complicated question since it can refer to the run-time like how long the program has been running, or how long they have been running/jogging). So start with simple responses and recognizing statements and then move on to harder stuff.  smile

Though I think Scratch will only be able to handle simple statements and questions, it'd be interesting to see how far you can go with this though. Good luck!

Offline

 

Board footer