示例#1
0
        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();
            }
        }
示例#2
0
        public void Train(long exampleTextId)
        {
            this.Train();

            var model = ConversationHistoryModel.FindById(exampleTextId);

            model.Learned();
        }
示例#3
0
        public void ResetLearning(long _conversationHistoryId)
        {
            var model = ConversationHistoryModel.FindById(_conversationHistoryId);

            if (model != null && model.Status != ConversationStatus.None)
            {
                model.Status = ConversationStatus.None;
                model.Save();
            }
        }
示例#4
0
        public void DenyTeach(long exampleTextId)
        {
            var model = ConversationHistoryModel.FindById(exampleTextId);

            model.DenyTeach();
        }
示例#5
0
 public void NotificationFinished(long exampleTextId)
 {
     NotificationFinished(ConversationHistoryModel.FindById(exampleTextId));
 }
示例#6
0
 public void StartLearning(long exampleTextId)
 {
     StartLearning(ConversationHistoryModel.FindById(exampleTextId));
 }