JMegaHal Package

A Java Implementation of MegaHal

Download JMegaHal.jar

Java MegaHal Artificial Intelligence Package

JMegaHal is a basic implementation of MegaHal. You can read more about MegaHal at http://www.megahal.net/

Markov chain sentence generation

JMegaHal generates a 4th-order Markov chain to generate sentences in response to user input. Punctuation style is also replicated in the output from JMegaHal. The higher order ensures that the output makes more sense. Of course, this is dependent on the user input :)

Using JMegaHal in your own Java programs

JMegaHal is supplied as a package. This means you cannot actually run it directly, but it's really easy to integrate it into your own programs. For example, you could very easily make an IRC Bot that "learns" from other people by using both the PircBot framework and the JMegaHal package. Of course, you can also use JMegaHal from within any other application...

JMegaHal is featured in the O'Reilly book IRC Hacks, where you are shown how to build a standalone artificial intelligence IRC bot with PircBot and JMegaHal.

How to use JMegaHal

Using JMegaHal is really simple, so I think the following example should be pretty self explanatory:

import org.jibble.jmegahal.*;

   ....

   JMegaHal hal = new JMegaHal();

   // We need to teach it a few things first...
   hal.add("Hello, my name is Paul.");
   hal.add("This is a sentence.");
   // (The more sentences we add, the more
   //  sense we will get out of it!)

   // Make JMegaHal generate a sentence.
   String sentence1 = hal.getSentence();

   // make JMegaHal generate another sentence,
   // with the word "jibble" in it (if possible).
   String sentence2 = hal.getSentence("jibble");

Artificial Intelligence IRC Bot

I quickly made an IRC bot using PircBot and JMegaHal so people could talk to it on an IRC channel. I fed in the entire contents of my mini-thesis, about 12,000 words to do with graph drawing. My input is shown in bold.

Hello, JMegaHal. Tell me about graph drawing.
Nodes are placed externally (by the user's expected style of drawing an entire document collection).
Are there many straight lines in graphs?
Here, we typically use more than simple straight lines in graphs.
What is the spring embedder?
The first stage of our first spring embedder.
Can you tell me more about the spring embedder?
Tell me more about the desired minimum node separation.
Well, I like nodes that are far enough apart.
The second phase simply attempts to ensure an even distribution of nodes which may cause an initial three-dimensional graph drawing that is far apart.
That sounds good.
Lexical navigation makes use of cost metrics to establish how good a graph G=(N,E) is, where N is the number of times.
You are strange.
What do you do with graph drawing?
I draw pretty layouts.
It is, in fact, quicker to draw the graph.

Licensing

This software product is OSI Certified Open Source Software, available under the GNU General Public License (GPL). Since the GPL may be too restrictive for use in proprietary applications, a commercial license is also provided.

Purchase a commercial license for this software.

 

Search this site

 
Web www.jibble.org

 

Copyright Paul Mutton 2001-2013
http://www.jibble.org/
Feedback welcomed
email

~
Dreamhost
Web Hosting

~
Dreamhost
Web Hosting