in reply to Developing an Expert System/Intelligent Agent for PM?
First, this can be made sufficiently generic that I'd consider developing this as a module rather than specific for PM.
As for how to do it, there's two possible ways. First is messy: assume that every question has no more than N possible keywords, so that when the question is asked, you extract the N most important ones (importance as determined by someone else). Thus, we can then simply use a N dimensional table, each entry being a weighted list (eg a list of hashes) sorted by importance. When the response satisfies the question, the response gets a bit more weight; when it doesn't, it loses some. While this is 'easy' to do, a list with 1000 keywords (reasonable) , and 3 keywords per question requires 1000^3, or a billion storage bins. Not impossible, but still messy.
A better way, but a bit more of trickier programming, would be to use a tree structure; each node would contain a list of responses that contain at least that node's and every parent up to the root of that node's keywords. The children would be stored as a sorted list, more details later. The initial tree would be simply one root and child nodes, one for each keyword, and each keyword knowing what messages it was in.
When a new question is asked, the keywords are extracted into a sorted list from most important to least important. Starting with the children of the root node (in an order, remember), the first keyword is looked for; if found, we go to that child, and start the process again with the next keyword. If the keyword is not found, we go to the next keyword on the list and try again. If we exhaust the list of keywords from the question, then the responses assoicated with the current node are presented to the user (if at the root node, we simply say "nothing found"). Now if we desend to a node with no children, but still have keywords left from the question, we present the responses for that node, and it's parents in order, and then ask the user if the response was helpful or not. If yes, we take the next keyword from the question list, add it as a new node to the current one, and move the response to the new node's list. If no, we take the next keyword from a sorted list from the response that is not in the question keyword list, and do the same. When a new node is created from an existing one, all other responses of the existing one are evaluated as well and moved as appropriate.
Note that the same keyword can appear many times in the tree, and messages will appear multiple times as well.
The keyword importance is important here -- it should be inversely related to the number of responses that all nodes of that keyword (and their children are associated with. That is, less-used keywords are more important than oft-asked ones, such that their questions will be answered first. This re-evaluating can be done periodically (once a day, for example).
New keywords can easily be added by adding that keyword at a very high importance at the top level, with all responses that that keyword is in added to the node's response list. As time progresses, the keyword and responses will be distributed appropriately.
Adding new responses is a bit trickier. A list of keywords from a new response should be generated, and every branch where a keyword from that list should be followed, placing the message in the lowest possible node.
Obvious storage would be an issue, but a straight-forward SQL database would do the job nicely. The requirements should not be as great as for the N-dimensional array system, since it's not expected that every keyword will be in a question with every other keyword.
Note that this is mimicing the "Guess the Animal" game that has persisted from the start of computer programming, where you use a binary tree to distribut knowledge around.
Most of these are just ideas, and I haven't attempted to put anything to code yet, so I'm just airing them to see if they sound reasonable...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Developing an Expert System/Intelligent Agent for PM?
by jynx (Priest) on Jun 16, 2001 at 03:07 UTC |