| |
COMP348 Document Processing and the Semantic Web
Practical, Week 12
Question Classification
The following file contains the rules used in the question
classifier of an early version of AnswerFinder, a question answering
system that we are developing at Macquarie University.
Do the following tasks:
- Examine the rules used in the classifier. Make sure that you
understand the patterns.
- Write a python function
classify(question) that
returns the expected answer type of the question by using the above
rules. The program could follow the following steps:
- Try each pattern of
regexps starting from the first until there is a
match.
- If there is a match:
- Record the question type (the second
item of each element of
regexps)
- If the question type is a key of the
dictionary
answ_types, return the value
associated with the key
- Else return a list with the question type
- Else return a list with the element
unknown.
- Come up with at least 8 questions that would trigger a different
pattern of the list
regexps. For each question, check
if the classification returned is correct. For example, include a
test function in your program that compares the classifications given
by your classifier with your sample solution.
- Come up with at least 5 questions that would be wrongly
classified by the system. For each question, can you come up with a
way to extend the classifier to handle them?
Mark Dras or
|