Package TEES :: Package ExampleBuilders :: Package FeatureBuilders :: Module EVEXFeatureBuilder :: Class EVEXFeatureBuilder
[hide private]

Class EVEXFeatureBuilder

source code

FeatureBuilder.FeatureBuilder --+
                                |
                               EVEXFeatureBuilder

Instance Methods [hide private]
 
__init__(self, featureSet)
This is called, when the ExampleBuilder object is created.
source code
 
initSentence(self, sentenceGraph)
This function is called once for each sentence, before any calls to "buildFeatures".
source code
 
buildEdgeFeatures(self, entity1, entity2, token1, token2, path, sentenceGraph)
This is the main-function for feature generation.
source code

Inherited from FeatureBuilder.FeatureBuilder: getEntityType, getPOSSuperType, getTokenAnnotatedType, getTokenFeatures, normalizeFeatureVector, setFeature, setFeatureVector, setTag

Method Details [hide private]

__init__(self, featureSet)
(Constructor)

source code 

This is called, when the ExampleBuilder object is created.

Parameters:
  • featureSet (Core.IdSet) - The feature ids
Overrides: FeatureBuilder.FeatureBuilder.__init__

initSentence(self, sentenceGraph)

source code 

This function is called once for each sentence, before any calls to "buildFeatures". It should be used to initialize per-sentence data structures.

Parameters:
  • sentenceGraph (Core.SentenceGraph) - a SentenceGraph object providing access to the aligned semantic and syntactic information of the sentence. The underlying XML can also be accessed through this class.

buildEdgeFeatures(self, entity1, entity2, token1, token2, path, sentenceGraph)

source code 

This is the main-function for feature generation. It is called once for each directed entity pair in the sentence.

For defining features, please use the member function "setFeature(self, name, value=1)", derived from the parent class. This ensures features get correctly tagged, if needed.

Parameters:
  • entity1 (cElementTree.Element) - First entity of the candidate edge, an Interaction XML "entity"-element
  • entity2 (cElementTree.Element) - Second entity of the candidate edge, an Interaction XML "entity"-element
  • token1 (cElementTree.Element) - The head token of entity1, an Interaction XML "token"-element
  • token2 (cElementTree.Element) - The head token of entity2, an Interaction XML "token"-element
  • path (list of cElementTree.Elements (when "no_path" style is set, this is always [token1, token2])) - the shortest connecting path of tokens (Interaction XML "token"-elements)
  • sentenceGraph (Core.SentenceGraph) - a SentenceGraph object providing access to the aligned semantic and syntactic information of the sentence. The underlying XML can also be accessed through this class.