认知服务开发选项Cognitive Services development options

本文档概述了有助于你完成 Azure 认知服务入门的开发和部署选项。This document provides a high-level overview of development and deployment options to help you get started with Azure Cognitive Services.

Azure 认知服务是基于云的 AI 服务,使开发人员无需深入了解机器学习即可将智能构建到其应用程序和产品中。Azure Cognitive Services are cloud-based AI services that allow developers to build intelligence into their applications and products without deep knowledge of machine learning. 使用认知服务,你可以访问由 Microsoft 构建、训练和更新的可以在你的应用程序中使用的 AI 功能或模型。With Cognitive Services, you have access to AI capabilities or models that are built, trained, and updated by Microsoft - ready to be used in your applications. 在许多情况下,你还可以根据业务需求自定义这些模型。In many cases, you also have the option to customize the models for your business needs.

认知服务分为四个类别:决策、语言、语音和视觉。Cognitive Services are organized into four categories: Decision, Language, Speech, and Vision. 通常,你可以通过 Microsoft 提供的 REST API、客户端库和自定义工具(例如命令行界面)访问这些服务。Typically you would access these services through REST APIs, client libraries, and custom tools (like command-line interfaces) provided by Microsoft. 但是,这只是通向成功的一个路径。However, this is only one path to success. 通过 Azure,你还可以访问若干开发选项,例如:Through Azure, you also have access to several development options, such as:

  • 自动化和集成工具,例如逻辑应用和 Power Automate。Automation and integration tools like Logic Apps and Power Automate.
  • 部署选项,例如 Azure Functions 和应用服务。Deployment options such as Azure Functions and the App Service.
  • 用于安全访问的认知服务 Docker 容器。Cognitive Services Docker containers for secure access.

在我们开始之前,请务必了解认知服务主要用于两个不同的任务。Before we jump in, it's important to know that the Cognitive Services is primarily used for two distinct tasks. 根据要执行的任务,你可以在不同的开发和部署选项中进行选择。Based on the task you want to perform, you have different development and deployment options to choose from.

用于预测和分析的开发选项Development options for prediction and analysis

用于自定义和配置模型的工具与用于调用认知服务的工具不同。The tools that you will use to customize and configure models are different than those that you'll use to call the Cognitive Services. 大多数认知服务都允许你直接发送数据和接收见解,不需要进行任何自定义。Out of the box, most Cognitive Services allow you to send data and receive insights without any customization. 例如:For example:

  • 可以将图像发送到计算机视觉服务,以检测字词和短语或统计帧中的人数You can send an image to the Computer Vision service to detect words and phrases or count the number of people in the frame
  • 可以将音频文件发送到语音服务并获取听录,同时将语音转换为文本You can send an audio file to the Speech service and get transcriptions and translate the speech to text at the same time
  • 可以将 PDF 发送到表单识别器服务,并检测表、单元格以及这些单元格中的文本,获得包含坐标和详细信息的 JSON 输出You can send a PDF to the Form Recognizer service and detect tables, cells, and text inside of those cells, and you get a JSON output with coordinates and details

Azure 提供了各种类型的工具,这些工具适用于不同类型的用户,其中许多工具可用于认知服务。Azure offers a wide range of tools that are designed for different types of users, many of which can be used with Cognitive Services. 设计器驱动的工具是最容易使用的工具,可快速设置和自动运行,但在自定义方面可能有限制。Designer-driven tools are the easiest to use, and are quick to set up and automate, but may have limitations when it comes to customization. 我们的 REST API 和客户端库为用户提供了更多控制和灵活性,但需要更多的工作量、时间和专业知识来构建解决方案。Our REST APIs and client libraries provide users with more control and flexibility, but require more effort, time, and expertise to build a solution. 如果你使用 REST API 和客户端库,则需要熟悉现代编程语言,例如 C#、Java、Python、JavaScript 或其他常用编程语言。If you use REST APIs and client libraries, there is an expectation that you're comfortable working with modern programming languages like C#, Java, Python, JavaScript, or another popular programming language.

让我们看看使用认知服务的各种方式。Let's take a look at the different ways that you can work with the Cognitive Services.

客户端库和 REST APIClient libraries and REST APIs

使用认知服务客户端库和 REST API,你可以直接访问你的服务。Cognitive Services client libraries and REST APIs provide you direct access to your service. 这些工具提供对认知服务及其基线模型的编程访问,并且在许多情况下允许以编程方式自定义模型和解决方案。These tools provide programmatic access to the Cognitive Services, their baseline models, and in many cases allow you to programmatically customize your models and solutions.

  • 目标用户:开发人员和数据科学家Target user(s): Developers and data scientists
  • 优点: 提供最大灵活性,允许从任何语言和环境调用服务。Benefits: Provides the greatest flexibility to call the services from any language and environment.
  • UI:不适用 - 仅限代码UI: N/A - Code only
  • 订阅:Azure 帐户 + 认知服务资源Subscription(s): Azure account + Cognitive Services resources

如果你想要详细了解可用的客户端库和 REST API,请参阅我们的认知服务概述来选择服务,并开始使用我们针对视觉、决策、语言和语音提供的快速入门之一。If you want to learn more about available client libraries and REST APIs, use our Cognitive Services overview to pick and service and get started with one of our quickstarts for vision, decision, language, and speech.

Azure Functions 和 Azure 服务 Web 作业Azure Functions and Azure Service Web Jobs

Azure FunctionsAzure 应用服务 Web 作业都提供了针对开发人员设计的代码优先的集成服务,并且是基于 Azure 应用服务构建的。Azure Functions and Azure App Service Web Jobs both provide code-first integration services designed for developers and are built on Azure App Services. 这些产品提供了用于编写代码的无服务器基础结构。These products provide serverless infrastructure for writing code. 在该代码中,你可以使用我们的客户端库和 REST REST API 来调用服务。Within that code you can make calls to our services using our client libraries and REST APIs.

  • 目标用户:开发人员和数据科学家Target user(s): Developers and data scientists
  • 优点: 无服务器计算服务,可用于运行事件触发的代码。Benefits: Serverless compute service that lets you run event-triggered code.
  • UI:是UI: Yes
  • 订阅:Azure 帐户 + 认知服务资源 + Azure Functions 订阅Subscription(s): Azure account + Cognitive Services resource + Azure Functions subscription

Azure 逻辑应用Azure Logic Apps

Azure 逻辑应用与 Power Automate 共享相同的工作流设计器和连接器,但提供更高级的控制,其中包括与 Visual Studio 和 DevOps 的集成。Azure Logic Apps share the same workflow designer and connectors as Power Automate but provides more advanced and control including integrations with Visual Studio and DevOps. 有了 Power Automate,就可以通过特定于服务的连接器轻松地与认知服务资源集成,这些连接器围绕 API 提供代理或包装器。Power Automate makes it easy to integrate with your cognitive services resources through service-specific connectors that provide a proxy or wrapper around the APIs. 它们与 Power Automate 中提供的连接器相同。These are the same connectors as those available in Power Automate.

  • 目标用户:开发人员、集成人员、IT 专业人员、开发运营人员Target user(s): Developers, integrators, IT pros, DevOps
  • 优点: 设计器优先(声明性)开发模型,在低代码解决方案中提供高级选项和集成Benefits: Designer-first (declarative) development model providing advanced options and integration in a low-code solution
  • UI:是UI: Yes
  • 订阅:Azure 帐户 + 认知服务资源 + 逻辑应用部署Subscription(s): Azure account + Cognitive Services resource + Logic Apps deployment

Power AutomatePower Automate

Power Automate 是 Power Platform 中的一项服务,可帮助你在应用和服务之间创建自动化工作流,无需编写代码。Power automate is a service in the Power Platform that helps you create automated workflows between apps and services without writing code. 我们提供了多个连接器,使你可以轻松地在 Power Automate 解决方案中与认知服务资源进行交互。We offer several connectors to make it easy to interact with your Cognitive Services resource in a Power Automate solution. Power Automate 基于逻辑应用而构建。Power Automate is built on top of Logic Apps.

  • 目标用户:业务用户(分析人员)和 SharePoint 管理员Target user(s): Business users (analysts) and Sharepoint administrators
  • 优点: 只需从桌面记录鼠标点击、击键和复制粘贴步骤,便可自动执行重复的手动任务!Benefits: Automate repetitive manual tasks simply by recording mouse clicks, keystrokes and copy paste steps from your desktop!
  • UI 工具:是 - 仅限 UIUI tools: Yes - UI only
  • 订阅:Azure 帐户 + 认知服务资源 + Power Automate 订阅 + Office 365 订阅Subscription(s): Azure account + Cognitive Services resource + Power Automate Subscription + Office 365 Subscription

AI BuilderAI Builder

AI Builder 是一种 Microsoft Power Platform 功能,可以用来自动执行流程并预测结果以提高业务绩效。AI Builder is a Microsoft Power Platform capability you can use to improve business performance by automating processes and predicting outcomes. AI Builder 通过点击体验将 AI 功能带入你的解决方案。AI builder brings the power of AI to your solutions through a point-and-click experience. 许多认知服务(例如表单识别器、文本分析和计算机视觉)已直接集成在这里,你不需要创建自己的认知服务。Many cognitive services such as Form Recognizer, Text Analytics, and Computer Vision have been directly integrated here and you don't need to create your own Cognitive Services.

  • 目标用户:业务用户(分析人员)和 SharePoint 管理员Target user(s): Business users (analysts) and Sharepoint administrators
  • 优点: 统包式解决方案,通过点击体验引入 AI 功能。Benefits: A turnkey solution that brings the power of AI through a point-and-click experience. 无需编码或数据科学技能。No coding or data science skills required.
  • UI 工具:是 - 仅限 UIUI tools: Yes - UI only
  • 订阅:AI BuilderSubscription(s): AI Builder

持续集成和持续部署Continuous integration and deployment

你可以使用 Azure DevOps 和 GitHub Actions 来管理你的部署。You can use Azure DevOps and GitHub actions to manage your deployments. 在讨论的以下部分中,我们提供了两个 CI/CD 集成示例,用于为语音和语言理解 (LUIS) 服务训练和部署自定义模型。In the section below that discusses, we have two examples of CI/CD integrations to train and deploy custom models for Speech and the Language Understanding (LUIS) service.

  • 目标用户:开发人员、数据科学家和数据工程师Target user(s): Developers, data scientists, and data engineers
  • 优点: 允许你以编程方式持续调整、更新和部署应用程序和模型。Benefits: Allows you to continuously adjust, update, and deploy applications and models programmatically. 当定期使用你的数据来改进和更新语音、视觉、语言和决策的模型时,这有明显的优势。There is significant benefit when regularly using your data to improve and update models for Speech, Vision, Language, and Decision.
  • UI 工具:不适用 - 仅限代码UI tools: N/A - Code only
  • 订阅:Azure 帐户 + 认知服务资源 + GitHub 帐户Subscription(s): Azure account + Cognitive Services resource + GitHub account

用于自定义和配置模型的工具Tools to customize and configure models

当你继续操作,使用认知服务构建应用程序或工作流时,你可能会发现需要自定义该模型以实现所需的性能。As you progress on your journey building an application or workflow with the Cognitive Services, you may find that you need to customize the model to achieve the desired performance. 我们的许多服务都允许你基于预建模型进行构建以满足你的特定业务需求。Many of our services allow you to build on top of the pre-built models to meet your specific business needs. 对于我们的所有可自定义的服务,我们都提供了用于演练流程的 UI 驱动体验,以及用于代码驱动训练的 API。For all our customizable services, we provide both a UI-driven experience for walking through the process as well as APIs for code-driven training. 例如:For example:

  • 你希望训练一个自定义语音识别模型,以小于 3% 的单词错误率 (WER) 来正确识别医学术语You want to train a Custom Speech model to correctly recognize medical terms with a word error rate (WER) below 3%
  • 你希望使用自定义视觉构建一个图像分类器,该分类器能够区分针叶树和落叶树You want to build an image classifier with Custom Vision that can tell the difference between coniferous and deciduous trees
  • 你希望使用你的个人语音数据构建自定义神经语音,以获得改进的自动化客户体验You want to build a custom neural voice with your personal voice data for an improved automated customer experience

用于训练和配置模型的工具与用于调用认知服务的工具不同。The tools that you will use to train and configure models are different than those that you'll use to call the Cognitive Services. 许多情况下,支持自定义的认知服务提供了设计用来帮助你训练、评估和部署模型的门户和 UI 工具。In many cases, Cognitive Services that support customization provide portals and UI tools designed to help you train, evaluate, and deploy models. 让我们快速看一下几个选项:Let's quickly take a look at a few options:

构成要素Pillar 服务Service 自定义 UICustomization UI 快速入门Quickstart
决策Decision 指标顾问Metrics Advisor https://metricsadvisor.chinacloudsites.cn/ 快速入门Quickstart
语言Language 语言理解 (LUIS)Language Understanding (LUIS) https://luis.azure.cn/
语音Speech 自定义语音识别Custom Speech https://speech.microsoft.cn/ 快速入门Quickstart
语音Speech 自定义语音Custom Voice https://speech.microsoft.cn/ 快速入门Quickstart

使用 DevOps 和 GitHub Actions 进行持续集成和交付Continuous integration and delivery with DevOps and GitHub Actions

语言理解和语音服务提供持续集成和持续部署解决方案,这些解决方案由 Azure DevOps 和 GitHub Actions 提供支持。Language Understanding and the Speech service offer continuous integration and continuous deployment solutions that are powered by Azure DevOps and GitHub actions. 这些工具用于对自定义模型进行自动训练、测试和发布管理。These tools are used for automated training, testing, and release management of custom models.

本地容器On-prem containers

许多认知服务可以部署在容器中,供本地访问和使用。Many of the Cognitive Services can be deployed in containers for on-prem access and use. 借助这些容器,你能够灵活地将认知服务移至更接近你的数据的位置,以满足合规性、安全性或其他操作目的。Using these containers gives you the flexibility to bring Cognitive Services closer to your data for compliance, security or other operational reasons. 有关认知服务容器的完整列表,请参阅认知服务的本地容器For a complete list of Cognitive Services containers, see On-prem containers for Cognitive Services.

后续步骤Next steps