示例#1
0
 def transition_features(self):
     data_frame = eli5.format_as_dataframes(
         eli5.explain_weights_sklearn_crfsuite(self.crf))
     return list(
         zip(data_frame['transition_features']['from'],
             data_frame['transition_features']['coef'],
             data_frame['transition_features']['to']))
示例#2
0
    def weight_targets(self):
        data_frame = eli5.format_as_dataframes(
            eli5.explain_weights_sklearn_crfsuite(self.crf, top=2**10000))

        return list(
            zip(data_frame['targets']['target'],
                data_frame['targets']['feature'],
                data_frame['targets']['weight']))
示例#3
0
 def transition_features_to_csv(self):
     data_frame = eli5.format_as_dataframes(
         eli5.explain_weights_sklearn_crfsuite(self.crf))
     data_frame['transition_features'].to_csv(os.path.abspath(
         'server/nlp/data/data_transition_features.csv'))
     return 'ok'
示例#4
0
 def state_features_to_csv(self):
     data_frame = eli5.format_as_dataframes(
         eli5.explain_weights_sklearn_crfsuite(self.crf, top=2**10000))
     data_frame['targets'].to_csv(os.path.abspath(
         'server/nlp/data/data_state_features.csv'))
     return 'ok'