Jump to content
DynamicRookie

Artificial Intelligence Neural Networks

Recommended Posts

DynamicRookie
Posted (edited)

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.

 

Edited by DynamicRookie
Updated

Share this post


Link to post
Share on other sites
KickStarter15
9 hours ago, DynamicRookie said:

My first hard task was letting the A.I know when a sentence is found in memory with different words

Is this an excel file where your memory database found for validation?

 

9 hours ago, DynamicRookie said:

       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

Secondly, if this were database validation then that would be easy for excel UDF by Water. But off course, you need to GUICtrlRead() for the input made by the user for the word validation.


Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare.

Share this post


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

For the typos, you have a few ways, depending on how lenient you want to make it.

1- The simplest would probably be to count the letters in each word (maybe store it in a data structure), so "apple" would be 1a, 2p, 1l, 1e. Then, you do a search and find a match in the word "papel". Problem: Anagrams. You could also make it accept a difference of 1 (leniency).

2- Check that two words match, but also check the +1/-1 char of the word for the letter in case they swtich it like I did for the word "switch". E.g. [w][t][c][h] and [w][t][c][h]:
0=0, 1=1, 2!=2, check 2+1=2 (2 and 3 are now found, so you can skip 3), 4=4, 5=5.

Pretend there is no strikeout above ^. The forum put it there.

Edited by IAMK

Share this post


Link to post
Share on other sites
FMS

maybe of topic on your question but I am also building AI (code here)
Maybe we can compare some code ?
I'm curious on your take on the math :)


as finishing touch god created the dutch

Share this post


Link to post
Share on other sites
DynamicRookie
13 hours ago, FMS said:

maybe of topic on your question but I am also building AI (code here)
Maybe we can compare some code ?
I'm curious on your take on the math :)

I'm not skilled or something honestly, i'm just trying to let my code be simple so debugging is easier, however, so far i could do self-learning, memory checking, non-supervised learning, GUI, Inputs, memory arrays, weight, neurons, temporal lobes (This will let the AI know that "My name is Rookie" will be reffered if the user says "What's my name?", i have made it up to 1000 messages and the sentences are kind of encrypted for privacy and saved in a file), and check if the AI is original.

 

The AI is interesting to talk to, but my objective is to make it entertaining, not only for use but for coding it, like a hobbie.

I checked ur AI thread and it looks really interesting, but hard to debug.

I'd appreciate if you explained me how it works, cause i'm really curious!

Share this post


Link to post
Share on other sites
Andreik

AI is a complex concept and usually is a mixture of many algorithms combined. For what you need a good start would be to play with levenshtein distance. This is an algorithm to check the similarities of strings.

  • Like 1

When the words fail... music speaks

Share this post


Link to post
Share on other sites
DynamicRookie
13 hours ago, Andreik said:

AI is a complex concept and usually is a mixture of many algorithms combined. For what you need a good start would be to play with levenshtein distance. This is an algorithm to check the similarities of strings.

Yeah, i have thought of that, but i made a extremely easy system that only took me about 10 minutes.

Is, checking strings letters, every letter has a value, then we replace all the letters by their values and sum them all, that means that, in example, msas and mass are both worth 16.

Very easy system, i'll also add a system so it can check for duplicated letters, missing letters, and extra letters.

About the learning system, it is designed to change topic as soon as the sentence the user provided was not found in memory, then tell another person (or to the same user in a different session) the sentence the other user said, and store the answer.

Share this post


Link to post
Share on other sites
FMS
Posted (edited)
Quote

I'd appreciate if you explained me how it works, cause i'm really curious!

The AI.au3 you see is (in this case) checks "handwritten digits" and calculates the best possible digit it think it is :)
The file's beneath the ai.au3 are the mnist database (handwritten digits and it's "target")
The targets are there for the "backwards propagation".
The handwritten digits are in a grid of 28 by 28 whit a black/white of 0 to 255.

In the beggining you have 1 "array" (or vector) of 784 (28*28) whit value's of 0-255 and propagrate forward (whit matrix math E4A)  to a array[10] (1 for each digit).
you see what i mean iff you klik the label "normelized input"

pseudo code:
(input[0]*wheigt[0])+(input[1]*wheight[1])+(...))+bias = output hiddenlayer1-node1

Where you are talking about doesn't sounds like a proper AI (code who thinks for it self instead of working out a code) or am i wrong?
If not could I see your feed function?

Edited by FMS
text added

as finishing touch god created the dutch

Share this post


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

code who thinks for it self instead of working out a code

What do you define by thinking by itself?

About feedback system, it checks a list with an array containing words that can be used to identify the meaning of the sentence that user typed, then, after getting class of the sentence, it calculates an answer by the user responses to questions with that type of class and the word matches of those responses with the actual user input by calculating every word value and choosing the word with the highest amount of matchs, then the class, sentence, and answer get encrypted, and saved in a file.

But, the main point of my AI is not chatting, what i want to do with it is a really original concept, and i don't feel like sharing it yet.

Still, i would like to let you know i learned AU3 Programming not long ago, i work on it as a hobbie, so if you could teach me anything it would be really appreciated, that's in fact why i chose the name Rookie :P

Edited by DynamicRookie

Share this post


Link to post
Share on other sites
FMS
Posted (edited)
Quote

Still, i would like to let you know i learned AU3 Programming not long ago, i work on it as a hobbie, so if you could teach me anything it would be really appreciated, that's in fact why i chose the name Rookie

I'm also not a big AU3 programmer but also I couldn't help you if I don't know what you are doing wrong :D
For this I need to see the code on whish you are having problems whit ;)

Edit:
 

Quote

What do you define by thinking by itself?

In mine case I've a "set of handwritten digits" to test whit and for changing the weights.
Afther all te test are done and the weights found there local minimum you can put "new" handwritten digits so the AI predicts the correct output.
I mean : it's not pre-defined and still get the correct output :)

Edited by FMS

as finishing touch god created the dutch

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

    • OneSolution
      By OneSolution
      Hi guys! I have these checkbox that I'm trying to click on. They have the same inner-text string but a different ID. Sometime there can be as many as 4 checkbox
      with the same string but the ID is always different. I tried a few methods down below but I'm unable to make any real results. Any suggestions or solutions I would
      appreciate it very much.
      <ul><li class="cx-list-item-wrapper" data-day="Aug 2 2018 07:27:37 GMT-0700 (Pacific Daylight Time)"><div class=""><div class="cx-list-item-container"><div class="cx-list-item cx-item-icon-2 pointer-cursor"><div class="cx-item-contents cx-item-time col-md-2"><!-- react-text: 675 -->Morning<!-- /react-text --><!-- react-text: 676 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-1"><!-- react-text: 678 -->OTHER<!-- /react-text --><!-- react-text: 679 -- >&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-2"><!-- react-text: 681 -->8:30 AM<!-- /react-text --><!-- react-text: 682 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-2"><!-- react-text: 684 -->10:30 AM<!-- /react-text --><!-- react-text: 685 -->&nbsp;<!-- /react-text -- ></div><div class="cx-item-contents col-md-1"><!-- react-text: 687 -->SRV<!-- /react-text --><!-- react-text: 688 -->&nbsp;<!-- /react-text --></div></div></div><div class="pull-right cx-listitem-chk"><div><input id="cx_checkbox1" class="cx-fa-chk cx-selfschedule-chk" value="on" type="checkbox"><label for="cx_checkbox1"></label></div></div></div></li><li class="cx-list-item-wrapper" data-day="Aug 2 2018 07:27:37 GMT-0700 (Pacific Daylight Time)"><div class=""><div class="cx-list-item-container"><div class="cx-list-item cx-item-icon-2 pointer-cursor"><div class="cx-item-contents cx-item-time col-md-1"><!-- react-text: 698 -- >Morning<!-- /react-text --><!-- react-text: 699 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-1"><!-- react-text: 701 -->OTHER<!-- /react- text --><!-- react-text: 702 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-2"><!-- react-text: 704 -->8:30 AM<!-- /react-text --><!-- react-text: 705 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-2"><!-- react-text: 707 -->2:30 PM<!-- /react-text --><!-- react-text: 708 -- >&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-1"><!-- react-text: 710 -->SRV<!-- /react-text --><!-- react-text: 711 -->&nbsp;<!-- /react-text --></div></div></div><div class="pull-right cx-listitem-chk"><div><input id="cx_checkbox2" class="cx-fa-chk cx-selfschedule-chk" value="on" type="checkbox"><label for="cx_checkbox2"></label></div></div></div></li></ul> I tried the _IETagNameGetCollection() but it only check the box but doesn't fire the event! And I'm unable to submit that without a click action.
      Func _Box1() $oInputs = _IETagNameGetCollection($oIE, "input") For $oInput In $oInputs If $oInput.id == "cx_checkbox1" Then $oInput.checked = true Next Sleep(10) ToolTip('box1') EndFunc ;==>_Box1 I also tried click by text.The boxes do get check by a click but the problem with that is it will select every box that has the same string. I'm allowed only to check 1 box selection at a time per day for the submit button to work.  Any preference to select only the second box and bypass the other?
      Func _Morning() For $a In _IETagNameGetCollection($oIE, "div") If StringInStr(_IEPropertyGet($a, "innerText"), "Morning") Then _IEAction($a, "click") EndIf Next Sleep(10) ToolTip('Morning selected') EndFunc ;==>Morning The last method I tried was _IEGetObjById(). It doesn't click or respond to the checkbox.
      Func _Click1() $oChk = _IEGetObjById($oIE, "cx_checkbox1") _IEAction($oChk, 'click') Sleep(20) ToolTip('box1') EndFunc ;==>_Click1  
    • 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!
      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
    • 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
    • toto22
      By toto22
      I'm trying to get a "double" value from memory . However my code gives me error.
       
      Opt("WinTitleMatchMode", 4)     Global $ProcessID = WinGetProcess("TI Pro")     If $ProcessID = -1 Then         MsgBox(4096, "ERROR", "Failed to detect process.")         Exit     EndIf     Local $DllInformation = _MemoryOpen($ProcessID)     If @Error Then         MsgBox(4096, "ERROR", "Failed to open memory.")         Exit     EndIf   Local $dAddress = 0x1FECD474   Local $tNbSteps = DllStructCreate("double", $dAddress)   Local $value = DllStructSetData($tNbSteps, 1, (_MemoryRead($dAddress, $DllInformation)))      MsgBox($MB_SYSTEMMODAL, $value)
×