Text generation device, text generation method, and text generation program

The sentence generation device ensures chapter-to-chapter consistency by using loop prompts to integrate previous sentences into subsequent text generation, addressing the inconsistency issue in existing systems.

JP7817716B1Active Publication Date: 2026-02-19株式会社エキスパート
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2025020346
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2026-02-19
Estimated Expiration
2045-02-10

AI Technical Summary

Technical Problem

Existing text generation systems using large-scale language models often produce inconsistent sentences across chapters due to a lack of focus on maintaining continuity and consistency.

Method used

A sentence generation device that divides text into chapters with headings and subheadings, using loop prompts to incorporate previous chapter content into subsequent prompts, ensuring consistency through a process involving a headline acquisition unit, prompt generation unit, and model interface unit.

Benefits of technology

Generates text that maintains consistency between chapters by incorporating previous sentences into prompts for the large-scale language model, resulting in coherent and connected text across multiple chapters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007817716000001_ABST
    Figure 0007817716000001_ABST
Patent Text Reader

Abstract

To provide a text generation device, a text generation method, and a text generation program for generating a text that can be divided into chapters and can maintain consistency with the preceding and following chapters. [Solution] A sentence generation device 200 that generates output sentences that can be divided into chapters based on M headings, and has: a heading acquisition unit that acquires M headings; a prompt creation unit that, in the process of sequentially generating output sentences from chapter 1 to chapter M based on the M headings acquired by the heading acquisition unit, when generating the output sentence for the Nth chapter (N is M or less), incorporates the output sentences of chapters 1 to (N-1) that have already been generated by a large-scale language generation model, and creates a prompt for generating the output sentence for the Nth chapter while maintaining consistency as a continuation of the output sentences of chapters 1 to (N-1); and a model interface unit that inputs the prompt into the large-scale language generation model and acquires the output sentences from the large-scale language model.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a text generation device, a text generation method, and a text generation program. [Background technology]

[0002] BACKGROUND ART Conventionally, a sentence generation device is known that generates a prompt to be input into a large-scale language model by adding reference information to an input question sentence (see, for example, Patent Document 1).

[0003] Such a sentence generation device has an additional sentence generation unit that generates additional sentences related to an input question sentence based on the input question sentence, with the total number of characters, including the number of characters in the question sentence, not exceeding the limit on the number of characters that can be input to a large-scale language model, and the additional sentence generation unit has a candidate sentence acquisition unit that acquires candidate sentences related to the question sentence, and a sentence adjustment unit that generates the additional sentences by adjusting the candidate sentences acquired by the candidate sentence acquisition unit.

[0004] In such a sentence generation device, when the number of characters in the candidate sentences acquired by the candidate sentence acquisition unit is large, the sentence adjustment unit makes an adjustment such that sentences with a large number of keywords are given priority, so that the number of characters, including the additional sentences, does not exceed the number of characters that can be input to the large-scale language model, thereby adjusting the number of characters to the number that can be input. [Prior art documents] [Patent documents]

[0005] [Patent Document 1] Japanese Patent Application Publication No. 2024-162602 Summary of the Invention [Problem to be solved by the invention]

[0006] However, in the configuration described in Patent Document 1, although the number of characters in the prompt to be input into the large-scale language model is adjusted, there is no particular intention to improve the quality of the sentences generated from the large-scale language model, and there is a problem in that inconsistent sentences may be generated.

[0007] Therefore, an object of the present invention is to provide a text generation device, a text generation method, and a text generation program that generate text that can be divided into chapters and maintains consistency between previous and subsequent chapters. [Means for solving the problem]

[0008] In order to achieve the above object, a sentence generation device according to one aspect of the present invention is a sentence generation device that generates an output sentence that can be divided into chapters into M headings (M is a natural number of 2 or more), a headline acquisition unit that acquires the M headlines; a prompt generation unit that, in the process of sequentially generating output sentences from chapter 1 to chapter M based on the M headings acquired by the heading acquisition unit, when generating an output sentence for the Nth chapter (N is a natural number between 2 and M), incorporates the output sentences of chapters 1 to (N-1) that have already been generated by the large-scale language generation model, and generates a prompt for generating the output sentence for the Nth chapter while maintaining consistency as a continuation of the output sentences of chapters 1 to (N-1); and a model interface unit that inputs the prompt into the large-scale language generation model and obtains an output sentence from the large-scale language model.

[0009] A sentence generation device according to another aspect of the present invention is capable of dividing a sentence into M headings (M is a natural number of 2 or more) into chapters, and each of the M headings has L M Subheadings (L M is a natural number equal to or greater than 1, and is variable depending on M or constant regardless of M), The M headings and the L set for each chapter of the M headings Ma headline acquisition unit for acquiring subheadlines; The L acquired by the headline acquisition unit M Based on the subheadings, the first to the last subheadings M In the process of sequentially generating output sentences corresponding to the contents of each of the subheadings, M If L is 2 or more, the output sentence corresponding to the Nth subheading (N is 2 or more) M a prompt generation unit that, when generating a subheading (a natural number below), takes in output sentences corresponding to the 1st to (N-1)th subheadings that have already been generated by the large-scale language generation model, and generates a prompt for generating an output sentence corresponding to the Nth subheading in parallel for each of the M chapters as a continuation of the output sentences corresponding to the 1st to (N-1)th subheadings; and a model interface unit that inputs the prompt into a large-scale language generation model and obtains an output sentence from the large-scale language generation model. [Effects of the Invention]

[0010] According to the present invention, for a text that can be divided into chapters, it is possible to generate a text that is consistent between the preceding and following chapters. [Brief explanation of the drawings]

[0011] [Figure 1] 1 is a diagram illustrating an example of a sentence generation device and related components according to an embodiment of the present invention. [Figure 2] FIG. 1 is a diagram illustrating an example of a hardware configuration of a sentence generation device according to an embodiment of the present invention. [Figure 3] FIG. 1 is a diagram showing an example of a functional block diagram of a sentence generation device according to an embodiment of the present invention. [Figure 4] FIG. 10 is a process flow diagram for explaining a loop operation by a loop prompt. [Figure 5] FIG. 10 is a diagram illustrating an example of an input receiving unit displayed on the screen of a user terminal. [Figure 6] FIG. 10 is a diagram illustrating a method for creating a loop prompt using variables. [Figure 7]FIG. 10 is a diagram showing an example of a method for connecting a combined variable and input contents. [Figure 8] FIG. 10 illustrates the prompt creation node in execution. [Figure 9] 10A and 10B are diagrams showing examples of states of a progress status display unit; [Figure 10] FIG. 10 is a diagram illustrating an example of using a loop prompt. [Figure 11] FIG. 1 is a diagram for explaining the concept of multiple variables. [Figure 12] 12A and 12B are diagrams for explaining indent division. Fig. 12A shows a multiple variable including two combined variables. Fig. 12B shows a specific example. [Figure 13] FIG. 10 illustrates how multiple variables and loop prompts can be used in combination. [Figure 14] FIG. 10 is a diagram illustrating a method for generating sentences by applying loop prompts to multiple variables. [Figure 15] FIG. 10 is a diagram for explaining the operation of the sentence generation device at the input stage. [Figure 16] 10A and 10B are diagrams illustrating additional operations of an indentation dividing unit. [Figure 17] 10A and 10B are diagrams for explaining a process of dividing an indented table of contents into indents. [Figure 18] FIG. 10 is a diagram for explaining the output of the first layer of indent division. [Figure 19] FIG. 10 is a diagram for explaining the output of the second layer of indentation division. [Figure 20] FIG. 10 is a diagram for explaining a countermeasure when an indented table of contents cannot be created. [Figure 21] FIG. 10 is a diagram illustrating the setting of a loop prompt after indentation division. [Figure 22] FIG. 10 is a diagram showing an example of an operating state when a loop with multiple variables is executed. DETAILED DESCRIPTION OF THE INVENTION

[0012] Hereinafter, embodiments of the present invention will be described with reference to the drawings.

[0013] [Outline of the text generation device] 1 is a diagram showing an example of the overall configuration of a text generation device 200 and related components according to an embodiment of the present invention. The text generation device 200 according to this embodiment is connected to a user terminal 100 via an internet network NE, and is also connected to a large-scale language model (generation AI) 300 via the internet network NE. A prompt is generated by the text generation device 200 based on an input received from a user at the user terminal 100, the generated prompt is input to the large-scale language model 300, and information output by the large-scale language model is output to the user terminal 100 via the text generation device 200.

[0014] The user terminal 100 is a terminal used by a user of the sentence generation device 200, and may be a terminal capable of executing arithmetic processing, such as a general personal computer, a business computer, a tablet, or a smartphone.

[0015] The text generation device 200 according to this embodiment is a device that generates text in response to input of questions, commands, requests, etc. from the user terminal 100. The text generation device 200 according to this embodiment generates text of a length that allows chaptering. It is possible to generate text that is coherent and consistent throughout the entire chapter. The device configuration and functional configuration of the text generation device 200 will be described in detail later.

[0016] Large language models (LLMs) are so-called generative AI, and examples of such large language models include ChatGPT (registered trademark), Gemini (registered trademark), and Claude (registered trademark). Various large language models can be used as long as they are usable.

[0017] Large-scale language models are accessed through an API (Application Programming Interface). While most APIs require payment, free APIs are also becoming available, and they can also be used.

[0018] In the sentence generation device 200 according to this embodiment, various processes are executed by API linking large-scale language models.

[0019] [Hardware configuration of the text generation device] 2 is a diagram showing an example of the hardware configuration of a sentence generation device 200 according to this embodiment. The sentence generation device 200 can be realized by a computing device such as a server, a personal computer, a tablet, a smartphone, etc. For example, the sentence generation device 200 is configured as a server.

[0020] The sentence generation device 200 includes a drive device 201, a storage device 202, a memory device 203, a processor 204, an interface device 205, and a communication device 206, which are interconnected via a bus B.

[0021] The programs or instructions that realize the various functions and processes of the sentence generation device 200 may be recorded on a removable recording medium such as a flash memory or a removable CD-ROM (Compact Disc-Read Only Memory), flash memory, etc. When the recording medium is set in the drive device 201, the programs or instructions are installed from the recording medium into the storage device 202 or memory device 203 via the drive device 201. However, the programs or instructions do not necessarily have to be installed from the recording medium, and may be downloaded from an external device via a network or the like.

[0022] The storage device 202 may be realized by a hard disk drive, etc. The storage device 202 stores installed programs or instructions as well as files, data, etc. used in executing the programs or instructions.

[0023] The memory device 203 may be realized by a random access memory, a static memory, etc. When a program or an instruction is activated, the memory device 203 reads and stores the program, instruction, data, etc. from the storage device 202. The storage device 202, the memory device 203, and the removable recording medium may be collectively referred to as a non-transitory storage medium.

[0024] The processor 204 may be realized by one or more CPUs (Control Processing Units), which may be configured with one or more core processors, GPUs (Graphics Processing Units), processing circuits, etc. The processor 204 executes various functions and processes of the text generation device in accordance with programs and instructions stored in the memory device 203, and data such as parameters required to execute the programs and instructions.

[0025] The interface device 205 is a device for connecting the text generation device 200 to the user terminal 100 and to the large-scale language model 300 .

[0026] The communication device 206 can be realized by various communication circuits or the like for performing wired or wireless communication with an external device, the Internet, a LAN (Local Area Network), a cellular network, or other communication network.

[0027] The above-described hardware configuration is merely an example, and the sentence generation device 200 according to this embodiment may be realized by any other appropriate hardware configuration.

[0028] [Functional blocks of the text generation device] 3 is a diagram showing an example of a functional block diagram of a sentence generation device 200 according to an embodiment of the present invention. The sentence generation device 200 includes a headline acquisition unit 210, a prompt creation unit 230, a model interface unit 250, and a data storage unit 270.

[0029] The heading acquisition unit 210 acquires headings for the sentences. The sentence generation device 200 according to this embodiment is intended to generate long sentences that can be divided into chapters and a table of contents created, rather than short sentences consisting of only a few sentences. Therefore, when generating a sentence, the structure of the entire sentence is determined by headings. The generated output sentences are sentences that can be divided by headings. "Dividable" means that the sentence structure can be divided, and also includes cases where headings are not included as a selection at the time of final output. In other words, it is not essential to include headings in the sentences to be generated, but it is necessary to acquire headings at the input stage. Therefore, the heading acquisition unit 210 is provided to acquire headings.

[0030] The prompt creation unit 230 generates prompts for the large-scale language model 300 to generate sentences. In the sentence generation device 200 according to this embodiment, the prompts are created using headings acquired by the heading acquisition unit 210 as delimiters, and sentences are generated that do not cause inconsistencies between the output sentences of the previous and current chapters. For example, simply inputting headings into the large-scale language model 300 and entering a prompt to create a sentence may result in separate, independent content for each chapter. Specifically, for example, different characters may appear in the previous and next chapters. In the sentence generation device 200 according to this embodiment, the prompt creation unit 230 generates appropriate prompts, generating consistent sentences that do not cause inconsistencies in the characters even when the chapters change. A specific method for creating prompts will be described later. The prompt creation unit 230 is implemented, for example, by cooperation between the processor 204 of FIG. 2 and programs and commands installed in the storage device 202 and memory device 203 by the drive device 201.

[0031] The model interface unit 250 inputs the prompts created by the prompt creation unit 230 into the large-scale language model 300 and acquires output sentences from the large-scale language model 300. The prompts created by the prompt creation unit 230 are created to generate sentences that are consistent from the first chapter to the last chapter of a document. Therefore, even if the document has multiple chapters, the sentences acquired by the model interface unit 250 are consistent from the first chapter to the last chapter, for example, sentences in which the characters are consistent from start to finish. The model interface unit 250 can be realized, for example, by the interface device 205 in FIG. 2.

[0032] The data storage unit 270 stores various data and also functions as a database. The data storage unit 270 is realized, for example, by the storage device 202 or the memory device 253 in FIG. 2. The data storage unit 270 has, for example, an output sentence storage unit 271, a variable storage unit 272, and an execution node storage unit 273. The output sentence storage unit 271 stores the output sentences up to the previous chapter. As will be described in detail later, the text generation device 200 according to this embodiment takes in the output sentences up to the previous chapter and generates a prompt. For this reason, the output sentence storage unit 271 is provided.

[0033] The variable storage unit 272 stores variables used in prompts. As will be described in detail later, the sentence generation device 200 according to this embodiment replaces output sentences in each chapter with variables and incorporates them into prompt creation very efficiently. There are various types of variables, including, for example, a combined variable that replaces a heading, and a multiple variable that replaces a subheading, and since these variables must be stored, the variable storage unit 272 is provided.

[0034] The node storage unit 273 may be required when generating prompts using chain prompts, which will be described later. Prompts may be generated for multiple processing units, and then the entire prompt may be generated by connecting these units in a chain. These processing units may be called execution nodes, and storing these execution nodes may enable more efficient prompt generation using chain prompts, which will be described later. In addition to execution nodes, there are also operation nodes, join nodes, and other execution nodes, and the node storage unit 273 also stores nodes other than execution nodes.

[0035] [Sentence generation method] Next, a sentence generation method realized by the sentence generation device 200 according to this embodiment will be described.

[0036] The sentence generation method according to this embodiment uses a prompt called a loop prompt. A loop prompt is a prompt that can incorporate the content of a sentence that has already been output into the next prompt and execute it. This type of incorporation is made possible by using variables such as combined variables and multiple variables. These variables will be described in more detail below.

[0037] In the loop prompt, the sentences from the previous chapter that have already been output are incorporated into the prompt, generating the sentences for the next chapter while maintaining consistency with the sentences from the previous chapter.

[0038] FIG. 4 is a process flow diagram for explaining the loop operation by the loop prompt.

[0039] In step S10, loop 1 is executed, a prompt is generated, and an output sentence is generated as the output result of loop 1. Specifically, the prompt is generated by prompt generation unit 230 shown in Fig. 3, and model interface unit 250 also shown in Fig. 3 inputs the generated prompt to large-scale language model 300 shown in Fig. 1, and obtains the output result of loop 1 as an output sentence in response to that prompt. Note that the prompt of loop 1 is substantially the same as a prompt that instructs a large-scale language model to generate a general sentence.

[0040] In step S20, Loop 2 is created by prompt creation unit 230, and the prompt for Loop 2 is created while incorporating the output result of Loop 1, which is the past output result. Then, model interface unit 250 inputs the created prompt into large-scale language model 300, and obtains the output sentence, which is the output result of Loop 2, as a response. As a result, the output result of Loop 2 is obtained in a state consistent with the output result of Loop 1.

[0041] In loop 3 of step S30, output sentences from both the output result of loop 1 and the output result of loop 2 are taken in, and a prompt for loop 3 is created by prompt creation unit 230. This prompt is input to large-scale language model 300 by model interface unit 250, and the output result of loop 3 is obtained as an output sentence. In other words, the output result of loop 3 is generated in a form that is consistent with the output results of loop 1 and loop 2 by taking in the output results of loop 1 and loop 2.

[0042] In loop 4 in step S40, a prompt for loop 4 is created incorporating the output results of loop 1, loop 2, and loop 3. Then, the model interface unit 250 inputs the prompt for loop 4 into the large-scale language model 300, and the output result of loop 4 is obtained as an output sentence. The output result of loop 4 is generated taking into account the output results of loop 1, loop 2, and loop 3, and is consistent with them.

[0043] In this way, when creating a prompt to create a sentence for the next chapter, all output sentences from the previous chapter are taken into account to create the prompt. When large-scale language model 300 is made to generate a sentence using this prompt, it is possible to output a sentence that is consistent with the sentences that have already been output.

[0044] Next, an example of how to actually create a loop prompt will be described.

[0045] 5 is a diagram showing an example of an operation screen 211 provided by the writing generation device 200 and displayed on the screen of the user terminal 100 shown in FIG. 1. The writing generation device 200 acquires input information from the operation screen 211 and accepts various operations by the user. Note that hereinafter, the input unit, processing unit, generation unit, etc. shown in a screen-like shape are all elements provided by the writing generation device 200 and displayed on the screen of the user terminal 100.

[0046] The operation screen 211 has an input receiving section 212. The input receiving section 212 also has a variable display section 213, a combined variable selection section 214, and a variable addition / edit button 215.

[0047] The user can add a variable called "chapter name and summary" as an initial input from the input receiving unit 212. That is, the input receiving unit 212 receives the user's initial input of the variable called "chapter name and summary." In Fig. 5, the variable display unit 213 displays the variable called "chapter name and summary" (characters).

[0048] Next, select a combined variable in the combined variable selection section 214, click the add / edit variable button 215, and enter specific details for "chapter name and summary" as variable values. The combined variable selection section 214 may use various selection methods, such as a button format or a checkbox format. Figure 5 shows an example of the button format.

[0049] For example, first, click the add / edit variable button 215 and enter the variable value "Chapter 1: Demons attack the village." Then, "Chapter 1: Demons attack the village" is displayed in the heading display section 216a.

[0050] Similarly, when "Chapter 2: Set out on a journey to defeat the demon," "Chapter 3: Meet friends," and "Chapter 4: Work together with friends to defeat the demon" are sequentially added and input as variable values, "Chapter 2: Set out on a journey to defeat the demon" is displayed in heading display section 216b, "Chapter 3: Meet friends" is displayed in heading display section 216c, and "Chapter 4: Work together with friends to defeat the demon" is displayed in heading display section 216d.

[0051] In this way, a variable with a chaptered structure in which multiple headings are set for one sentence is called a combined variable. This means a variable that combines the headings of chapters 1 to 4. Note that the input receiving unit 212 acquires the headings, and therefore corresponds to the heading acquisition unit 210 in FIG. 3. In this way, the headings may be acquired by input from the user.

[0052] After inputting the heading, the user selects and adds the loop prompt 220a in the node adding section 220.

[0053] 6 is a diagram for explaining a method for creating a loop prompt using variables. The loop prompt is created as the following prompt, for example. ######################################## Please write the main text of {target chapter} in 200 characters following {the text so far} Target chapter=" %%input1%% ” Previous text = " %%loop%% ” ########################################

[0054] In this way, by using the "text up to now" as a variable, the text up to now is taken in as a variable and stored in the output text storage unit 271 in Figure 3. The "target chapter" is also indicated as a variable, and the prompt "Please create the text for {target chapter} in 200 characters following {text up to now}" allows the text of the chapter to be generated this time (= "target chapter") to be generated following all the text up to the previous chapter (= "text up to now").

[0055] In this prompt, by replacing the "target chapter" variable with "%%input1%%" and the "text up to now" variable with "%%loop%%", the variable "%%loop%%" can be used to incorporate all text from up to the previous chapter into the prompt.

[0056] In FIG. 6 , the prompt display unit 231 displays the above-described prompt, and the menu on the right displays "loop" and "target chapter" in the column for question 232, and the replacement code 233 displays the replacement code "%%loop%%" corresponding to the question "loop" and the replacement code "%%input1%%" corresponding to the question "target chapter." The operation column 234 includes "insert" and "delete" buttons, allowing insertion and deletion in the prompt display unit 231. Specifically, pressing the "insert" button on the row for question "loop" allows the user to input the replacement code "%%loop%%," and pressing the "insert" button on the row for question "target chapter" allows the user to insert the replacement code "%%input1%%" into the prompt. These variables are stored in the variable storage unit 272 shown in FIG. 3 .

[0057] FIG. 7 shows an example of how to connect a combined variable and input content. In FIG. 7, the combined variable consisting of the chapter and heading ("Chapter Name and Summary") entered in FIG. 5 is connected to a prompt using the variables described in FIG. 6. As a result, the initial input content of FIG. 5 is input to the variable of the loop prompt described in FIG. 6. Note that the chain prompt function used in the sentence generation device 200 connects partially stored variables and partial processing functions by linking the output and input in a chain-like manner. This is realized by storing partial variables and processing in the data storage unit 270 shown in FIG. 3. The data storage unit 270 in FIG. 3 includes an output statement storage unit 271, a variable storage unit 272, and a node storage unit 273, which store the respective variables and processing. The process is then realized by the processor 204 in FIG. 2 creating the connected prompt and the sentence generation process in cooperation with the model interface unit 250.

[0058] In the sentence generation device 200 according to this embodiment, the output unit 212a of the input receiving unit 212 is connected to the input unit 235a of the prompt creation node 235, and when the overall execution button 217 of the input receiving unit 212 is pressed, a prompt is created for the input content. The model interface unit 250 then inputs the created prompt into the large-scale language model 300, generating a sentence. Note that the prompt creation node 235 creates prompts, and therefore corresponds to the prompt creation unit 230 in FIG. 3. Since it also generates sentences, it also corresponds to the model interface unit 250.

[0059] 8 shows the state in which the prompt creation node 235 is running. In FIG. 8, the execution state display section 235b indicates that the sentence generation process is running.

[0060] 9 is a diagram showing an example of the state of the progress status display unit 251. By selecting a completed loop in the progress status display unit 251, the prompt and output result (output sentence) can be checked. FIG. 9 shows a state in which the processing of loop 1 has been completed and the prompt and output sentence of loop 1 can be checked. The progress status display unit 251 corresponds to the model interface unit 250, as it can acquire and display generated sentences.

[0061] The following is an example of an output statement using a loop prompt: Chapter 1: The village was quiet. Suddenly, a terrifying scream cut through the night, causing the residents to tremble in fear. The trees rustled, and a demon appeared in the village. The demon had glowing red eyes, long horns, and huge hands. The villagers fled in panic, and their homes were ransacked. However, a hero from the village's legend appeared, determined to face the demon. Chapter 2: A hero sets out on a journey to defeat the demons, and he has obtained an ancient map in search of a legendary sword. His journey will be arduous. He must go through deep forests, cross high mountains, and overcome many challenges. Renewing his resolve, he sets out with his childhood friend, Enna, who has a wealth of knowledge of magic and will be of great help to him on his journey. The two pass through the gates of a ruined village and set out on an unknown adventure. All they can rely on is hope. Chapter 3: Meeting Friends On their new journey, the two meet a mysterious boy named Lyle. He was lost in the forest, but he told them he had special powers. Lyle has the ability to communicate with animals, and it is expected that he will be of great help on their journey as a wild storyteller. Enna is impressed by Lyle's powers and suggests that he join her. Both agree, and the three decide to join forces and move forward together. Chapter 4: Work together with your allies to defeat the demons Finally, the heroes arrive at the cave where the demon is hiding. Enna casts a magical barrier, while Lyle summons animals to keep watch. The demon growls threateningly and attacks the heroes, but they calmly deal with it. The heroes wield their legendary swords, Enna casts spells of support, and Lyle works with his fellow heroes to toy with the demon. With their united power, they finally succeed in stopping the demon's movements.

[0062] In this output sentence, the names "Hero," "Enna," and "Ryle" are used consistently throughout Chapters 1 through 4. In other words, the characters are consistent. This is because when generating the sentences for a new chapter, loop prompts that incorporate the content of the previous chapter are used. By using loop prompts, consistency can be maintained across all chapters, even in sentences that are divided into multiple chapters.

[0063] Next, an example of an output sentence when a normal prompt that does not use a loop prompt is input to the large-scale language model 300 is shown below. Chapter 1: The Demon Attacks the Village As night deepens, eerie footsteps begin to be heard coming from somewhere in the village. Trembling with fear, our protagonist, Shoji Yuki, and the other villagers try to find the source of the sound. Suddenly, a huge shadow appears at the entrance to the village. It is a demon with red eyes and sharp fangs. The villagers scream and run, but Yuki alone is determined to stand up to it. Chapter 2: Set out on a journey to defeat the demon Our protagonist, Souta, has resolved to protect the people from the demon that attacked their village, and has decided to set out on a journey. On the day he sets off, he says goodbye to everyone in the village, carrying an old sword and a few provisions. A difficult journey awaits him, but Souta's heart never wavers. His eyes are filled with a firm resolve, and his single-minded desire to defeat the demon and restore safety to the village shines through. Chapter 3: Meeting Friends Lena's heart is filled with both anxiety and anticipation as she sets foot in a new town. Her goal is to solve the mystery hidden on an old map left behind by her former master. While buying fruit at the market, she suddenly sees a boy getting into trouble. Lena instinctively comes to his aid and develops a friendship with the boy, Miharu. Miharu is also a traveler with the same goal. Chapter 4: Work together with your allies to defeat the demons Our hero, Hikaru, and his friends come together to defeat a vicious demon lurking deep in the mountains. They each use their special skills and devise a plan: Hikaru with his swordsmanship, Sakura with her magic, and Takeru with his clever traps. As night falls, they creep towards the demon's lair and wait with bated breath. Finally, when everything is ready, they join forces to face the demon.

[0064] In the above sentence, "protagonist Souta" appears in Chapter 2, but becomes "Rena" in Chapter 3, and then becomes "protagonist Hikaru" again in Chapter 4, resulting in an inconsistent sentence. Also, "Miharu" who appeared in Chapter 3 is no longer there in Chapter 4, and new characters "Sakura" and "Takeru" have appeared. In other words, the names of characters that appeared in the previous chapter are not reflected in the next chapter. In this way, with a normal prompt that does not use a loop prompt, the sentence is generated without reflecting the previous output results, resulting in the phenomenon of the protagonist's name and format changing with each combined variable.

[0065] Next, an example of how to use loop prompts will be described.

[0066] FIG. 10 is a diagram illustrating an example of using loop prompts. In FIG. 10, an example of creating a blog post on the topic of "How to use ChatGPT" is described. The screen and execution nodes shown in FIG. 10 are provided by the text generation device 200 and are all displayed on the screen of the user terminal 100. Furthermore, the above-mentioned chain prompt function partially configures variables and execution nodes, stores them in the variable storage unit 272 and execution node storage unit 273 of the data storage unit 270, and performs a series of processes by connecting inputs and outputs.

[0067] First, the input receiving unit 221 receives a blog theme setting from the user. In this example, an input value of "How to use ChatGPT" is obtained for a variable called "blog theme." This sets the theme as "How to use ChatGPT."

[0068] Next, the table of contents creation unit 222 executes a prompt process to ask the user to provide three bulleted table of contents for writing a blog post about "How to use ChatGPT," and generates three tables of contents. In this way, the table of contents may be generated and acquired from the information about the "blog topic" through the prompt process.

[0069] For example, the following three tables of contents are created in table of contents creation unit 222. Note that table of contents creation unit 222 acquires headings, and therefore corresponds to heading acquisition unit 210 in FIG. What is ChatGPT? How to use ChatGPT effectively ChatGPT application examples

[0070] After this, the three tables of contents are input to the splitting processor 236, where they are itemized and converted into a combined variable consisting of three headings (chapters). When the table of contents is generated by the table of contents creation unit 222, it is not yet treated as a heading-like variable. In other words, it is simply in the state of three outputs from the table of contents creation unit 222. In the splitting processor 236, splitting processing is performed, and the top three headings are treated as combined variables. In other words, the three headings are now regarded as variables.

[0071] The text generation unit 237 uses a loop prompt as a combined variable to create a coherent sentence for each chapter. The prompt at this time is, for example, as follows: ######################################## Please write the main text of {target chapter} in 200 characters following {the text so far} Target chapter=" %%input1%% ” Previous text = " %%loop%% ” ########################################

[0072] By applying this loop prompt to the three headings, text is generated that is consistent across chapters 1 to 3 for the three headings, "What is ChatGPT?", "Effective Use of ChatGPT," and "Application Examples of ChatGPT." Specifically, after a sentence is generated for "What is ChatGPT?", the sentence "Effective Use of ChatGPT" is generated as an output sentence based on this output sentence. Next, the sentence "Application Examples of ChatGPT" is generated as an output sentence based on the sentences for "What is ChatGPT?" and "Effective Use of ChatGPT." This allows for the generation of text that maintains consistency across the three chapters.

[0073] The segmentation processing unit 236 and the text generation unit 237 create prompts and input the prompts into the large-scale language model 300 to obtain consistent sentences, and therefore correspond to the prompt creation unit 230 and the model interface unit 250 in Figure 3.

[0074] Up to FIG. 10, the basic configuration and operation of the sentence generation device 200 utilizing loop prompts have been explained. Now, multiple variables having a hierarchical structure and an indent structure will be explained.

[0075] Fig. 11 is a diagram for explaining the concept of multiple variables, showing the relationship between variables, combined variables, and multiple variables.

[0076] As shown in Figure 11, one multiple variable contains multiple combined variables. This will be explained in more detail starting from the left side of Figure 11.

[0077] A variable is a value indicated by a substitution code such as %%input1%%, and is a value that can change depending on the theme.

[0078] For example, in the example in Figure 10, "Blog theme" is the variable = "%%input1%%", and "How to use ChatGPT" is the value entered into the variable.

[0079] Then, multiple variables are set, and together they form a combined variable. In the example in Figure 10, the three headings "What is ChatGPT?", "Effective Use of ChatGPT", and "Application Examples of ChatGPT" are variables, and together they form a combined variable.

[0080] A multiple variable is used when it contains multiple combined variables. In the example of Figure 10, if there are three combined variables, "What is ChatGPT?", "Effective Uses of ChatGPT", and "Application Examples of ChatGPT", and if subheadings are created for each of them, it will become a multiple variable.

[0081] Multiple variables can be created by performing a process called indent splitting. First, we will explain the indent structure.

[0082] The indented structure means the following hierarchical structure. 1. Headline Heading Description 1-1. Subheading Subheading explanation 1-2. Subheadings Subheading explanation 2. Heading Heading Description 2-1. Subheadings Subheading explanation 2-2. Subheadings Subheading explanation

[0083] In this way, an indented structure is a two-level format in which information is indented in stages to visually show the hierarchical relationship between information. In the example above, the hierarchy is as follows: First level: "1." "2." Second level: "1-1.", "1-2.", "2-1.", "2-2."

[0084] Examples of how to use the indent structure include the following: · Creating a table of contents for a book ·Create a project plan ·Structure of learning materials

[0085] Indentation may be done using, for example, step-by-step numeral notation using "- (hyphen)" as in the example above.

[0086] In addition, you can specify the output format in the prompt, and when splitting the indent to create an indent structure, you must specify the output format as this indent structure. The headings and subheadings for the indent structure can be obtained by accepting input from the user, or they can be created and obtained by creating a prompt from the theme "How to use ChattGPT."

[0087] Figure 12 is a diagram for explaining indent splitting. Figure 12(a) shows a state of multiple variables including two combined variables. Indent splitting refers to splitting a two-level indent structure into multiple variables.

[0088] Figure 12(b) shows a specific example. For example, if the theme is types of generative AI, the main headings could be "1. Text generation AI" and "2. Image generation AI," dividing the chapters into text and images.

[0089] Furthermore, there are two types of "1. Text Generation AI": "1-1. ChatGPT" and "1-2. Gemini." These correspond to subheadings at the second level. Similarly, there are two types of "2. Image Generation AI": "2-1. DALL-E (registered trademark)" and "2-2. Mdjourney (registered trademark)." These also correspond to subheadings at the second level. Note that subheadings at the second level are generally the "sections" below the "chapters" in a text.

[0090] This division allows the data to be presented like a hierarchical list, making it easier to manage. In other words, indentation division divides the headings and subheadings into a two-level indentation structure, creating chunks of data that are easier to manage and use, making subsequent data processing easier and more efficient.

[0091] Figure 13 illustrates how multiple variables and loop prompts can be used in combination. Consider the following prompt: ######################################## Write a {section} sentence. Chapter 1 Combined Variables Sections = "Introduction", "Self-introduction", "Family Composition" Chapter 2 Combined Variables Clauses = "Occupation", "Skills", "Experience" ########################################

[0092] Here, a variable called "section" is set in the combined variable for Chapter 1, and the input values ​​are set to "Introduction," "Self-introduction," and "Family Composition." In this case, the text for the "Introduction" section is written first, followed by a text about "Self-introduction," and then a text about "Family Composition."

[0093] Similarly, a variable called "section" is set in the combined variables of Chapter 2, and values ​​such as "occupation," "skill," and "career" are input. In this case, too, the sentence about "occupation" is written first, then the sentence about "skill" is generated, and then the sentence about "career" is generated. In this way, the sentences for the sections can be automatically generated sequentially in each of Chapters 1 and 2.

[0094] FIG. 14 is a diagram for explaining a method of generating sentences by applying loop prompts to multiple variables.

[0095] As shown in Figure 14, loop prompts can be applied in both Chapter 1 and Chapter 2. This is parallel execution of loop prompts at the first level, allowing for efficient sentence generation for texts with multiple chapters.

[0096] Moreover, in Chapter 1, after generating the "Introduction" sentence, the "Self-introduction" sentence is generated to follow the output sentence of the "Introduction", and then the "Family Composition" sentence is generated to follow the "Introduction" and "Self-introduction" sentences, so it is possible to generate sentences that are consistent within Chapter 1. In this case, the prompts explained in Figures 6 and 10 can be applied by changing them into clauses.

[0097] For example, you can create a prompt like this: ######################################## Please write the main text of {target section} in 200 characters following {the text so far} target_clause=" %%input1%% ” Previous text = " %%loop%% ” ########################################

[0098] Similarly, in Chapter 2, after generating the "occupation" sentence, the "skill" sentence can be generated to follow the "occupation" sentence, and then the "career" sentence can be generated to follow the "occupation" and "skill" sentences, thereby creating consistent sentences.

[0099] In this way, by executing the loop prompt for each chapter in the first level, it is possible to generate consistent sentences in each chapter in parallel, enabling efficient sentence generation in a short amount of time.

[0100] Next, an example will be described in which an indent division unit is provided in the sentence generation device 200 and a prompt for generating a blog sentence is created.

[0101] 15 is a diagram for explaining the input stage operation of the sentence generation device 200. Note that the same elements as those explained so far are given the same reference numerals, and their explanation will be omitted.

[0102] 15 shows an input receiving unit 221 and a table of contents creating unit 222. These are contents that are displayed on the screen of the user terminal 100. The input receiving unit 221 receives input of the blog theme. In this embodiment, an example will be described in which the blog theme is "How to use ChatGPT."

[0103] When the input receiving unit 221 of the sentence generation device 200 receives "How to use ChatGPT" as a value to be assigned to a variable, the table of contents creating unit 222 creates a table of contents with an indented structure. The table of contents creating unit 222 can create not only a table of contents of combined variables but also a table of contents with an indented structure. The prompt for creating a table of contents with an indented structure may be, for example, as follows: ######################################## #Execution instructions Table of contents for blog posts on {topic} Please refer to [#Output format] when exporting. theme=" %%input1%% ” #Output format: 1. Headline Heading Description 1-1. Subheading Subheading explanation 1-2. Subheadings Subheading explanation 2. Heading Heading Description 2-1. Subheadings Subheading explanation 2-2. Subheadings Subheading explanation 3. Heading Heading Description 3-1. Subheading Subheading explanation 3-2. Subheadings Subheading explanation #supplement: -Do not repeat instructions. -Don't self-assess. -Please do not write any unnecessary actions, conclusions or summaries that deviate from [#writing rules]. ########################################

[0104] These prompts generate an indented table of contents, which is then split into data by indentation to create a hierarchical structure, making it possible to apply loop prompts.

[0105] 16 is a diagram showing the adding operation of the indent splitting section. From the node addition menu 222a, "indent splitting" is selected and added to perform the indent splitting process as the next data operation.

[0106] 17 is a diagram for explaining the settings and processing for indent-splitting an indented table of contents. The table of contents created by the table of contents creation unit 222 is input to the indent splitting unit 238. Then, the table of contents with the indented structure is indent-split. The indent splitting unit 238 analyzes the data received from the table of contents creation unit 222 and performs indent splitting. Specifically, as shown in the "Output Result" on the right side of the indent splitting unit 238, it groups and splits "1. Heading 1" to "3. Heading 3" and "Explanation 1" to "Explanation 3" at the first level, and further groups and splits "1-1. Subheading 1-1" to "3-2. Subheading 3-2" and "Explanation 1-1" to "Explanation 3-2" at the second level.

[0107] Fig. 18 is a diagram for explaining the output of the first layer of indent division. Fig. 18 shows a table of contents 223 including headings and subheadings with an indent structure. The table of contents 223 includes headings 1 to 3 and subheadings 1-1, 1-2, 2-1, 2-2, 3-1, and 3-2.

[0108] In Figure 18, the number of subheadings in each of the headings 1 to 3 is two, but this does not necessarily have to be the same for each heading.The number of subheadings can be set differently for each chapter, such as one chapter having three subheadings and another chapter having two subheadings.

[0109] When the table of contents 223 with an indent structure is input to the indent splitter 238, the indent splitter 238 splits and outputs a heading 239 including "Heading 1" to "Heading 3" at the first level, and an explanation 240 including "Explanation 1" to "Explanation 3" at the first level. In this way, outputting data blocks with the same attributes, such as a heading at the first level and an explanation at the first level, has the advantage of making subsequent processing easier.

[0110] The explanations are explanations of each heading, and are like subtitles that supplement the titles.

[0111] The first-level heading 239 output from the indent division unit 238 includes headings 1 to 3. Similarly, the first-level explanation output from the indent division unit 238 includes all of explanations 1 to 3 for headings 1 to 3. In this way, the indent division unit 238 divides the first-level headings and explanations by attribute and outputs them.

[0112] As can be seen from the first layer heading 239 and the first layer description 240, the output of the first layer is output as a combined variable.

[0113] 19 is a diagram for explaining the output of the second layer of indent division. As in FIG. 18, the table of contents 223 with an indent structure is input to the indent division unit 238, which then performs text analysis to divide the indents.

[0114] In Figure 19, the indentation division unit 238 outputs a second-level heading 241 and a second-level explanation 242. The second-level heading 241 refers to a subheading. When outputting the second-level heading 241, subheading 1-1, subheading 1-2, subheading 2-1, subheading 2-2, subheading 3-1, and subheading 3-2 are output as a block of data.

[0115] Furthermore, the output of the second layer explanation 242 is explanation 1-1, explanation 1-2, explanation 2-1, explanation 2-2, explanation 3-1, and explanation 3-2. In this way, by outputting the second layer data as data chunks according to attributes, subsequent data processing becomes easier.

[0116] As can be seen from the second layer heading 241 and second layer explanation 242, the output of the second layer is output as multiple variables. Also, as can be seen from Figures 18 and 19, the output section of the first layer and the output section of the second layer are different, and the output sections of the first layer heading and explanation are also different. The output sections of the second layer heading (subheading) and explanation are also different.

[0117] FIG. 20 is a diagram for explaining a countermeasure when the table of contents 223 with an indented structure cannot be generated in the processing of the text generation device 200 according to this embodiment.

[0118] 20, there are provided an input receiving unit 221, a table of contents generating unit 222, an indent shaping unit 224, and an indent dividing unit 238. If the table of contents output by the table of contents generating unit 222 does not have an indent structure, it is advisable to arrange the indent shaping unit 224 after the table of contents generating unit 222.

[0119] The indent formatting section 224 is provided before the indent dividing section 238, and the table of contents that could not be output as an indent structure by the table of contents generating section 222 is formatted into an indent structure in the indent formatting section.

[0120] For example, the indent formatting unit 224 formats the table of contents into an indent structure using the following normal prompt (a prompt that is not a loop prompt). ######################################## #Execution instructions: [Table of contents with incorrect numbering] Please refer to [Output format] and re-format it before outputting. Please correct any mistakes in the indentation structure. Do not change the content. #information: Table of contents with incorrect numbering=" %%input1%% ” #Output format: 1. Headline Heading Description 1-1. Subheading Subheading explanation 1-2. Subheadings Subheading explanation 2. Heading Heading Description 2-1. Subheadings Subheading explanation 2-2. Subheadings Subheading explanation 3. Heading Heading Description 3-1. Subheading Subheading explanation 3-2. Subheadings Subheading explanation #supplement: There is no need to recheck the instructions. No conclusion or summary is necessary. No self-assessment is required. Please strictly adhere to the format of [Output format]. ########################################

[0121] In this way, if splitting the indents does not work well, you can simply use the normal prompt processing to fix the indent structure of the table of contents.

[0122] Next, a method for applying loop prompts to the output of the indentation splitter 238 will be described.

[0123] 21 is a diagram for explaining the setting of a loop prompt after indentation division. A loop prompt is applied to the subheadings at the second level after indentation division, i.e., to the sections. To achieve this, a loop prompt creation unit 243 is provided and connected to the second-level output unit of the indentation division unit 238.

[0124] In the loop prompt generator 243, for example, the following prompt is generated. ######################################## #Execution instructions Article body on {topic} The contents of the article {relevant part} as a continuation of {previous article} Please export according to {output format}. theme=" %%input1%% ” Previous articles=" %%loop%% ” #Output format: ##Title of {relevant part} Please enter the text you created ########################################

[0125] Here, "theme" means the first level heading, and "relevant part" means the second level subheading, and these are input as variables. "Previous articles" is the previous text in the same chapter, and is a prompt that takes in the previous output text to generate. This variable is %%loop%%, which functions as a loop prompt.

[0126] Next, the operation state when a loop with multiple variables is executed will be described.

[0127] FIG. 22 shows an example of the operating state when a loop with multiple variables is executed. In FIG. 22, a progress screen 252 is shown, which indicates the progress of the loop prompt. In the progress screen, the first line shows Loop 1-1, Loop 1-2, and the final connection; the second line shows Loop 2-1, Loop 2-2, and the final connection; the third line shows Loop 3-1, Loop 3-2, and the final connection; the fourth line shows Loop 4-1, Loop 4-2, and the final connection; and the fifth line shows Loop 5-1, Loop 5-2, and the final connection, indicating that five loops are running. These five loops operate independently and are not affected by the progress of other loops. In other words, each loop executes its own processing independently within a chapter.

[0128] For example, creating Loop 1-2 involves checking Loop 1-1 before executing it. This is because it references previous articles. Similarly, creating Loop 2-2 involves checking Loop 2-1 before executing it. On the other hand, Loop 2-1 is executed without checking Loop 1-1 or Loop 1-2 of the previous chapter. Note that while the final combining is performed for each chapter, a process of combining all the completed sentences of each chapter can also be performed, and a prompt to perform such a final combining process is generated as needed.

[0129] The process of performing the final join can be performed, for example, by creating a join node, creating "Input 1," "Input 2," and "Input 3" within the join node, and generating a prompt that outputs the chapter heading to "Input 1," the chapter explanation to "Input 2," and the main text (the sentence in which each section is joined) to "Input 3." Specifically, for example, the output of "First Layer - Heading" from the indent splitter 238 shown in Fig. 21 can be connected to "Input 1" of the join node, the output of "First Layer - Explanation" from the indent splitter 238 can be connected to "Input 2" of the join node, and the output from "Normal Output" of the loop prompt creator 243 can be connected to "Input 3" of the join node.

[0130] The prompt at the join node is, for example, as follows: By executing this, a sentence in which all the sentences are joined together will finally be generated. ######################################## %%input1%% %%input2%% %%input3%% ########################################

[0131] The above explanation also explains the process of generating a prompt, but once all the connection and input of the execution nodes is complete, pressing the execute button will automatically generate a sentence. In other words, in this embodiment, the procedure etc. is also explained in order to explain the content, but once all the connection of the nodes is complete, all that remains is to enter the input items from the input receiving units 212, 221 and execute the sentence generation process by pressing the execute button, and a consistent sentence will be automatically generated from the first to the last chapter.

[0132] As explained above, by introducing multiple variables, it is possible to separate the loop by chapter. This allows you to create long texts while keeping API fees low. In other words, reading everything from the beginning would result in a huge amount of text, which would result in high API fees, but by creating texts independently for each chapter, it is possible to generate texts while keeping API fees low.

[0133] Furthermore, since loop prompts are used within a chapter, it is possible to generate consistent sentences for each chapter, resulting in high-quality sentences.

[0134] In the example above, all chapters are divided into two sections: Chapter 1 is divided into sections 1-1 and 1-2, Chapter 2 is divided into sections 2-1 and 2-2, and Chapter 3 is divided into sections 3-1 and 3-2. However, this can be different for each chapter. For example, it is also possible for Chapter 1 to be divided into three sections, Chapter 2 to be divided into two sections, and Chapter 3 to be divided into four sections. Furthermore, it is also possible for Chapter 1 to have only one section. For example, Chapter 3 may have one section. In this case, for Chapter 3, only the sentence for Section 1 is generated, and the loop prompt is not applied to Chapter 3, but the loop prompt is applied only to Chapters 1 and 2.

[0135] [Text generation program] In this embodiment, the description has focused on the sentence generation device 200, but as explained in FIG. 2, it is also possible to install the program in the storage device 202 or the memory device 203, have the processor 204 read and operate it, and realize it as a sentence generation program.

[0136] Although the preferred embodiments of the present invention have been described in detail above, the present invention is not limited to the above-described embodiments, and various modifications and substitutions can be made to the above-described embodiments without departing from the scope of the present invention. [Industrial Applicability]

[0137] The present invention can be used in a text generation device, a text generation method, and a program that utilize a large-scale language model. [Explanation of symbols]

[0138] 100 user terminals 200 Sentence generator 201 Drive unit 202 Storage device 203 Memory Device 204 processors 205 Interface Device 206 Communication Equipment 210 Heading Acquisition Section 212, 221 Input reception unit 222 Table of Contents Creation Department 230 Prompt Creation Department 236 Division Processing Unit 237 Text generation section 238 Indentation division 243 Loop prompt creation section 250 Model Interface Section 270 Data Storage Unit 271 Output sentence memory section 272 Variable storage section 273 Node Storage 300 large-scale language models

Claims

1. It is possible to divide the book into M chapters (M is a natural number of 2 or more), and each chapter of the M chapters is L. M Subheadings (L M is a natural number equal to or greater than 1), The M headings and the L set for each chapter of the M headings M a headline acquisition unit for acquiring subheadlines; A prompt including the M number of headlines acquired by the headline acquisition unit, M Based on the subheadings, the first to Lth subheadings M In the process of sequentially generating output sentences corresponding to the contents of each of the subheadings, M is 2 or more, the output sentence corresponding to the Nth subheading (N is 2 or more, L M a prompt generation unit that, when generating a subheading (a natural number below), takes in output sentences corresponding to the first to (N-1)th subheadings that have already been generated by the large-scale language generation model, and generates a prompt for generating an output sentence corresponding to the Nth subheading in parallel for each of the M chapters as a continuation of the output sentences corresponding to the first to (N-1)th subheadings; a model interface unit that inputs the prompt into a large-scale language generation model and obtains an output sentence from the large-scale language generation model.

2. The headline acquisition unit is configured to acquire the M headlines and the L set for each chapter of the M headlines. M The M subheadings are the first layer, the L M 2. The text generation device according to claim 1, wherein the subheadings are acquired in a state in which the hierarchical structure is clearly indicated so that the subheadings can be distinguished from the second layer.

3. 3. The sentence generation device according to claim 2, wherein the prompt for generating an output sentence corresponding to the Nth subheading incorporates the first to (N-1)th output sentences as variables.

4. The headline acquisition unit acquires the M headlines and the L headlines from the input. M or obtain the M headings and the L M The M headings and the L subheadings are derived from the information for deriving the M subheadings. M and inputting the headline generation prompt into the large-scale language generation model to generate the M headlines and the L subheadlines. M The text generation device according to claim 3, wherein subheadings are acquired.

5. The headline acquisition unit acquires the M headlines and the L included in each chapter of the M headlines. M When obtaining subheadings, the M headings and the L M The text generation device according to claim 4, further comprising: a headline explanation corresponding to each of the subheadings; and a subheading explanation corresponding to each of the subheadings.

6. 6. The text generation device according to claim 1, wherein the prompt creation unit creates a combining prompt that combines the M chapters.

7. It is possible to divide the book into M chapters (M is a natural number of 2 or more), and each chapter of the M chapters is L. M Subheadings (L M is a natural number equal to or greater than 1), The M headings and the L set for each chapter of the M headings M a headline acquisition step for acquiring subheadlines; A prompt including the M number of headlines acquired by the headline acquisition unit, M Based on the subheadings, the first to Lth subheadings M In the process of sequentially generating output sentences corresponding to the contents of each of the subheadings, M is 2 or more, the output sentence corresponding to the Nth subheading (N is 2 or more, L M a prompt generation step of taking in output sentences corresponding to the 1st to (N-1)th subheadings already generated by the large-scale language generation model when generating a subheading (a natural number below), and generating a prompt for generating an output sentence corresponding to the Nth subheading in parallel for each of the M chapters as a continuation of the output sentences corresponding to the 1st to (N-1)th subheadings; an output sentence acquisition step of inputting the prompt into a large-scale language generation model and acquiring an output sentence from the large-scale language generation model.

8. It is possible to divide the book into M chapters (M is a natural number of 2 or more), and each chapter of the M chapters is L. M Subheadings (L M is a natural number greater than or equal to 1), On the computer, The M headings and the L set for each chapter of the M headings M a headline acquisition step for acquiring subheadlines; A prompt including the M number of headlines acquired by the headline acquisition unit, M Based on the subheadings, the first to Lth subheadings M In the process of sequentially generating output sentences corresponding to the contents of each of the subheadings, M is 2 or more, the output sentence corresponding to the Nth subheading (N is 2 or more, L M a prompt generation step of taking in output sentences corresponding to the 1st to (N-1)th subheadings already generated by the large-scale language generation model when generating a subheading (a natural number below), and generating a prompt for generating an output sentence corresponding to the Nth subheading in parallel for each of the M chapters as a continuation of the output sentences corresponding to the 1st to (N-1)th subheadings; an output sentence acquisition step of inputting the prompt into a large-scale language generation model and acquiring an output sentence from the large-scale language generation model.

9. The headline acquisition step includes: acquiring the M headlines and the L set for each chapter of the M headlines; M The M subheadings are the first layer, the L M 9. The text generation program according to claim 8, wherein the subheadings are acquired in a state in which the hierarchical structure is clearly indicated so that the subheadings can be distinguished from the second layer.

10. 10. The sentence generation program according to claim 9, wherein the prompt for generating an output sentence corresponding to the Nth subheading incorporates the first to (N-1)th output sentences as variables.

11. The headline acquisition step acquires the M headlines and the L headlines from the input. M or obtain the M headings and the L M The M headings and the L subheadings are derived from the information for deriving the M subheadings. M and inputting the headline generation prompt into the large-scale language generation model to generate the M headlines and the L subheadlines. M The text generation program according to claim 10, wherein subheadings are obtained.

12. The headline acquisition step includes: acquiring the M headlines and the L included in each chapter of the M headlines; M When obtaining subheadings, the M headings and the L M 12. The text generation program according to claim 11, further comprising: acquiring a description of the heading and a description of the subheading corresponding to each of the subheadings.

13. 13. The sentence generation program according to claim 8, wherein the prompt creating step creates a combining prompt that combines the M chapters.

Citation Information

Patent Citations

  • Generating grounded documents using large language models

    US20240428005A1

  • Sentence generation device and sentence generation method

    JP2024162602A