Text generation program, text generation method, and text generation apparatus

The text generation device uses a large-scale language model to process graph data of template and reference sentences, generating hint sentences that ensure the new sentence maintains the structure of the template while incorporating the meaning of the reference sentence, addressing the challenges of existing techniques in sentence generation.

JP2026011435APending Publication Date: 2026-01-23FUJITSU LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2024112030
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Existing techniques struggle to generate sentences that incorporate the meaning of another independent sentence while maintaining the meaning and structure of the original sentence, often resulting in unnatural or incomplete sentences due to complications in graph representation, redundant content, and the need for time-consuming trial and error in prompt engineering.

Method used

A text generation device that utilizes a large-scale language model (LLM) to process graph data of template and reference sentences, generating triplets and similar pairs to create hint sentences that guide the rewriting process, ensuring the new sentence maintains the structure of the template while incorporating the meaning of the reference sentence.

Benefits of technology

The method efficiently generates sentences that appropriately integrate the meaning of multiple sentences, reducing human error and time required for prompt engineering, resulting in natural-sounding and accurate rewritten texts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026011435000001_ABST
    Figure 2026011435000001_ABST
Patent Text Reader

Abstract

To provide a sentence generation program, a sentence generation method and a sentence generation device for easily generating a sentence in which the meaning of each of a plurality of sentences is appropriately incorporated.SOLUTION: The program causes a computer to execute a process of acquiring a model template sentence and a reference text, generating a graph including a noun phrase included in the reference text and information on relevance of the noun phrase in the reference text based on the reference text, and generating a rewritten text satisfying requirements defined in the template text by inputting a prompt including the generated graph and the template sentence to a LLM15.SELECTED DRAWING: Figure 13
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

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

[0002] Various techniques have been proposed for generating sentences, including techniques that create a keyword comparison table and replace it, techniques that generate text after converting data into graphs or other data representations, techniques that combine multiple sentences to generate a single summary, and techniques that generate sentences by inputting prompts into a large-scale language generation model. [Prior art documents] [Non-patent literature]

[0003] [Non-Patent Document 1] Yupian Lin, Tong Ruan, Jingping Liu, and Haofen Wang, “A Survey on Neural Data-to-Text Generation”, IEEE Transactions on Knowledge and Data Engineering, Volume 36, Issue 4, April 2024 [Non-patent document 2] Claire Gardent, Anastasia Shimorina, Shashi Narayan, “Creating Training Corpora for NLG Micro-Planning”, Association for Computational Linguistics, August 2017 [Non-patent document 3] Mir Tafseer Nayeem, Tanvir Ahmed Fuad, Yllias Chali, “Abstractive Unsupervised Multi-Document Summarization using Paraphrastic Sentence Fusion”, International Conference on Computational Linguistics, August 2018 [Non-patent document 4] Danqing Wang, Pengfei Liu, Yining Zheng, Xipeng Qiu, Xuanjing Huang, “Heterogeneous Graph Neural Networks for Extractive Document Summarization”, Association for Computational Linguistics, July 2020 Summary of the Invention [Problem to be solved by the invention]

[0004] However, using the above techniques or simple combinations of them, it is difficult to generate a sentence that incorporates the meaning of another independent sentence while maintaining the meaning and structure of the original sentence.

[0005] The disclosed technology has been developed in consideration of the above, and aims to provide a sentence generation program, a sentence generation method, and a sentence generation device that can easily generate sentences that appropriately incorporate the meaning of each of multiple sentences. [Means for solving the problem]

[0006] In one aspect of the sentence generation program, sentence generation method, and sentence generation device disclosed herein, a first sentence that serves as a model and a second sentence related to a case are obtained, and based on the second sentence, graph data of the second sentence is generated, the graph data including noun phrases contained in the second sentence and information on the relevance of the noun phrases in the second document is generated, and the generated second graph data and a prompt including the first sentence are input into a large-scale language model, thereby generating a third sentence that meets the requirements specified in the first document. [Effects of the Invention]

[0007] In one aspect, the present invention can easily generate a sentence that appropriately incorporates the meaning of each of a plurality of sentences. [Brief explanation of the drawings]

[0008] [Figure 1] FIG. 1 is a diagram showing an example of a situation in which sentence generation according to the embodiment is useful. [Figure 2] FIG. 2 is a diagram showing an example of text generation using Data to Text generation (D2T). [Figure 3] FIG. 3 is a diagram showing an example of generation of a summary sentence by multi-document summarization (MDS). [Figure 4] FIG. 4 is a diagram showing an example of a simple combination of D2T and MDS. [Figure 5] Figure 5 shows an example of sentence rewriting using an LLM that can perform NLP tasks with prompts. [Figure 6] FIG. 6 is a block diagram of a sentence generation device. [Figure 7] FIG. 7 is a diagram for explaining the learning of prediction of a rewritten sentence. [Figure 8] FIG. 8 is a diagram illustrating an example of triplet generation processing. [Figure 9] FIG. 9 is a diagram showing an example of a triplet. [Figure 10]FIG. 10 is a diagram showing an example of a prompt for generating similar pairs. [Figure 11] FIG. 11 is a diagram illustrating an example of the similar pair generation process. [Figure 12] FIG. 12 is a diagram showing an example of a prompt for rewriting a sentence using a hint sentence. [Figure 13] FIG. 13 is a diagram showing an example of rewriting a sentence using a hint sentence. [Figure 14] FIG. 14 is a flowchart of triplet extraction processing using LLM. [Figure 15] FIG. 15 is a flowchart of a similar pair generation process using LLM. [Figure 16] FIG. 16 is a flowchart of the hint sentence generation and sentence rewriting process using LLM. [Figure 17] FIG. 17 is a diagram illustrating an example of the hint message generation process according to the second embodiment. [Figure 18] FIG. 18 is a flowchart of a process of generating a hint message and rewriting a sentence according to the third embodiment. [Figure 19] FIG. 19 is a flowchart of triplet extraction processing using morphological analysis according to the fourth embodiment. [Figure 20] FIG. 20 is a flowchart of a similar pair generation process using a comparison function of character strings according to the fourth embodiment. [Figure 21] FIG. 21 is a flowchart showing the process of generating a hint sentence and rewriting a sentence without using an LLM. [Figure 22] FIG. 22 is a hardware configuration diagram of the sentence generation device. DETAILED DESCRIPTION OF THE INVENTION

[0009] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. Note that the present invention is not limited to the embodiments. [Example]

[0010] FIG. 1 is a diagram illustrating an example of a situation in which sentence generation according to an embodiment is useful. For example, an AI system A1 is under development. In this case, a worker P of the AI ​​system A1, such as a developer or manager, may be required to identify potential risks of the AI ​​system A1. In such a case, the worker P obtains, for example, guidelines G1 summarizing points to be checked, and assesses the AI ​​system A1 according to the guidelines G1.

[0011] However, the text of each check item in guideline G1 is general and written in general terms. Therefore, worker P obtains document D1 regarding the specifications of AI system A1. Worker P then supplements each check item in guideline G1 with the content in document D1 to create check items tailored to AI system A1 and assesses AI system A1.

[0012] However, if worker P were to compare guideline G1 with document D1 and create check items tailored to AI system A1, the process would be cumbersome and there would be a risk of human error. In this case, if there were a rewritten document GD1 in which guideline G1 was rewritten in the context of document D1, worker P could simply assess AI system A1 according to the rewritten document GD1, simplifying the process and reducing the risk of human error.

[0013] In such a case, it is necessary to automatically generate a rewritten sentence by using the content of guideline G1 as a template sentence and the content of document D1 as a reference sentence, and rewriting the template sentence in the context of the reference sentence. Here, the following techniques exist as techniques for creating sentences.

[0014] Figure 2 shows an example of sentence generation using Data to Text generation (D2T). D2T is a technology that generates accurate and natural text representations from data expressed in non-natural language, such as graph data and tables.

[0015] For example, a case will be described in which text is generated using D2T for graph data 901, which is a knowledge graph. In graph data 901, "A building" and "B company" are linked by the relationship "maintenance." Furthermore, "B company" and "C city" are linked by the relationship "location." Furthermore, "C city" and "XXX. OOO" are linked by the relationship "leader." Then, by using D2T on this graph data 901, a sentence structure is inferred from each noun phrase and their relationships, and text 902 is generated.

[0016] However, D2T is a technology that is designed to represent text based on a single piece of data, so it is difficult to rewrite a sentence that uses two sentences, a template sentence and a reference sentence, as described above.

[0017] Figure 3 shows an example of generating a summary using Multi-document Summarization (MDS). MDS is a technology that generates a summary that summarizes multiple documents related to a specific topic. D2T is a technology that assumes the representation of text based on a single piece of data.

[0018] Here, a case will be described in which there are sentences 911 and 912. A sentence is, for example, a collection of multiple sentences separated by periods. A sentence is also made up of a combination of multiple words.

[0019] For example, one MDS technique is as follows: A hierarchical graph 913 is created from sentences 911 and 912. A GNN (Graph Neural Network) 916 is trained to select sentences to be used as summaries and create summary sentences using training data including graphs of multiple sentences and summaries created from those sentences. Then, by inputting the graph 913 into the trained GNN 916, a summary 918 is output from the GNN 916.

[0020] Another MDS technique is the following. For each sentence in documents 911 and 912, sentences with similar meanings are clustered to generate multiple clusters 914. A word graph 915 is created for each sentence. A mathematical model 917 is also prepared to select sentences to use and create a summary. Then, a summary 918 is obtained by applying the mathematical model 917 to the clusters 914 and word graphs 915.

[0021] However, when rewriting a template sentence in the context of a reference sentence, it is preferable to emphasize the structure of the template sentence. In contrast, when using MDS, a summary is generated that takes multiple sources into consideration evenly, making it difficult to perform appropriate rewriting according to the purpose. Furthermore, when the template sentence is shorter than the reference sentence and its content differs, using MDS may result in the rewritten sentence not fully reflecting the template sentence's vocabulary and structure.

[0022] FIG. 4 is a diagram showing an example of a simple combination of D2T and MDS. Here, an example will be described in which sentences 921 and 922 are combined to create one sentence. For example, a method can be considered in which MDS is used to serially connect similar relationships based on the similarity between the relationship connecting noun phrases a1 to a4 in sentence 921 and the relationship connecting noun phrases b1 to b4 in sentence 922. Between sentences 921 and 922, relationships connected by lines such as line 923 indicate similarity. This creates graph 925 that combines sentences 921 and 922. Then, D2T is used to create synthesized sentence 927 for the created graph 925.

[0023] However, such a method may result in a complicated graph due to an increase in the number of branches in the graph or the occurrence of loops. When a complicated graph is used, the sentences may also become complicated, and appropriate sentences may not be generated. In addition, to prevent the sentences from becoming too complicated, it is possible to remove weak relationships between sentences in the graph, but this may result in unnatural sentences or sentences that are far removed from the original sentence.

[0024] 5 is a diagram showing an example of rewriting a sentence using a large language model (LLM) that can execute a natural language processing (NLP) task with a prompt. For example, a prompt 933 instructs an LLM 934 to generate a rewritten sentence from a template sentence 931 and a reference sentence 932, and the LLM 934 generates a rewritten sentence 935.

[0025] However, some sentences may contain redundant sentences, and because LLM934 takes into account the entire input sentence, there is a risk that the rewriting may not be performed appropriately.

[0026] In summary, the techniques mentioned above, or simple combinations of them, are difficult to generate rewritten sentences that retain the meaning and structure of the template sentence while incorporating the meaning of the independent reference sentence. For example, when the template sentence and the reference sentence are completely unrelated, methods that consider the similarity between each sentence as a whole or that equally incorporate all source sentences, as in summarization, may generate insufficient sentences. Furthermore, if the source sentence contains redundant content that is unrelated to the original sentence, the resulting sentence may sound unnatural. Furthermore, when simply applying LLM, creating appropriate sentences requires time, money, and labor, such as trial and error and fine-tuning through prompt engineering, making it difficult to achieve. Furthermore, even if detailed prompts are created, there is no guarantee that the prompts will improve the results.

[0027] Therefore, as shown in FIG. 1, a worker P uses a text generation device 1 according to this embodiment to generate a rewritten document GD1 that incorporates the meaning of document D1 while maintaining the meaning and structure of guideline G1. The text generation device 1 is an improvement over a conventional computer that generates text. Then, the worker P can evaluate the AI ​​system A1 according to the rewritten document GD1, which contains check items tailored to the AI ​​system A1. The text generation device 1 according to this embodiment will be described in detail below.

[0028] 6 is a block diagram of a text generation device 1. The text generation device 1 includes a text receiving unit 11, a data conversion unit 12, a similar text extraction unit 13, a learning execution unit 14, an LLM 15, a text rewriting unit 16, and an output unit 17.

[0029] The LLM 15 is a language model that performs learning using a large amount of calculation, data, and parameters, inputs natural language, executes the learned process, and returns a response. In this embodiment, the description is given of a configuration in which the sentence generation device 1 includes the LLM 15, but the LLM 15 may be located outside the sentence generation device 1, for example, in the cloud.

[0030] The learning execution unit 14 causes the LLM 15 to perform learning. The learning execution unit 14 uses a large amount of learning data, for example, a combination of a sentence and graph data obtained from each of the sentences contained in the sentence, as learning data, and causes the LLM 15 to perform learning. This enables the LLM 15, when a specific sentence is input, to output triplets obtained from each of the sentences contained in the specific sentence.

[0031] Furthermore, the learning execution unit 14 sets, as learning data, for example, graph data of a template sentence, graph data of a reference sentence, and a set of information on whether the graph data of each reference sentence is similar to the graph data of the template sentence.The learning execution unit 14 then causes the LLM 15 to perform learning using a large amount of learning data.This enables the LLM 15, when graph data of a template sentence and graph data of a reference sentence are input, to determine whether the graph data of the reference sentence is similar to the graph data of the template sentence.

[0032] Furthermore, the learning execution unit 14 causes the LLM 15 to perform learning using a large amount of learning data, such as similar pairs between the graph data of the template sentence and the graph data of the reference sentence, the template sentence, and a rewritten sentence obtained by rewriting the template sentence based on the reference sentence. This enables the LLM 15 to output a rewritten sentence obtained by rewriting the template sentence based on the reference sentence when the template sentence and a similar pair between the graph data of the template sentence and the graph data of the reference sentence are input.

[0033] FIG. 7 is a diagram for explaining learning to predict rewritten sentences. In this embodiment, triplets are used as graph data. Similar pairs of triplets of template sentences and triplets of reference sentences, and the template sentences, serve as explanatory variables. Furthermore, rewritten sentences obtained by rewriting the template sentences by incorporating the meaning of the reference sentences serve as objective variables. The learning execution unit 14 then adjusts the parameters of the LLM 15 based on error information between the objective variables and the prediction results when the explanatory variables are input to the LLM 15, thereby causing the LLM 15 to perform learning.

[0034] More specifically, this learning to predict rewritten sentences may be performed through the following steps. The learning execution unit 14 provides the LLM 15 with a function for obtaining a hint sentence from a similar pair of a triplet of a template sentence and a triplet of a reference sentence, for example. The learning execution unit 14 then causes the LLM 15 to generate a hint sentence using the function for the similar pair of a triplet of the template sentence and a triplet of the reference sentence. The learning execution unit 14 then causes the LLM 15 to make a prediction using the hint sentence and the template sentence as input, and adjusts the parameters of the LLM 15 using error information between the template sentence and a rewritten sentence that incorporates the meaning of the reference sentence.

[0035] Continuing the explanation, returning to Figure 1, the text receiving unit 11 receives the template text and reference text input by the worker P from the user terminal device 2. Then, the text receiving unit 11 outputs the template text and reference text to the data conversion unit 12. The text receiving unit 11 also outputs the template text to the text rewriting unit 16.

[0036] The template text is a text written in a document related to an assessment that meets the requirements to be met, such as a law or a checklist. The reference text is a text written in a document that provides an overview of the subject, such as a specification or memo related to the AI ​​system A1. The template text is an example of a "first text," and the reference text is an example of a "second text." That is, the text receiving unit 11 acquires a first text that serves as a model and a second text related to a case. This acquisition process includes acquiring a text related to an assessment that meets the requirements to be met as the first text, and acquiring a text that provides an overview of the subject as the second text.

[0037] The data conversion unit 12 receives input of template sentences and reference sentences from the sentence receiving unit 11. Then, the data conversion unit 12 converts the template sentences into graph data. In this embodiment, the data conversion unit 12 inputs the template sentences to the trained LLM 15 and obtains a set of triplets output from the LLM 15. A triplet contains three pieces of information: two noun phrases contained in a sentence and a relationship that links those noun phrases. In other words, a triplet can be said to contain a set of three phrases: a subject, an object, and a relationship.

[0038] Similarly, the data conversion unit 12 converts the reference sentence into a triplet set, and then outputs the triplet set of the template sentence and the triplet set of the reference sentence to the similar sentence extraction unit 13.

[0039] 8 is a diagram showing an example of triplet generation processing. For example, the data conversion unit 12 receives input of a template sentence 101 and a reference sentence 103. Then, the data conversion unit 12 inputs the template sentence 101 to the trained LLM 15, and obtains a triplet set 102 output from the LLM 15. For example, the triplet set 102 includes three triplets. Furthermore, the data conversion unit 12 inputs the reference sentence 103 to the trained LLM 15, and obtains a triplet set 104 output from the LLM 15.

[0040] Fig. 9 is a diagram showing an example of a triplet. For example, one triplet 105 included in the triplet set 102 in Fig. 8 includes a subject 151 called "Trust" and an object 152 called "using the AI ​​system," as shown in Fig. 9. Furthermore, triplet 105 includes a relation 153 called "is not compromised by" as a phrase connecting subject 151 and object 152.

[0041] 8 includes a subject 161, "***** system," and an object 162, "face image data," as shown in FIG. 9. Furthermore, triplet 106 includes a relation 153, "classifies," as a phrase connecting subject 161 and object 162.

[0042] Here, the triplet of the template sentence is an example of "graph data of a first sentence." Furthermore, the triplet of the reference sentence is an example of "graph data of a second sentence." That is, based on the second sentence, which is the reference sentence, the data conversion unit 12 generates graph data of the second sentence, including information on the noun phrases included in the second sentence and the relevance of the noun phrases in the second sentence. Furthermore, based on the first sentence, which is the template sentence, the data conversion unit 12 generates graph data of the first sentence, including information on the noun phrases included in the first sentence and the relevance of the noun phrases in the first sentence. Furthermore, the process of generating the graph data of the second sentence includes a process of generating, as graph data, triples including a subject and an object, which are noun phrases, and an association indicating the relevance between the subject and the object.

[0043] Returning to Figure 6, the explanation will continue. The similar sentence extraction unit 13 receives an input of a triplet set of template sentences and a triplet set of reference sentences from the data conversion unit 12. The similar sentence extraction unit 13 extracts triplets of reference sentences that are similar to each triplet included in the triplet set of template sentences. The similar sentence extraction unit 13 regards triplets of similar template sentences and triplets of reference sentences as similar pairs and acquires a similar pair set that includes a plurality of similar pairs.

[0044] In this embodiment, the similar sentence extraction unit 13 inputs the triplet set of the template sentence and the triplet set of the reference sentence, as well as a prompt instructing extraction of similar pairs from them, to the trained LLM 15, and obtains a set of similar pairs output from the LLM 15. Thereafter, the similar sentence extraction unit 13 outputs the obtained set of similar pairs to the sentence rewriting unit 16.

[0045] FIG. 10 shows an example of a prompt for similar pair generation. E denotes the triplet set of template sentences, and T r denotes the triplet set of the reference sentence. e is T E Furthermore, we denote the individual triplets contained in T sim is a set of similar pairs.

[0046] The similar sentence extraction unit 13 can store in advance the format of the similar pair generation prompt 110 and complete the similar pair generation prompt 110 by, for example, complementing the format according to the triplet set of the acquired template sentence and the triplet set of the reference sentence. Alternatively, the similar sentence extraction unit 13 may acquire the similar pair generation prompt 110 generated by the worker P.

[0047] The similar pair generation prompt 110 is a template sentence T E For each triplet in r The LLM 15 executes a process of extracting similar triplets from among the triplets included in T and forming them into similar pairs. E For one triplet in T r It is also possible to extract multiple triplets contained in T and generate multiple similar pairs. E Let LLM15 generate similar pairs for all triplets contained in

[0048] FIG. 11 is a diagram illustrating an example of similar pair generation processing. For example, the similar sentence extraction unit 13 inputs a triplet set 111 of template sentences, a triplet set 112 of generated sentences, and a similar pair generation prompt 110 to the LLM 15. In this case, for each triplet included in the triplet set 111, a similar triplet is extracted from the triplet set 112 by the LLM 15. In FIG. 11, triplets in the triplet set 112 connected by arrows extending from each triplet in the triplet set 111 are similar triplets. For example, triplet 113 is similar to triplets 114 and 115. In this case, two similar pairs are generated: a similar pair between the triplet 113 and the triplet 114, and a similar pair between the triplet 113 and the triplet 115. The similar sentence extraction unit 13 then acquires a similar pair set 116 output from the LLM 15.

[0049] Also, here, the similar sentence extraction unit 13 has the LLM 15 perform the similarity determination and the generation of a similar pair set all at once, but this is not limited to this. For example, the similar sentence extraction unit 13 may have the LLM 15 determine whether or not a triplet of a template sentence and a triplet of a reference sentence are similar, and generate a similar pair set by grouping together pairs of triplets that are determined to be similar based on the determination result.

[0050] In this way, the similar sentence extraction unit 13 identifies the graph data of the second sentence that is similar to the graph data of the first sentence.

[0051] 6, the sentence rewriting unit 16 receives an input of a set of similar pairs from the similar sentence extraction unit 13. The sentence rewriting unit 16 also receives an input of a template sentence from the sentence receiving unit 11.

[0052] The sentence rewriting unit 16 acquires triplets of reference sentences included in the set of similar pairs. Next, the sentence rewriting unit 16 generates hint sentences from the acquired triplets of reference sentences as hints for rewriting the template sentences. Next, the sentence rewriting unit 16 rewrites the template sentences using the generated hint sentences to generate rewritten sentences. Thereafter, the sentence rewriting unit 16 outputs the generated rewritten sentences to the output unit 17.

[0053] In this embodiment, the sentence rewriting unit 16 inputs the set of similar pairs and the template sentence to the trained LLM 15. The sentence rewriting unit 16 then causes the LLM 15 to generate hint sentences based on each similar pair included in the set of similar pairs, and rewrites the template sentences in order based on each of the generated hint sentences to generate a rewritten sentence. For example, the hint sentence may be a sentence in which the phrases included in the triplet of the reference sentence are arranged in the order of subject, relative, and object. The sentence rewriting unit 16 outputs the generated rewritten sentence to the output unit 17.

[0054] FIG. 12 shows an example of a prompt for rewriting a sentence using a hint sentence. med is an intermediate sentence in the process of rewriting the template sentence. tmp is a template sentence. Also, T sim is a set of similar pairs, and (t e ,t r ) is the triplet t in the template sentence. e and the reference triplet t r Furthermore, H is a hint sentence. "tri2str" is a function that generates a hint sentence from a triplet, for example, a sentence that arranges the words contained in the triplet of the reference sentence in the order of subject, relative, and object. Furthermore, S out is a rewritten sentence that has been rewritten using the reference sentence of the template sentence.

[0055] The sentence rewriting unit 16 can store the format of the sentence rewriting prompt 120 in advance and complete the sentence rewriting prompt 120 by complementing the format according to the acquired template sentence and similar pair set. Alternatively, the sentence rewriting unit 16 may acquire the sentence rewriting prompt 120 generated by the worker P.

[0056] Sentence Rewriting Prompt 120 is for LLM15 med The initial state of tmp Then, the sentence rewriting prompt 120 is set to T sim For each similar pair included in the sentence S, the LLM 15 generates a hint sentence H using the function tri2str. Then, the sentence rewriting prompt 120 uses the generated hint sentence H to med Rewrite it as S med ' is generated by LLM15, and S med The generated S med The sentence rewriting prompt 120 causes the LLM 15 to repeat the anomaly processing for each similar pair, and S med The sentence rewriting prompt 120 prompts the LLM 15 to rewrite the intermediate sentence S at that time using the hint sentences created from each similar pair. med The final rewritten sentence S out This causes...

[0057] 13 is a diagram showing an example of sentence rewriting using a hint sentence. For example, the sentence rewriting unit 16 receives a template sentence 121 and a similar pair set 122 as input. Then, the sentence rewriting unit 16 inputs the template sentence 121 and the similar pair set 122 to the LLM 15. In this case, a triplet set 123 of the reference sentence included in the similar pair set 122 is extracted by the LLM 15. As schematically shown in the triplet set 123, each triplet includes a set of three words: a subject, a relative, and an object.

[0058] Then, from the triplet set 123, the LLM 15 generates a hint sentence set 124 including hint sentences corresponding to the triplets of each reference sentence. The LLM 15 then sequentially rewrites the template sentence 121 based on the hint sentences included in the hint sentence set 124 to complete a rewritten sentence 125. The sentence rewriting unit 16 acquires the rewritten sentence 125 output from the LLM 15.

[0059] Here, the rewritten sentence is an example of a "third sentence." In this way, the sentence rewriting unit 16 inputs a prompt including the graph data of the second sentence, which is the graph data of the reference sentence, and the first sentence, which is the template sentence, into the large-scale language model based on the second sentence, which is the reference sentence. As a result, the sentence rewriting unit 16 generates a third sentence that satisfies the requirements specified in the first sentence. The hint sentence is an example of a "reference sentence." The third sentence generation process includes a process of generating reference sentences corresponding to the graph data of the first sentence based on the identified graph data of the second sentence. Furthermore, the third sentence generation process includes a process of inputting the generated reference sentence and the first sentence, and a prompt instructing rewriting of the first sentence based on the reference sentence, into the large-scale language model to generate a third document in which the first sentence is rewritten based on the second sentence and the requirements specified in the first sentence are reflected. In addition, the process of generating the third sentence includes a process of generating a third sentence by repeatedly generating an intermediate sentence based on the reference sentence, the first sentence, and the prompt for each generated reference sentence, and rewriting the intermediate sentence.

[0060] Returning to Figure 6, we will continue the explanation. The output unit 17 receives the rewritten sentence as input from the sentence rewriting unit 16. Then, the output unit 17 transmits the rewritten sentence to the user terminal device 2. As a result, as shown in Figure 1, the worker P can obtain the rewritten document GD1 containing the rewritten sentence. By using this document, the worker P can evaluate the AI ​​system A1 based on the rewritten sentence, which is a template sentence that incorporates the meaning of the reference sentence.

[0061] Fig. 14 is a flowchart of triplet extraction processing using LLM. Next, the flow of triplet extraction processing using LLM 15 will be explained with reference to Fig. 14. Here, triplet extraction from a template sentence will be explained as an example, but the same applies to reference sentences.

[0062] The data conversion unit 12 inputs a template to the LLM 15 and issues a prompt to extract triplets, thereby obtaining N triplets (step S101).

[0063] Next, the data conversion unit 12 sets i_ns to 1 (step S102).

[0064] Next, the data conversion unit 12 selects one triplet from the extracted triplets (step S103).

[0065] Next, the data conversion unit 12 adds the selected triplet to the triplet set (step S104).

[0066] Next, the data conversion unit 12 determines whether i_ns is greater than or equal to N (step S105). If i_ns is less than N (step S105: No), the data conversion unit 12 increments i_ns by 1 (step S106). Thereafter, the data conversion unit 12 returns to step S103.

[0067] On the other hand, if i_ns is equal to or greater than N (step S105: Yes), the data conversion unit 12 ends the triplet extraction process.

[0068] 15 is a flowchart of the similar pair generation process using the LLM 15. Next, the flow of the similar pair generation process using the LLM 15 will be described with reference to FIG.

[0069] The similar sentence extraction unit 13 acquires triplet sets for each of the template sentence and the reference sentence (step S111). Here, the similar sentence extraction unit 13 assigns consecutive numbers starting from 1 to each triplet included in the triplet set of the template sentence. Similarly, the similar sentence extraction unit 13 assigns consecutive numbers starting from 1 to each triplet included in the triplet set of the reference sentence. Hereinafter, a triplet included in the triplet set and assigned a predetermined number will be referred to as the predetermined-numbered triplet.

[0070] Next, the similar sentence extraction unit 13 sets it to 1, sets jr to 1, and sets the similar pair set to an empty set (step S112).

[0071] Next, the similar sentence extraction unit 13 prompts the LLM 15 to determine whether the relation between the ith triplet of the template sentence and the relation between the jrth triplet of the reference sentence are similar (step S113).

[0072] The similar sentence extraction unit 13 determines whether the relationship between the ith triplet of the template sentence and the jrth triplet of the reference sentence are similar (step S114) from the output of the LLM 15. If the relationship between the ith triplet of the template sentence and the jrth triplet of the reference sentence are not similar (step S114: No), the similar sentence extraction unit 13 proceeds to step S116.

[0073] On the other hand, if the relationship between the ith triplet of the template sentence and the jrth triplet of the reference sentence is similar (step S114: Yes), the similar sentence extraction unit 13 performs the following process: The similar sentence extraction unit 13 adds the pair of the ith triplet of the template sentence and the irth triplet of the reference sentence to a set of similar pairs (step S115).

[0074] Thereafter, the similar sentence extraction unit 13 determines whether jr is equal to or greater than the number of triplets included in the triplet set of the reference sentence-referenced sentence (step S116). If jr is less than the number of triplets included in the triplet set of the reference sentence-referenced sentence (step S116: No), the similar sentence extraction unit 13 increments jr by 1 (step S117). Thereafter, the similar sentence extraction unit 13 returns to step S113.

[0075] On the other hand, if jr is equal to or greater than the number of triplets included in the triplet set of the reference sentence-referenced sentence (step S116: Yes), the similar sentence extraction unit 13 executes the following process. The similar sentence extraction unit 13 determines whether it is equal to or greater than the number of triplets included in the triplet set of the template sentence-referenced sentence (step S118). If it is less than the number of triplets included in the triplet set of the template sentence-referenced sentence (step S118: No), the similar sentence extraction unit 13 increments it by one (step S119). Thereafter, the similar sentence extraction unit 13 returns to step S113.

[0076] On the other hand, if it is equal to or greater than the number of triplets included in the triplet set of the reference sentence (step S118: Yes), the similar sentence extraction unit 13 ends the similar pair generation process.

[0077] 16 is a flowchart of the hint message generation and text rewriting process using the LLM 15. Next, the flow of the hint message generation and text rewriting process using the LLM 15 will be described with reference to FIG.

[0078] The sentence rewriting unit 16 sets i to 1 (step S121). Here, the sentence rewriting unit 16 assigns consecutive numbers starting from 1 to each similar pair included in the similar pair set.

[0079] Next, the text rewriting unit 16 sets the template text as the intermediate text (step S122).

[0080] Next, the text rewriting unit 16 selects the i-th similar pair from the set of similar pairs (step S123).

[0081] Next, the sentence rewriting unit 16 prompts the LLM 15 to generate a hint sentence from the selected i-th similar pair (step S124).

[0082] Then, the sentence rewriting unit 16 acquires the hint sentence generated from the i-th similar pair from the LLM 15 (step S125).

[0083] Next, the sentence rewriting unit 16 instructs the LLM 15 to rewrite the intermediate sentence using the hint sentence by using a prompt (step S126).

[0084] Then, the text rewriting unit 16 acquires the next intermediate text that has been rewritten based on the hint text (step S127).

[0085] Next, the sentence rewriting unit 16 determines whether i is equal to or greater than the number of similar pairs (step S128). If i is less than the number of similar pairs (step S128: No), the sentence rewriting unit 16 increments i by 1 (step S129). Thereafter, the sentence rewriting unit 16 returns to step S123.

[0086] On the other hand, if i is equal to or greater than the number of similar pairs (step S128: Yes), the sentence rewriting unit 16 causes the LLM 15 to output the intermediate sentence at that time as a rewritten sentence (step S130).

[0087] As described above, the text generation device 1 according to this embodiment generates triplets, which are graph data, from each of the template text and the reference text, using the trained LLM 15. Next, the text generation device 1 generates similar pairs of triplets that are similar to each other among the generated triplets, using the trained LLM 15. The text generation device 1 then causes the trained LLM 15 to generate hint sentences from the similar pairs, and sequentially rewrites the template text using the generated hint sentences, ultimately completing the rewritten text.

[0088] This allows the sentence generation device 1 to generate a rewritten sentence that incorporates the meaning of an independent reference sentence while maintaining the structure of the template sentence. Unlike simple matching, this method considers the similarity between sentences when rewriting, enabling appropriate rewriting based on the content of both sentences. Furthermore, by considering the similarity of triplets contained in a sentence rather than the similarity of the entire sentence, appropriate rewriting can be performed using highly related sentences. Furthermore, unlike summarizing, the original sentence is not incorporated equally, making it possible to generate a rewritten sentence that appropriately incorporates the meaning of both sentences. Even if a sentence contains redundant sentences, treating the sentences as triplets can eliminate the redundant parts and generate natural-sounding sentences. Furthermore, the time required for prompt engineering and fine-tuning can be shortened, enabling efficient acquisition of rewritten sentences. [Example]

[0089] Next, a second embodiment will be described. The sentence generation device 1 according to this embodiment is also represented by the block diagram of FIG. 6. The sentence generation device 1 according to this embodiment differs from the first embodiment in that it generates one hint sentence by combining triplets of multiple reference sentences in which the triplet of a template sentence is included in the same similar pair. Here, the process of generating the hint sentence will be mainly described. In the following explanation, the operation of each unit similar to that of the first embodiment may be omitted.

[0090] The learning execution unit 14 according to this embodiment uses similar pairs of triplets of template sentences and triplets of reference sentences as explanatory variables. The learning execution unit 14 also uses a single hint sentence, which is a collection of triplets of multiple reference sentences included in similar pairs of each template sentence, as a target variable.

[0091] The learning execution unit 14 then causes the LLM 15 to perform learning using the similar pairs, which are explanatory variables, and the hint sentences, which are objective variables, as learning data. This allows the LLM 15 to receive input of similar pairs of triplets of template sentences and triplets of reference sentences, and to output hint sentences generated by combining multiple triplets of reference sentences included in similar pairs of triplets of the same template sentence.

[0092] The sentence rewriting unit 16 generates a hint sentence by combining triplets of multiple reference sentences included in the similar pair of triplets of the same template sentence by inputting similar pairs of triplets of template sentences and triplets of reference sentences to the LLM 15. That is, the sentence rewriting unit 16 generates one reference sentence based on graph data of multiple second sentences similar to graph data of a first sentence.

[0093] 17 is a diagram illustrating an example of a hint sentence generation process according to Example 2. For example, the sentence rewriting unit 16 inputs a set 201 of similar pairs of triplets of template sentences and triplets of reference sentences to the trained LLM 15.

[0094] In the set 201, a similar pair group 211 includes two similar pairs with the same triplet in the template sentence. A similar pair group 212 includes one similar pair with the same triplet in the template sentence. A similar pair group 213 includes two similar pairs with the same triplet in the template sentence.

[0095] Therefore, the LLM 15 generates one hint sentence 221 from a triplet of two reference sentences included in the similar pair group 211. The LLM 15 also generates one hint sentence 222 from a triplet of one reference sentence included in the similar pair group 212. The LLM 15 also generates one hint sentence 223 from a triplet of two reference sentences included in the similar pair group 213.

[0096] The sentence rewriting unit 16 causes the LLM 15 to rewrite the template sentence using the generated hint sentence that is a compilation of one or more reference sentences, and obtains the rewritten sentence to be output.

[0097] As described above, the sentence generation device 1 according to this embodiment generates one hint sentence by combining triplets of multiple reference sentences whose triplet in a template sentence is included in the same similar pair, and rewrites the template sentence using the hint sentence. Since the sentence generation device 1 performs the rewriting process loop as many times as the number of hint sentences, combining hint sentences can reduce the number of rewriting process loops. By combining hint sentences in this way, it is possible to reduce the processing time, the number of tokens processed by the LLM 15, etc. [Example]

[0098] Next, a third embodiment will be described. The text generation device 1 according to this embodiment is also represented by the block diagram of FIG. 6. The text generation device 1 according to this embodiment differs from the first embodiment in that, when a predetermined condition is met, the rewriting based on the hint text is interrupted and the intermediate text at that time is used as the rewritten text. Here, the rewriting process based on the hint text will be mainly described. In the following description, the operation of each part that is the same as that of the first embodiment may be omitted.

[0099] The sentence rewriting unit 16 according to this embodiment inputs a set of similar pairs and a template sentence to the trained LLM 15. Then, the LLM 15 generates a hint sentence based on each similar pair included in the set of similar pairs. The sentence rewriting unit 16 then causes the LLM 15 to rewrite an intermediate sentence that uses the template sentence as the original sentence based on the hint sentence, thereby generating a next intermediate sentence.

[0100] Next, the sentence rewriting unit 16 provides the LLM 15 with a function for evaluating the rewritten state of the intermediate sentence, and causes the LLM 15 to evaluate the generated intermediate sentence using the function each time an intermediate sentence is generated. Then, when the evaluation result of the function satisfies a predetermined condition, the sentence rewriting unit 16 causes the LLM 15 to interrupt the rewriting and causes the intermediate sentence at that point to be the rewritten sentence.

[0101] The sentence rewriting unit 16 can use a function that calculates the similarity between the intermediate sentence and the template sentence using, for example, a sentence vector. In this case, the sentence rewriting unit 16 causes the LLM 15 to calculate the similarity using the function. Next, the sentence rewriting unit 16 causes the LLM 15 to determine whether a first condition, that is, the similarity is less than a predetermined threshold, is satisfied. If the first condition is satisfied, the sentence rewriting unit 16 causes the LLM 15 to determine whether a second condition, that is, the current similarity is lower than the average of the previous two similarities, is satisfied. Then, the sentence rewriting unit 16 causes the LLM 15 to suspend rewriting if the intermediate sentence satisfies both the first and second conditions. Then, the sentence rewriting unit 16 causes the LLM 15 to output the current intermediate sentence as the rewritten sentence.

[0102] In this way, the sentence rewriting unit 16 stops the process of generating the third sentence when the rewritten intermediate sentence satisfies a predetermined condition, and sets the intermediate sentence that satisfies the predetermined condition as the third sentence.

[0103] 18 is a flowchart of the hint message generation and text rewriting process according to the embodiment 3. Next, the flow of the hint message generation and text rewriting process according to the embodiment 3 will be described with reference to FIG.

[0104] The sentence rewriting unit 16 sets i to 1 (step S201). Here, the sentence rewriting unit 16 assigns consecutive numbers starting from 1 to each similar pair included in the similar pair set.

[0105] Next, the text rewriting unit 16 sets the template text as the intermediate text (step S202).

[0106] Next, the text rewriting unit 16 selects the i-th similar pair from the set of similar pairs (step S203).

[0107] Next, the sentence rewriting unit 16 prompts the LLM 15 to generate a hint sentence from the selected i-th similar pair (step S204).

[0108] Then, the sentence rewriting unit 16 acquires the hint sentence generated from the i-th similar pair from the LLM 15 (step S205).

[0109] Next, the sentence rewriting unit 16 instructs the LLM 15 to rewrite the intermediate sentence using the hint sentence by using a prompt (step S206).

[0110] Then, the text rewriting unit 16 acquires the next intermediate text obtained by rewriting the intermediate text based on the hint text (step S207).

[0111] Next, the text rewriting unit 16 causes the LLM 15 to determine whether the intermediate text satisfies the condition using the function (step S208).

[0112] The sentence rewriting unit 16 determines whether the intermediate sentence satisfies the condition based on the output from the LLM 15 (step S209). If the intermediate sentence satisfies the condition (step S209: Yes), the sentence rewriting unit 16 causes the LLM 15 to suspend rewriting of the sentence. Then, the sentence rewriting unit 16 causes the LLM 15 to output the intermediate sentence at that time as a rewritten sentence (step 212).

[0113] On the other hand, if the intermediate sentence does not satisfy the condition (step S209: No), the sentence rewriting unit 16 determines whether i is equal to or greater than the number of similar pairs (step S210). If i is less than the number of similar pairs (step S210: No), the sentence rewriting unit 16 increments i by 1 (step S211). Thereafter, the sentence rewriting unit 16 returns to step S203.

[0114] On the other hand, if i is equal to or greater than the number of similar pairs (step S210: Yes), the sentence rewriting unit 16 causes the LLM 15 to output the intermediate sentence at that time as a rewritten sentence (step S212).

[0115] As described above, the sentence generation device 1 according to this embodiment suspends the rewriting of a sentence when the rewritten intermediate sentence satisfies a predetermined condition, and designates the intermediate sentence at that point as the rewritten sentence. When there are many hint sentences, for example, the number of rewritings increases, and repeated rewriting may cause the meaning to deviate from the meaning of the template sentence, the reference sentence, or both. In response to this, the sentence generation device 1 according to this embodiment pre-sets conditions for determining that the meaning has deviated, and suspends the rewriting when the conditions are met. This reduces the negative impact of the rewritten sentence deviating from the meaning of either the template sentence, the reference sentence, or both. [Example]

[0116] Next, a fourth embodiment will be described. The text generation device 1 according to this embodiment is also represented by the block diagram of FIG. 6. The text generation device 1 according to this embodiment differs from the first embodiment in that the triplet generation process and the similar pair generation process are performed without using the LLM 15. Here, the triplet generation process and the similar pair generation process will be mainly described. In addition, in the following description, the description of the operation of each unit similar to that of the first embodiment may be omitted.

[0117] In this embodiment, the data conversion unit 12 divides the template sentence and the reference sentence into sentences. Next, the data conversion unit 12 selects one sentence from the sentences in the template sentence. Next, the data conversion unit 12 performs morphological analysis on the selected sentence. Next, the data conversion unit 12 extracts triplets from the results of the morphological analysis. Then, the data conversion unit 12 adds the extracted triplets to a triplet set. The data conversion unit 12 performs this extraction of triplets from each sentence for all sentences generated from the template sentence, and generates a triplet set for the template sentence.

[0118] The data conversion unit 12 also selects one sentence from the reference sentence and extracts triplets from each sentence in the same way as for the template sentence. The data conversion unit 12 extracts triplets from each sentence for all sentences generated from the reference sentence, and generates a triplet set for the reference sentence.

[0119] The similar sentence extraction unit 13 calculates the similarity between the triplet associations of the template sentence and the triplet associations of the reference sentence using a comparison function. If the calculated similarity is equal to or greater than a predetermined similarity threshold, the pair of triplet of the template sentence and triplet of the reference sentence is added to a set of similar pairs. The similar sentence extraction unit 13 performs the above extraction of similar pairs of triplets for all triplets of the template sentence and for each triplet of the reference sentence to generate a set of similar pairs.

[0120] Fig. 19 is a flowchart of triplet extraction processing using morphological analysis according to Example 4. Next, the flow of triplet extraction processing using morphological analysis will be described with reference to Fig. 19. Here, triplet extraction from a template sentence will be described as an example, but the same applies to reference sentences.

[0121] The data conversion unit 12 divides the template text into sentences (step S301). Here, a case where the template text is divided into N sentences will be described.

[0122] Next, the data conversion unit 12 sets i_ns to 1 (step S302).

[0123] Next, the data conversion unit 12 selects one sentence (step S303).

[0124] Next, the data conversion unit 12 performs a morphological analysis of the selected sentence (step S304).

[0125] Next, the data conversion unit 12 extracts triplets from the results of the morphological analysis (step S305).

[0126] Next, the data conversion unit 12 adds the extracted triplets to the triplet set (step S306).

[0127] Next, the data conversion unit 12 determines whether i_ns is greater than or equal to N (step S307). If i_ns is less than N (step S307: No), the data conversion unit 12 increments i_ns by 1 (step S308). Thereafter, the data conversion unit 12 returns to step S303.

[0128] On the other hand, if i_ns is equal to or greater than N (step S307: Yes), the data conversion unit 12 ends the triplet extraction process.

[0129] 20 is a flowchart of the similar pair generation process using the string comparison function according to Example 4. Next, the flow of the similar pair generation process using the string comparison function will be described with reference to FIG.

[0130] The similar sentence extraction unit 13 acquires triplet sets for each of the template sentence and the reference sentence (step S311). Here, the similar sentence extraction unit 13 assigns consecutive numbers starting from 1 to each triplet included in the triplet set of the template sentence. Similarly, the similar sentence extraction unit 13 assigns consecutive numbers starting from 1 to each triplet included in the triplet set of the reference sentence.

[0131] Next, the similar sentence extraction unit 13 sets it to 1, sets jr to 1, and sets the similar pair set to an empty set (step S312).

[0132] Next, the similar sentence extraction unit 13 calculates the similarity between the relation of the ith triplet of the template sentence and the relation of the jrth triplet of the reference sentence using a comparison function (step S313).

[0133] Next, the similar sentence extraction unit 13 determines whether the similarity between the relation of the ith triplet of the template sentence and the relation of the jrth triplet of the reference sentence is equal to or greater than a predetermined similarity threshold θ (step S314). If the similarity between the relation of the ith triplet of the template sentence and the relation of the jrth triplet of the reference sentence is less than θ (step S314: No), the similar sentence extraction unit 13 proceeds to step S316.

[0134] On the other hand, if the similarity between the relation between the ith triplet of the template sentence and the relation between the jrth triplet of the reference sentence is equal to or greater than θ (step S314: Yes), the similar sentence extraction unit 13 performs the following process: The similar sentence extraction unit 13 adds the pair of the ith triplet of the template sentence and the irth triplet of the reference sentence to a set of similar pairs (step S315).

[0135] Thereafter, the similar sentence extraction unit 13 determines whether jr is equal to or greater than the number of triplets included in the triplet set of the reference sentence (step S316). If jr is less than the number of triplets included in the triplet set of the reference sentence (step S316: No), the similar sentence extraction unit 13 increments jr by 1 (step S317). Thereafter, the similar sentence extraction unit 13 returns to step S313.

[0136] On the other hand, if jr is equal to or greater than the number of triplets included in the triplet set of the reference sentence-referenced sentence (step S316: Yes), the similar sentence extraction unit 13 executes the following process. The similar sentence extraction unit 13 determines whether it is equal to or greater than the number of triplets included in the triplet set of the template sentence-referenced sentence (step S318). If it is less than the number of triplets included in the triplet set of the template sentence-referenced sentence (step S318: No), the similar sentence extraction unit 13 increments it by one (step S319). Thereafter, the similar sentence extraction unit 13 returns to step S313.

[0137] On the other hand, if it is equal to or greater than the number of triplets included in the triplet set of the reference sentence (step S318: Yes), the similar sentence extraction unit 13 ends the similar pair generation process.

[0138] In this embodiment, both the triplet generation process and the similar pair generation process are performed without using the LLM 15, but either one of them may be performed using the LLM 15 as in the first embodiment.

[0139] In addition, in this embodiment, the rewriting of the text is performed using the LLM 15, but it is also possible to generate hint texts and rewrite template texts based on the hint texts without using the LLM 15. Fig. 21 is a flowchart showing the process of generating hint texts and rewriting texts without using the LLM. Next, the flow of the process of generating hint texts and rewriting texts without using the LLM 15 will be described with reference to Fig. 21.

[0140] The sentence rewriting unit 16 sets i to 1 (step S321). Here, the sentence rewriting unit 16 assigns consecutive numbers starting from 1 to each similar pair included in the similar pair set.

[0141] Next, the text rewriting unit 16 sets the template text as the intermediate text (step S322).

[0142] Next, the text rewriting unit 16 selects the i-th similar pair from the set of similar pairs (step S323).

[0143] Next, the sentence rewriting unit 16 obtains the subject, object, and relation from the triplet of the reference sentence of the selected i-th similar pair (step S324).

[0144] Next, the sentence rewriting unit 16 generates a hint sentence by arranging the subject, relation, and object in this order (step S325).

[0145] Next, the sentence rewriting unit 16 breaks down the intermediate sentence and the hint sentence into words and extracts sentence structure information for each (step S326).

[0146] Next, the sentence rewriting unit 16 identifies a common sentence structure between the intermediate sentence and the hint sentence based on the extracted sentence structure information (step S327).

[0147] Then, the sentence rewriting unit 16 rewrites the intermediate sentence with the words of the hint sentence based on the identified common sentence structure, and acquires the next intermediate sentence (step S328).

[0148] Next, the sentence rewriting unit 16 determines whether i is equal to or greater than the number of similar pairs (step S329). If i is less than the number of similar pairs (step S329: No), the sentence rewriting unit 16 increments i by 1 (step S330). Thereafter, the sentence rewriting unit 16 returns to step S323.

[0149] On the other hand, if i is equal to or greater than the number of similar pairs (step S329: Yes), the sentence rewriting unit 16 sets the intermediate sentence at that time as the rewritten sentence (step S331).

[0150] As described above, the text generation device 1 according to this embodiment performs the triplet generation process and the similar pair generation process without using the LLM 15. In this way, even when the triplet generation process and the similar pair generation process are performed without using the LLM 15, the text generation device 1 can generate a rewritten text that incorporates the meaning of an independent reference text while maintaining the structure of the template text. [Example]

[0151] Next, a fifth embodiment will be described. A text generation device 1 according to this embodiment inputs a prompt instructing rewriting of a second sentence into a large-scale language model, instead of a prompt instructing rewriting of a first sentence. For example, the text generation device 1 acquires a first sentence that serves as a model and a second sentence related to a case. Next, for example, the text generation device 1 generates graph data of the second sentence based on the second sentence, the graph data including information on the noun phrases included in the second sentence and the relevance of the noun phrases in the second sentence. Then, for example, the text generation device 1 inputs the generated second graph data, the first sentence, and the prompt instructing rewriting of the second sentence into a large-scale language model, thereby generating a third sentence that satisfies the requirements specified in the first sentence.

[0152] Specifically, the sentence generation device 1 according to this embodiment is also represented by the block diagram of Fig. 6. In the following description, the description of the operation of each unit similar to that of the first embodiment may be omitted.

[0153] The data conversion unit 12 converts the template sentence into a triplet set, and also converts the reference sentence into a triplet set.

[0154] The similar sentence extraction unit 13 extracts triplets of the reference sentence that are similar to each triplet included in the triplet set of the template sentence. The similar sentence extraction unit 13 regards triplets of the similar template sentence and triplets of the reference sentence as similar pairs, and acquires a similar pair set that includes multiple similar pairs.

[0155] The sentence rewriting unit 16 acquires triplets of reference sentences included in the set of similar pairs. Next, the sentence rewriting unit 16 generates hint sentences that serve as hints for rewriting the reference sentences from the acquired triplets of reference sentences. Next, the sentence rewriting unit 16 inputs the generated hint sentences and template sentences, as well as a prompt that instructs rewriting the reference sentences, to the trained LLM 15. Here, the LLM 15 according to this embodiment has been trained using training data that includes triplets of reference sentences, template sentences, and rewritten sentences obtained by rewriting the reference sentences.

[0156] In response to the input, the text rewriting unit 16 obtains a rewritten text obtained by rewriting the reference text output from the LLM 15. This rewritten text includes the content of the reference text and satisfies the requirements defined in the template text.

[0157] As described above, the text generation device 1 according to this embodiment inputs triplets of the reference text that are similar to the template text and the template text to the LLM 15, and obtains a rewritten text in which the reference text is rewritten as the output. In this way, the text generation device 1 can generate a rewritten text that incorporates the meaning of the independent reference text while maintaining the structure of the template text, even by rewriting the reference text.

[0158] (Hardware configuration) 22 is a diagram showing the hardware configuration of the sentence generation device 1. Next, an example of the hardware configuration for realizing each function of the sentence generation device 1 will be described with reference to FIG.

[0159] 22, the sentence generation device 1 includes, for example, a CPU (Central Processing Unit) 91, a memory 92, a hard disk 93, and a network interface 94. The CPU 91 is connected to the memory 92, the hard disk 93, and the network interface 94 via a bus.

[0160] The network interface 94 is an interface for communication between the text generation device 1 and an external device. The network interface 94 relays communication between, for example, the user terminal device 2 and the CPU 91. In other words, the network interface 94 realizes communication between the text receiving unit 11 and the output unit 17 and the user terminal device 2.

[0161] The hard disk 93 is an auxiliary storage device. The hard disk 93 may store the LLM 15 illustrated in Fig. 6. The hard disk 93 also stores various programs, including programs for realizing the functions of the text receiving unit 11, the data converting unit 12, the similar text extracting unit 13, the learning executing unit 14, the text rewriting unit 16, and the output unit 17 illustrated in Fig. 6.

[0162] The memory 92 is a main storage device and may be, for example, a dynamic random access memory (DRAM).

[0163] The CPU 91 reads various programs from the hard disk 93, expands them into the memory 92, and executes them. As a result, the CPU 91 realizes the functions of the text receiving unit 11, the data converting unit 12, the similar text extracting unit 13, the learning executing unit 14, the text rewriting unit 16, and the output unit 17, all of which are shown in FIG. [Explanation of symbols]

[0164] 1 Sentence generator 2. User terminal device 11 Text receiving section 12 Data conversion section 13 Similar sentence extraction part 14 Learning Execution Department 15 LLM 16 Text Rewriting Unit 17 Output section

Claims

1. Obtaining a first sentence as a norm and a second sentence related to the case; generating graph data of the second sentence based on the second sentence, the graph data including information on noun phrases included in the second sentence and relevance of the noun phrases in the second sentence; The graph data of the generated second sentence and a prompt including the first sentence are input to a large-scale language model to generate a third sentence that satisfies the requirements specified in the first sentence. A text generation program that causes a computer to execute a process.

2. The sentence generation program according to claim 1, characterized in that the process of generating the third sentence includes a process of generating a third sentence that satisfies the requirements specified in the first sentence by inputting graph data of the second sentence, the first sentence, and a prompt that instructs rewriting either the first sentence or the second sentence into a large-scale language model.

3. generating graph data of the first sentence based on the first sentence, the graph data including information on noun phrases included in the first sentence and relevance of the noun phrases in the first sentence; Identifying graph data of the second sentence that is similar to the graph data of the first sentence causing the computer to further execute the process; The third sentence generation process includes: generating reference sentences corresponding to each of the graph data of the first sentences based on the identified graph data of the second sentences; and inputting the generated reference sentence, the first sentence, and the prompt instructing rewriting of the first sentence based on the reference sentence into a large-scale language model to generate a third sentence in which the first sentence is rewritten based on the second sentence and in which the requirements specified in the first sentence are reflected.

3. The text generation program according to claim 2.

4. The sentence generation program of claim 3, characterized in that the process of generating the third sentence includes a process of generating the third sentence by repeatedly generating an intermediate sentence based on the reference sentence, the first sentence, and the prompt for each generated reference sentence, and rewriting the intermediate sentence.

5. The sentence generation program according to claim 4, characterized in that the process of generating the third sentence stops rewriting when the rewritten intermediate sentence satisfies a predetermined condition, and the intermediate sentence that satisfies the predetermined condition becomes the third sentence.

6. The sentence generation program according to claim 3, characterized in that the generation of the reference sentence includes a process of generating one reference sentence based on graph data of a plurality of second sentences that are similar to graph data of the first sentence.

7. 2. The sentence generation program according to claim 1, wherein the process of generating graph data of the second sentence includes a process of generating triples including the subject and object, which are the noun phrases, and an association indicating an association between the subject and the object, as graph data of the second sentence.

8. The acquisition process includes: Obtaining a document relating to an assessment that satisfies the requirements as the first document; A sentence describing an outline of the subject is acquired as the second sentence.

2. The sentence generation program according to claim 1, further comprising a process for generating a sentence.

9. The sentence generation device Obtaining a first sentence as a norm and a second sentence related to the case; generating graph data including information on noun phrases included in the second sentence and relevance of the noun phrases in the second sentence based on the second sentence; The generated graph data and a prompt including the first sentence are input to a large-scale language model to generate a third sentence that satisfies the requirements specified in the first sentence. A sentence generation method comprising:

10. a text receiving unit that receives a first text serving as a model and a second text relating to a case; a data conversion unit that generates graph data based on the second sentence, the graph data including information on noun phrases included in the second sentence and relevance of the noun phrases in the second sentence; a sentence rewriting unit that generates a third sentence that satisfies requirements defined in the first sentence by inputting the generated graph data and a prompt including the first sentence into a large-scale language model; A sentence generation device comprising: