Package nltk :: Package classify :: Module rte_classify :: Class RTEFeatureExtractor
[hide private]
[frames] | no frames]

type RTEFeatureExtractor

source code

object --+
         |
        RTEFeatureExtractor

This builds a bag of words for both the text and the hypothesis after throwing away some stopwords, then calculates overlap and difference.

Instance Methods [hide private]
 
__init__(self, rtepair, stop=True, lemmatize=False) source code
 
overlap(self, toktype, debug=False)
Compute the overlap between text and hypothesis.
source code
 
hyp_extra(self, toktype, debug=True)
Compute the extraneous material in the hypothesis.
source code
Method Details [hide private]

__init__(self, rtepair, stop=True, lemmatize=False)
(Constructor)

source code 
Parameters:
  • rtepair - a RTEPair from which features should be extracted
  • stop (bool) - if True, stopwords are thrown away.
Overrides: object.__init__

overlap(self, toktype, debug=False)

source code 

Compute the overlap between text and hypothesis.

Parameters:
  • toktype ('ne' or 'word') - distinguish Named Entities from ordinary words

hyp_extra(self, toktype, debug=True)

source code 

Compute the extraneous material in the hypothesis.

Parameters:
  • toktype ('ne' or 'word') - distinguish Named Entities from ordinary words