简体   繁体   English

如何访问 Luis 中的实体值

[英]How to access the entity value in Luis

I want to print the value of the entity that is already defined in the Luis portal, I already printed the TopIntent but I need to access the entity and print the value of it我想打印已在 Luis 门户中定义的实体的值,我已经打印了 TopIntent 但我需要访问该实体并打印它的值

As per MS doc :根据MS 文档

You can get entity and subentities, for example:您可以获得实体和子实体,例如:

modelObject = client.model.get_entity(app_id, versionId, modelId)
toppingQuantityId = get_grandchild_id(modelObject, "Toppings", "Quantity")
pizzaQuantityId = get_grandchild_id(modelObject, "Pizza", "Quantity")

If you want to get the prediction from the runtime, for example:如果您想从运行时获取预测,例如:

# Production == slot name
predictionRequest = { "query" : "I want two small pepperoni pizzas with more salsa" }

predictionResponse = clientRuntime.prediction.get_slot_prediction(app_id, "Production", predictionRequest)
print("Top intent: {}".format(predictionResponse.prediction.top_intent))
print("Sentiment: {}".format (predictionResponse.prediction.sentiment))
print("Intents: ")

for intent in predictionResponse.prediction.intents:
    print("\t{}".format (json.dumps (intent)))
print("Entities: {}".format (predictionResponse.prediction.entities))

You can refer to How to extract entity from Microsoft LUIS using python?您可以参考How to extract entity from Microsoft LUIS using python?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Dart 访问数据库中的值? - How to access a value in the database using Dart? LUIS 应用程序和 Botframework 作曲家之间有什么关系? - What is the relationship between LUIS apps and Botframework composer? Bot Framework LUIS 忽略特定单词 - Bot Framework LUIS ignore specific words Flutter - 如何使用 Firebase Auth 在 streambuilder 中访问未来的价值 - Flutter - how to access the value of a future inside a streambuilder, with Firebase Auth Dialogflow 检测意图匹配置信度和实体值选择 - Dialogflow Detect Intent Matching Confidence And Entity Value Selection 带有 LUIS 的 Microsoft Bot Framework 未检测到所有意图 - Microsoft Bot Framework with LUIS not detecting all intents 413请求实体太大如何解决 - How to solve 413 request entity too large 访问 Firebase 实时数据库中的嵌套值 - Access nested value in Firebase Realtime Database 如何从 Node.js 中的 function 访问 Cloud Function 的返回值 Map? - How can I access return value of Map from function in Node.js for Cloud Function? 如何访问扳手中的视图? - How to access a view in spanner?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM