Automated Legal Question and Answering System
I'm trying to implement a web application that will let users define rules and ask questions to see if statements are legal or illegal according to a set of rules. The domains I have in mind would be rules for small communities or clubs.
For example, say a possible rule set contains the rules:
Only cars with valid registration tags may park anywhere indefinitely.
Cars without valid registration tags may only park in a visitor spot for up to 3 days.
And then someone asks "Can I park my Honda here?"
The system would attempt to answer by first following a question and answer tree resembling:
"Is a Honda a car?"
=>Yes
"Does it have a valid registration tag?"
=>Yes
"Yes"
=>No
"Are you parking in a visitor spot?"
=>Yes
"Have you parked in that spot for more than 3 days?"
=>Yes
"No"
=>No
"Yes"
=>No
"No"
=>Define "visitor spot"?
"A visitor spot is a parking spot. A parking spot is spatial rectangular area of asphault with a width of 8 feet and a length of 15 feet with a variation of 1 foot. It has either another parking spot or a curb adjacent to it. It has the words "Visitor" painted on it. It ressembles <img>."
=>Define "parking"?
"Parking is the act of placing a vehicle within the spatial area of a parking spot. The state of a parked image ressembles <img>."
=>Define "valid registration tag"?
"A valid registration tag ressembles <img>"
=>No
"No"
=>Define "car"?
"A car is a 4 wheeled vehicle weighing less than 3 tons."
The user selects an answer at each node, and the system would ask the next question according to an answer until a leaf node is reached, representing a "final" answer.
At each node, the user may ask the system to explain or define terms used in the question. Explanations would be a series of statements containing terms, which themselves could be further explained or defined.
After enough experience is gained, the system could automatically skip certain nodes, such as the first "Is a Honda a car?" when it lear开发者_JAVA技巧ns that in the context of "parking" a "Honda" will always imply a "car".
Although not shown in this tree, some trees may have "Undefined" leaf nodes, representing cases where the rules didn't provide enough coverage to fully create the tree, requiring the question to be redirected to a human expert for clarification or correction of the rules.
The goal would be to define the rules in a database, and then dynamically generate these Q&A trees as needed.
Although the rules and questions shown here are represented as natural language, the initial system would use symbolic logic instead, as doing NLP in addition to this logical parsing would immensely complicate the initial system. The rules may be initially drafted as natural language, but they'd be manually converted to discrete rules by hand before being entered into the system. The questions would be displayed as simple natural language statements, and the answers would be multiple choice.
Does this seem like a practical project? Is there any prior art? I haven't read about anything like this so far, but I'm not sure what search keywords adequately describe this system.
What tools should I use? I'm not sure if I should use decision trees or some sort of expert system for matching questions to rules and narrowing down the scope of the question.
You would need "decision tree" software to generate the rules based upon your target. If you are going open source I would suggest using the "R" package with it's rpart extension. I also suggest you use a text analytics package to begin to classify your documents. "R" also has the tm extension which can help with this. These are some of the open source options. There are also many good options for commercial software.
-Ralph Winters
IBM just spent 3 years and hundreds of people programming a super-computer that could play and win at Jeopardy.
In my opinion, you're not proposing a practical project.
What IBM did and what you're trying on a smaller scale is called semantic processing.
精彩评论