Break paragraph
    • PDF

    Break paragraph

    • PDF

    Article summary

    Available in Classic and VPC

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

    Request

    The following describes the request format for the endpoint. The request format is as follows:

    MethodURI
    POST/testapp/v1/api-tools/segmentation/{appId}

    Request headers

    The following describes the request headers.

    FieldRequiredDescription
    X-NCP-CLOVASTUDIO-API-KEYRequiredAPI key issued when creating the test app or service app
    X-NCP-APIGW-API-KEYRequiredAPI Gateway key issued when creating the test app or service app
    X-NCP-CLOVASTUDIO-REQUEST-IDOptionalRequest ID
    Content-TypeRequiredRequest data format
    • application/json

    Request path parameters

    The following describes the request path parameters.

    FieldTypeRequiredDescription
    appIdStringRequiredID of the test app or service app

    Request body

    The following describes the request body.

    FieldTypeRequiredDescription
    textArrayRequiredDocument you want to paragraph break
    • 1 - 120,000 characters (based on Korean, including spaces)
    alphaFloatOptionalThresholds 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
    segCntIntegerOptionalNumber of paragraph breaks
    • -1 (default) | 1 or higher
      • -1: The model automatically performs with optimal values
    postProcessBooleanOptionalWhether 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
    postProcessMaxSizeIntegerOptionalMaximum number of characters in a paragraph after postProcess post-processing
    • 1 or higher (default: 1,000)
    postProcessMinSizeIntegerOptionalMinimum 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 following is a sample request.

    curl --location --request POST 'https://clovastudio.apigw.ntruss.com/testapp/v1/api-tools/segmentation/{appId}' \
    --header 'X-NCP-CLOVASTUDIO-API-KEY: {CLOVA Studio API Key}' \
    --header 'X-NCP-APIGW-API-KEY: {API Gateway 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

    The following describes the response format.

    Response body

    The following describes the response body.

    FieldTypeRequiredDescription
    topicSegArray-Paragraph break results
    spanArray-Indexes in paragraphed text
    • See where paragraphs are broken
    • [] (default)
    inputTokensInteger-Token for the paragraph break target document

    Response example

    The following is a sample example.

    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.


    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.