edu.washington.cs.knowitall.rule.base
Class BaseRuleFactory

java.lang.Object
  extended by edu.washington.cs.knowitall.rule.base.BaseRuleFactory
All Implemented Interfaces:
com.google.common.base.Function<Annotation,List<Rule>>
Direct Known Subclasses:
IARPABaseRuleFactory

public abstract class BaseRuleFactory
extends Object
implements com.google.common.base.Function<Annotation,List<Rule>>


Field Summary
protected static org.slf4j.Logger logger
           
 
Constructor Summary
BaseRuleFactory()
           
 
Method Summary
 List<Rule> apply(Annotation annotation)
           
protected  CaptureConstraint baseRuleArgumentConstraint(Extraction extraction, ExtractionPart part, String value)
          Used in base rule creation.
 List<Rule> create(Annotation annotation)
          Create base rules from the supplied annotation.
 List<Rule> create(Annotation annotation, RelationExtraction extraction)
          Create base rules from the supplied annotation and extraction.
protected  void createConstraints(Annotation annotation, Extraction extraction, ExtractionPart part, List<Constraint> constraints)
          Used in base rule creation.
protected  List<Constraint> createConstraints(Annotation annotation, RelationExtraction extraction)
          Used in base rule creation.
protected  void createOntologicalForm(String name, List<OntologicalForm> forms, List<List<OntologicalFormArgument>> matrix, List<OntologicalFormArgument> arguments)
          Used in base rule creation.
protected  void createOntologicalFormArgumentConstraints(OntologicalRelationArgument argument, ExtractionPart part, Extraction extraction, List<CaptureConstraint> constraints)
          Used in base rule creation.
protected  List<OntologicalForm> createOntologicalForms(Annotation annotation, RelationExtraction extraction)
          Used in base rule creation.
 List<AnnotatedSentence> filter(List<AnnotatedSentence> annotateds)
           
 boolean isLearnable(Annotation annotation)
           
protected  boolean validate(List<OntologicalFormArgument> arguments)
          Returns true if the arguments satisfy the minimum requirements for a base rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.common.base.Function
equals
 

Field Detail

logger

protected static org.slf4j.Logger logger
Constructor Detail

BaseRuleFactory

public BaseRuleFactory()
Method Detail

apply

public List<Rule> apply(Annotation annotation)
Specified by:
apply in interface com.google.common.base.Function<Annotation,List<Rule>>

create

public List<Rule> create(Annotation annotation)
Create base rules from the supplied annotation. There may be multiple if different argument constraints may be specified.

Parameters:
annotation - seed for base rules
Returns:
base rules

validate

protected boolean validate(List<OntologicalFormArgument> arguments)
Returns true if the arguments satisfy the minimum requirements for a base rule.

Parameters:
arguments - arguments to validate
Returns:

create

public List<Rule> create(Annotation annotation,
                         RelationExtraction extraction)
Create base rules from the supplied annotation and extraction. There may be no base rules if the ontological relation cannot be mapped from the supplied extraction.

Parameters:
annotation - seed for base rules
extraction - to apply base rules
Returns:
list of base rules

filter

public List<AnnotatedSentence> filter(List<AnnotatedSentence> annotateds)

isLearnable

public boolean isLearnable(Annotation annotation)

createOntologicalForms

protected List<OntologicalForm> createOntologicalForms(Annotation annotation,
                                                       RelationExtraction extraction)
Used in base rule creation.

Parameters:
annotation -
extraction -
Returns:
ontological forms possible

createOntologicalFormArgumentConstraints

protected void createOntologicalFormArgumentConstraints(OntologicalRelationArgument argument,
                                                        ExtractionPart part,
                                                        Extraction extraction,
                                                        List<CaptureConstraint> constraints)
Used in base rule creation.

Parameters:
argument -
part -
extraction -
constraints -

createConstraints

protected List<Constraint> createConstraints(Annotation annotation,
                                             RelationExtraction extraction)
Used in base rule creation.

Parameters:
annotation -
extraction -
Returns:

createConstraints

protected void createConstraints(Annotation annotation,
                                 Extraction extraction,
                                 ExtractionPart part,
                                 List<Constraint> constraints)
Used in base rule creation. A recursive helper method.

Parameters:
annotation -
extraction -
part - part of the relation
constraints - constructed result

createOntologicalForm

protected void createOntologicalForm(String name,
                                     List<OntologicalForm> forms,
                                     List<List<OntologicalFormArgument>> matrix,
                                     List<OntologicalFormArgument> arguments)
Used in base rule creation.

Parameters:
name -
forms -
matrix -
arguments -

baseRuleArgumentConstraint

protected CaptureConstraint baseRuleArgumentConstraint(Extraction extraction,
                                                       ExtractionPart part,
                                                       String value)
Used in base rule creation.

Parameters:
extraction -
part -
value -
Returns:


Copyright © 2011 University of Washington CSE. All Rights Reserved.