def features(self, document):
     """
     document must be a dict of the following format--
         {
             'text': "text str",
         }
     """
     feature_dict = {}
     # Add unigram, bigram features:
     feature_dict.update(self._get_term_features(document))
     # Add politeness strategy features:
     feature_dict.update(get_politeness_strategy_features(document))
     return feature_dict
 def features(self, document):
     """
     document must be a dict of the following format-- 
         {
             'sentences': ["sentence str"],
             'parses': [[dependency parse list]]
         }
     """
     feature_dict = {}
     # Add unigram, bigram features:
     feature_dict.update(self._get_term_features(document))
     # Add politeness strategy features:
     feature_dict.update(get_politeness_strategy_features(document))
     return feature_dict
Example #3
0
 def features(self, document):
     """
     document must be a dict of the following format-- 
         {
             'sentences': ["sentence str"],
             'parses': [[dependency parse list]]
         }
     """
     feature_dict = {}
     # Add unigram, bigram features:
     feature_dict.update(self._get_term_features(document))
     # Add politeness strategy features:
     feature_dict.update(get_politeness_strategy_features(document))
     return feature_dict