Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How would one go about making artificial intelligent

edited October 2013 in Questions Posts: 577

Hi, I'm trying to make a chat bot, but I'm not sure how I would make the program interpret the users words, does anyone know how to make it?

Comments

  • dave1707dave1707 Mod
    Posts: 7,683

    @Prynok You could start by putting the most common words in a table as the key, with how you want to react to those words.

  • Posts: 577

    Sorry if I didn't state it well in the original post, but I meant how can I decide what the user says?

    Lets say the user types in "The cat is fat"

    how could the program break it down into sectors, so I could do

    if sentence == fat then
    
    table.add(sometable,fat)
    end
    
    if sentence == the then
    
    table.add(sometable, why)
    end
    
    
  • edited October 2013 Posts: 372

    And then save the contents of the table. Then when something new comes up you could ask what would you like the reply to be(In a way it doesn't look like you're asking), and then save it in the table too.

  • Posts: 66

    There are several open source chatbots - find one and translate the source code.

    I'd start with Eliza.

  • IgnatzIgnatz Mod
    Posts: 5,396

    Some people have spent their careers trying to achieve this. It is HARD! It may be easier to start with a small fixed set of words and get Codea to understand them.

  • edited August 2 Posts: 12

    So how can you break the sentences into words

  • dave1707dave1707 Mod
    Posts: 7,683

    @joaquin You would parse the sentence searching for a space. You could put each word into a table and then identify what each word means. To start, you'll need a small table of words with what action you want to take for each word. It would have a limited vocabulary, but you can keep adding to it.

  • dave1707dave1707 Mod
    Posts: 7,683

    @joaquin Here's some code that splits words.

    function setup()
        tab={}
        str="Some people have spent their careers trying to achieve this. It is HARD! It may be easier to start with a small fixed set of words and get Codea to understand them. So how can you break the sentences into words."
    
        for word in string.gmatch(str,"(%w*)[%.% %!]") do   -- find each word
            table.insert(tab,word)  -- put each word into the table
        end
        print(table.concat(tab,"\n"))   -- print the table
    end
    
  • edited August 10 Posts: 12

    @dave1707 Thanks again

  • AnatolyAnatoly Mod
    Posts: 831

    AIs are known to overwrite themselves. I suggest you to create a new text file, and respond with it.

Sign In or Register to comment.