Summarize documents
- Print
- PDF
Summarize documents
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
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 name | Description |
---|---|
X-NCP-APIGW-API-KEY-ID | Client ID issued when registering the appX-NCP-APIGW-API-KEY-ID:{Client ID} |
X-NCP-APIGW-API-KEY | Client secret issued when registering the appX-NCP-APIGW-API-KEY:{Client Secret} |
Content-Type | Binary transfer methodContent-Type: application/json |
Request body
Field name | Requirement status | Type | Description |
---|---|---|---|
document | Yes | DocumentObject | Document to summarize |
option | Yes | OptionObject | Summarization option |
DocumentObject
Field name | Requirement status | Type | Description |
---|---|---|---|
content | Yes | String | |
title | No | String |
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 name | Requirement status | Type | Description | value |
---|---|---|---|---|
language | Yes | String | Language of document | * ko: Korean * ja: Japanese |
model | No | String | - Model to use for summarization, -If not specified, use the summarization model for general documents | * general: summarizes general documents * news: summarizes news |
tone | No | Int | - 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 |
summaryCount | No | Int | - The number of sentences in the summarized document - If not specified, default value: 3 |
Responses
Response bodies
Field name | Data type | Description |
---|---|---|
summary | String | Summarized 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
HttpStatusCode | ErrorCode | ErrorMessage | Description |
---|---|---|---|
400 | E001 | Unsupported empty or blank text | Empty string or blank character |
400 | E002 | Utf-8 encoding error | UTF-8 encoding error |
400 | E003 | Text quota Exceeded | Sentences over the standard value |
400 | E100 | insufficient valid sentence | Insufficient valid sentence |
400 | E101 | Unsupported language | Not ko or ja |
400 | E102 | Unsupported model | Not general or news |
400 | E103 | Invalid request body | Invalid request body’s json format or omitting required parameters |
400 | E415 | Unsupported media type | Content-type error |
400 | E900 | Unexpected error | Case without exception handling (Bad Request) |
500 | E501 | Endpoint connection failed | Endpoint connection failed |
500 | E900 | Unexpected error | Error without exception handling (Server Error) |
Was this article helpful?