以编程方式创建LUIS APP Python SDK

问题描述 投票:1回答:1

我已经浏览了LUIS文档,我能够训练和发布我的Luis APP,如here所示。在我的ChatBot(Bot Framework v4)中,我使用Dispatcher将Luis分解为各自的组。

Intent,Utterance和Entities来自外部数据库。我想以编程方式处理LUIS APP的“创建”,“训练”和“发布”,这样,如果创建了新的“意图组”,这将在“基础路易斯”和“新儿童LUIS”中创建基本意图关于新的“意图集团”。

虽然该示例显示了培训和发布现有LUIS APP,但它仍未显示如何以编程方式“创建”LUIS APP。

python luis azure-cognitive-services
1个回答
0
投票

在您提到的链接中有一个LUIS应用程序创建示例:

https://github.com/Azure-Samples/cognitive-services-python-sdk-samples/blob/master/samples/language/luis/luis_authoring_samples.py#L29

# Create a LUIS app
default_app_name = "Contoso-{}".format(datetime.datetime.now())
version_id = "0.1"

print("Creating App {}, version {}".format(default_app_name, version_id))

app_id = client.apps.add({
    'name': default_app_name,
    'initial_version_id': version_id,
    'description': "New App created with LUIS Python sample",
    'culture': 'en-us',
})
print("Created app {}".format(app_id))

client在哪里

client = LUISAuthoringClient(
    'https://westus.api.cognitive.microsoft.com',
    CognitiveServicesCredentials(subscription_key),
)
© www.soinside.com 2019 - 2024. All rights reserved.