Author Topic: Hal is neither male or female... but Hal could be.  (Read 5306 times)

Larry

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
Hal is neither male or female... but Hal could be.
« on: September 26, 2003, 07:03:52 pm »
This is really for onthecuttingedge2005... cause he's really good at this...

Hal is neither male or female... but Hal could be...

For example, a girl might talk about "my hairdresser", but most guys would not... Guys might talk about "my barber", but most girls would not...

So onthecuttingedge2005, we would only need 4 'detectors' ... those dealing with 'my' for both sexes and those dealing with 'your' for both sexes... Think about it... before Hal gives out 'his' getresponse, run it by the detectors so that 'he' won't say something a girl would say... we can take it a step further... often during a conversation, we usually will give away which sex we are when we talk to hal... (that's where the 'your' detector would come in)... so hal would only say stuff that would be said to the sex he's talking to...

I can see a problem here and I don't know how you would over come it... A guy for example might say "My beard is getting shaggy." My beard obviously makes him a guy... but what if he said, "My big black beard has turned grey." - see the problem???

MyFemaleGenderDetector might contain:
" I AM A FEMALE ","True"
" I AM A GAL ","True"
" I AM A GIRL ","True"
" I AM NOT A BOY ","True"
" I AM NOT A GUY ","True"
" I AM NOT A MAN ","True"
" I HAD A BOYFRIEND","True"
" I DON'T HAVE A BOYFRIEND ","True"
" I HAVE A BOYFRIEND ","True"
" I HAVE GREAT TAN LINES","True"
" MY BOYFRIEND","True"
" MY HAIRDRESSER","True"
" MY HUSBAND","True"
" MY LIPSTICK","True"
" MY SMART HUSBAND","True"


There's a bit of programming involved here because you have to modify some other routines to make this work right... mostly RESPOND: PROCESS TOPICFOCUS FILES and SAVE: TOPIC SENTENCE IN APPROPRIATE FILE IF CURRENTLY IN TOPICFOCUS MODE

Any how... Are you up for it???

 

Morkeleb

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Hal is neither male or female... but Hal could be.
« Reply #1 on: September 26, 2003, 07:32:47 pm »
So Larry,

still having problems with the script with this one. Keep at it either you or someone else will figure it out. I understand what you want but dont know how to make vbs do it yet. You need a script that would parse the response for certain trigger words or phrases and then save them to a new brain file to recall later if recieved again. the script would also have to be able to generate a comparison file for user sent response and hal sent responses. It could then maybe ask the user if they are boy or girl and save this with the response file so when next it got the response, I use lipstick. it could check and see that it is a girl talking to it know. you could also asign hals sex the same way with declarative statements like, you like red lisptick. or something similar.
I hope this helped in some way. given enough time and information hal can and will choose to use either more femine resposnes or masculine, it depends on the type of information fed to hal over time.
One more thing though, you need a script that would filter out certain adjectives so they would not interfer in the comparisons. My mustache needs a triming , my brown mustache needs a triming. brown need to be filtered out to not interfer with the trigger detector of mustache.

Well I am done for now, hope you have beter luck with this one.
Ask and you shall learn
Be not afraid to try new things.
----------------------
Check out www.cold-chaos.net

Larry

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
Hal is neither male or female... but Hal could be.
« Reply #2 on: September 26, 2003, 07:43:58 pm »
quote:
Originally posted by Morkeleb

One more thing though, you need a script that would filter out certain adjectives so they would not interfer in the comparisons. My mustache needs a triming , my brown mustache needs a triming. brown need to be filtered out to not interfer with the trigger detector of mustache.


I hadn't thought of a filter... wonder how to make a filter??? I would guess anything after the 'my' up to the 'beard'... hummm... any other ideas???
 

Morkeleb

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Hal is neither male or female... but Hal could be.
« Reply #3 on: September 26, 2003, 08:02:45 pm »
Hey larry,

I know in basica you could selectively choose words in a string to do comparasion with but I am not sure how VBS does it. It was something to due with variable length or something similar. Perhaps Don could help you out more on this one then me. The problem could be avoided if peopl would use the adjectives after the trigger word and not before. My beard is brown. Hal now know the user beard is brown and the user doesnt have to repeat it later, my (brown) beard needs to be trimmed. brown not needing to be said this time.
Ask and you shall learn
Be not afraid to try new things.
----------------------
Check out www.cold-chaos.net

Larry

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
Hal is neither male or female... but Hal could be.
« Reply #4 on: September 27, 2003, 04:52:37 am »
Help me out here guys... talk to Isabel181818 and let me know if she says anything not 'female' ...
 

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
Hal is neither male or female... but Hal could be.
« Reply #5 on: September 27, 2003, 11:03:46 pm »
Hello,

You are already on a track that will work.  You asked my opinion, but remember, there are often several ways to get to where you want to go.  

My opinion isn't going to be any better than anybody else's opinion if both methods work!

Suppose we say this is the goal: Infer user's and Hal's genders, to turn on and off extra databases.

With this as the goal, the first thing I would think of would be to make a routine or a file look-up to infer gender from name.  The username and Halname are both readable as variables in the script.  So, you could make something like this:

If ComputerName = Linda Then HalFemale = True
If ComputerName = Mildred Then HalFemale = True
'Etc., etc., for every female name you can think of.

If you wanted to get fancier, you could use a file to hold the data.

Now if you still want to infer gender from context rather than name, you pose the problem of modifiers interfering with phrases such as "my brown beard," since "my brown beard" has an adjective in the way between "my" and "brown" and you don't want to have to imagine every possible adjective.

In this case (again, this is only my opinion), I would take a chance and detect "my" and "beard" separately.  There would be a slight risk of being wrong, but if both words tested as present, and the male word tested as later in the sentence than the word "my," you could make a pretty good guess.  Remember, "Instring" returns a number of 0 if the character string is not found, and it returns the number of the character position in the sentence if it IS found. Here is how this would look:

'------------------------

'Make a good guess about Hal's gender based on context:

'Let's start with our variants at zero just in case we decide to use them in an earlier routine someday:

MyWordPosition = 0
MaleWordPosition = 0

'Now we change the variants to the positions of our desired words, if the words are present:

MyWordPosition = Instr(Usersentence, " my ")

If Instr(Usersentence, " beard ") > 0 Then MaleWordPosition = Instr(Usersentence, " beard ")
If Instr(Usersentence, " manhood ") > 0 Then MaleWordPosition = Instr(Usersentence, " manhood ")

'Etc., etc. for all the words you want to look for...

'Now we do a logical "and" test; if all the right conditions are satisfied, we conclude that Hal is a male:

If MyWordPosition > 0 And MaleWordPosition > 0 And MyWordPosition < MaleWordPosition Then HalMale = True

'---------------------

Again, I know that you are on the right track, and these are only options and opinions, but if it was me, that's how I would approach the problem.

Another reminder: Write code in little blocks in one window, while running Hal in the other window.  Toggle back and forth and talk to Hal after writing and saving a little block of code.  If you make a syntax error, Hal will "lock up" and give you an error code right away.  Then you can go back and find your error while the trail is hot.  Some syntax errors can be nearly impossible to find after the trail is cold; it could be just one comma or parenthesis out of place somewhere!

Sincerely,

Don
Don Ferguson
E-mail: fergusonrkfd@prodigy.net
Website: www.cortrapar.com
Don's other forum posts: http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274

Larry

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
Hal is neither male or female... but Hal could be.
« Reply #6 on: September 28, 2003, 04:29:41 am »
Thanks Don!!!

While I was waiting around for ideas - I came up with this:
If Instr (1, ThisSentence, " MY ", VbTextCompare) > 0 Or Instr (1, ThisSentence, " YOUR ", VbTextCompare) > 0 Then
ThisSentence = HalBrain.ProcessSubstitutions(ThisSentence, WorkingDir & "AdVerbsubstitutions.brn")
End If
ThisSentence = Trim(ThisSentence)


ThisSentence is the same as UserSentence at the point of adding spaces to the line at both ends (=" " & UserSentence & " ")

The AdVerbsubstitutions.brn contains just a few simple things like BIG, BLACK, SHAGGY etc I know black is a color, but size, color, texture all seem to fit between MY and Beard - same with MY and DRESS.

Then I added this to determine if ThisHal could say the line the HalUserBrain came up with in the RESPOND: PROCESS TOPICFOCUS FILES section.
TempSentence = HalUserBrain
IWantToSay = CanWeSay(TempSentence, WorkingDir, ThisHal)
SayToYou = ToYou(TempSentence, WorkingDir, ThisHal)

IWantToSay returns a true or false - we set Hals gender earlier - then this routine checks the sentence against that gender - if this hal can say it returns a true. SayToYou checks the sentence to see if it is directed toward a gender and if so it will return Male, Female, or AnyOne.

As far as I can tell, this method seems to be working well.