Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:37 28 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : ELIZA

Author Message
RicM
Regular Member

Joined: 05/02/2022
Location: Australia
Posts: 52
Posted: 02:57pm 25 Jul 2023
Copy link to clipboard 
Print this post

Dear Members,

Dose anyone have this style of program.

ELIZA is an early natural language processing computer program created from 1964 to 1966[1] at MIT by Joseph Weizenbaum.[2][3] Created to explore communication between humans and machines.

SORRY POSTED IT ON WINDMILLS

Regards,

RicM
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 03:13pm 25 Jul 2023
Copy link to clipboard 
Print this post

Youll find it in this Post
Eliza by Mixtel90
'no comment
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 339
Posted: 03:57pm 25 Jul 2023
Copy link to clipboard 
Print this post

  RicM said  Dear Members,

Dose anyone have this style of program.

ELIZA is an early natural language processing computer program created from 1964 to 1966[1] at MIT by Joseph Weizenbaum.[2][3] Created to explore communication between humans and machines.

SORRY POSTED IT ON WINDMILLS

Regards,

RicM


Here's one in BASIC. It's written for 8K Microsoft BASIC but is very easy to use on Micromites:

https://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/areas/classics/eliza/basic/eliza.100
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 04:39pm 25 Jul 2023
Copy link to clipboard 
Print this post

  toml_12953 said  
Here's one in BASIC. It's written for 8K Microsoft BASIC but is very easy to use on Micromites:

https://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/areas/classics/eliza/basic/eliza.100

Fast and Dirty MM Basic Translation
10 'by jack shalom[72176,1077] from a program in creative computing. Make sure caps lock is on.Only reply one sentence at a time
80 'INITIALIZE
100 DIM S(38):DIM R(38):DIM N(38)
110 N1=38:N2=14:N3=115
120 RESTORE 4001
130 FOR X=1TO N1
140 READ S(X),L
141 R(X)=S(X):N(X)=S(X)+L-1
150 NEXT X
155 CLS
160 PRINT "HELLO! MAKE YOURSELF COMFORTABLE."
170 PRINT "NOW,WHAT'S YOUR PROBLEM?"
180 ' USER INPUT
200 INPUT  I1$
201 I1$=" "+I1$+"  ":?
210 'KILL APOSTROPHES
220 AP$="'":IF INSTR(1,I1$,AP$)>0 THEN I1$=LEFT$(I1$,(INSTR(1,I1$,AP$)-1))+RIGHT$(I1$,LEN(I1$)-INSTR(1,I1$,AP$)):GOTO 220
250 IF I1$=P$ THEN PRINT "WHY DO YOU REPEAT YOURSELF?"
260 'FIND KEYWORD IN I1$
290 RESTORE
300 FOR K=1 TO N1
310 READ K1$
330 IF INSTR(1,I1$,K1$)>0 THEN F$=K1$:L=INSTR(1,I1$,K1$):GOTO420
340 NEXT K
370 K=36:GOTO 590:'NO KEYWORDS
400 'CONJUGATE WORDS
420 RESTORE 2001
430 C1$=" "+RIGHT$(I1$,LEN(I1$)-LEN(F$)-L+1)+" "
440 FOR X=1 TO N2/2
450 READ S$,R$
455 CC=1
460 IF INSTR(CC,C1$,S$)>0 THEN 500
470 IF INSTR(CC,C1$,R$)>0 THEN 510
480 GOTO 550
500 L=INSTR(1,C1$,S$):C1$=LEFT$(C1$,L-1)+R$+RIGHT$(C1$,LEN(C1$)-L-LEN(S$)+1):CC=L+LEN(R$):GOTO 460
510 L=INSTR(1,C1$,R$):C1$=LEFT$(C1$,L-1)+S$+RIGHT$(C1$,LEN(C1$)-L-LEN(R$)+1):CC=L+LEN(S$):GOTO 460
550 NEXT X
555 IF MID$(C1$,2,1)=" "THEN C1$=RIGHT$(C1$,LEN(C1$)-1):'ONE SPACE ONLY
557 IF INSTR(1,C1$,"!")>0 THEN L=INSTR(1,C1$,"!"):C1$=LEFT$(C1$,L-1)+RIGHT$(C1$,LEN(C1$)-L)
580 ' GET REPLY
590 RESTORE 3001
600 FOR X=1 TO R(K):READ F$:NEXT
610 R(K)=R(K)+1:IF R(K)>N(K) THEN R(K)=S(K)
620 IF RIGHT$(F$,1)<>"*" THEN PRINT F$:P$=I1$:GOTO 200
630 PRINT LEFT$(F$,LEN(F$)-1);C1$
640 P$=I1$:GOTO 200
1000 'KEYWORDS
1001 DATA "CAN YOU","CAN I","YOU ARE","YOURE","I DONT","I FEEL"
1060 DATA "WHY DONT YOU","WHY CANT I","ARE YOU","I CANT","I AM"," IM "
1070 DATA "YOU ","I WANT","WHAT","HOW","WHO","WHERE","WHEN","WHY"
1080 DATA "NAME","CAUSE","SORRY","DREAM","HELLO"," HI ","MAYBE"
1090 DATA " NO ","YOUR","ALWAYS","THINK","ALIKE","YES "," FRIEND"
1100 DATA "COMPUTER","NOKEY","PHOOEY","OUCH"
2000 'CONJUGATIONS
2001 DATA " ARE "," AM "," WERE "," WAS "," YOU "," I "," YOUR "," MY "
2010 DATA " IVE "," YOUVE "," IM "," YOURE "
2020 DATA  " ME "," !YOU "
3000 'REPLIES
3001 DATA "DON'T YOU BELIEVE THAT I CAN*"
3040 DATA "PERHAPS YOU WOULD LIKE TO BE ABLE TO*"
3050 DATA "YOU WANT ME TO BE ABLE TO*"
3060 DATA "PERHAPS YOU DON'T WANT TO*"
3070 DATA "DO YOU WANT TO BE ABLE TO*"
3080 DATA "WHAT MAKES YOU THINK I AM*"
3090 DATA "DOES IT PLEASE YOU TO BELIEVE I AM*"
3100 DATA "PERHAPS YOU WOULD LIKE TO BE*"
3400 DATA "DO YOU SOMETIMES WISH YOU WERE*"
3410 DATA "DON'T YOU REALLY*"
3420 DATA "WHY DON'T YOU*"
3430 DATA "DO YOU WISH T BE ABLE TO*"
3440 DATA "DOES THAT TROUBLE YOU?"
3450 DATA "TELL ME MORE ABOUT SUCH FEELINGS."
3460 DATA "DO YOU OFTEN FEEL*"
3470 DATA "DO YOU ENJOY FEELING*"
3480 DATA "DO YOU REALLY BELIEVE I DON'T*"
3490 DATA "PERHAPS IN GOOD TIME I WILL*"
3500 DATA "DO YOU WANT ME TO*"
3510 DATA "DO YOU THINK YOU SHOULD BE ABLE TO*"
3520 DATA "WHY CAN'T YOU*"
3530 DATA "WHY ARE YOU INTERESTED IN WHETHER OR NOT I AM *"
3540 DATA "WOULD YOU PREFER IF I WERE NOT*"
3550 DATA "PERHAPS IN YOUR FANTASIES I AM*"
3560 DATA "HOW DO YOU KNOW YOU CAN'T*"
3570 DATA "HAVE YOU TRIED?"
3580 DATA "PERHAPS YOU CAN NOW*"
3590 DATA "DID YOU COME TO ME BECAUSE YOU ARE*"
3600 DATA "HOW LONG HAVE YOU BEEN*"
3601 DATA "DO YOU BELIEVE IT IS NORMAL TO BE*"
3602 DATA "DO YOU ENJOY BEING*"
3603 DATA "WE WERE DISCUSSING YOU-NOT ME"
3604 DATA "OH I*"
3605 DATA "YOU'RE NOT REALLY TALKING ABOUT ME ARE YOU?"
3606 DATA "WHAT WOULD IT MEAN TO YOU IF YOU GOT*"
3607 DATA "WHY DO YOU WANT*"
3608 DATA "SUPPOSE YOU SOON GOT*"
3609 DATA "WHAT IF YOU NEVER GOT*"
3610 DATA "SOMETIMES I ALSO WANT*"
3611 DATA "WHY DO YOU ASK?"
3612 DATA "DOES THAT QUESTION INTEREST YOU?"
3613 DATA "WHAT ANSWER WOULD PLEASE YOU THE MOST?"
3614 DATA "WHAT DO YOU THINK?"
3615 DATA "ARE SUCH QUESTIONS ON YOUR MIND OFTEN?"
3616 DATA "WHAT IS IT THAT YOU REALLY WANT TO KNOW"
3617 DATA "HAVE YOU ASKED ANYONE ELSE?"
3618 DATA "HAVE YOU ASKED SUCH QUESTIONS BEFORE?"
3619 DATA "WHAT ELSE COMES TO MIND WHEN YOU ASK THAT?"
3620 DATA "NAMES DON'T INTEREST ME"
3621 DATA "I DON'T CARE ABOUT NAMES -PLEASE GO ON"
3622 DATA "IS THAT THE REAL REASON?"
3623 DATA "DON'T ANY OTHER REASONS COME TO MIND?"
3624 DATA "DOES THAT REASON EXPLAIN ANYTHING ELSE?"
3625 DATA "WHAT OTHER REASONS MIGHT THERE BE?"
3626 DATA "PLEASE DON'T APOLOGIZE!"
3627 DATA "APOLOGIES ARE NOT NECESSARY"
3628 DATA "WHAT FEELINGS DO YOU HAVE WHEN YOU APOLOGIZE?"
3629 DATA "DON'T BE SO DEFENSIVE!"
3630 DATA "WHAT DOES THAT DREAM SUGGEST TO YOU?"
3631 DATA "DO YOU DREAM OFTEN?"
3632 DATA "WHAT PERSONS APPEAR IN YOUR DREAMS?"
3633 DATA "ARE YOU DISTURBED BY YOUR DREAMS?"
3634 DATA "HOW DO YOU DO...PLEASE STATE YOUR PROBLEM."
3635 DATA "YOU DON'T SEEM QUITE CERTAIN"
3636 DATA "WHY THE UNCERTAIN TONE?"
3637 DATA "CAN'T YOU BE MORE POSITIVE?"
3638 DATA "YOU AREN'T SURE?"
3639 DATA "DON'T YOU KNOW?"
3640 DATA "WHAT'S YOUR FEELING ABOUT THAT?"
3641 DATA "YOU ARE BEING A BIT NEGATIVE"
3642 DATA "WHY NOT?"
3643 DATA "WHY ARE YOU CONCERNED ABOUT MY*"
3644 DATA "WHAT ABOUT YOUR OWN*"
3645 DATA "CAN YOU THINK OF A SPECIFIC EXAMPLE?"
3646 DATA "WHEN?"
3647 DATA "WHAT ARE YOU THINKING OF?"
3648 DATA "REALLY,ALWAYS?"
3649 DATA "DO YOU REALLY THINK SO?"
3650 DATA "BUT YOU ARE NOT SURE YOU*"
3651 DATA "DO YOU DOUBT YOU*"
3652 DATA "IN WHAT WAY?"
3653 DATA "WHAT RESEMBLANCE DO YOU SEE?"
3654 DATA "WHAT DOES THE SIMILARITY SUGGEST TO YOU?"
3655 DATA "WHAT OTHER CONNECTIONS DO YOU SEE?"
3656 DATA "COULD THERE REALLY BE SOME CONNECTION?"
3657 DATA "HOW?"
3658 DATA "YOU SEEM QUITE POSITIVE."
3659 DATA "ARE YOU SURE?"
3660 DATA "I SEE."
3661 DATA "I UNDERSTAND"
3662 DATA "WHY DO YOU BRING UP THE TOPIC OF FRIENDS?"
3663 DATA "DO YOUR FRIENDS WORRY YOU?"
3664 DATA "DO YOUR FRIENDS PICK ON YOU?"
3665 DATA "ARE YOU SURE YOU HAVE ANY FRIENDS?"
3666 DATA "DO YOU IMPOSE ON YOUR FRIENDS?"
3667 DATA "PERHAPS YOUR LOVE FOR FRIENDS WORRIES YOU."
3668 DATA "DO COMPUTERS WORRY YOU?"
3669 DATA "ARE YOU TALKING ABOUT ME IN PARTICULAR?"
3670 DATA "ARE YOU FRIGHTENED BY MACHINES?"
3671 DATA "WHY DO YOU MENTION COMPUTERS?"
3672 DATA "WHAT DO YOU THINK MACHINES HAVE TO DO WITH YOUR PROBLEM?"
3673 DATA "DON'T YOU THINK COMPUTERS CAN HELP PEOPLE?"
3674 DATA "WHAT IS IT ABOUT MACHINES THAT WORRIES YOU?"
3675 DATA "SAY,DO YOU HAVE ANY PSYCHOLOGICAL PROBLEMS?"
3676 DATA "WHAT DOES THAT SUGGEST TO YOU?"
3677 DATA "I SEE"
3678 DATA "I'M NOT SURE I UNDERSTAND YOU FULLY"
3679 DATA "GO ON, PLEASE."
3680 DATA "CAN YOU ELABORATE ON THAT?"
3681 DATA "THAT IS QUITE INTERESTING.  TELL ME MORE."
3690 DATA "I'M LISTENING"
3700 DATA "YOU HAVE VERY STRONG FEELINGS ABOUT THIS."
3701 DATA "ARE YOU TRYING TO SHOCK ME WITH YOUR LANGUAGE?"
3702 DATA "YOU FEEL A NEED TO BE OBSCENE?"
3703 DATA "LOOK ASSHOLE, CUT THE CURSING CRAP!"
4000: '(REPLY#,#OF REPLIES)
4001 DATA 1,3,4,2,6,4,6,4,10,4,14,3,17,3,20,2,22,3,25,3
4540 DATA 28,4,28,4,32,3,35,5,40,9,40,9,40,9,40,9,40,9,40,9
4550 DATA 49,2,51,4,55,4,59,4,63,1,63,1,64,5,69,3,72,2,74,4
4560 DATA 78,3,81,6,87,4,91,6,97,8,105,7,112,4,112,4

'no comment
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1109
Posted: 04:39pm 25 Jul 2023
Copy link to clipboard 
Print this post

Here's the one I ported for the CMM2. Maybe it will work on the Pico too?
Visit Vegipete's *Mite Library for cool programs.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 09:05pm 25 Jul 2023
Copy link to clipboard 
Print this post

If you want to know how Eliza works with its databases I suggest that you have a look at the one I did (the one mentioned by Martin) as I included a lot more comments than you find in the usual versions. It's almost a rewrite for MMBasic in some places. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
andreas

Senior Member

Joined: 07/12/2020
Location: Germany
Posts: 207
Posted: 04:59pm 26 Jul 2023
Copy link to clipboard 
Print this post

Weizenbaums paper: https://dl.acm.org/doi/pdf/10.1145/365153.365168
-andreas
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 05:23pm 26 Jul 2023
Copy link to clipboard 
Print this post

Yep. It's best to remember that the BASIC versions that we see are only vaguely related to the original. A lot of it has been simplified or omitted in order to squeeze it into the restricted memory and the rather crude operations available to BASIC on a low power processor.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3804
Posted: 10:24am 27 Jul 2023
Copy link to clipboard 
Print this post

  andreas said  Weizenbaums paper: https://dl.acm.org/doi/pdf/10.1145/365153.365168
-andreas

Thanks for the URL!

John
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024