Week (20)
Description.
I have been loosing track of keeping up-to-date with this blog but I handed in my dissertation a few days ago so hopefully I can now get back on track with the build.
I have been working on the Eliza code. First of all I downloaded the Eliza library for processing from http://codeanticode.wordpress.com/2007/11/12/eliza-library-for-processing/
I then used the open source code from codeanticode. the system at first seemed quite difficult to get going the intrusions on the website did not appear that clear to me but after trying out a few different approaches it worked. The problem I had was that processing was not picking up the Eliza script this was because in the instructions the person who wrote them did not define the nature of the text document e.g script.txt in his example he just used the short term 'script' I had a feeling that this was going to be an issues. Another problem concerned getting the code to start reading from a position in the script of my choosing, the problem was that the piece of pre written code had a starting position for the script to start. I changed this so instead of the script starting from its natural point it starts from the middle of the script where I entered my own welcome (that was no recognised via processing as the start of the code)
import codeanticode.eliza.*;
Eliza eliza;
PFont font;
String elizaResponse, humanResponse;
boolean showCursor;
int lastTime;
void setup()
{
size(400, 400);
eliza = new Eliza(this)
eliza.readScript("script");
font = loadFont("Rockwell-24.vlw");
textFont(font);
printElizaIntro();
humanResponse = "";
showCursor = true;
lastTime = 0;
}
void draw()
{
background(102);
fill(255);
text(elizaResponse, 10, 50, width - 40, height);
fill(0);
int t = millis();
if (t - lastTime > 500)
{
showCursor = !showCursor;
lastTime = t;
}
if (showCursor) text(humanResponse + "_", 10, 150, width - 40, height);
else text(humanResponse, 10, 150, width - 40, height);
}
void keyPressed()
{
if ((key == ENTER) || (key == RETURN))
{
println(humanResponse);
elizaResponse = eliza.processInput(humanResponse);
println(">> " + elizaResponse);
humanResponse = "";
}
else if ((key > 31) && (key != CODED))
{
humanResponse = humanResponse + key;
}
else if ((key == BACKSPACE) && (0 < humanResponse.length()))
{
char c = humanResponse.charAt(humanResponse.length() - 1);
humanResponse = humanResponse.substring(0, humanResponse.length() - 1);
}
}
void printElizaIntro()
{
String hello = "Hello.";
elizaResponse = hello + " " + eliza.processInput(hello);
println(">> " + elizaResponse);
}
I then added my own script in by changing the default script to my own text file inside the Eliza library. Here is an example of the changed script:
(Shortened Example)
initial: Hello. Oh come on then… tell me your problems ?
final: Bye, I think you ought to know i’m feeling very depressed by all of this.
quit: oh ..right..your going, i’ll just wait here for some other person to come along and discuss their ghastly existence.
quit: Wretched humans … never understood them.
quit: I am going to have a lie down.. this has been terrible, goodbye
synon: everyone everybody nobody noone
synon: be am is are was
key: xnone
decomp: *
reasmb: Oh, what are you talking about ?
reasmb: Ohhh, this is so very depressing.
reasmb: I think you ought to know i am feeling very depressed
reasmb: Why are you discussing such depressing things ?
key: sorry
decomp: *
reasmb: Please dont apologise, i am only a robot I do not care.
reasmb: Give me strength, Apologies are not necessary, I don’t care.
reasmb: I have told you that apologies are not required, but i’ll file it away under ‘Unimportant babble’.
I used these instructions from http://www.chayden.net/eliza/instructions.txt to change the algorithm of the default script.
To personalise the interface I adapted one of the side I used for my presentation on the project and imported it into processing. 1.1 I also changed the position of the response from eliza to be more central to the interface 1.2.
In Addition I have been working on the Eye mechanism and have managed to get the eyes functioning well.
Equipment
2 X Micro Servos
Milliput
2 x Servo Arms
3mm Wire
To start with I was having trouble thinking of ways to position the micro servos onto the back of the eye frame in the original plans I had decided the driving the eye mechanism from a central point within the eye framework would be the best way. However there was not enough room for the servo arms to fully swing which would have resulted in restricted eye movement. I decided that I would mount the servos into the back of the framework, this would make the eyes smother and easier to function but resulted in having to use a lot of Milliput adding to the upper weight of the model and also creating a mound on the back of the robots head that I am worried does not look right. After the Milliput had dried I added the servo arms to the micro servos and made a hook and loop shape with the 3mm wire and bent it into shape with some pliers. To keep the loop in place i used Milliput to restrict its movement and some more 3mm wire to keep it in place. 1.3, 1.4, 1.5
(Note the eye mechanism is still not attached to the main framework it is just balanced onto to give an idea of scale and how it looks together as an object)
Feelings
I am very please with the progress over the past few days I have managed to get back to grips with the project and I really enjoyed playing around with the Eliza script. I have a presentation on the progress of the project in a few days so this has given me a lot of drive to get as much done as I can to show.
Evaluation
This was a good session, it made a change from just doing the physical computing side and added a whole new element to the project. I think that using Eliza as part of the project really adds extra value to it in terms of its focus on A.I. and giving it another side to its personally thats not its physical expression. I also feel that I was able to tackle problems with the processing code that i encountered on my own. By doing this and thinking and finding ways around problems I feel that i am getting to grips with the code again after leaving it for a while.
Analysis
This session made sense in terms of adding a new element to the project I think that it will make even more sense when it is out putted using APPLESCRIPT to a speaker system on the animatronic. However I have e-mailed my tutor asking him for help with the next part of the process because I have little to no knowledge of APPLESCRIPT.
Conclusion
In conclusion I do not think I could have done anything more on this part of the project without requiring assistance. I have a session on friday the 28th with my main tutor to discuss to progress of the project so far, however I am in finical difficulty due to issues with student finance messing up my funding I have had to borrow some money off my parents to be able to fund going into uni which is very demoralising.
Action Plan
The action plan is to see my tutor about outputting the Eliza script into Applescripts voice function so the responses become audible. If i could start this session over again I would of liked to of got a little further with the project, I am really eager to get back into spending more time on the project than I have been able to but it feels like its still getting going again and that I'm second guessing myself a little which I didn't do at the start of the project.
Action Plan
The action plan is to see my tutor about outputting the Eliza script into Applescripts voice function so the responses become audible. If i could start this session over again I would of liked to of got a little further with the project, I am really eager to get back into spending more time on the project than I have been able to but it feels like its still getting going again and that I'm second guessing myself a little which I didn't do at the start of the project.
1.1
1.2
1.4

