United Kingdom
Asked — Edited

Pandoras Bot Integration

In another topic an idea was mentioned for a user to speak to the robot, the text sent to Chatterbot and the response sent back... So I took it upon myself to make such a script...

The first problem is chatterbot itself, there is no user control and for the advanced features you need to pay. Budget is a huge thing to me so paying for anything I don't already have is a big no no.

But, I had used Pandoras Bot in the past and it offers everything needed for free. It's really intelligent in how it works and very trainable either online through the control panel or by just talking to the robot.

i.e. if you start talking you can say "my name is Rich" and it will remember your name. Or the same for age, favourite things etc.

Anyway, it's more of a project/work in progress than a script at this point but not something for the showcase so something for the scripting section.

So far, there are problems to overcome.

  1. Pandora Bot's API uses XML, EZ-Script can't parse it correctly. In this case all it just needs to set $response to be whatever is between the and xml tags.
  2. WaitForSpeech needs a phrase list and (unless I missed it) can't wait for dictation.

A little bit of playing around and I've managed to write (well, modify) a PHP parser for the API and can use HTTPGet to send the user speech to the API and save the response as a variable to be spoken by EZ-Script.

Currently testing with a small phrase list of; Hello Who are you What is your name How old are you

The script is sending off the recognised phrases ($input) and the parser is working, sending the response back and keeping it in variable ($response)

The script then says the text with Say($response) and the robot speaks.

Now come a few new issues... 3) The WaitForSpeech is picking up the robot speaking 4) WaitForSpeech is waiting for the phrase to finish and match, if it doesn't it times out. It seems to always want to include the part the robot said (or acts that way), for instance if it responds to "hello" with "hi there" it will hear itself, if then you say "how old are you" it thinks you have said "hi there how old are you" and doesn't match so times out.

I've avoided the timeout by setting it short and looping but this means the user has only a couple of seconds to say what they want to say or it'll restart. If I don't loop it around it takes "timeout" as the phrase and the robot responds to that.

What I need to find out is if EZ-Script can be set to wait until speech finished, rather than putting a Sleep(2000) to wait a couple of seconds.

Also, is it possible to use SAPI's dictation mode to set a variable as anything heard not just from a set list of phrases?

And, if it's possible to reset the waitforspeech after say a second of silence, rather than timeout and restart even if it is "hearing" something.

Also, can an XML parser be added like the RSS one? It's extremely similar in construction so sounds simple but without knowing how the RSS one works in ARC I really have no clue.

I guess those last few questions are really aimed at @DJ

This may all come to nothing and be one of those many failed projects I've started, it may be something that just isn't really possible with the software but it could be an awesome addition to the AI... whatever it is, it's going to be fun:)


ARC Pro

Upgrade to ARC Pro

Discover the limitless potential of robot programming with Synthiam ARC Pro – where innovation and creativity meet seamlessly.

United Kingdom
#9  

Thanks. I had looked at that code before too which is where I got a few of the ideas in my code from.

I've not really looked in to this again for the last couple of days due to being out yesterday and recovering today however it is one of those things that's always ticking over in my mind and the more I think about it the more I think it's going to end up having to be a C# addition or having to wait and see whatever happened to DJs chatbot (maybe part of the "revolution", who knows). If DJ is working on this still then there's really very little point in going any further with this (I have no doubts his will work better).

I've also realised I need to go over the EZ-Script manual a few more times as I keep finding functions I was not aware of.

New Zealand
#10  

PS You should also see the pause box tick and untick itself on the speech recognition box thus stopping your bot listening to itself.

United Kingdom
#11  

I'll have to check that, from memory I don't think I have the speech recognition box added to the ARC, that may explain the problem...

United Kingdom
#12  

Time has been against me lately with other commitments and work stopping work on this script and on my bot in general however a small update on this side project of mine. And that is I've solved the issue of the robot listening to itself.

What I didn't realise until earlier is there are both the Say() command and SayWait() command. I was using Say() which works as it should but would also continue to listen. I guess I really should have read the Script manual a bit sooner than I did:)

So that is one of the small issues solved. The main one still remains to be the listening for any word not just a phrase list. But on second thoughts (after making a few changes to my other voice controlled software I use) it's best to stick to a list otherwise the software can come out with some rather confusing sentences... I think I will probably do this on a word by word basis, with a timeout indicating no further words. Writing the phrase list may be the biggest task but luckily there are downloadable dictionaries which will help there with some copy & paste work.

Now to figure out a logical list of words for each position based on the English language and correct grammar etc. (however English was never my strong point at school and what I learned there I've forgotten in the last 15 years!).

#13  

What might be an interesting addition to EZ-Script would be a "Listen" feature. As already pointed out, it's already using speech recognition, but it's looking for specific phrases. What if the "Listen" feature, simply translated speech to text? It would probably need to have a variable that indicates how long of a pause to listen for to indicate the end of a phrase.

Something like:

Listen(2000), would activate the mic and listen for a phrase. It will stop listening if there is a pause in speech longer than 2 seconds.

Whatever is captured by the Listen feature could be:

  • Added to a global variable
  • Written to a file.

Once the speech is captured as a variable, then you could probably use it in any number of diabolical ways.

PRO
Synthiam
#14  

I've gone the route many times with a open dictionary of english words for input. Meaning, it uses every word in the english language and tries to "guess" what was spoken. You can try it on your computer by using "Dictation" built into windows. You can speak and have the text written to Notepad, for example.

Try it - and you'll see what the trouble has been:)

Hint: It picks up words that sound like other words. Speak a sentence, and what is "detected" is entirely incorrect, but rhymes. With a proper microphone headset, it works better - but no one here uses a headset.

If I was to create a dictation control, you would require a headset - and that still might not be accurate enough.

#15  

Curses! Eye guess ewe can't wean them awl?:)

PRO
Synthiam
#16  

I've had some ideas by using a custom dictionary. There has been a few examples I've tried. Those who use the EZ-SDK will see some examples and the speech recognition with full dictation.