Workshop 7 - Using Caspian
The purpose of this workshop is to:
- Use a CBR system.
- Understand some principles components of CBR systems, namely cases,
features, and matching.
- Modify an existing CBR system, by firstly adding cases, then modifying
the feature structure, then modifying the retrieval mechanism.
Part 1, using the existing Caspian case base
- If you can't find Caspian, you can download it from
- First you need to run Caspian. I do this by opening a DOS window, move to the Caspian directory (using cd), and the invoking Caspian with the case file. We're working with the chef2 file provided so I use,
- This brings up the Caspian GUI, which prompts you with 4 options; choose the first option Search for Matching Case. Then choose Stir-Fry, then choose Hot, then choose no ingredients by typing ; then choose use weights, and you should receive the recipe for stir fried tofu.
- You have now retrieved one case. Now a brief explanation of the Chef2 file that describes the case base. As we're going to modify Chef2 eventually, copy it to chef3 and put it in your own directory. You should be able to run Caspian by specifying the full path of the file that you're using so
Alternatively, you can move to the directory where your new file is and specify the full path for Caspian
- Now, open up the chef3 file using wordpad. It's just a text file, and that's all you have to modify. Have a look through it, noting that lines starting with ~ are comments. In particular, look for a few blocks at the end starting with case instance. (You can search for these.) These are the cases that you retrieve. How many are there? Try running the system again and try to retrieve all of the cases? Turn on expansion so you can get the full effect.
Part 2, modifying the Caspian case base
- The Mange_tout case looks like the easiest, so let's try modifying it. Let's make it print out both the ingredients and the vegetable. How would that be done? Change the recipe line to
recipe = [ cook_method 'the' ingredients 'and' vegetable];
- Now run the system so and see that you get both the ingredients you add (possibly nothing) and green_beans.
- Another way to modify the case base is to add a new case. Try adding a new case. I've added a case called taters by simply copying the mange_tout case, changing the method to boil, the vegetable and ingredients to potatoes, and the name of the case to taters.
- Now, let's think about how things are retrieved. We've got three things that are stir-fried (chicken, tofu, and green_beans), and one thing that is boiled (potatoes). If you type in stir_fry and hot, you get the relevant case (tofu), but you get the first case if you type sweet. If you type in bake, you don't get anything. So how does the system match cases? Clearly it matches first on cook_method, and if that doesn't match, it gives up. If it does match it then goes on taste, but if that doesn't match it guesses. It doesn't seem to use the ingredients in matching.
- Look at the beginning of the chef3 file for index. It is currently indexed by cook_method. Change this to taste. Now which do you get first? Try boiled, hot.
- Try adding a new field. (I added cost.) You need to add it both to the definition at the top and the cases at the bottom.
Conclusion You've seen the basics of this CBR system. There are
still several things that we have not looked at such as repair
mechanisms, but we have explored the basics. Caspian is a very simple
system, but it is able to make sophisticated CBR systems. What are
its shortcomings? What would be a good case-based system that you