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

Class GraphKernelFeatureBuilder

source code

FeatureBuilder.FeatureBuilder --+
                                |
                               GraphKernelFeatureBuilder

Instance Methods [hide private]
 
__init__(self, featureSet) source code
 
buildGraphKernelFeatures(self, sentenceGraph, path) source code
 
_matrixToFeatures(self, W, labels)
Linearizes the representation of the graph
source code
 
_prepareMatrix(self, adjacencyMatrix, node_count, dtyp=<type 'numpy.float64'>) source code
 
_getTokenId(self, tokenElement)
Returns the position id of the token
source code
 
_getTokenText(self, path, sentenceGraph, token) source code
 
_buildAdjacencyMatrix(self, sentenceGraph, path, edges, floattype=<type 'numpy.float64'>, directed=True, linearOrderWeight=0.9)
Returns a Numpy-matrix
source code
 
_setAllDependencyWeights(self, sentenceGraph, weights, weight)
All weights are set to the given value
source code
 
_getEdgeList(self, edgeDict) source code
 
_setDependencyWeightsByPath(self, edges, weights, weight)
The weights of all dependencies in specified paths are set to the given value
source code
 
_reduceWeightByDistance(self, sentenceGraph, weights, zeroDistanceThreshold=0.9, reduceFactor=0.5)
Reduces the weight of dependencies based on their distance from the nearest dependency whose weight is >= the threshold.
source code
 
_addPositionTags(self, sentenceGraph, entity1Tokens, entity2Tokens)
Sets a prefix to the tokens ppiText based on their linear order in the sentence.
source code

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

Method Details [hide private]

__init__(self, featureSet)
(Constructor)

source code 
Parameters:
  • featureSet - feature ids
Overrides: FeatureBuilder.FeatureBuilder.__init__
(inherited documentation)