AI Personal Learning
and practical guidance

Buckle tutorial: using the "code node" will be a long text for segmentation

In learning to automate the process of generating novels, segmenting long texts and then generating shot scripts in response to the segments is an important part of the work.

Buckle tutorial: the use of "code nodes" will be long text for segmentation-1


 

This method reduces the number of picture images generated, but requires a matching sentence-by-sentence voiceover generation tool. This ensures that the picture and voice are consistent.

A lot of tools to first import the SRT file, in relying on the SRT file in the Chinese version of the time point to generate the screen, so there is noLong text segmentation necessary, just use the text directly to generate audio and SRT for use.

Before for long text segmentation has been using ChatGPT input long text, output CSV format text way. This is not only tired, the output is not too stable, especially when the context is too long. Of course, this approach also has an advantage: it is possible to put theCombine similarly worded text into one paragraphThe

 

Buckle tutorial: using the code node will be long text sentence processing-1

 

Benefits of using buttons:

  1. You can add "Text Segmentation" to subsequent workflows to complete the scripting process in one step. (Not explained in this article)
  2. Code segmentation is more stable and efficient in execution, and invalid characters can be filtered as required.

 

workflow

 

1. Create a workflow and add code nodes

Buckle tutorial: the use of "code nodes" will be long text for segmentation-1

 

Buckle tutorial: the use of "code nodes" will be long text for segmentation-1

 

2. Enter the code

async function main({ params }: { params: { input: string } }): Promise<{ content: string, rows: string[] }> {

    // Check if the params and inputs exist

    const input = params?.input ??? "";

    // Split the input text

    const lines = input.split('\n');

    // Store the processed lines

    const rows: string[] = [];

    // Process each row

    for (let i = 0; i  20) {

            rows.push(line);

        } else if (line.length > 0) {

            // If the current line is less than or equal to 20 and not empty, merge into the previous line (if it exists)

            if (rows.length > 0) {

                rows[rows.length - 1] += ' ' + line;

            } else {

                // If rows is empty (i.e., the first line), add the line directly

                rows.push(line);

            }

        }

    }

    // Return the result object

    return {

        content: input, // return original input content

        rows: rows, // returns the processed rows.

    };

}

Note: Single lines of text will merge and parallelize if they are too short. You can use ChatGPT to add more filtering features, such as filtering special characters.

 

3. Code node complete configuration

Buckle tutorial: the use of "code nodes" will be long text for segmentation-1

 

4. Link to end node

Buckle tutorial: the use of "code nodes" will be long text for segmentation-1

 

5. Create a Bot

Buckle tutorial: the use of "code nodes" will be long text for segmentation-1

 

6. Select Single Agent Mode

Buckle tutorial: the use of "code nodes" will be long text for segmentation-1

 

7. Add the workflow published in step 4

Buckle tutorial: the use of "code nodes" will be long text for segmentation-1

 

8. Copy the output

Buckle tutorial: the use of "code nodes" will be long text for segmentation-1

 

9. randomly find a JOSN to EXCEL method (search for JSON to EXCEL)

Buckle tutorial: the use of "code nodes" will be long text for segmentation-1

 

10. Finally: you will get a formatted EXCEL

Buckle tutorial: the use of "code nodes" will be long text for segmentation-1

 

concluding remarks

In fact, many AI drawing programs have this feature, usually for a fee, but certain programs allow importing full script files to generate images for free.

Subsequent addition of the Generate Screen Cue Words node will result in a more complete screen script EXCEL.

Why don't you make a full workflow? Because the follow-up is unsustainable for fear of paying for it.

AI Easy Learning

The layman's guide to getting started with AI

Help you learn how to utilize AI tools at a low cost and from a zero base.AI, like office software, is an essential skill for everyone. Mastering AI will give you an edge in your job search and half the effort in your future work and studies.

View Details>
May not be reproduced without permission:Chief AI Sharing Circle " Buckle tutorial: using the "code node" will be a long text for segmentation

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish