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 headers.

    HeaderRequiredDescription
    X-NCP-CLOVASTUDIO-API-KEYYAPI key issued when creating the test app
    X-NCP-APIGW-API-KEYYAPI Gateway key issued when creating the test app or service app
    X-NCP-CLOVASTUDIO-REQUEST-IDNRequest ID for each request
    Content-TypeYapplication/json

    Request path parameters

    The following describes the parameters.

    FieldTypeRequiredDescription
    appIdstringYUnique ID of the applicable test app or service app

    Request body

    The following describes the body.

    FieldTypeRequiredDescription
    textsarray[string]YDocument to break paragraphs for
  • 1 - 120,000 characters (based on Korean, including spaces)
  • alphafloatNThe thresholds value for paragraph breaks; Larger values increase the number of paragraph splits
  • -1.5 - 1.5, -100 (The model automatically breaks paragraphs with the best value when you enter -100)
  • Default: 0.0
  • alphafloatNThe thresholds value for paragraph breaks; Larger values increase the number of paragraph splits
  • -1.5 - 1.5, -100 (The model automatically breaks paragraphs with the best value when you enter -100)
  • Default: 0.0
  • segCntintegerNDesired number of paragraph breaks
  • 1 or greater (when set to -1, the model will split it into the optimal number of paragraphs)
  • Default: -1
  • postProcessbooleanNWhether to perform post-processing to merge or split paragraphs to the desired length after performing a paragraph break
  • true: Parameters related to postProcess work
  • false: Parameters related to postProcess don't work (default)
  • postProcessMaxSizeintegerNMaximum number of characters in a string in a paragraph when applying post process module
  • 1 or greater (default: 1000)
  • postProcessMaxSizeintegerNMaximum number of characters in a string in a paragraph when applying post process module
  • 0 - postProcessMaxSize (When -1 is entered, automatically set to minimum unit)
  • Default: 300
  • Request syntax

    The following is a sample syntax.

    curl --location 'https://clovastudio.apigw.ntruss.com/testapp/v1/api-tools/segmentation/{appId}' \
    --header 'X-NCP-CLOVASTUDIO-API-KEY: <X-NCP-CLOVASTUDIO-API-KEY>' \
    --header 'X-NCP-APIGW-API-KEY: <X-NCP-APIGW-API-KEY>' \
    --header 'X-NCP-CLOVASTUDIO-REQUEST-ID: <X-NCP-CLOVASTUDIO-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 body.

    FieldTypeRequiredDescription
    topicSegarray[array[string]]YResults with paragraphs separated by subtopics
    spanarray[array[integer]]NIndex of paragraphed text (to see where paragraphs are broken)
  • Default: []
  • inputTokensintegerYNumber of tokens in a document with paragraph break performed

    Response syntax

    The following is a sample syntax.

    Success

    The following is a sample syntax 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 syntax 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.