AINLP05 – Extract key phrases
2 mins read

AINLP05 – Extract key phrases

Key phrase extraction is the process of evaluating the text of a document, or documents, and then identifying the main points around the context of the document(s).

Key phrase extraction works best for larger documents (the maximum size that can be analyzed is 5,120 characters).

As with language detection, the REST interface enables you to submit one or more documents for analysis.


Trích xuất cụm từ khóa (Key phrase extraction) là quá trình đánh giá văn bản của một hoặc nhiều tài liệu, sau đó xác định các điểm chính (identifying the main points) xung quanh ngữ cảnh của tài liệu.

Trích xuất cụm từ khóa (Key phrase extraction) hoạt động tốt nhất với các tài liệu lớn hơn (kích thước tối đa có thể được phân tích là 5,120 ký tự).

Giống như việc nhận diện ngôn ngữ (language detection), giao diện REST (the REST interface) cho phép bạn gửi (submit) một hoặc nhiều tài liệu để phân tích (for analysis).

{
    "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."
            }
        ]
    }
}

The response contains a list of key phrases detected in each document:


Phản hồi (The response) chứa danh sách các cụm từ khóa (a list of key phrases) được phát hiện (detected in) trong mỗi tài liệu:

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

Leave a Reply

Your email address will not be published. Required fields are marked *