Intelligent Java Applications for the Internet and Intranets
Intelligent Java Applications for the Internet and Intranets
Dateline: 09/09/97
Ever wanted to learn more about various Artificial Intelligence (AI) techniques? Need hands-on programming experience with neural networks, genetic algorithms, expert systems and intelligent agents? Here is a book that will teach you just that. It is written by Mark Watson, an experienced software engineer and writer (he is the author of seven books), with background in the development of intelligent commercial and military applications. He chose Java for the programming examples: it is a modern, freely available, object-oriented language with built-in garbage collector and support for complex data types (arrays, vectors, hash tables) and multithreading which makes it an ideal language for this purpose. Simplified Booch object-modeling notation is used throughout the book to visualize classes, their methods and properties. Reader doesn't have to read this book in a linear fashion: experienced Java programmers can immediately jump to the "interesting" parts. So, let's start reading...
Introduction to AI + Software Libraries
First chapter is devoted to introduction to Artificial Intelligence. It provides a brief history of AI research and a discussion of several interesting projects. It is followed by the description of reusable graphic user interface (GUI) framework used for testing the AI Java classes developed in the book. The purpose of this framework is to make the program examples shorter and easier to read. The code examples throughout the book are very concise and clear, one of the best I have seen, thanks to the author's programming experience and robustness of the Java programming language. This GUI class provides command buttons, scrolling display of text output, one-line text input form and graphics pane with support for line-drawing, plotting rectangles and text overlays. As Java provide excellent support for distributing applications as separate, cooperating programs over local and wide-area networks, a framework for supporting distributed AI (DAI) is developed, based on a few simple classes to support client and server behavior. A set of classes to support flexible hierarchical data structures, frames is also presented. Each frame has one required attribute, name, and other optional data that can consists of a reference to a parent frame and one or more slots, consisting of a slot name and a value. There are several short programs to test client-server communication using frames.
Next chapter starts with the introduction to the theory, implementation and use of backwards error propagation neural networks. Full source code for the three-layer backpropagation neural network is given here, along with the instructions for including these classes in the HTML pages , which is useful for demonstration purposes. More complex, real-life applications, that define their parameters and training data in separate files, are also explained. Genetic algorithms are presented as an efficient way to search large data spaces using principles from population biology. Base class for genetic algorithms (including methods for performing crossover, mutations, sorting and selecting chromosomes based on fitness), mechanism for extending base class, and control mechanism for producing many generations of chromosomes are described in detail.
Natural language processing classes developed in the next chapter use both conceptual dependency theory and some real-world knowledge. Conceptual dependency theory, developed by Roger Schank and Christoper Riesbeck is briefly explained, followed by the source code of the package for natural language processing. And finally... A chapter on AI agents that automate tasks that otherwise we would have to do ourselves. Two types of Java classes for building agents are discussed here: classes for distributed cooperating agents and for data collection agents that automate fetching information from the Web and e-mail servers. Expert systems, one of the oldest and most useful technologies to emerge from AI research in the past years, are introduced in the next chapter. Here you can find rather short, but very useful tutorial for the CLIPS/Jess languages for writing expert systems. The OPS5 language has been widely used for the expert systems developments because of its efficient pattern-matching algorithm. It is also freely available in source form. Researches at NASA reimplemented OPS5 (written in LISP) in the C language, naming it CLIPS. Jess is the implementation of CLIPS in Java, supporting most of its capabilities.
Practical Projects
The remaining of the book is devoted to practical projects. It starts with demonstration of genetic algorithm for evolution of more efficient control functions in a scrolling arcade game. Neural network classes developed in the first part are used to implement a handwriting demonstration program. One of difficulties in using neural networks is preparing training data. It is very important to eliminate conflicting training cases that prevent training process from completing, and frequently training needs to be hand-tuned. Next project uses Java classes to form a toolkit for preprocessing neural network training data. Genetic algorithms are also used to improve the structure of the neural network handwriting recognition program: it is extended to recognize all characters in the alphabet. A program for answering historical questions is based on the NLP classes and frame data structures developed in the earlier chapters. The history database is placed in a separate server program that can run on any machine in the local area network or the Internet. Finally, the last project provides the design and implementation of a complete agent-based information retrieval program for the Internet.
Conclusion...
This book lays out a theoretical foundation for various AI techniques and provides many complete example programs and Java classes and packages that can be used without restriction in compiled form. The code is simple and clear, and the more complex data structures are often used: this is not a book for beginners. More experienced programmers interested in intelligent Java applications will like it: it provides almost everything you need to know to immediately start using AI (especially distributed AI) techniques in your applications. For more information, visit the author's Web site or the publisher, Morgan Kaufmann.