public void TestAddingIntentExample() { string intentName = "TestAddingIntentExample"; string intentExample = "Rotate object 30 degrees to the left"; string entityName = "amount"; string entityDirection = "direction"; string entityNameExample = "30 degrees"; string entityDirectionExample = "left"; LuisModel model = new LuisModel(luisAppID, ocpAcimSubscriptionKey); try { model.Modify() .AddIntent(intentName, new List <Entitylabel>() { Entitylabel.Create(intentExample, entityName, entityNameExample), Entitylabel.Create(intentExample, entityDirection, entityDirectionExample), }) .Update(); var intentNames = model.GetIntents().Keys; Assert.IsTrue(intentNames.Contains(intentName)); } finally { model.DeleteIntent(intentName); } }
public static void addEntity(string entityName, int position, int length, List <Entitylabel> labels) { Entitylabel entity = new Entitylabel(); entity.entityName = entityName; entity.startCharIndex = position; entity.endCharIndex = position + length; labels.Add(entity); }