ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
To do this properly there are some small sub-problems to solve first:
extraction of the meaning a natural language sentence
comprehension of the meaning of a statement
When you have invented the positronic brain, I will tell you how to program it.
Seriously though, these are not problems which are well solved in computer science, so I doubt you will find a good solution to the problem you posed. Until then, you need a qualified teacher to do this task fairly.
A cheap and nasty approach might be to see if the student mentions key words which you would expect to see, but this will never be very good. Even more sophisticated statistical word analysis methods suffer from the same problem. Consider the two student responses to the question you provided:
it's a bunch of inter-linked general purpose computation devices.
network machines a network autonomous network interconnection network computer is an of.
Any key-word based system would mark the first as 0, and the second as at least some marks, despite the fact that the seconds is meaningless nonsense, and the first probably deserves at least something.
The point is that computers don't understand the meaning of natural language statements at this time, and if you're trying to judge the validity of a written statement, you're not going to be able to automate that process in any reliable way.
What you can do is re-design the question so that it can be automatically marked. e.g. by making the test multiple-choice. However, this is not going to be suitable for all question types. To judge if it is, you probably need some education expert (which I am certainly not).
I would look into using something like a chatbot for doing the language processing. Some of them are quite good reducing language into basic keyword components and can execute external programs when needed for other functions. I recently was looking at 'charlix' which is probably the best suited for that purpose. It can be used as a system help and system administration tool -it knows about different programs and what they do. Unfortunately it uses java so it may be a little slow. But you could use some other bot program which uses another language like python or one that is wriitten in C++ or C.
I started a couple of months ago working with one calle 'ainebot' which is written in C. Unlike most of the others it does not use the AIML language. Instead it uses a simplified format of AIML. It still achieves most of the functionality avaliable with standard bots, but data files used with other bots must be translated into the aine format. It is much faster than most other bots since it is written in C and instead of having to load huge data files each time it is run, it 'compiles' the data files into a condensed and indexed form. this means it starts immediately. The drawback is that it can't load more data files on the fly like most other bots.
AIML is the best we've got for processing language so far. It is able to break language down into basic parts and recognize similar words or phrases and refer them to the same answer. All of the chatbots can do this pretty well, but their vocabulary and scope of knowledge are pretty general. There are several engines which can be used. These are combined with data files which constitute the personality of the bot.
As I mentined, charlix is a little different in that it has a 'personality' which turns it into a system administration tool which uses natural language instead of exact syntax for commands.
For instance you can ask it: What is kopete? And it will answer telling you what the program does. Then you could tell it something like: Do I have that on my system? It will check to see if it is installed. If not, it might ask you: Would you like to install it? You could say, Yes I'd like that very much. It will then download and install the program for you.
The author has built a pretty complete tool this way, for administering a debian box. He includes the use of many external programs. he also has written a set of aiml data which makes it easy for you to teach the bot new stuff. You can ask it a question and if it doesn't answer correctly you tell it 'wrong' or 'wrong answer' or 'bad answer' and it will then pop up a dialog box which lets you give the correct answer. Using the 'reversed aiml' it will automatically generate many different variant forms of the same question which should be answered with that answer.
To use charlix you need some sort of program D interpreter -that is a java-based aiml interpreter, or you can use libaiml or qaiml. Basically you just install the interpreter and then place the charlix AIML files in the same folder or even replace the standard AIML files completely with the charlix files.
It should give you a good taste of what can be done. It's pretty surprising what can be done.
I've done some work toward doing something similar to what you want. I had the idea to create a help bot before I ran across charlix. I am using the ainebot interpreter as it is written ic C. It doesn't matter so much which engine you use. The trouble it get the data files like you want. Any of the bot personality will provide the basic functions of 'reducing' many statements to a simpler, more direct form. Beyond that you'd be on your own to teach the bot the questions and answers that you want. There are several bots which have the ability to learn.
You might get a taste of what can be done by creating your own online at the pandorabots site.
These techniques are being used in lots of robots to give them somewhat natural language abilities. Your needs are fairly straightforward in that you don't need to give the bot any particular personality and the scope of its' knowledge could be limited to just the subjects and questions you want. Still, it won't be a trivial matter, though you'll find that AIML is pretty easy to write and the hard part of creating rules which deal with variations in grammar has already been done.
YEah, I get an e-mail whenever there's a new posting. I may soon get back to doing some work on this subject myself -I've had to take a few weeks to do some more work on my src2pkg package-making software. If you use regular AIML data files then you'll have a variety of interpreters which can be used.
i have installed rebecca AIML interpreter as an eclipse plugin.
i have used rebecca since it came with an eclipse plugin and i can also program in java.
my question now is:
say a user(client) questions the bot:"retreive the tuples from a restaurants table"
the bot should then retrieve the tuples using an sql query:"select * from restaurants"
of course i have assumed that in my java code i have established a connection to the database server(I am using Java derby network server) using the Derby network client driver and created a database with tuples entered into the restaurants table under the database.
You may also need entries in a reductions.aiml or reducer.aiml file which make RETRIEVE * point to download or lookup or search, etc.
I really recommend that you download the charlix aiml files as it is the most comprehensive that I have seen for branching the aiml files into useful system functions, etc. It even has some functions where it runs Xdialog or zenity to provide dialogs for doing things, such as learning, etc.
You'll soon figure out that much of the utility and funny, hard-to-trace erros come about from the reductions of various ways of saying the same thing. You may need to start pretty much from scratch with these basic aiml data files so that you can focus the functionality, vocabulary and perceived 'personailty' of the bot. I worked for a few days on getting some utility out of some files until my head was like spaghetti... Hopefully you are a little younger than I am and you won't find it so distressing. It does help to start with just a few very short data files if you have trouble getting a feel for the flow of the reductions and referrals that take place.
I hope this helps you get further along. AIMl is used to program lots of robots to give them natural-language capability, so I have no doubt it can do what you want. Just needs a sharp person who can use both left and right sides of the brain...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.