if intents is None:
intents = dataset[INTENTS].keys()
self.language = Language.from_iso_code(dataset[LANGUAGE])
self.intent_classifier = SnipsIntentClassifier(
self.config.intent_classifier_config)
self.intent_classifier.fit(dataset)
if self.slot_fillers is None:
self.slot_fillers = dict()
for intent_name in intents:
feature_signatures = crf_features(
dataset, intent_name, self.language,
self.config.crf_slot_filler_config)
self.slot_fillers[intent_name] = CRFSlotFiller(
features_signatures=feature_signatures,
config=self.config.crf_slot_filler_config)
self.slot_fillers[intent_name].fit(dataset, intent_name)
return self
def get_missing_intents(self, dataset, intents_to_fit):
After Change
for intent_name in intents:
// We need to copy the slot filler config as it may be mutated
slot_filler_config = deepcopy(self.config.crf_slot_filler_config)
self.slot_fillers[intent_name] = CRFSlotFiller(slot_filler_config)
self.slot_fillers[intent_name].fit(dataset, intent_name)
return self
def get_missing_intents(self, dataset, intents_to_fit):