Summarize documents
    • PDF

    Summarize documents

    • PDF

    Article summary

    Summarizing documents API

    It is a REST API based on HTTP, which returns the results as a service that summarizes Korean text (documents) of various subjects into 1-2 lines by extracting core sentences.

    Requests

    POST https://naveropenapi.apigw.ntruss.com/text-summary/v1/summarize
    

    Request headers

    Header nameDescription
    X-NCP-APIGW-API-KEY-IDClient ID issued when registering the app
    X-NCP-APIGW-API-KEY-ID:{Client ID}
    X-NCP-APIGW-API-KEYClient secret issued when registering the app
    X-NCP-APIGW-API-KEY:{Client Secret}
    Content-TypeBinary transfer method
    Content-Type: application/json

    Request body

    Field nameRequirement statusTypeDescription
    documentYesDocumentObjectDocument to summarize
    optionYesOptionObjectSummarization option

    DocumentObject

    Field nameRequirement statusTypeDescription
    contentYesString
    titleNoString
    Note

    The sum of content and title fields can be up to 2,000 characters. The body (content) field must have at least one sentence separated by a sentence separator, and the sentence separator treats it as a sentence only when a sentence must be at least 5 words and less than 200 characters.

    OptionObject

    Field nameRequirement statusTypeDescriptionvalue
    languageYesStringLanguage of document* ko: Korean
    * ja: Japanese
    modelNoString- Model to use for summarization,
    -If not specified, use the summarization model for general documents
    * general: summarizes general documents
    * news: summarizes news
    toneNoInt- Change the tone of the summarized results
    - If not specified, maintain the tone of the original text
    - Applicable only when selecting language=ko option
    * 0: Keep the tone of the original text
    * 1: Converts a coda to the polite style.
    <Example> josa-handa → josa-heayo
    * 2: Converts a coda to the honorifics.
    Example) josa-handa → josa-habnida
    * 3: Converts a coda to the noun form.
    <Example> josa-handa → josa-ham
    summaryCountNoInt- The number of sentences in the summarized document
    - If not specified, default value: 3

    Responses

    Response bodies

    Field nameData typeDescription
    summaryStringSummarized document

    Examples

    Request examples (Korean)

    {
      "document": {
        "title": ""200 billion a day," expanding easy remittance market",
        "content": "The usage amount of easy remittance exceeded the daily average of 200 billion won. According to "2019 Electronic Payment Service Usage Status for the First Half" announced on the 17th by the Bank of Korea, the (average) daily usage amount for easy money transfer service during the first half of this year was measured at 200.5 billion KRW, which is a 60.7% increase compared to the second half of the last year. For the same period, the daily average number of uses was 2.18 million, which is a 34.8% increase. In the easy money transfer market, electronic financial business operators and financial institutions that provide prepaid electronic payment service are participating. The electronic financial business operators take up 187.9 billion won of the average daily usage amount, while the financial institutions take up 12.6 billion won. The Bank of Korea analyzed that the usage volume expanded greatly as the competition heated up between companies that provide easy money transfer service, such as KakaoPay and Toss. According to National Policy Committee's congressperson Yu Eui-dong of the Bareunmirae Party, companies that offer prepaid electronic payment service including KakaoPay and Toss spent more than 100 billion won for marketing last year. For the marketing expenditure scale, KakaoPay recorded 49.1 billion won, followed by Viva Republica Inc. (Toss) with 13.4 billion won."
      },
      "option": {
        "language": "ko",
        "model": "news",
        "tone": 2,
        "summaryCount": 3
      }
    }
    

    Response examples (Korean)

    {
        "summary": "The usage amount of easy remittance exceeded the daily average of 200 billion won.\nThe Bank of Korea analysis showed that the usage volume expanded greatly as the competition heated up between companies that provide easy remittance service such as KakaoPay and Toss.\nAccording to National Policy Committee's Yu Euidong of Bareunmirae Party, companies that offer prepaid electronic payment service including KakaoPay and Toss spent more than 100 billion won for marketing last year."
    }
    

    Request examples (Japanese)

    {
      "document": {
        "title": "三菱電機、杉山社長が辞任表明 検査不正で引責",
        "content": "鉄道向け空調機器などで検査不正が発覚した三菱電機の杉山武史社長は2日、東京都内で記者会見し、社長を辞任すると発表した。杉山社長は「多くの方々に多大なるご迷惑とご心配をおかけし、誠に申し訳ございません。複数の品質事案が判明しており、自ら発見、是正できなかったことを深くおわび申し上げます」と陳謝した。\n【図解】三菱電機が行っていた検査偽装の流れ\n同社は外部の弁護士を委員長とする調査委員会を設置。9月に調査結果と再発防止策を公表すると発表した。\n杉山社長は「ガバナンスの強化とよりよい風土の醸成は社長に課せられた重大な使命。2018年の就任以降、現在までの経緯を踏まえ、私がこの任にあることがすべてのステークホルダーにご理解いただけるか何度も自問した。そして結論として、社長を辞任することが適切と判断した」と説明した。\n三菱電機は6月14日、社内調査で不正を把握した。6月29日に毎日新聞などの報道で問題が明らかになったが、記者会見を開いたのは今回が初めて。\n不正検査をしていたのは、鉄道向け製品を製造している長崎製作所(長崎県時津町)。空調機器の冷暖房の機能や省エネ性能、防水などの検査で、顧客との契約とは違う方法で検査したり、検査をせずに架空のデータを成績書に記入したりしていた。"
      },
      "option": {
        "language": "ja",
        "model": "general"
      }
    }
    

    Response examples (Japanese)

    {
        "summary": "鉄道向け空調機器などで検査不正が発覚した三菱電機の杉山武史社長は2日、東京都内で記者会見し、社長を辞任すると発表した。\nそして結論として、社長を辞任することが適切と判断した」と説明した。\n三菱電機は6月14日、社内調査で不正を把握した。"
    }
    

    Error

    Error examples

    {
      "status": 400,
      "error": {
        "errorCode": "E001",
        "message": "Unsupported empty or blank text"
      }
    }
    

    Errors

    HttpStatusCodeErrorCodeErrorMessageDescription
    400E001Unsupported empty or blank textEmpty string or blank character
    400E002Utf-8 encoding errorUTF-8 encoding error
    400E003Text quota ExceededSentences over the standard value
    400E100insufficient valid sentenceInsufficient valid sentence
    400E101Unsupported languageNot ko or ja
    400E102Unsupported modelNot general or news
    400E103Invalid request bodyInvalid request body’s json format or omitting required parameters
    400E415Unsupported media typeContent-type error
    400E900Unexpected errorCase without exception handling (Bad Request)
    500E501Endpoint connection failedEndpoint connection failed
    500E900Unexpected errorError without exception handling (Server Error)

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.