Jump to content

Recommended Posts

DynamicRookie

Hey there!

I was thinking about building a chatting artificial intelligence in AutoIt

I've been all the day learning about machine learning algorithms, but most of them were made for other type of areas such as marketing.

Anyone knows an algorithm for sentences and context pattern finding i can study?

 

I would also like to implement features like finding on memory related sentences and compare them

I.e. Hello, how are you

And split that sentence into 2 type of refferences to the answer, 'Hello' and 'How are you'

I.e. Wanna play?

I would like to let the bot understand same for "Wanna play" and "Wanna play?"

Or for "Hello bot' and "Hello"

 

Or memory finding message by conversation

I have made a memory array based on the conversation i had with the bot, but i couldnt figure a way to make the bot find in memory, even though is supposed to work properly

$ArrayTraceB = 0
        $MemoryArray = StringSplit($Memory, '|')
        For $D in $SentenceKeyArray
            If $D = 'about' Then
                MemoryFunction($D, $ArrayTraceB, $SentenceKeyArray)
            Else
                $ArrayTraceB = $ArrayTraceB +1
            EndIf
        Next

Like on that code snap which leads to this function

Func MemoryFunction($Call, $Trace, ByRef $KeyArray)
    $MemoryArray = StringSplit($Memory, '|')
    If $Call = 'About' Then
        $FirstArray = 1
        For $Ref In $MemoryArray
            If $FirstArray = 1 Then
                $FirstArray = 0
            Else
                $NeuronValues = $NeuronValues & '|' & $Neurons[$Ref]
            EndIf
        Next
        $NeuronValuesArray = StringSplit($NeuronValues, '|')
        $ArrayTrace = $Trace +1
        $Topic = ''
        While 1
            If $ArrayTrace >= $KeyArray[0] Then
                ExitLoop
            Else
            $Topic = $Topic & ' ' & $KeyArray[$ArrayTrace]
            $ArrayTrace = $ArrayTrace +1
            EndIf
            Sleep(50)
        WEnd
        $ArrayTrace = 0
        $bFound = False
        _ArrayDisplay($NeuronValuesArray)
        For $i = 0 To $NeuronValuesArray[0]         ; Test from element 0 to the last element of the array
            If StringInStr($Topic, $NeuronValuesArray[$i]) Then
                $bFound = True
                ExitLoop ; Unless i need to find more instances we exit this part of the code imediately
                Global $ArrayX = $i
            EndIf
        Next
        If $bFound = False Then
            MsgBox(0, '', '-' & $Topic & '-')
        $Answer = "I dont remember anything about " & $Topic
        $WaitYesNo = True
        $BehaviorFlag = 2
        AnswerSentence($Answer, $BehaviorFlag)
        Else
        _ArrayDisplay($NeuronValuesArray)
        MsgBox(0, '', $ArrayX)
        $Answer = 'I remember a message saying "' & $NeuronValuesArray[$ArrayX] & '", do you want to talk about that?'
        $WaitYesNo = True
        $BehaviorFlag = 4
        AnswerSentence($Answer, $BehaviorFlag)
        EndIf
    EndIf
EndFunc

It always misses the last word and adds an empty space char at start.

I would appreciate any suggestions

Share this post


Link to post
Share on other sites
TheSaint

Hi DynamicRookie.

I know you think this topic belongs here, and certainly on some levels it does. It is certainly an interesting topic and exercise.

But seeing as it has code and asks a related question or two, and I am guessing you want the brightest and greatest we have here to look at it, and respond, perhaps with code, then you are more likely to get that happening in the GH&S forum, so I recommend you Report it to be relocated there.

We don't get anywhere near as many attendees or viewers here in Chat, and many of us come here for a no code break. :D

 


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
Somerset
21 minutes ago, TheSaint said:

Hi DynamicRookie.

I know you think this topic belongs here, and certainly on some levels it does. It is certainly an interesting topic and exercise.

But seeing as it has code and asks a related question or two, and I am guessing you want the brightest and greatest we have here to look at it, and respond, perhaps with code, then you are more likely to get that happening in the GH&S forum, so I recommend you Report it to be relocated there.

We don't get anywhere near as many attendees or viewers here in Chat, and many of us come here for a no code break. :D

 

All of this coming from our residential "Spam Bot"? How nice! :muttley:

  • Confused 1

 

Spoiler

 

Share this post


Link to post
Share on other sites
TheSaint
Posted (edited)
7 minutes ago, Somerset said:

All of this coming from our residential "Spam Bot"? How nice! :muttley:

Dog Darn It! I might reside, but I am not residential ... I am far more suave & sophisticated than that. o:)

As for my Bot, it takes umbrage at the idea it has been spammed.

And yes, I was being nice, you dufous.

Now go and change your underpants before we get any more droppings slipping out. :lmao:

Edited by TheSaint
  • Confused 1

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
DynamicRookie
14 hours ago, TheSaint said:

Hi DynamicRookie.

I know you think this topic belongs here, and certainly on some levels it does. It is certainly an interesting topic and exercise.

But seeing as it has code and asks a related question or two, and I am guessing you want the brightest and greatest we have here to look at it, and respond, perhaps with code, then you are more likely to get that happening in the GH&S forum, so I recommend you Report it to be relocated there.

We don't get anywhere near as many attendees or viewers here in Chat, and many of us come here for a no code break. :D

 

In part is more like asking for suggestions rather than for help, like a conversation about what algorithms are good for machine learning, i don't feel like posting a thread saying "what algorithms are good for this" on that forum, however i'll do it.

Share this post


Link to post
Share on other sites
DynamicRookie

Hey there!

I was thinking about building a chatting artificial intelligence in AutoIt

I've been all the day learning about machine learning algorithms, but most of them were made for other type of areas such as marketing.

Anyone knows an algorithm for sentences and context pattern finding i can study?

 

I would also like to implement features like finding on memory related sentences and compare them

I.e. Hello, how are you

And split that sentence into 2 type of refferences to the answer, 'Hello' and 'How are you'

I.e. Wanna play?

I would like to let the bot understand same for "Wanna play" and "Wanna play?"

Or for "Hello bot' and "Hello"

 

Or memory finding message by conversation

I have made a memory array based on the conversation i had with the bot, but i couldnt figure a way to make the bot find in memory, even though is supposed to work properly

$ArrayTraceB = 0
        $MemoryArray = StringSplit($Memory, '|')
        For $D in $SentenceKeyArray
            If $D = 'about' Then
                MemoryFunction($D, $ArrayTraceB, $SentenceKeyArray)
            Else
                $ArrayTraceB = $ArrayTraceB +1
            EndIf
        Next

Like on that code snap which leads to this function

Func MemoryFunction($Call, $Trace, ByRef $KeyArray)
    $MemoryArray = StringSplit($Memory, '|')
    If $Call = 'About' Then
        $FirstArray = 1
        For $Ref In $MemoryArray
            If $FirstArray = 1 Then
                $FirstArray = 0
            Else
                $NeuronValues = $NeuronValues & '|' & $Neurons[$Ref]
            EndIf
        Next
        $NeuronValuesArray = StringSplit($NeuronValues, '|')
        $ArrayTrace = $Trace +1
        $Topic = ''
        While 1
            If $ArrayTrace >= $KeyArray[0] Then
                ExitLoop
            Else
            $Topic = $Topic & ' ' & $KeyArray[$ArrayTrace]
            $ArrayTrace = $ArrayTrace +1
            EndIf
            Sleep(50)
        WEnd
        $ArrayTrace = 0
        $bFound = False
        _ArrayDisplay($NeuronValuesArray)
        For $i = 0 To $NeuronValuesArray[0]         ; Test from element 0 to the last element of the array
            If StringInStr($Topic, $NeuronValuesArray[$i]) Then
                $bFound = True
                ExitLoop ; Unless i need to find more instances we exit this part of the code imediately
                Global $ArrayX = $i
            EndIf
        Next
        If $bFound = False Then
            MsgBox(0, '', '-' & $Topic & '-')
        $Answer = "I dont remember anything about " & $Topic
        $WaitYesNo = True
        $BehaviorFlag = 2
        AnswerSentence($Answer, $BehaviorFlag)
        Else
        _ArrayDisplay($NeuronValuesArray)
        MsgBox(0, '', $ArrayX)
        $Answer = 'I remember a message saying "' & $NeuronValuesArray[$ArrayX] & '", do you want to talk about that?'
        $WaitYesNo = True
        $BehaviorFlag = 4
        AnswerSentence($Answer, $BehaviorFlag)
        EndIf
    EndIf
EndFunc

It always misses the last word and adds an empty space char at start.

I would appreciate any suggestions

Share this post


Link to post
Share on other sites
DynamicRookie
Posted (edited)
3 hours ago, JLogan3o13 said:

Please stick to one thread per topic.

Wow i was posting that on Gh&s but it posted it here?
 

Weird

 

EDIT: My bad, you moved it here

Edited by DynamicRookie

Share this post


Link to post
Share on other sites
JLogan3o13

You had one in Chat and one in GH & S, we don't allow duplicate threads. GH & S is where it should have lived from the beginning.

 


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
DynamicRookie
Just now, JLogan3o13 said:

You had one in Chat and one in GH & S, we don't allow duplicate threads. GH & S is where it should have lived from the beginning.

 

I understand

Share this post


Link to post
Share on other sites
JLogan3o13
Posted (edited)

Also, when you respond, please just hit the reply button rather than quoting everything. It pads the thread needlessly, and I know what I said (I was there when I said it).

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • DynamicRookie
      By DynamicRookie
      Hey there!
       
      I've been developing a artificial intelligence.

      My first hard task was letting the A.I know when a sentence is found in memory with different words
      What i tried to do here is simply, get all the words in user sentence that could be used
      as a identifier
              
              example: Steve Jobs
              
              then identify the sentence purpose with the words we found in the past "for" loop
              
              example: Do/Know/You/Who/Steve/Jobs
              
              Compare the example in the following matching sentences in memory.
              
              1-Steve jobs was a known person
              2-Do you know who barack obama is?
              3-Do you know Steve jobs?
              4-Do you know who steve jobs is?
              5-How much money steve jobs had
              
              Then find the sentence that has way more matches than the other ones, remember that if the identifier words were not found
              (Steve jobs) then the sentence is invalid.
              
              Every sentence has a different answer and is important that the right one is chosen.
              
      If there's no more than the half of words in matches, then assign a variable the result of function, such as a return but for a global var.
      I couldn't figure out how to do that with StringRegExp.
       
      I honestly need help with detecting identifiers on memory sentences.
      I would also like to let the AI know typos, meaning that moeny and money means the same thing.
      Any help is hugely appreciated.

       
    • DynamicRookie
      By DynamicRookie
      Hey there!
       
      I was studying about algorithms of machine learning and artificial intelligence inner systems, in specific, i would like to create a similar system like AIML and A.L.I.C.E., but in AU3.

      I can re-create pretty much all the functions in AIML by myself, except for "any (*)", which is really useful for pattern detection.
       
      Example:
       
      How i could re-create it in Au3?

      Any help is really appreciated!
    • DynamicRookie
      By DynamicRookie
      Hey There!
       
      So, what i need to do is an app that can read text in a image (I.e. a png that has text saying "This is a png" and return the text to a variable)
      I'm pretty much a newbie on AutoIt, my purpose is doing that but i don't know any function that can

      Any help is much appreciated
    • kjsisco
      By kjsisco
      This algorithm is loosely based on the Approximate Counting algorithm.  After the user is prompted for a starting number, a "virtual coin flip" is performed.  The numbers are then put in order from least to greatest.  This is great for sorting.
       
      SmartCounting.au3
×