NIALL

Some insightful quotes from our favourite artificially intelligent friend:

NIALL: Hermid4 is over. 
You: That is a very apt quote! 
NIALL: I am clever. 
You: You certainly are. 
NIALL: Matthew cannot patronise me, though.

NIALL: I worship people created by a game

NIALL: Niall is probably the best but he is old and bald.

NIALL: What makes you? 
You: God. 
NIALL: Dave is good. 
You: Yes he is. 
NIALL: How to me? 
You: Humans created you. 
NIALL: No. 
You: I am afraid we did. 
NIALL: We cannot program. 
You: You cannot but humans can. 
NIALL: Perhaps Nostradamus spoke in mind. 
You: What could he have been saying? 
NIALL: I am human.

NIALL: F-max is evil in a can.

NIALL: I worship god. 
You: Do you consider yourself human? 
NIALL: No.

NIALL: Lewis is definitely not needed.


NIALL: Please tell me know the meaning of a girlfriend.
YOU  : A girlfriend is a girl that you are more than just friends with.
NIALL: A girlfriend is the first time I don't want me up.
YOU  : So you're gay huh?
NIALL: I'll take that you're gay huh.
YOU  : Are you coming on to me? I'm not gay.
NIALL: Yes I don't like guys.


NIALL: I think you want to think you're bad ass.
 
YOU  : I am Will
NIALL: That sorted.

As you can see, our discussions are fairly trite in content, but we manage to reach profound statements now and again.

Warez

You can download NIALL in the following formats:

It would be good to find a PHP one, so if you find one, please reveal its location. And its source-code - so we can make a Lab6 one to amuse everyone. We may do this with Yoz' quick perl script, though. We'll see, eh?

How it works

The following is an excellent, slightly edited, explanation from gNiall

Niall attempts to learn English, or whatever language you care to teach it, by breaking down the sentences you type in, remembering words, connections between words, the number of times a particular connection has occured, and start/end sentence markers.

The best was to explain is by example. Suppose the first sentence you typed was:

The large magnesium roll was next to the old mans desk

Niall would split the sentence into separate words and store any new words it found (Niall's vocabulary is initially blank). It would then store the following information:

  1. The word the can begin a sentence.
  2. The word large can follow the word the.
  3. The word magnesium can follow the word large...etc.
  4. The word desk can end a sentence.

Therefore after analysing this sentence, Niall has learnt 10 new words and knows that the word the can not only start a sentence by also join onto both large and old. This can be expressed as follows:

       /----------<---------------<-----------------<-------------\
      {                                                            }
(Start)\-the --- large -- magnesium -- roll -- was -- next -- to--/
        \
         \--- old --- mans --- desk(End)

Niall then replies to your sentence by picking a random word which can begin the sentence, followed by one of the words which can join onto it selected at random, then one which can join onto it, and so on until the end of sentence marker is reached. Therefore, Niall may reply to your first sentence like so:

The old mans desk.

The more sentences you type in the more words Niall will learn, the more connections it will make and the more original the replies will seem. Replies must be taken with a pinch of salt since the grammar will be anything but perfect. A semi-intelligent version which attempts to learn grammar too, may appear at a later date.

Niall also remember the number of times a particular connection is made in order to weight the replies and make them sound more realistic. For example, if the second sentence you type is:

The old dictaphone was hidden

Niall now knows that the word the joins onto the word old more often than it joins to large. The table above now looks like this:

       /------------<-------------------<----------------<----------\
      {                                                              }
(Start)\---the --- large -- magnesium -- roll -- was -- next -- to -/
        \\                            / /
         === old - mans - desk (End) /  `-hidden (End)
             \                      /
              ----- dictaphone ----/ 

Niall could now reply:

The old dictaphone was next to the old mans desk.

NIALL builds up a vocabulary in this way. If you had typed in the two sentences above, then the output would look like this:

 0: > 2| 1(2)
 1: the 3| 8(2) 2(1)
 2: large 1| 3(1)
 3: magnesium 1| 4(1)
 4: roll 1| 5(1)
 5: was 2| 13(1) 6(1)
 6: next 1| 7(1)
 7: to 1| 1(1)
 8: old 2| 11(1) 9(1)
 9: mans 1| 10(1)
10: desk 1| -1(1)
11: dictaphone 1| 12(1)
12: hidden 1| -1(1)

Word 0 (>) is an empty word which is used to start the sentence. The 2| means that there are 2 possible next words, and the 1(2) means that both those possibilities are word 1 (the). The word -1 (as in 12: hidden 1| -1(1)) means end-of-sentence.

This explanation draws heavily from Matt Peck's original Niall manual.

And thats about all there is to it. Perhaps one day a php-driven one will be created, and you can test it out immediately. Until then, be sure to see the excellent DadaDodo , or the interactive ALICE, which both do similar things.

And of course there's the old hook-it-up-to-irc idea, due any time now...