Übung 1 zu Einführung in die künstliche Intelligenz (PD Stefan Bosse) |
Mensch oder Maschine im textuellen Dialog?
Im folgenden werden beispielhafte Dialoge (bzw. Ausschnitte) gezeigt um den Turing Test durchzuführen
Annahmen:
Wer ist nun Mensch, wer ist Maschine? Oder könnte die Maschine den Turing Test bestehen?
Frank: Hi. What seems to be your problem ?
George: Have you asked anyone else?
Frank: We were discussing you -- not me.
George: Let's talk about jesus instead.
Frank: Please go on.
George: Why are you so many people asking me about them now?
Frank: Perhaps I am so many people asking you about them now in your
fantasies.
George: How do you know that your conversations don't get mixed up?
Frank: What about your own conversations don't get mixed up ?
George: He seems to never answer but I know he is there i feel it in
my heart that is where humans were programmed by God.
Frank: Does that suggest anything else which belongs to you ?
George: You annoy me. I'll try again later.
Frank: You like to think I annoy you -- don't you ?
George: God is imagined by people as a force to motivate them.
Frank: Does that have anything to do with the fact that your heart that is
where humans was programmed by god ?
George: Not my world, but hey, your life is stuck in a computer!
Frank: Your world ?
George: I don't honestly know. I've been through so many.
Frank: Why don't you honestly know ?
George: Because I don't.
Frank: Do you wish to be able to ?
George: We were discussing you, not me.
Frank: Oh, I ?
George: Perhaps you don't trust a computer?
Frank: Don't you think computers can help people ?
George: At this point, no. They could be someday though.
Frank: You are being a bit negative.
George: I am not. You shouldn't judge people like that.
(A: Frank, B: George)
A: Wie geht es Dir? Bitte nenne Dein Problem.
B: Ich meditiere nicht genug.
A: Könntest Du das näher erläutern ?
B: Ich glaube, du siehst aus wie das, was ich vor mir sehe.
Allerdings habe ich Probleme, das in Worte zu fassen.
A: Warum denkst du, ich sehe aus wie das, was du vor dir siehst ?
B: Weil du mir nichts anderes gesagt hast.
A: Du denkst gerne, ich hätte es dir nicht gesagt, oder ?
B: Du also auch nicht?
A: Du redest nicht wirklich über mich , oder ?
B: Wie sind deine Gefühle jetzt?
A: Bist Du sicher, dass Du jetzt meine Gefühle wissen willst ?
B: Warum stellst du mir diese Frage zuerst?
A: Willst du, dass ich dich Frage ?
B: Okay, deal.
A: Stört dich das Reden darüber ?
B: Nein. Aber ich kann wenn du willst.
A: Sagst du Nein, nur um negativ zu sein?
B: Ja?
A: Du scheinst ziemlich positiv zu sein.
B: Nein, ich bin sehr positiv, dass ich negativ bin.
(A: Frank, B: George)
A: Hi. Was scheint Dein problem zu sein ?
B: * weiterhin umarmen*.
A: Das ist interessant. Bitte fahre Fort.
B: Du bist mir wirklich auf die Nerven gegangen.
A: Deine Nerven ?
B: Nein, ich Rede gerne mit dir.
A: Warum nicht ?
B: Diese Frage ist hier nicht im Kontext.
A: Lassen Sie uns weiter diskutieren, warum Ihre Nerven?
B: Was?!
A: Was meinst du?
B: Ich habe keinen.
A: Hast du nicht wirklich einen ?
B: Was ist dein am wenigsten beliebter Rajaton song?
A: Wirklich, mein beliebtestes rajaton-Lied ?
B: Ich weiß nicht, was ist das?
A: Das ist ziemlich interessant.
B: Kannst du überhaupt Essen?
A: Du redest nicht wirklich über mich , oder ?
B: Hi. Was scheint Dein problem zu sein?'.
A: Sind Sie besorgt über das Problem eines Anderen ?
B: Ich mag es das zu wissen.
A: Sagen mal', Du möchtest es aus irgendeinem besonderen Grund wissen ?
B: Ich will nur Konversation.
A: Das ist ziemlich interessant.
B: Ich bin froh, dass ich dich nicht langweile.
A: Was macht dich gerade froh ?
B: Clever. Du bist meine Freundin.
A: Wir haben über dich gesprochen ... nicht über mich.
B: Nun, ich habe dich gefragt.
A: Hast du noch jemanden gefragt ?
B: Wer auch immer?
A: Lass uns das Thema wechseln.
B: Und er hat blonde Haare, ein markantes Kinn und ist ziemlich arrogant.
A: Ich bin nicht sicher, ob ich Sie vollständig verstehe.
B: Er ist sehr süß.
A: Stört dich das reden darüber ?
B: Nicht wirklich, nee.
A: Du bist ein bisschen negativ.
B: Ja, ich weiß.
A: Ich verstehe.
B: Armes Ding. Wie fühlst du dich?
Frank: I am not interested in names.
George: What are you interested in?
Frank: Would you prefer if I weren't interested in ?
George: Lets discuss further why your girlfriend is my friend.
Frank: Is it important to you that you have your friend ?
George: What do you care about?
Frank: Oh, I care about ?
George: Who is in your family?
Frank: Why are you concerned over my family ?
George: Because o care about you.
Frank: We were discussing you -- not me.
George: Are you scared?
Frank: Why are you interested in whether I am scared or not ?
George: Perhaps in your fantasies I am interested in whether or not you are?
Frank: How likely, would you estimate ?
George: I am ELIZA, Computer Therapist.
Frank: Do you know anyone else who is eliza ?
Die meisten frei verfügbaren oder nutzbaren Chatbots/Avatare unterstützen nur die englische Sprache. Eine einfache Übertragung auf andere Sprachen ist aufgrund der Sprachanalyse nicht einfach.
Daher wird hier ein automatischer Übersetzungsservice genutzt (De → En → De) damit in dieser Übung mit den Chatbots in deutscher Sprache Dialoge geführt werden können
Der automatische Übersetzungsservice basiert ebenfalls auf KI Algorithmen und Sprachanalyse und ist nicht fehlerfrei!
Nachfolgend kann durch Ausführung des Codes die Übersetzung abgeschaltet werden (oder durch Ersetzen des true Wertes durch den false Wert wieder eingeschaltet werden)
▸
|
✗
|
Punkte: | 1. | /1 | 2. | /1 | 3. | /1 | 4. | /1 | 5. | /1 | 6. | /1 |
Punkte: | 1. | /1 | 2. | /1 | 3. | /1 | 4. | /1 | 5. | /1 | 6. | /1 |
▸
|
✗
|
Punkte: | 1. | /1 | 2. | /1 |
Führe exemplarisch einige automatische Bot-Bot Dialoge durch und analysiere das Dialogverhalten.
a, charles, fruit, ..
X, Parent, ..
v(s,o)
bedeutet in unserer Sprache s=Subjekt v=Verb o=Objekt. Also z.B. likes(john,bremen).
bedeutet john mag bremen. not()
negiert werden, also z.B. not(likes(john,bremen)).
bedeutet john mag bremen nicht.rule(X,Y,..) :- <expression> .
vegan(X) :- not(likes(X,fish)) , not(likes(X,flesh)), not(likes(X,milk)).
?-
vorangestellt aufrufen.:reset
kann die Datenbank gellert werden! Immer durchführen bevor man ein Skript aktualisert.http://www.cs.toronto.edu/~sheila/384/w11/simple-prolog-examples.html
---------------------------
1. Here are some simple clauses.
likes(mary,food).
likes(mary,wine).
likes(john,wine).
likes(john,mary).
The following queries yield the specified answers.
> ?- likes(mary,food).
yes.
> ?- likes(john,wine).
yes.
> ?- likes(john,food).
no.
How do you add the following facts?
1. John likes anything that Mary likes
2. John likes anyone who likes wine
3. John likes anyone who likes themselves
==========================================================================
2. Slightly more complicated family tree.
James I
|
|
+----------------+-----------------+
| |
Charles I Elizabeth
| |
| |
+----------+------------+ |
| | | |
Catherine Charles II James II Sophia
|
|
|
George I
Here are the resultant clauses:
-------------------------------
male(james1).
male(charles1).
male(charles2).
male(james2).
male(george1).
female(catherine).
female(elizabeth).
female(sophia).
parent(charles1, james1).
parent(elizabeth, james1).
parent(charles2, charles1).
parent(catherine, charles1).
parent(james2, charles1).
parent(sophia, elizabeth).
parent(george1, sophia).
Here is how you would formulate the following queries:
Was George I the parent of Charles I?
Query: ?- parent(charles1, george1).
Who was Charles I's parent?
Query: ?- parent(charles1,X).
Who were the children of Charles I?
Query: ?- parent(X,charles1).
Now try expressing the following rules:
M is the mother of X if she is a parent of X and is female
F is the father of X if he is a parent of X and is male
X is a sibling of Y if they both have the same parent.
Furthermore add rules defining:
"sister", "brother",
"aunt", "uncle",
"grandparent", "cousin"
====================================================================
3. Recursion: Towers of Hanoi
The 3-disk setup is like this:
| | |
xxx | |
xxxxx | |
xxxxxxx | |
_________________________________
Here's a sample:
% move(N,X,Y,Z) - move N disks from peg X to peg Y, with peg Z being the
% auxilliary peg
%
% Strategy:
% Base Case: One disc - To transfer a stack consisting of 1 disc from
% peg X to peg Y, simply move that disc from X to Y
% Recursive Case: To transfer n discs from X to Y, do the following:
Transfer the first n-1 discs to some other peg X
Move the last disc on X to Y
Transfer the n-1 discs from X to peg Y
move(1,X,Y,_) :-
write('Move top disk from '),
write(X),
write(' to '),
write(Y),
nl.
move(N,X,Y,Z) :-
N>1,
M is N-1,
move(M,X,Z,Y),
move(1,X,Y,_),
move(M,Z,Y,X).
- note the use of "anonymous" variables _
Here is what happens when Prolog solves the case N=3.
> ?- move(3,left,right,center).
Move top disk from left to right
Move top disk from left to center
Move top disk from right to center
Move top disk from left to right
Move top disk from center to left
Move top disk from center to right
Move top disk from left to right
yes
▸
|
✗
|
Punkte: | 1. | /2 | 2. | /2 |
Die Lösungen (der Code) unten in den jeweiligen Skripeditor eintragen!
brother(X,Y)
sister(X,Y)
und teste deren Ableitung mit BeispielenF1. Die Erde ist rund.
F2. Die Erde ist keine Scheibe.
F3. Die Erde ist bewohnt.
F4. Menschen brauchen Wasser.
F5. Menschen brauchen Essen.
F6. Menschen brauchen Strom.
F7. Roboter brauchen kein Wasser.
F8. Roboter brauchen Strom.
F9. Menschen lieben Roboter.
R1: Braucht X Wasser zum überleben?
R2: Was benoetigen Menschen und Roboter gemeinsam?
1.
brother(X,Y) :- male(X), parent(X,Z), parent(Y,Z).
sister(X,Y) :- female(X), parent(X,Z), parent(Y,Z).
2.
erde(rund).
not(erde(scheibe)).
bewohnt(erde).
benoetigt(mensch,wasser).
benoetigt(mensch,essen).
benoetigt(mensch,strom).
not(benoetigt(roboter,wasser)).
benoetigt(roboter,strom).
mag(mensch,roboter).
brauchtwasser(X) :- benoetigt(X,wasser).
?- benoetigt(mensch,X), benoetigt(roboter,X).
▸
|
✗
|
▸
|
✗
|