AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

“wide open” discussion: simulating emotions - implementation algorithms and parameters
 
 
  [ # 31 ]
Dave Morton - Mar 24, 2011:

1.) Who says that a chat bot can’t have “strong AI”?

Well, I didn’t raspberry

My view is that strong-AI might (maybe) be needed to actually pass the Turing test (although passing the TT would not automatically mean ‘strong-AI’). But it seems that most chatbot projects aim strictly at NLP and are not aiming at anything close to ‘consciousness’ or similar ideas.

 

 
  [ # 32 ]

I figure I’m just going to go with what I’m best at, and in this case, it’s emotions. Having lived for a number of years with a woman who was afflicted with severe bipolar disorder, I think I’ve got a pretty good handle on what different emotional states are like. smile

Seriously, though. I’m leaving things like NLP, consciousness, and the like to those who are better qualified to handle those aspects. I’ll stick to the “easy” stuff, like math (because let’s face it: ALL of this emotion module is statistical weighting, and similar math functions - Ok, maybe some database manipulation, too, but…).

 

 
  [ # 33 ]

Ok, it’s time for a progress report!

I’ve got a very primitive test page up and running at http://www.geekcavecreations.com/emotions/ and it seems to work as expected. the PHP code is in need of streamlining, and the “emotion ontology” is limited to ten words, four of which are “debugging” words, all of which are as follows:

# word, angry, happy, sad
love, -0.050.1, -0.09
death
0.06, -0.10.1
birthday
, -0.030.08, -0.06
stupid
0.1, -0.060.09
puppy
, -0.030.09, -0.085
ugly
0.1, -0.50.45
angry
1, -1, -1
happy
, -11, -1
sad
, -1, -11
neutral
, -1, -1, -

The words “angry”, “happy”, “sad” and “neutral” are used to automatically trigger the image swap. This will change when I start working on processing phrases.
I’m still working on how “traits” will factor into the equations, but I’m happy with the results at this stage. smile

 

 
  [ # 34 ]

Looks like a good start Dave smile

 

 
  [ # 35 ]

Very nice so far Dave (I see you are a DAZ3D fan too).

Bug: If there is punctuation in the sentence there is no response.

When looking at how a character interacts with the user, you need to think about changing the avatar back to neutral even if there is no new input. The way to do this depends on how the interface (web page) is designed and if you want your character to remain angry or happy until the next input. For static images it is no problem going from one state to another. But, if you add animations, it is often easier to go back to a neutral state.

One easy way to do this is to add a piece of JavaScript code that has a delay for the change back to neutral.
This is accomplished with the setTimeout() Method.
http://www.w3schools.com/js/js_timing.asp

This would allow you to control how long before you return to your neutral state or even change to a new waiting or bored state.

 

 
  [ # 36 ]

@Hans Peter: Thanks. There’s still a long way to go, but it’s a good start. smile

@Merlin:

Very nice so far Dave (I see you are a DAZ3D fan too).

Yup! I love Daz Studio. And Emotiguy seemed more fitting for this project than Morti did, for now. smile

Bug: If there is punctuation in the sentence there is no response.

Since I don’t yet have any logging features added in yet, can you give me an example of the input you used that created the problem you saw?

When looking at how a character interacts with the user, you need to think about changing the avatar back to neutral even if there is no new input. The way to do this depends on how the interface (web page) is designed and if you want your character to remain angry or happy until the next input. For static images it is no problem going from one state to another. But, if you add animations, it is often easier to go back to a neutral state.

Once I get the system working the way I want it to, I’ll work on things such as timed reversion back to neutral, and creating animated transition images, so that it looks more fluid and continuous. Since I’m using jQuery to do the image swaps, I can make use of some interesting fades and such to do some neat effects from one image to the next, or I can even make some “one shot” animated GIFs that would actually show the avatar transform from one emotion to another. I also want to have the avatar go from neutral, to an intermediate emotional state, to a “fully charged” state, sort of like from neutral, to mad, to enraged. But all of the fancy stuff can wait until I’m done with the functionality portion of the project.

 

 
  [ # 37 ]

Bug Input:
Are you happy?

No result.

jQuery is a great framework for the kind of pages we make for chatbots. If I knew you were so web literate, I might have suggested you use JAIL (JavaScript Artificial Intelligence Language) as the foundation for the next version of Morti.

 

 
  [ # 38 ]

I’m still pretty well “old school” when it comes to JS, and subscribe to the thought that “less is more” for client-side scripting. Thus, I try to keep my sites’ JavaScript footprint as small as possible. I realize that the vast majority of visitors now have broadband connections, but the whole “waste not, want not” philosophy is hard for me to get past. smile

As to the input bug, that’s just plain laziness on my part. I thought of tossing in a quick and dirty trim statement, with a short list of non-alphabetic characters, but I know that a better solution would be to use regular expressions to do the job correctly. I hate RegEx, though, and so had opted to do nothing about it till now. (I can DO RegEx, mind you. I just don’t like doing so)

and BTW, if you had taken the time to read my bio page, you would have seen that I’m pretty sharp with web design. raspberry
(just a little gentle picking, Merlin, meant to elicit a smile)

 

 
  [ # 39 ]

Input.replace(/[^\w ]/,”“)

I know you are web savvy, I am just trying to get you come over to the benefits of the Dark (client) side.

 

 
  [ # 40 ]

Probably should have had a “g” for global and if you just want letters maybe this would be better.

Input.replace(/[^a-z ]/gi,”“)

 

 
  [ # 41 ]

I opted for this:

$word trim($word".,;:?!"); 

which, while not ideal, handles the most likely non-alphabetic characters. smile

 

 
  [ # 42 ]

The pattern I gave says delete everything that is not a letter or a space.
You can do it in the input form, reducing overhead on your server side script.
Although it is not really required for this application, if you end up having a lot of users or you are looking to have your server script run faster, off loading some of the preprocessing to the client is fast and effective.

In this application, you could have it change the image before it ever hit the server.

 

 
  [ # 43 ]

The biggest reason I opted for the trim method was that I don’t necessarily want to strip out every non-alphabetic character from the input. At some point, I may wish to use emoticons to alter the graphic, if not the mood. For example, if someone used the simple emoticon : ), I may wish to have that smilie trigger the “happy” image.

Which reminds me: I’ve updated the page, to use simple animated GIF images to effect the transformation from “neutral” to one of the other emotional states. It’s rather cute. There are also debugging links to test the animations without changing the mood of the system. Once again, the page is at http://www.geekcavecreations.com/emotions/ (just in case someone missed it). I’ll be posting some code on this in a bit, once I get it cleaned up a little. smile

 

 
  [ # 44 ]

Bugs:
Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

When changed the emotions replay the current emotion and then the new emotion. Did you create animations going from the current back to neutral?


“For example, if someone used the simple emoticon : ), I may wish to have that smilie trigger the “happy” image.”

You would just need to add the new characters that the pattern accepts:
Input.replace(/[^a-z :\)]/gi,”“)

 

 
  [ # 45 ]

Uh oh. I found the problem. It seems that I forgot to set a save path before I initiated a session, and the shared host’s drive that holds the default location for session variables is full. Generally, I use an alternate save path for security reasons, but I got sloppy, and failed to do so this time. Fixed now. smile

 

 < 1 2 3 4 > 
3 of 4
 
  login or register to react