Break paragraph

Prev Next

Available in Classic and VPC

Identify paragraphs in a post by topic by identifying similarities between sentences.

Request

This section describes the request format. The method and URI are as follows:

Method URI
POST /v1/api-tools/segmentation

Request headers

The following describes the request headers.

Field Required Description
Authorization Required API key for authentication Example: Bearer nv-************
X-NCP-CLOVASTUDIO-REQUEST-ID Optional Request ID
Content-Type Required Request data format
  • application/json

Request body

You can include the following data in the body of your request:

Field Type Required Description
text Array Required Document you want to paragraph break
  • 1-120,000 characters (based on Korean, including spaces)
alpha Float Optional Thresholds value for paragraph breaks
  • Larger values increase the number of paragraph splits
  • -100 | -1.5 - 1.5 (default: 0.0)
    • -100: The model automatically breaks paragraphs with the optimal values
segCnt Integer Optional Number of paragraph breaks
  • -1 (default) | 1 or higher
    • -1: The model automatically performs with optimal values
postProcess Boolean Optional Whether to perform post-processing after paragraph breaks to merge or split paragraphs to the desired length
  • true | false (default)
    • true: Perform post-processing and apply relevant parameters
    • false: No post-processing performed
postProcessMaxSize Integer Optional Maximum number of characters in a paragraph after postProcess post-processing
  • 1 or higher (default: 1000)
postProcessMinSize Integer Optional Minimum number of characters in a paragraph after postProcess post-processing
  • -1 | 0 - postProcessMaxSize value (default: 300)
    • -1: Automatically set to minimum unit

Request example

The request example is as follows:

curl --location --request POST 'https://clovastudio.stream.ntruss.com/v1/api-tools/segmentation' \
--header 'Authorization: Bearer {API Key}' \
--header 'X-NCP-CLOVASTUDIO-REQUEST-ID: {Request ID}' \
--header 'Content-Type: application/json' \
--data '{
          "text": "How can we create a note?\nThere are two ways to do it.\nTap the Add button in the CLOVA Note app to start recording, or import a recording file you have saved on your smartphone to create a note.\nThe notes you create can be viewed not only on the app but also integrated with the CLOVA Note website on your PC.\nOn the CLOVA Note website, you can create a note by importing a saved recording file.\nHow do we use bookmarks?\nIf you tap the Bookmark button in the middle of the recording on the CLOVA Note app page, it will be displayed as shown below, so you can easily find the section you need even after finishing the recording.\nIf you finish a recording, there must be a section of the recording that you want to find again.\nWe provide bookmarks for such moments.\nSo, how do we listen to our recordings?\nSelect the recorded conversation from the created notes and you can listen to the recording again.\nIf there's a mistake in the recording, you can easily correct it by listening to it again and tapping the Edit button.",
          "alpha": -100,
          "segCnt": -1,
          "postProcess": false,
          "postProcessMaxSize": 2000,
          "postProcessMinSize": 500
}'

Response

This section describes the response format.

Response body

The response body includes the following data:

Field Type Required Description
topicSeg Array - Paragraph break results
span Array - Indexes in paragraphed text
  • See where paragraphs are broken
  • [] (default)
inputTokens Integer - Token for the paragraph break target document

Response example

The response example is as follows:

Succeeded

The following is a sample response upon a successful call.

{
    "status": {
        "code": "20000",
        "message": "OK"
    },
    "result": {
        "topicSeg": [
            [
                "How can we create a note?",
                "There are two ways to do it."
            ],
            [
                "Tap the Add button in the CLOVA Note app to start recording, or import a recording file you have saved on your smartphone to create a note.",
                "The notes you create can be viewed not only on the app but also integrated with the CLOVA Note website on your PC.",
                "On the CLOVA Note website, you can create a note by importing a saved recording file."
            ],
            [
                "How do we use bookmarks?",
                "If you tap the Bookmark button in the middle of the recording on the CLOVA Note app page, it will be displayed as shown below, so you can easily find the section you need even after finishing the recording.",
                "If you finish a recording, there must be a section of the recording that you want to find again.",
                "We provide bookmarks for such moments."
            ],
            [
                "So, how do we listen to our recordings?",
                "Select the recorded conversation from the created notes and you can listen to the recording again.",
                "If there's a mistake in the recording, you can easily correct it by listening to it again and tapping the Edit button."
            ]
        ],
        "span": [
            [
                0,
                1
            ],
            [
                2,
                3,
                4
            ],
            [
                5,
                6,
                7,
                8
            ],
            [
                9,
                10,
                11
            ]
        ],
        "inputTokens": 330
    }
}

Failure

The following is a sample response upon a failed call.