Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule Runner - Create Evidence #140

Open
Ravi-Rao26 opened this issue Nov 28, 2017 · 0 comments
Open

Rule Runner - Create Evidence #140

Ravi-Rao26 opened this issue Nov 28, 2017 · 0 comments

Comments

@Ravi-Rao26
Copy link

Hi,

Trying to get the rule based classifier working but currently unable to do so.

I run the command python ./rules_verifier.py WhatisthePolicyNumberIssued?
I get the output -
Matches for rule is_PolicyNumber

Nothing matched

I run the command python ./iepy_rules_runner.py
Output -
Relations not defined in the rule file.

Here is one sample rule that I have defined in rules.py file, which I have placed in /bin folder of IEPY project & outside the bin folder as well.


from refo import Question, Star, Any, Plus
from iepy.extraction.rules import rule, Token, Pos

Relation = "WhatisPolicyNumberIssued?"

@rule(True)
def is_PolicyNumber(Subject, Object):
"""
POLICY NUMBER:1234
"""
anything = Star(Any())
return Subject + Token(":") + Object + anything


I have loaded one sample corpus document in IEPY database and have also run preprocess.py. I have also done evidence labelling as well.
However if I check the corpus_iedocument table,the token column has this value :-
'COMPANY' 'ABC','POLICY', 'NUMBER', ':', '1234', 'RENEWAL', 'OF', 'POLICY','-','NEW','OWNER', 'NAME' ....

But still the command 'python ./rule_verifier.py WhatisPolicyNumberIssued? gives the output - Nothing matched,

Also can anyone please illustrate the use of rules_verifier.py with create evidence option. How does it work?

Currently seen the operation of the Active Learning core. Once it is trained , for predicting the relations between entities on new unseen text, the text has to be inserted into database and preprocess.py has to be executed. Then if we run the active learning core trained classifier with option --no-questions, then too for this text, it will not predict anything as there are no candidate evidence. Creation of candidate evidence is a manual activity, which is done during training phase where in the defined entities are annotated/labelled.
Here is what I was thinking if the process of creating candidate evidence could be automated through the rules_verifier.py and then run the trained classifer on the annotated set of entities to predict if relation exists or not.

Cheers,
Ravi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant