【问题标题】:Creating LUIS APP Programmatically Python SDK以编程方式创建 LUIS APP Python SDK
【发布时间】:2019-03-11 09:59:10
【问题描述】:

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

意图、话语和实体来自外部数据库。我想以编程方式处理 LUIS APP 的“创建”、“训练”和“发布”,因此,如果创建了一个新的“意图组”,这将在“基础 Luis”和“新子 LUIS”中创建一个基本意图关于新的“意图组”。

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

【问题讨论】:

    标签: python azure-language-understanding azure-cognitive-services


    【解决方案1】:

    您提到的链接中有一个 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),
    )
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多