您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

创建人工审阅 (REST)Create human reviews (REST)

评审存储和显示审阅人,若要评估的内容。Reviews store and display content for human moderators to assess. 当用户完成评审时,结果将发送到指定的回调终结点。When a user completes a review, the results are sent to a specified callback endpoint. 在本指南中,将了解如何设置以使用通过 API 控制台的 REST Api 查看评论。In this guide, you'll learn how to set up reviews using the review REST APIs through the API console. 一旦您了解的 Api 结构,您可以轻松地移植到任何 REST 兼容平台这些调用。Once you understand the structure of the APIs, you can easily port these calls to any REST-compatible platform.

必备组件Prerequisites

  • 登录或在内容审查器上创建一个帐户审阅工具站点。Sign in or create an account on the Content Moderator Review tool site.

创建评审Create a review

若要创建评审,请转到**查看-创建** API 引用页,选择密钥中你所在区域的按钮 (您可以在中找到此终结点 URL 上凭据审阅工具)。To create a review, go to the Review - Create API reference page and select the button for your key region (you can find this in the Endpoint URL on the Credentials page of the Review tool). 这将启动 API 控制台中,您可以轻松地构建和运行的 REST API 调用。This starts the API console, where you can easily construct and run REST API calls.

复习-Get 区域选择

输入 REST 调用参数Enter REST call parameters

输入值teamName,并Ocp Apim 订阅密钥:Enter values for teamName, and Ocp-Apim-Subscription-Key:

  • teamName:您设置时创建的团队 ID 你审阅工具帐户 (在中找到Id评审工具的凭据屏幕上的字段)。teamName: The team ID that you created when you set up your Review tool account (found in the Id field on your Review tool's Credentials screen).
  • Ocp-Apim-Subscription-Key:你的内容审查器密钥。Ocp-Apim-Subscription-Key: Your Content Moderator key. 您可以在上找到此设置选项卡审阅工具You can find this on the Settings tab of the Review tool.

输入评审定义Enter a review definition

编辑请求正文框中输入 JSON 请求包含以下字段:Edit the Request body box to enter the JSON request with the following fields:

  • 元数据:若要返回到你的回调终结点的自定义键 / 值对。Metadata: Custom key-value pairs to be returned to your callback endpoint. 如果该键中定义的短代码审阅工具,它将显示为一个标记。If the key is a short code that is defined in the Review tool, it appears as a tag.
  • 内容:对于图像和视频内容,这是指向内容的 URL 字符串。Content: In the case of Image and Video content, this is a URL string pointing to the content. 对于文本内容,这是实际的文本字符串。For text content, this is the actual text string.
  • ContentId:一个自定义的标识符的字符串。ContentId: A custom identifier string. 此字符串将传递给 API,并通过回调返回。This string is passed to the API and returned through the callback. 它可用于将与审查作业的结果相关联的内部标识符或元数据。It is useful for associating internal identifiers or metadata with the results of a moderation job.
  • CallbackEndpoint:(可选)要评审完成时接收回调信息的 URL。CallbackEndpoint: (Optional) The URL to receive callback information when the review is completed.

默认请求正文演示了的评审可以创建不同类型的示例:The default request body shows examples of the different types of reviews you can create:

[Image]
[
  {
    "Metadata": [
      {
        "Key": "string",
        "Value": "string"
      }
    ],
    "Type": "Image",
    "Content": "<Content Url>",
    "ContentId": "<Your identifier for this content>",
    "CallbackEndpoint": "<Url where you would receive callbacks>"
  }
]
[Text]
[
  {
    "Metadata": [
      {
        "Key": "string",
        "Value": "string"
      }
    ],
    "Type": "Text",
    "Content": "<Your Text Content>",
    "ContentId": "<Your identifier for this content>",
    "CallbackEndpoint": "<Url where you would receive callbacks>"
  }
]
[Video]
[
  {
    "VideoFrames":[
      {
          "Id": "<Frame Id>",
          "Timestamp": "<Frame Timestamp",
          "FrameImage":"<Frame Image URL",
          "Metadata": [
            {
              "Key": "<Key>",
              "Value": "<Value"
            }
          ],
          "ReviewerResultTags": [
          ]
    ], 
    "Metadata": [
      {
        "Key": "string",
        "Value": "string"
      },
      //For encrypted Videos
        {
          "Key": "protectedType",
          "Value": "AES or FairPlay or Widevine or Playready"
        },
        {
          "Key": "authenticationToken",
          "Value": "your viewtoken(In case of Video Indexer AES encryption type, this value is viewtoken from breakdown json)"
        },
      //For FairPlay encrypted type video include certificateUrl as well
        {
          "Key": "certificateUrl",
          "Value": "your certificate url"
        }
    ],
    "Type": "Video",
    "Content": "<Stream Url>",
    "ContentId": "<Your identifier for this content>",
    "CallbackEndpoint": "<Url where you would receive callbacks>",
    [Optional]
    "Timescale": "<Timescale of the video>
  }
]

提交请求Submit your request

选择“发送”。Select Send. 如果操作成功,响应状态200 OK,和响应内容框显示为评审 ID。If the operation succeeds, the Response status is 200 OK, and the Response content box displays an ID for the review. 复制此 ID,然后在以下步骤中使用它。Copy this ID to use in the following steps.

审查 - 创建控制台响应内容框显示审查 ID

检查新评审Examine the new review

在中审阅工具,选择评审 > 映像/文本/ 视频(使用具体取决于哪些内容)。In the Review tool, select Review > Image/Text/Video (depending on what content you used). 应显示已上传的内容,准备好进行人工审阅。The content that you uploaded should appear, ready for human review.

足球的审查工具图像

获取查看详细信息Get review details

若要检索有关现有评审的详细信息,请转到查看-获取API 引用页,选择你所在区域的按钮 (在其中管理你的密钥的区域)。To retrieve details about an existing review, go to the Review - Get API reference page and select the button for your region (the region in which your key is administered).

“工作流 - 获取”区域选择

输入 REST 调用参数,如在上面的部分。Enter the REST call parameters as in the above section. 此步骤中,对于reviewId收到创建评审时的唯一 ID 字符串。For this step, reviewId is the unique ID string you received when you created the review.

审查 - 创建控制台获取结果

选择“发送”。Select Send. 如果操作成功,响应状态200 OK,和响应内容框显示查看详细信息以 JSON 格式,如下所示:If the operation succeeds, the Response status is 200 OK, and the Response content box displays the review details in JSON format, like the following:

{  
  "reviewId":"201712i46950138c61a4740b118a43cac33f434",
  "subTeam":"public",
  "status":"Complete",
  "reviewerResultTags":[  
    {  
      "key":"a",
      "value":"False"
    },
    {  
      "key":"r",
      "value":"True"
    },
    {  
      "key":"sc",
      "value":"True"
    }
  ],
  "createdBy":"<teamname>",
  "metadata":[  
    {  
      "key":"sc",
      "value":"true"
    }
  ],
  "type":"Image",
  "content":"https://reviewcontentprod.blob.core.windows.net/<teamname>/IMG_201712i46950138c61a4740b118a43cac33f434",
  "contentId":"0",
  "callbackEndpoint":"<callbackUrl>"
}

记下响应中的以下字段:Take note of the following fields in the response:

  • statusstatus
  • Reviewerresulttag:这会显示任何标记已手动添加由人工审阅团队 (所示createdBy字段)。reviewerResultTags: This appears if any tags have been manually added by the human review team (shown the createdBy field).
  • metadata:这将显示在查看之前的人工审阅团队所做更改最初添加的标记。metadata: This shows the tags that were initially added in the review, before the human review team made changes.

后续步骤Next steps

在本指南中,您学习了如何创建使用 REST API 的内容审查评论。In this guide, you learned how to create content moderation reviews using the REST API. 接下来,将集成评审到一种端到端的适度性方案,如电子商务审查教程。Next, integrate reviews into an end-to-end moderation scenario, such as the E-commerce moderation tutorial.