提取关键短语

已完成

关键短语提取是这样一个过程,即评估一个或多个文档的文本,然后围绕文档上下文识别出要点。

关键短语提取最适合大型文档(可分析的最大大小为 5,120 个字符)。

与语言检测一样,使用 REST 接口可以提交一个或多个文档进行分析。

{
    "kind": "KeyPhraseExtraction",
    "parameters": {
        "modelVersion": "latest"
    },
    "analysisInput":{
        "documents":[
            {
              "id": "1",
              "language": "en",
              "text": "You must be the change you wish 
                       to see in the world."
            },
            {
              "id": "2",
              "language": "en",
              "text": "The journey of a thousand miles 
                       begins with a single step."
            }
        ]
    }
}

响应包含在每个文档中检测到的关键短语的列表:


{
    "kind": "KeyPhraseExtractionResults",
    "results": {
    "documents": [   
        {
         "id": "1",
         "keyPhrases": [
           "change",
           "world"
         ],
         "warnings": []
       },
       {
         "id": "2",
         "keyPhrases": [
           "miles",
           "single step",
           "journey"
         ],
         "warnings": []
       }
],
    "errors": [],
    "modelVersion": "2021-06-01"
    }
}