public void SaveReaction(LuisExample example, string action, long _exampleTextId) { string entity_values = ""; foreach (var label in example.EntityLabels) { var value = example.Text.Substring(label.StartCharIndex, (label.EndCharIndex - label.StartCharIndex + 1)) + ","; entity_values += value; } entity_values = entity_values.Trim(','); var model = SynAppsIntentModel.New(); model.SynAppsDeviceId = this.DeviceId; model.Name = example.IntentName; model.Entity = entity_values; model.ReactionBody = "{\"Talk\": \"" + action + "\"}"; model.IsSynAppsLinked = false; model.Save(); if (_exampleTextId > 0) { var m = ConversationHistoryModel.FindById(_exampleTextId); m.ToMessage = action; m.IsSynAppsLinked = false; m.Save(); } }
public void Train(long exampleTextId) { this.Train(); var model = ConversationHistoryModel.FindById(exampleTextId); model.Learned(); }
public void ResetLearning(long _conversationHistoryId) { var model = ConversationHistoryModel.FindById(_conversationHistoryId); if (model != null && model.Status != ConversationStatus.None) { model.Status = ConversationStatus.None; model.Save(); } }
public void DenyTeach(long exampleTextId) { var model = ConversationHistoryModel.FindById(exampleTextId); model.DenyTeach(); }
public void NotificationFinished(long exampleTextId) { NotificationFinished(ConversationHistoryModel.FindById(exampleTextId)); }
public void StartLearning(long exampleTextId) { StartLearning(ConversationHistoryModel.FindById(exampleTextId)); }