Ai Dreams Forum

Chatbots => Avatar Talk => Haptek => Topic started by: cybertution on October 09, 2008, 09:31:59 am

Title: Web Program D & Haptek Integration
Post by: cybertution on October 09, 2008, 09:31:59 am
Hi I am doing a web application where program D is the AIML engine and Haptek being the graphic interface. Is there a good way to integrate these 2 programs together so that the conversations will be speaked out by the haptek avatar?

I have also been trying to send user input by pressing 'enter' but it seems that the voice reply by the Haptek avatar does not sync and usually tend to delay by 1 answer or even just repeat the same answer? Is there a getaround or good solution for this? thanks.
Title: Re: Web Program D & Haptek Integration
Post by: Maviarab on October 09, 2008, 10:41:35 am
Welcome to the forum Cyber...

Have removed this post from the ALICE section then it can be centralised and we can keep track of just the one topic as its more Haptek related :)

Can't help you myself unfortunatly (not really my field) but sure our resident AIML/Haptek guru's will be along later to answer your question.

Hope you enjoy your time here.
Title: Re: Web Program D & Haptek Integration
Post by: GT40 on October 09, 2008, 12:13:38 pm

Hi cybertution! Linking (locally) an AIML brain to an Haptek character is a dream of mine, too. But because I'm not a guru (hi Mav!), I'm totally unable to do that. So I use Pandorabots (Program Z), lol.               

The plus:

- The brain is located in the computers of A.L.I.C.E. (Oakland, CA) and there is no comparison to our poor PCs (old or not). The answer is immediate with a broadband connection, despite the distance (in my case, Europe > California > Europe). :)

The minus:

- The same reason, lol. Sometimes they fail. Not a real problem, it's just an entertainment, but... sometimes they fail (very bad idea to use Pandorabots in a professional site). :(

That's why I'm interested in an answer to your question, too.

Title: Re: Web Program D & Haptek Integration
Post by: Freddy on October 09, 2008, 01:47:15 pm
I've only worked on Progam E so I don't know either!  I do know a lot of people have used Program D and after Pandorabots it is probably the most popular so I would expect someone to give you an answer at some point.
Title: Re: Web Program D & Haptek Integration
Post by: cybertution on October 10, 2008, 04:47:07 am
Thanks guys for your prompt replies

I have managed to link (locally) an AIML brain to an Haptek character. It is just that I need the whole integration to work properly & smoothly be it the question & answer part or the server side.

Now that I can get the Haptek bot to speak out ALICE response, i need to enable user to submit input by button(which i manage to do it properly) and pressing 'enter' (the better way to type and submit) which I have problem with syncing the response displayed and what the Haptek avatar speak despite using the same logic for both button and 'enter' button.

Any suggestions, solutions or other resources are appreciated, thanks
Title: Re: Web Program D & Haptek Integration
Post by: GT40 on October 10, 2008, 11:46:51 am

Hello cybertution! Not sure it helps you, but I made a little "tutorial" after creating some bots. In fact, just the testimonial from a guy who wasted a lot of time before his Pandorabots work fine. ;D

http://knytetrypper.proboards19.com/index.cgi?action=display&board=pbot&thread=643&page=1

I am a poor programmer, so I only altered the "official" files found on KnyteTrypper's site, until the bot runs fine. All that is totally empirical and maybe bad looking, but it works... at least on Pandorabots. :)

Title: Re: Web Program D & Haptek Integration
Post by: Maviarab on October 10, 2008, 11:49:48 am
Knyte knew how to do this if I recall correctly, cant seem to find the thread though at the moment, may not be in here at all but somewhere else..

Anyone else remember that topic...was it here or over at his site?
Title: Re: Web Program D & Haptek Integration
Post by: Maviarab on October 10, 2008, 11:50:41 am
Thanks GT
Title: Re: Web Program D & Haptek Integration
Post by: Freddy on October 10, 2008, 11:57:01 am
As far as I recall, Knytetryper only did a demo of Pandorabots and Haptek.  Could be wrong though, if I find anything I will post about it.
Title: Re: Web Program D & Haptek Integration
Post by: GT40 on October 10, 2008, 12:02:50 pm

What I called "the official files":  ;)

http://knytetrypper.proboards19.com/index.cgi?board=pbot&action=display&thread=621

and elsewhere (very good site, too):

http://aidreams.co.uk/forum/index.php?topic=97.0  ;D

and also (Mark Chavez site changed from .com to .net):

http://clone3d.net/how_to.htm

Title: Re: Web Program D & Haptek Integration
Post by: Maviarab on October 10, 2008, 01:27:57 pm
Now how in the nine hells did I miss that post grrrr.....going back to bed lol :)
Title: Re: Web Program D & Haptek Integration
Post by: cybertution on October 13, 2008, 05:12:06 am
hi GT40, after looking at ur links u provide for ur Meghan bot & tutorial from clone3D, I see a successful integration of Haptek & Pandorabots. In this case, the Haptek is the main page and the Pandorabot chat is embedded as iframe.

For my case of Haptek & web Program D, my web Program D which is a .jsp page is the main page while the Haptek page is embedded in a iframe. Thus I have to pass the ALICE reply after submitting input from Program D page to the Haptek page through a buffer value which may b the cause of voice sync problem.

How do I go about to modify my program so that it will work properly? How can I adapt the Haptek & Pandorabot example to my Haptek & web program D in this case?
Title: Re: Web Program D & Haptek Integration
Post by: GT40 on October 13, 2008, 03:43:37 pm

Hi cybertution! As I wrote above, I'm not a programmer. Just playing a little with JavaScript and when it finally works, I stop changing anything (well known rule, lol). ;D

That's why I'm sorry to be unable to help you. I guess all the Pandorabots are made like that, but your method is totally different (and maybe better). About the lipsync, the <template context="tts"> tag seems to be very important.

I found this interesting thread (Freddy, you wrote "I don't know php", you must update your post ;)):

http://knytetrypper.proboards1.com/index.cgi?board=worikings&action=display&thread=1588

Maybe it'll help you.  :)

Title: Re: Web Program D & Haptek Integration
Post by: Freddy on October 13, 2008, 06:28:34 pm
Quote
I found this interesting thread (Freddy, you wrote "I don't know php", you must update your post ):

Hehe, yes, that seems like a long time ago now.
Title: Re: Web Program D & Haptek Integration
Post by: cybertution on October 14, 2008, 04:33:37 am
Saw this code snippet in the program e & Haptek example.

Code
<script language="javascript">
var elizaresponse= "<template context="tts"><response index="1"/></template>";

var hapA= "\\q2[s0=[";
var hapB= "]]";
function nadiaTalk(){
parent.SendText(hapA+elizaresponse+hapB);
}
nadiaTalk();
</script>

I believe this is the part which gets Haptek to speak out ALICE response so can anyone please guide me through this from how ALICE reply is retrieved to the part where it is sent to Haptek to be speaked out, thanks.
Title: Re: Web Program D & Haptek Integration
Post by: Freddy on October 14, 2008, 11:12:16 am
elizaresponse is the reply from the bot, in this case using the reply history made by KnyteTrypper.

the vars HapA and HapB are parts of the haptek command that are used to build the full command.

SendText is a haptek javascript command, used to send text to the player.

nadiaTalk() simply calls that function when the form loads.

So if the bot said "Yes it is a nice day." :

elizaresponse = "Yes it is a nice day."

parent.Sendtext = parent.Sendtext(\\q2[s0=[Yes it is a nice day.]])



Title: Re: Web Program D & Haptek Integration
Post by: cybertution on October 16, 2008, 03:09:56 am
can you explain about this line of code

Code
var elizaresponse= "<template context="tts"><response index="1"/></template>";

What doe the "template context" refer to in this case? Is it a default definition or used-defined tag?

For the last line of code

Code
parent.Sendtext = parent.Sendtext(\\q2[s0=[Yes it is a nice day.]])

"parent.Sendtext" is used to send text back to the Haptek player? So in this case we are sending reply back to the parent page for it to be speaked out. What about the case we are trying to send from parent to child page?
Title: Re: Web Program D & Haptek Integration
Post by: Freddy on October 16, 2008, 11:08:02 am
I'm not sure about the template tag, it might be a custom thing for pandoarabots.  I can't be sure how that works, javascript is not my strong point.

Same goes for the parent.SendText, I am not sure, but you should be able to refer to the object by using it's name.  This page might help:

http://www.howtocreate.co.uk/tutorials/javascript/javascriptobject

or this one:

http://www.infimum.dk/HTML/JSwindows.html

Got to go out now, but will take a look again later.  You might want to try searching the web for basic javascript useage.
Title: Re: Web Program D & Haptek Integration
Post by: GT40 on October 16, 2008, 05:45:32 pm

I thought the <template context="tts"> was important but I tried a simple <template> on a bot of mine. Not any change, the lipsync works fine too.  :D

Found this (jesusarmy's post): http://www.vrconsulting.it/vhf/topic.asp?TOPIC_ID=113

Title: Re: Web Program D & Haptek Integration
Post by: cybertution on February 20, 2009, 07:14:24 am
I have managed to insert html link in my aiml file but my Haptek avatar will speak out the code. Is there any workaround so that only the text is spoken out while the html code is ignored by the aiml engine?
Title: Re: Web Program D & Haptek Integration
Post by: GT40 on February 20, 2009, 05:46:02 pm

Hi cybertution.

With Pandorabots, HTML lines and also Haptek commands, embedded in the AIML code, are usually not spoken by the bot. But it's not the same thing if you try to add JavaScript in it, <think> or not <think>, lol. Maybe Program D is very different?

<category>
<pattern>SITE</pattern>
<template>
<font color="black">
\\SetSwitch [switch= lookleft state= e]
\\SetSwitch [switch= lookdown state= e]
<#br />
</font>
Please click here: it's <#a href="http://gt40.chez-alice.fr/Haptek/MyBots.htm" target="_blank">GT40<#/a>'s site.
</template>
</category>

PLEASE DELETE THE THREE "#" YOU CAN FIND IN THE CODE ABOVE. I put them to avoid some anomalies in the post.

You can check it with Meghan (if Pandorabots is not down!) at

http://www.pandorabots.com/pandora/talk?botid=a814d6c1ce361ff9

Just type "site". Of course it's an example and she can say some more very interesting things... ;D

Title: Re: Web Program D & Haptek Integration
Post by: GT40 on February 23, 2009, 12:37:58 pm

Oh, by the way, Nirosha doesn't like that.  :)

http://aidreams.co.uk/forum/index.php?topic=2566.0

Program # ?
Title: Re: Web Program D & Haptek Integration
Post by: cybertution on March 02, 2009, 07:18:29 am
GT40, I have tested your Meghan with the input 'site' and that the avatar just speak the text link without the code, do you how to implement this on program d?

In program d, the way I insert a html link to work is as follows:

Code
<html:a href="http://www.google.com" target="_blank">google</html:a>

I have to put the html tag or else it won't work. As a result, it will speak out some codes and the whole link address. Ideally I just want the html link to execute without any text showing up or avatar speaking anything.
Title: Re: Web Program D & Haptek Integration
Post by: GT40 on March 02, 2009, 03:45:40 pm

Infortunately, cybertution, as you can see, I don't know Program D. With Pandorabots, your code for the template line becomes ("normal" HTML):

Code
<a href="http://www.google.com" target="_blank">Google</a>

If you ask "google" to Meghan:

- She says "Google" (and never shuts up, lol)
- She writes "Google"
- The link is valid but must be clicked

Of course, all this is not what you wish to get. Maybe on AI Nexus?

And oops, thank you for indirectly teaching me how to insert codes in AI Dreams posts. Never tried this before. Senior member but total newbie. :)
Title: Re: Web Program D & Haptek Integration
Post by: cybertution on March 03, 2009, 06:27:48 am
Pandorabots is a gd aiml bot hosting site, here i am trying create a simplified version with Haptek as the interface.

Though program D is one of the best aiml interpreters around, there is limited documentation and technical issues to resolve before it can come close to pandorabots.

Seems that I have to search around and wait for other program d experts to reply, anyway thanks for your info (u r one of the experts here too :) )

I have 2 more aiml questions here


Thanks once again for any info provided.
Title: Re: Web Program D & Haptek Integration
Post by: GT40 on March 03, 2009, 04:57:10 pm

Thanks cybertution. But the 2 or 3 real experts in AIML are on AI Nexus, lol. Your project is very interesting and I hope they'll help you. Maybe you could try this (it's not really a forum):

http://www.nabble.com/Pandorabots-general-f14519.html

About your questions:

1- Just an example: "hard-drive" doesn't exist in knowledge.aiml.

- Humain: What is a hard-drive?
- Meghan: A disk drive is where we store information.

It's the template for "what is a hard drive"...


2- When you say goodbye to a Pandorabot, then he/she forgets all about your conversation. Alzheimer?

Of course the botmaster can read the logs and create customized categories, giving to some "customers" the impression that the bot remembers them. Clients love this... ;D

Title: Re: Web Program D & Haptek Integration
Post by: cybertution on March 04, 2009, 03:18:30 am
ya folks @ AI Nexus are helpful too so currently i am posting and sharing stuffs there and here, virtual human forum side also not bad.

About my questions:

1. Do u mean tat symbols like "-" or keyword like "brother's" is accepted? so i can put a pattern like 'cross-section' and it will output to the corresponding template?

2.How can I get access to the conversation logs and to create custom aiml tags myself to give bot some extra customization?

Title: Re: Web Program D & Haptek Integration
Post by: GT40 on March 04, 2009, 01:09:41 pm

1- Yes we can, lol. I mean, I hope so. Then "reductionism" do its job and answers are sometimes amazing. But trying and testing is the best part of the game, isn't it? ;)

2- When you have a bot on Pandorabots, you can do this and more. All is well explained.

Title: Re: Web Program D & Haptek Integration
Post by: cybertution on August 23, 2010, 09:10:47 am
Hi I have managed to integrate program D with Haptek, the 3D avatar interface, but have problem with the text to speech feature of Haptek. I have included html in my aiml answers and thus need to include the necessary xml header tags in my aiml document. The Haptek is speaking out the header urls, in particular this line "xmlns="http://alicebot.org/2001/AIML-1.0.1" whenever it encounters a html tag. It is working in most computers and i was thinking if it is related to the haptek plugin, browser (ie 8 in this case) or something to do with HTML parsing.

I am using the same version of internet explorer 8 on 2 different pcs and one of them works and the other does not, I have also tried reinstalling the haptek plugin and still does not work. when I integrate haptek with the aiml interpreter Program D, the haptek text to speech speaks out the html headers as well as tags and urls, is there a way to filter the tts spoken by haptek? Could it be due to some config I need to make to haptek tts or javascript so it will treat html tags as markup and not text to be spoken?

Thank you for attention and help.
Title: Re: Web Program D & Haptek Integration
Post by: Freddy on August 23, 2010, 02:35:25 pm
To me it seems like you need to separate screen output from TTS output.  Then you can strip the HTML from the TTS part before it gets sent to the TTS engine.

You want to be looking on google for things like this :

http://www.google.com/search?q=javascript+strip+html