Virtual Humans Forum
Virtual Humans Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Virtual Humans
Partner website:
Chatbots.org
 All Forums
 Virtual Humans
 Artificial Intelligence
 human mind map
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic 
Page: of 25

Hatcheda
Curious Member



27 Posts

Posted - Apr 28 2009 :  07:32:09  Show Profile  Reply with Quote
quote:
Originally posted by toborman

Harry's primary tables are knowledge, english, conversation, inference (as per the mindmap). They all have the same physical structure: Sense1,object1,relation,sense2,object2. this structure allows the same set of table access functions to be used for all tables.

The content of each record is the relationship of object1 to object2. sense1 and sense2 constrain the meaning of each object.

Each record has a record number.



Thank you! Will refer to this when studying the db.
Back tomorrow, time permiting . . .



Just thought of one major improvement!
Synonyms, Antonyms!
During "Think Time" Cortona or Harry could webparse something like:
http://www.synonym.com/synonyms/Male/
And store the data.

Will start that soon to show you how its done.

If you have not download Autoit yet, please do so.
It may not be hard to adapt the code. -There is a great help file included. -And most of the functions are UDF's included with the install. (meaning you can read the basic code)

Edited by - Hatcheda on Apr 28 2009 07:46:27
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Apr 28 2009 :  15:26:41  Show Profile  Visit toborman's Homepage  Reply with Quote
quote:
Just thought of one major improvement!
Synonyms, Antonyms!
During "Think Time" Cortona or Harry could webparse something like:
http://www.synonym.com/synonyms/Male/
And store the data.

Harry stores synonyms in the english table as part of the pattern to be recognized. His use of antonyms has been limited to challenging assertions during verification of new inputs.

http://mindmap.iwarp.com
Go to Top of Page

Hatcheda
Curious Member



27 Posts

Posted - Apr 28 2009 :  20:06:46  Show Profile  Reply with Quote
Did you catch the last code post? -1 page back.

What do you think about the direction so far?
The structure?
labeling?
math?
Or webparsing on the last post?
Would you want to use that to populate your tables with
synonyms and antonyms?


Another thought I had is that it would be great to get the two to talk to eachother down the road.

Going to review your map again now before more coding.
I think I will develope the webparse today. Based on the page I mentioned as well as any pages developed for computer initiated searches I can find.
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Apr 28 2009 :  23:52:57  Show Profile  Visit toborman's Homepage  Reply with Quote
quote:
Did you catch the last code post? -1 page back.


I missed it. Thanks for the heads up.

quote:
What do you think about the direction so far?
The structure?
labeling?
math?


The structure is different than Harry’s, but that’s not important. There are many ways to structure the data. The question is “will this structure support the other functions”? you won’t know that until you design the other functions.

The first set of functions I expect Cortona to learn are memory functions: Remember, forget, and recall. She has learned to remember and recall set and member relationships. This beginning is required for all of the other functions. Looks like you’re on the right track.

I don’t see any problems with labeling or math at this point.

quote:
Or webparsing on the last post?
Would you want to use that to populate your tables with
synonyms and antonyms?


Harry learns by dialog entries or by inference. He has the ability to learn rudimentary language patterns by dialog, but has not learned to infer language patterns, yet. In order for synonyms and antonyms to be useful they must be incorporated into those patterns as part of the input. That means they would need to be converted to input statements that Harry understands or Harry would need to learn how to apply them to the patterns. Sounds like something for the todo list.

quote:
Another thought I had is that it would be great to get the two to talk to each other down the road.


Great idea. It will be interesting to see what roles each will take. Student/teacher/collaborator?

http://mindmap.iwarp.com
Go to Top of Page

Hatcheda
Curious Member



27 Posts

Posted - Apr 29 2009 :  01:52:19  Show Profile  Reply with Quote
ok here is the first part of the webparse.
Set up for Synonyms:
#include <array.au3>
#include <string.au3>
#include <IE.au3>
Dim $aNameArray, $aSynonyms[1] ;Set up arrays
$Subject = "Male"
$oIE = _IECreate("http://thesaurus.reference.com/browse/" & $Subject, 0, 0, 1, 0);IECreate ( [$s_Url = "about:blank" [, $f_tryAttach = 0 [, $f_visible = 1 [, $f_wait = 1 [, $f_takeFocus = 1]]]]] )
$sHTML = _IEDocReadHTML($oIE)
_Run1()
Func _Run1()
    $aNameArray  = _StringBetween($sHTML, '<b>Synonyms:</b></td>', '</span></td>') ;Get the section of HTML that Data exists in
	For $i = 0 to UBound($aNameArray) -1
		$aNameArray[$i] = StringRegExpReplace($aNameArray[$i], '<(.*?)>', "", 0) ;Remove anything inside <Here>
		$aNameArray[$i] = StringReplace($aNameArray[$i], '*', "", 0) ;Remove Disclaimers
		$aNameArray[$i] = StringReplace($aNameArray[$i], '/', ",", 0) ;Break grouping such as Miss/Mrs/ms
		$aNameArray[$i] = StringStripWS ($aNameArray[$i], 8) ;Remove whitespace
		$aNameArray[$i] = StringStripCR ($aNameArray[$i]) ;Remove carriage return's
		$Value = StringSplit($aNameArray[$i], ",") ;Break into array
		For $a = 1 to UBound($Value) -1 ;Add first group to master array
			_ArrayAdd($aSynonyms, $Value[$a])
		Next 
	Next
	$aSynonyms[0] = UBound($aSynonyms) -1  ;Set first row as total Synonyms parsed. -dupes may occur if in page.
	_ArraySort($aSynonyms) ;Sort the Master array
	For $d = $aSynonyms[0] to 1 Step -1 ;remove dupes
		If $aSynonyms[$d] = $aSynonyms[$d-1] Then _ArrayDelete($aSynonyms, $d)
	Next
	_ArrayDelete($aSynonyms, 0) ;Clear the first 
EndFunc
_ArrayDisplay($aSynonyms) ;See your results -you can add this anywhere to check the progress along the way. -It will hault until you close.
_IEQuit ($oIE) ;Kill the hidden web browser


At this point it can be set up for any entry method.

you would just write a loop that has the rest of your entry material.

Ex
Loop
Send("John is a " & $Array[1])
Send("{Enter}")
Next

Edit: There would be no real reason to recode. You could just add you loop in autoit at the bottom. Then set a hotkey to run it. Run the script.
Click the input box you use (on Harry), then press your hotkey.
You get lots of entries in your format! :-)

Edited by - Hatcheda on Apr 29 2009 02:00:34
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Apr 29 2009 :  02:45:03  Show Profile  Visit toborman's Homepage  Reply with Quote
Thanks. The function looks useful.
quote:
At this point it can be set up for any entry method.

you would just write a loop that has the rest of your entry material.

Ex
Loop
Send("John is a " & $Array[1])
Send("{Enter}")
Next

Edit: There would be no real reason to recode. You could just add you loop in autoit at the bottom. Then set a hotkey to run it. Run the script.
Click the input box you use (on Harry), then press your hotkey.
You get lots of entries in your format! :-)

Harry would use it differently. instead of storing lots of statements that have the same meaning, Harry would store one standard statement and use this function to interpret any other input statements to the standard meaning.

To provide conversational interest, using this function,Harry could translate the standard meaning to an alternative expression on output.

http://mindmap.iwarp.com
Go to Top of Page

Hatcheda
Curious Member



27 Posts

Posted - Apr 29 2009 :  08:38:00  Show Profile  Reply with Quote
A simple spell Check prior to entry: WIP


#Region ;Includes
#include <Word.au3>
#include <String.au3>
#include <Array.au3>
#EndRegion 
$oWordApp = _WordCreate("", 0, 0, 0)
$sString = "David Davidsdf 123 ?><"
_SpellCheck()
Func _SpellCheck()
	$SpellCheck = StringRegExpReplace($sString, "[0-9!@#$%^&*()?/<>,:;+-]", "")
	$SpellCheck2 = _StringExplode($SpellCheck, " ")
	_ArrayDisplay($SpellCheck2)
	For $s = 0 To UBound($SpellCheck2) - 1
		$oWordApp.Selection.TypeText($SpellCheck2[$s])
		$oWordApp.Selection.WholeStory
		$oWordApp.Selection.Range.SpellingErrors
		$Test = $oWordApp.Selection.Range.SpellingErrors
		If $Test.Count > 0 Then ConsoleWrite($SpellCheck2[$s] & " Appears to be mispelled" & @CRLF)
		$oWordApp.Selection.Delete
	Next
EndFunc   ;==>_SpellCheck
_WordQuit($oWordApp, 0)

Edited by - Hatcheda on Apr 29 2009 17:48:26
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Apr 29 2009 :  10:27:37  Show Profile  Visit toborman's Homepage  Reply with Quote
quote:
A simple spell Check prior to entry: WIP

I'm sure that Cortona will find this function useful.

One of the objectives of the Harry project is to explain human mental behavior. Therefore Harry needs to show me how he aquired this ability relative to human development. what fundamental intelligence processes (see mindmap) contributed to this "learned" procedure?

http://mindmap.iwarp.com
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Apr 29 2009 :  11:50:05  Show Profile  Visit toborman's Homepage  Reply with Quote
The Harry project is not a programming project designed to simulate human behavior.

Harry is an experiment designed to emulate human thought for a cognitive science project that seeks to answer the question “how does the human mind work”? The human mind map is not the answer to that question. It is the question “is this how the human mind works”?

Harry’s development helps answer these questions and, as a byproduct, Harry will simulate human behavior.

The mental acuity tests (VHMATS) help us determine how well the emulation meets human behavior standards.

http://mindmap.iwarp.com
Go to Top of Page

Hatcheda
Curious Member



27 Posts

Posted - Apr 29 2009 :  17:34:01  Show Profile  Reply with Quote
Yes, I understand. I plan to follow the same path with Cortona making her own connections and explaining them. I also want her to aquire data using other input to continue her own pathway connections.

My short term goal (because I dont believe in AIML method) is to remove all templates and instead create lists such as common sentence parts. Using these, I want Cortona to break apart the sentence using common sentence part ordering. -Then decide what to do with it.

As for the spelling. Are you sure you dont need a spellcheck to check entries before adding them to Harry's DB?
what if I wrote
David is a Homan in Harry's input?
Was just thinking it would reduce input errors . . .
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Apr 29 2009 :  23:56:50  Show Profile  Visit toborman's Homepage  Reply with Quote
quote:
As for the spelling. Are you sure you dont need a spellcheck to check entries before adding them to Harry's DB?
what if I wrote
David is a Homan in Harry's input?
Was just thinking it would reduce input errors . . .

A spellchecker would help keep the db clean, but if Harry doesn't experience errors and corrective methods he won't discover a general method for error detection and correction.

If someone tells Harry that "David is a homan" then, like a child, he will believe this is true until someone tells him otherwise. At that point he may ask "why' and be told about misspellings and how to recognize and correct them. He could then generalize this procedure to explore methods for detection and correction of other types of errors.

It will be a while before Harry aquires these abilities. In the mean time Harry will make mistakes.

http://mindmap.iwarp.com
Go to Top of Page

Hatcheda
Curious Member



27 Posts

Posted - May 01 2009 :  04:05:00  Show Profile  Reply with Quote
How did you tackle plural and single?
Ex.
David is a Human - David is a Mammal - Humans are Mammals

Is David a mammal?
I can write a plural 'remover' but would prefer not.
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - May 01 2009 :  05:36:44  Show Profile  Visit toborman's Homepage  Reply with Quote
quote:
How did you tackle plural and single?
Ex.
David is a Human - David is a Mammal - Humans are Mammals

Is David a mammal?
I can write a plural 'remover' but would prefer not.

Harry thinks that words ending in "s" are plural, so he uses the english table to interpret "*s are *s." to mean "set %2 contains the set %1". Example: "Humans are Mammals" means "set Mammal contains the set Human". of course Harry may misinterpret words that normally end with "s" or plurals that have unusual endings. Harry will then have to learn about exceptions.

Harry has pattern matching and substitution functions that allow him to do interpretations.

http://mindmap.iwarp.com
Go to Top of Page

GrantNZ
Dedicated Member



New Zealand
2677 Posts

Posted - May 01 2009 :  06:23:21  Show Profile  Reply with Quote
Hi guys, you're doing some great work And welcome aboard, Hatcheda!

Have you considered using a dictionary system (such as WordNet) for handling things like pluralisation? That may be an easy way to handle some language interpretation difficulties.

I think some of those dictionary things have set descriptions too, e.g. "cat" is a "mammal", which may give your AIs a head start. You may want to consider those descriptions low-quality, since I'm not sure if they're well arranged for AI use, but at least Harry or Cortona could answer "I think so" if you ask "is a cat a mammal," even if he has never talked about cats or mammals before!
Go to Top of Page

Hatcheda
Curious Member



27 Posts

Posted - May 01 2009 :  07:06:56  Show Profile
quote:

Harry thinks that words ending in "s" are plural, so he uses the english table to interpret "*s are *s." to mean "set %2 contains the set %1".


Here is a quick method I started using today. Sounds like what you are doing. For now, I will check it first, then switch back if not found.
If StringRight ($Object1, 1 ) = "S" Then $Object1 = StringLeft($Object1, StringLen($Object1)-1 )

Good to know that has worked well so far for you.

Below are two nice functions from an Autoit MVP that I added a bit to. I was thinking of doing this to cover plural also. (then doing a real time check)
;*******************************************************************************
;Functions to assist with grammar.
;
;   Function List
;         _Grammar_AintRight()
;         _Grammar_RemoveContractions()
;*******************************************************************************

#Include-once

;===============================================================================
; Function Name:   _Grammar_AintRight()
; Description:     Rids the world of the (non)word Ain't
; Syntax:          _Grammar_AintRight($sStr)
; Parameter(s):    $sStr - String or file to test
; Requirement(s):  
; Return Value(s): - Success = Corrected string, @Extended contains the number of changes made
;                  - Failure = Sets @Error to 2 if $sStr is not valid
;                              returns the string ($sStr) if aint or ain't are not found in the string
; Author(s):       George (GEOSoft) Gedye
; Modification(s): 
; Note(s):    
; Example(s):   
#cs

#ce
;===============================================================================

Func _Grammar_AintRight($sStr)
   If FileExists($sStr) Then $sStr = FileRead($sStr)
   If NOT $sStr Then Return SetError(2,0)
   If Not StringRegExp($sStr, "(?i)\bain'?t\b") Then Return $sStr
   Local $iCount = 0
    $sStr = StringReplace($sStr, "aint", "ain't") ;added
	$iCount += @Extended
    $sStr = StringReplace($sStr, "ain't have", "do not have") ;added 
	$iCount += @Extended
    $sStr = StringReplace($sStr, "ain't it", "is it not") ;added
	$iCount += @Extended
	$sStr = StringReplace($sStr, "ain't my", "is not my") ;added
	$iCount += @Extended
	$sStr = StringReplace($sStr, "ain't she", "is she not") ;added
	$iCount += @Extended
	$sStr = StringReplace($sStr, "ain't heard", "have not heard") ;added
	$iCount += @Extended
	$sStr = StringReplace($sStr, "ain't he", "is he not") ;added
	$iCount += @Extended
	$sStr = StringReplace($sStr, "ain't they", "are they not") ;added
	$iCount += @Extended
	$sStr = StringReplace($sStr, "ain't that right", "is that not correct") ;added
	$iCount += @Extended
	$sStr = StringReplace($sStr, "ain't that", "is that not") ;added
	$iCount += @Extended
	$sStr = StringReplace($sStr, "ain't I", "am I not") ;added
	$iCount += @Extended
	$sStr = StringReplace($sStr, "ain't got", "do not have") ;added
	$iCount += @Extended
	$sStr = StringReplace($sStr, "ain't so", "is not so") ;added
	$iCount += @Extended
	$sStr = StringRegExpReplace($sStr, "(?i)\b(he|she|it|that|mine|what|one|here|whom?|someone|something|this|other)\sain'?t\b", "$1 is not") ;added "this"
	$iCount += @Extended
	$sStr = StringRegExpReplace($sStr, "\bus\sain'?t\b", "we are not")
	$iCount += @Extended
	$sStr = StringRegExpReplace($sStr, "(?i)\b(th)em\sain'?t\b", "$1ose are not")
	$iCount += @Extended
	$sStr = StringRegExpReplace($sStr, "(?i)\b(they|we|you|those|ours|many|others)\b\s\bain'?t\b", "$1 are not")
	$iCount += @Extended
	$sStr = StringRegExpReplace($sStr, "(?i)\b(i)\sain'?t\b", "$1 am not")
	$iCount += @Extended
	$sStr = StringReplace($sStr, "ain't", "am not") ;added
	$iCount += @Extended
	SetExtended($iCount)
	Return $sStr
EndFunc   ;<==> _Grammar_AintRight()

;===============================================================================
; Function Name:   _Grammar_RemoveContractions()
; Description:     Remove common English Contractions
; Syntax:          _Grammar_RemoveContractions($sStr[, use shall instead of will])
; Parameter(s):    $sStr - String or file to test
;                  $iShall - If not set to 0 then 'll will he replaced with shall. Default is will.
; Requirement(s):  
; Return Value(s): - Success = Corrected string, @Extended contains the number of changes made
;                  - Failure = Sets @Error to 1 if cancelled from language warning or 2 if $sStr is not valid.
; Author(s):       George (GEOSoft) Gedye
; Modification(s): 
; Note(s):    For English contractions only!!
; Example(s):   
#cs
   $string = "'tis,'twas,he ain't,aint,aren't,can't,could've,couldn't,didn't,doesn't,don't,"
   $string &= "hasn't,he'd,he'll,he's,how'd,how'll,how's,i'd,i'll,"i'm,i've,"
   $string &= "isn't,it's,might've,mightn't,must've,mustn't,shan't,they're,"
   $string &= "they've,wasn't,we'll,we'd,she'd,she'll,she's,should've,"
   $string &= "shouldn't,that'll,that's,there's,they'd,they'll,we're,weren't,what'd,what's,"
   $string &= "when,when'd,when'll,when's,where'd,where'll,where's,who'd,who'll,who's,"
   $string &= "why'd,why'll,why's,won't,would've,wouldn't,you'd,you'll,you're,you've"
   $string = _Grammar_RemoveContractions($string)
   $wrds = @Extended
   $string = StringReplace($string,",", @CRLF)
   If Not @Error Then MsgBox(4096, "Results " & @Extended,"Word count = " & $Wrds & @CRLF & $string)
#ce
;===============================================================================

Func _Grammar_RemoveContractions($sStr, $iShall = 0)
   If StringRight(@OSLang, 2) <> 9 Then
      If MsgBox(262180, "Warning", "Your system language is not English" & @CRLF & @CRLF & _
      "Are you sure you wish to continue") = 7 Then Return SetError(1,0)
   EndIf
   If FileExists($sStr) Then $sStr = FileRead($sStr)
   If NOT $sStr Then Return SetError(2,0)
   Local $iCount = 0
   Local $sShall = "will"
   If $iShall <> 0 Then $sShall = "shall"
   If StringRegExp($sStr, "(?i)\bain'?t\b") Then _Grammar_AintRight($sStr)
   $sStr = StringReplace($sStr, "'tis", "it is")
   $iCount += @Extended
   $sStr = StringRegExpReplace($sStr, "(?i)\b(can)'t\b", "$1 not")
   $iCount += @Extended
   $sStr = StringReplace($sStr, "'twas", "it was")
   $iCount += @Extended
   $sStr = StringRegExpReplace($sStr, "(?i)\b(i)'m\b", "$1 am")
   $iCount += @Extended
   $sStr = StringRegExpReplace($sStr, "(?i)\b([a-z]+)'re\b", "$1 are")
   $iCount += @Extended
   $sStr = StringRegExpReplace($sStr, "(?i)\b(s)han't\b", "$1hall not")
   $iCount += @Extended
   $sStr = StringRegExpReplace($sStr, "(?i)\b(w)on't\b", "$1ill not")
   $iCount += @Extended
   $sStr = StringRegExpReplace($sStr, "(?i)\b([a-z]+)'?'ll\b", "$1 "& $sShall) ;Changed from "$sStr = StringRegExpReplace($sStr, "(?i)\b([a-z]+)'?ll\b", "$1 "& $sShall)" -to keep "Shall not, Will not" from being "Sha will not,  Wi will not"
   $iCount += @Extended
   $sStr = StringRegExpReplace($sStr, "(?i)\b([a-z]+)'d\b", "$1 would")
   $iCount += @Extended
   $sStr = StringRegExpReplace($sStr, "(?i)\b([a-z]+)n'?t\b", "$1 not")
   $iCount += @Extended
   $sStr = StringRegExpReplace($sStr, "(?i)\b([a-z]+)'ve\b", "$1 have") ;Edited to avoid "have" error as "ha have" when '?ve\b"
   $iCount += @Extended
   $sStr = StringRegExpReplace($sStr, "(?i)\b([a-z]+)'?nt\b", "$1 not")
   $iCount += @Extended
	$sStr = StringRegExpReplace($sStr, "(?i)\b([a-z]+)'s\b", "$1 is") ;Changed from "$sStr = StringRegExpReplace($sStr, "(?i)\b([a-z]+)'?s\b", "$1 is")" -causes is'nt, or is not to become "i is not"
   $iCount += @Extended
   SetExtended($iCount)
   Return $sStr
EndFunc   ;<==> _Grammar_RemoveContractions()




Thanks Grant! No, I didn't know about the site. I am downloading it now to take a peak! May be a great jump start! -Thanks!

Edited by - Hatcheda on May 01 2009 07:15:27
Go to Top of Page
Page: of 25 Previous Topic Topic   
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Virtual Humans Forum © V.R.Consulting Go To Top Of Page
This page was generated in 0.15 seconds. Snitz Forums 2000