def predict_salience(self, event, corpus, feature_set, key, model_events, **kwargs): print "- predicting salience..." sp = SaliencePredictions() sp.predict_salience(event, corpus, feature_set, key, model_events, **kwargs) if not self.check_model_predictions(event, corpus, feature_set, key, model_events, **kwargs): raise Exception("Model prediction failed!")
def check_model_predictions(self, event, corpus, feature_set, key, model_events, **kwargs): sp = SaliencePredictions() coverage = sp.check_coverage(event, corpus, feature_set, key, model_events, **kwargs) return coverage == 1