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

#1 2011-03-08 23:15:32

silvershine
Scratcher
Registered: 2010-11-21
Posts: 500+

AI help

Hey everyone,
I've been bored lately, so I started working on an AI that you can chat with. It would work by finding keywords in the users question, and coming up with an answer based on that.

Heres what it does so far:

•The user types in a question
•The answer is put, letter by letter, into a list. (each list item  in the list is either one letter, or a space)
•A variable called "Word" is set to all the letters before the first space in the question (The first word).
•The word that "Word" contains is added to a list which will later be searched for keywords (Each item in the list will be each word in the sentence)

That's all I have. I can only get it to separate the first word from any given sentence. How do I get it to repeat this until a each word of the question is put into a list?

Help would be greatly appreciated!

Silvershine

Offline

 

#2 2011-03-08 23:17:49

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: AI help

Well, I made a chatbot that works pretty much like what you're thinking of... you could download it and study the scripts. My chatbot  big_smile .


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#3 2011-03-09 12:36:04

silvershine
Scratcher
Registered: 2010-11-21
Posts: 500+

Re: AI help

I took a look at it, but struggled to understand the scripts. I guess I'll keep experimenting. Thanks anyways!

Offline

 

#4 2011-03-09 14:09:48

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

Re: AI help

For each letter, add it to a list named 'word', then when it hits a space, add that list to another list 'word list', then keep doing that till it hits the end of the list. Then use 'word list' to understand what the Human is saying to the Bot.

Offline

 

Board footer