Text generation device, text generation system, text generation method, and program
The sentence generation device addresses the challenge of generating user-desired output sentences by incorporating persona information to improve the efficiency of AI-based language processing.
Patent Information
- Application Number
- JP2024172509
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2023-04-28
- Filing Date
- 2024-10-01
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2044-01-29
AI Technical Summary
Conventional AI-based language processing devices often generate output sentences that do not meet user expectations, requiring repetitive corrections, which is time-consuming and laborious.
A sentence generation device that acquires output sentences related to theme information, utilizing a persona information setting unit to set attributes of a target person, an input sentence generation unit to generate advice sentences based on persona information, and an output sentence acquisition unit to generate desired sentences using a learning model.
Enables the generation of output sentences that align with user desires by considering persona attributes, reducing the need for repetitive corrections and improving efficiency.
Smart Images

Figure 0007734454000001 
Figure 0007734454000002 
Figure 0007734454000003
Abstract
Description
[Technical Field]
[0001] The present invention relates to a text generation device, a text generation system, a text generation method, and a program. [Background technology]
[0002] Conventionally, devices that interact with users by performing language processing using artificial intelligence (AI) have been known. For example, Patent Document 1 proposes a processing device that uses a pre-trained neural network to generate an output sentence in response to an input sentence (prompt) input by a user. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Application Publication No. 2020-86549 Summary of the Invention [Problem to be solved by the invention]
[0004] However, in conventional technologies, the content of the output sentence generated changes depending on the content of the input sentence (prompt) entered by the user, so the output sentence desired by the user may not be generated depending on the content of the input sentence. As a result, the input sentence must be repeatedly corrected until the desired output sentence is generated, which can be time-consuming and laborious for the user.
[0005] The present invention has been made in consideration of the above circumstances, and one of its objects is to provide a sentence generation device, a sentence generation system, a sentence generation method, and a program that can obtain the output sentence desired by the user. [Means for solving the problem]
[0006] In order to achieve the above-mentioned object, the sentence generation device of the present invention is a sentence generation device that acquires output sentences related to theme information to be provided to a target person, and includes: a persona information setting unit that sets persona information that indicates the attributes of the target person; an input sentence generation unit that generates advice sentences, which are sentences related to the target person, based on the persona information and without using the theme information, using a learning model, and extracts key phrases from the advice sentences; and an output sentence acquisition unit that acquires output sentences generated using the learning model based on the key phrases extracted by the input sentence generation unit and the theme information. [Effects of the Invention]
[0007] According to one aspect of the present invention, it is possible to provide a text generation device, a text generation system, a text generation method, and a program that can obtain a text desired by a user. [Brief explanation of the drawings]
[0008] [Figure 1] FIG. 1 is a diagram showing the overall configuration of a sentence generation system. [Figure 2] FIG. 1 is a block diagram showing a sentence generation device 100. [Figure 3] 2 is a diagram showing an example of a document display screen 210 displayed on the display unit of the terminal device 200. FIG. [Figure 4] FIG. 2 is a diagram showing an example of a template display screen 220 displayed on the display unit of the terminal device 200. [Figure 5] FIG. 2 is a diagram showing an example of a template input screen 230 displayed on the display unit of the terminal device 200. [Figure 6] 2 is a diagram showing an example of a persona display screen 240 displayed on the display unit of the terminal device 200. FIG. [Figure 7] FIG. 2 is a diagram showing an example of a persona creation screen 250 displayed on the display unit of the terminal device 200. [Figure 8] 2 is a diagram showing an example of a persona detail display screen 260 displayed on the display unit of the terminal device 200. FIG. [Figure 9]FIG. 2 is a diagram showing an example of a similarity check result list screen 270 displayed on the display unit of the terminal device 200. [Figure 10] 10 is a diagram showing an example of a similarity check result details screen 280 displayed on the display unit of the terminal device 200. FIG. [Figure 11] FIG. 10 is a diagram showing an example of how the sentence vector comparison unit 172 calculates the similarity between sentence vectors. [Figure 12] FIG. 10 is a diagram showing an example of how the key phrase comparison unit 174 calculates the occurrence frequency of matching key phrases in an output sentence and a comparison target sentence. [Figure 13] FIG. 10 is a diagram schematically illustrating the process of calculating the overall similarity between an output sentence and a comparison sentence by a similarity calculation unit 170. [Figure 14] 10 is a flowchart showing an example of processing executed by the sentence generation device 100. [Figure 15] 15 is a flowchart showing an example of the similarity calculation process in step S110 of FIG. DETAILED DESCRIPTION OF THE INVENTION
[0009] Hereinafter, a text generation device, a text generation system, a text generation method, and a program according to embodiments will be described with reference to the drawings.
[0010] 1 is a diagram showing the overall configuration of a sentence generation system. The sentence generation system includes a sentence generation device 100, a terminal device 200, an artificial intelligence server 300, and a language analysis server 400. The sentence generation device 100, the terminal device 200, the artificial intelligence server 300, and the language analysis server 400 are communicably connected to each other via a network NW. The network NW includes, for example, some or all of a WAN (Wide Area Network), a LAN (Local Area Network), the Internet, a provider device, a wireless base station, a dedicated line, etc.
[0011] As will be described in detail later, the sentence generation device 100 is a computer that generates an input sentence (prompt) based on the contents of input items entered into a template by a user. The terminal device 200 may be, for example, a desktop computer, a notebook computer, a tablet computer, or a mobile terminal device such as a smartphone. The artificial intelligence server 300 is a server that generates an output sentence using a learning model based on the input sentence generated by the sentence generation device 100. The language analysis server 400 is a server that performs natural language processing such as dividing the sentence, identifying the positions where words appear in the sentence, and acquiring feature vectors (sentence vectors) and key phrases. These devices will be described in detail later.
[0012] 2 is a block diagram showing a sentence generation device 100. The sentence generation device 100 includes a template acquisition unit 110, an input item acquisition unit 120, an input sentence generation unit 130, an output sentence acquisition unit 140, a conversion unit 150, an editing unit 160, a similarity calculation unit 170, a communication unit 180, and a storage unit 190.
[0013] The template acquisition unit 110, the input item acquisition unit 120, the input sentence generation unit 130, the output sentence acquisition unit 140, the conversion unit 150, the editing unit 160, and the similarity calculation unit 170 may be realized, for example, by the processor of the sentence generation device 100 executing a program, or may be realized by hardware such as an LSI (Large Scale Integration), an ASIC (Application Specific Integrated Circuit), or an FPGA (Field-Programmable Gate Array), or may be realized by software and hardware working together.
[0014] The similarity calculation unit 170 includes a sentence vector comparison unit 172, a key phrase comparison unit 174, and an overall similarity calculation unit 176. Details of these functional units will be described later.
[0015] The communication unit 180 includes, for example, a network interface card (NIC). The sentence generation device 100 uses the communication unit 180 to communicate with the terminal device 200, the artificial intelligence server 300, and the language analysis server 400 via the network NW.
[0016] The storage unit 190 is realized by, for example, a random access memory (RAM), a read only memory (ROM), a hard disk drive (HDD), a flash memory, or a hybrid storage device that combines two or more of these. The storage unit 190 may also be an external device accessible to the sentence generation device 100, such as a network attached storage (NAS) or an external storage server. Note that, as will be described in detail later, the storage unit 190 stores information such as template information, persona information, input sentences, output sentences, and comparison sentences.
[0017] The terminal device 200 is a terminal operated by a user, and uses a browser to display various screens on a display unit provided in the terminal device 200. For example, the terminal device 200 accesses the writing generation device 100 by specifying a URL (Uniform Resource Locator), thereby receiving screen data corresponding to the specified URL from the writing generation device 100 and displaying the received screen data on the display unit. The screens displayed on the terminal device 200 will be described below.
[0018] 3 is a diagram showing an example of a document display screen 210 displayed on the display unit of the terminal device 200. The document display screen 210 displays a document creation button 201, a document display button 202, a template display button 203, a persona display button 204, a settings button 205, a trash can button 206, a search word input area 211, a new creation button 212, and an import button 213.
[0019] The document creation button 201 is a button for instructing the creation of a document. When the user selects the document creation button 201, a selection screen (not shown) is displayed, allowing the user to select whether to create a blank document or to create a document using a template. If the user selects to create a blank document, a document input screen (not shown) with no text entered is displayed. On the other hand, if the user selects to create a document using a template, a template display screen 220 (FIG. 4), which will be described later, is displayed on the display unit of the terminal device 200.
[0020] The document display button 202 is a button for displaying a list of documents. When the user selects the document display button 202, a document display screen 210 is displayed. Information about folders and documents created by the user is displayed on the document display screen 210. In the example shown in FIG. 3, a company information folder and various documents (a press release for a spring campaign, a speech script for a presentation) are displayed on the document display screen 210. When the user selects the company information folder, the folders and documents in the company information folder are displayed. Furthermore, when the user selects various documents (a press release for a spring campaign, a speech script for a presentation), an editing screen for the selected document is displayed.
[0021] Information about folders and documents created by the user is stored in the storage unit 190 of the writing generation device 100. The terminal device 200 receives information about folders and documents from the writing generation device 100 and displays it on the document display screen 210.
[0022] The template display button 203 is a button for displaying a list of templates. When the user selects the template display button 203, a template display screen 220 (FIG. 4), which will be described later, is displayed.
[0023] The persona display button 204 is a button for displaying a list of registered persona information. Persona information is data indicating attribute information (for example, name, sex, age, occupation, etc.) of the target person (reader) to whom the output sentence obtained by the text generation device 100 is provided. When the user selects the persona display button 204, a persona display screen 240 (FIG. 6) described below is displayed.
[0024] The setting button 205 is a button for displaying a setting screen (not shown) for making various settings related to the text generation service provided by the text generation device 100. On the setting screen, it is possible to change the plan of the text generation service being used, change the payment method, etc.
[0025] The trash can button 206 is a button for displaying a trash can screen (not shown) that displays a list of folders and documents that have been moved to the trash can. Folders and documents that have been moved to the trash can are automatically deleted after a certain period of time (for example, 30 days) has passed. On the trash can screen, it is possible to empty the trash can and remove folders and documents from the trash can.
[0026] The search word input area 211 is an area where a search word is input in response to a user's operation on the terminal device 200. When a search word is input into the search word input area 211, a list of folders and documents containing the input search word is displayed.
[0027] The new creation button 212 is a button for instructing the creation of a folder or document. When the user selects the new creation button 212, folder and document options are displayed in a pull-down menu. When the user selects the folder option and enters a folder name, a new folder is created. Furthermore, when the user selects the document option, the same processing as when the above-mentioned document creation button 201 is selected is performed.
[0028] The import button 213 is a button for instructing the import of a document. When the user selects the import button 213 and specifies the document to be imported, the specified document is sent to the writing generation device 100 and stored in the storage unit 190 of the writing generation device 100. The imported document is displayed on the document display screen 210 and can be edited by the terminal device 200.
[0029] 4 is a diagram showing an example of a template display screen 220 displayed on the display unit of the terminal device 200. A plurality of template selection buttons 221 to 227 are displayed on the template display screen 220. Each of the plurality of template selection buttons 221 to 227 corresponds to a type of document to be generated (press release, product introduction, blog / column, etc.).
[0030] Specifically, template selection button 221 is a button for selecting a press release template. Template selection button 222 is a button for selecting a product introduction template. Template selection button 223 is a button for selecting a blog / column template. Template selection button 224 is a button for selecting a catchy copy template. Template selection button 225 is a button for selecting a business document template. Template selection button 226 is a button for selecting a rewrite / summary template. Template selection button 227 is a button for selecting a custom template.
[0031] When the user selects one of the plurality of template selection buttons 221 to 227, a template input screen corresponding to the selected button is displayed. In this embodiment, as an example, the process when the user selects the press release template will be described.
[0032] When the user selects the template selection button 221, the terminal device 200 transmits a press release template request to the writing generation device 100. When the writing generation device 100 receives the press release template request from the terminal device 200, the template acquisition unit 110 of the writing generation device 100 reads out press release template information from the storage unit 190 and controls the communication unit 180 to transmit the read press release template information to the terminal device 200. When the terminal device 200 receives the press release template information from the writing generation device 100, it displays a press release template input screen based on the received press release template information.
[0033] Fig. 5 is a diagram showing an example of the template input screen 230 displayed on the display unit of the terminal device 200. In the example shown in Fig. 5, the template input screen 230 for a press release is shown.
[0034] The press release template input screen 230 displays a genre selection area 231, an outline input area 232, a headline input area 233, a persona selection area 234, a text creation button 235, a text display area 236, a document save button 237, and a similarity check button 238.
[0035] The genre selection area 231 is an area for selecting the genre of the press release. When the user selects the genre selection area 231, multiple genre options are displayed in a pull-down menu. The user selects one from the multiple genre options displayed. The summary input area 232 is an area for inputting the summary of the press release. The headline input area 233 is an area for inputting the headline of the press release.
[0036] The persona selection area 234 is an area for selecting persona information of a target person (reader) to whom a press release will be provided from among a plurality of registered persona information. The plurality of registered persona information is stored in the storage unit 190 of the writing generation device 100. Therefore, the terminal device 200 may acquire the plurality of registered persona information from the writing generation device 100. When a user selects the persona selection area 234, options of the plurality of registered persona information are displayed in a pull-down menu. The user selects one of the displayed plurality of persona information options. Note that instead of the persona selection area 234, an area may be provided that allows the user to directly input persona information (for example, name, gender, age, occupation, etc.) of a target person (reader) to whom a press release will be provided.
[0037] Note that the input fields included in the press release template are not limited to these. For example, other input fields, such as the background of the press release, may be included in the press release template. Furthermore, in addition to personas that set people, personas that set media may also be displayed. Media include, for example, television variety shows, documentary programs, social media influencers, the Nikkei newspaper, general national newspapers, industry newspapers, weekly magazines, etc.
[0038] The text creation button 235 is a button for issuing an instruction to generate text based on the information entered in each field of the press release template. When the user selects the text creation button 235, the terminal device 200 transmits the contents of the multiple input fields of the template entered by the user to the writing generation device 100. The input field acquisition unit 120 of the writing generation device 100 acquires the contents of the multiple input fields transmitted from the terminal device 200. Furthermore, the input sentence generation unit 130 of the writing generation device 100 generates an input sentence based on the contents of the multiple input fields acquired by the input field acquisition unit 120. The input sentence is a prompt for causing the artificial intelligence server 300 to generate a sentence. The input sentence generation unit 130 stores the generated input sentence in the memory unit 190 and controls the communication unit 180 to transmit it to the artificial intelligence server 300.
[0039] The artificial intelligence server 300 generates an output sentence based on an input sentence received from the sentence generation device 100 using a learning model trained by an algorithm such as deep learning. When the artificial intelligence server 300 is made to generate a sentence, if the quality and quantity of information contained in the input sentence is insufficient, the sentence desired by the user may not be generated. For this reason, the sentence generation device 100 uses a template to prompt the user to input multiple input items, and generates the input sentence based on the content of the multiple input items. For example, when making the artificial intelligence server 300 generate a sentence for a press release, the user inputs essential content to be incorporated into the input sentence as each item (genre, summary, headline, etc.) of the press release template. For this reason, the artificial intelligence server 300 can generate a sentence (output sentence) desired by the user based on the input sentence generated by the sentence generation device 100.
[0040] The artificial intelligence server 300 transmits the generated output sentence to the sentence generation device 100. The output sentence acquisition unit 140 of the sentence generation device 100 acquires the output sentence transmitted from the artificial intelligence server 300. This allows the sentence generation device 100 to acquire the sentence (output sentence) desired by the user from the artificial intelligence server 300.
[0041] The input item acquisition unit 120 may acquire persona information input using a template, and the input sentence generation unit 130 may generate an input sentence according to the persona information acquired by the input item acquisition unit 120. This allows the text generation device 100 to generate an input sentence that causes the artificial intelligence server 300 to generate an output sentence according to the attributes (e.g., name, sex, age, occupation, etc.) of the target person (reader) to whom the output sentence is provided.
[0042] Furthermore, the conversion unit 150 of the sentence generation device 100 may convert the output sentence acquired by the output sentence acquisition unit 140 according to the persona information acquired by the input item acquisition unit 120. For example, the conversion unit 150 may change the proportion of kanji characters and the proportion of colloquial expressions in the output sentence according to the persona information. Specifically, the conversion unit 150 may convert the content of the output sentence so that the proportion of kanji characters is lower and the proportion of colloquial expressions is higher, as the age indicated by the persona information is lower. Furthermore, the conversion unit 150 may convert the content of the output sentence so that the proportion of kanji characters is higher and the proportion of colloquial expressions is lower, as the age indicated by the persona information is higher. In this way, the sentence generation device 100 can convert the output sentence so that the content corresponds to the attributes (e.g., name, gender, age, occupation, etc.) of the target person (reader) to whom the output sentence is provided.
[0043] The output sentence acquisition unit 140 of the sentence generation device 100 controls the communication unit 180 to send the output sentence to the terminal device 200. The terminal device 200 displays the output sentence received from the sentence generation device 100 in the text display area 236 shown in FIG.
[0044] When the user selects the save document button 237 while the output sentence is displayed in the text display area 236, the content of the output sentence is saved as a document. The terminal device 200 transmits the saved document to the sentence generation device 100. The sentence generation device 100 stores the output sentence received from the terminal device 200 in the storage unit 190.
[0045] The user can directly edit the output sentence displayed in the text display area 236. Specifically, the terminal device 200 transmits the content of the output sentence edited by the user to the sentence generation device 100. The editing unit 160 of the sentence generation device 100 edits the output sentence acquired by the output sentence acquisition unit 140 based on the content received from the terminal device 200. The editing unit 160 also stores the edited output sentence in the storage unit 190.
[0046] Furthermore, when the user selects the similarity check button 238 while the output sentence is displayed in the text display area 236, a similarity check process is executed, and a similarity check result list screen 270 (FIG. 9), which will be described later, is displayed on the terminal device 200. The similarity check process is a process for checking whether sentences similar to the generated output sentence exist on the Internet. If the generated output sentence is similar to sentences already published on the Internet, the generated output sentence may not be usable due to copyright considerations of the sentences. For this reason, the similarity check process is executed based on instructions from the user. The similarity check process will be described in detail later.
[0047] 6 is a diagram showing an example of a persona display screen 240 displayed on the display unit of the terminal device 200. On the persona display screen 240, a search word input area 241, a new creation button 242, and a plurality of persona selection buttons 243 to 246 are displayed.
[0048] The search word input area 241 is an area where a search word is input in response to a user's operation on the terminal device 200. When a search word is input into the search word input area 241, a list of persona information that includes the input search word is displayed.
[0049] New creation button 242 is a button for instructing the creation of persona information. When the user selects new creation button 242, persona creation screen 250 (FIG. 7), which will be described later, is displayed.
[0050] Each of the plurality of persona selection buttons 243 to 246 is associated with a plurality of registered persona information. Specifically, persona selection button 243 is a button for selecting persona information of user A. Persona selection button 244 is a button for selecting persona information of user B. Persona selection button 245 is a button for selecting persona information of user C. Persona selection button 246 is a button for selecting persona information of user D. As will be described in detail later, when the user selects one of the plurality of persona selection buttons 243 to 246, a persona detail display screen 260 (FIG. 8) corresponding to the selected button is displayed.
[0051] FIG. 7 is a diagram illustrating an example of a persona creation screen 250 displayed on the display unit of the terminal device 200. The persona creation screen 250 displays an input area for attribute information of the target (reader) to whom the output sentence is to be provided and a persona registration button 251. As shown in FIG. 7, the attribute information of the target (reader) to whom the output sentence is to be provided includes information about the target (reader)'s image, name, gender, age, occupation, annual income, family, residence, hobbies, how they spend their holidays, and personality. Note that the target (reader) attribute information is not limited to these information and may also include information such as consumption trends, strengths, weaknesses, and worries. By assigning an image and name to a persona, the operator can imagine a specific individual image. Compared to a collection of dry personas, this allows the operator to more specifically imagine the person to whom the sentence is to be provided and easily select the most appropriate persona. Furthermore, since hobbies and how they spend their holidays are set, sentences can be generated that are tailored to the product to be promoted.
[0052] When the user inputs information into all input fields on the persona creation screen 250 and selects the persona registration button 251, the input persona information is registered. The terminal device 200 transmits the registered persona information to the text generation device 100. The text generation device 100 stores the persona information received from the terminal device 200 in the storage unit 190.
[0053] 8 is a diagram showing an example of a persona detail display screen 260 displayed on the display unit of the terminal device 200. As an example, a screen displayed on the terminal device 200 when the user selects the persona selection button 243 shown in FIG.
[0054] 6, the terminal device 200 transmits a request for persona information of user A to the text generation device 100. The text generation device 100 reads out the persona information of user A from the storage unit 190 based on the persona information request of user A received from the terminal device 200. Furthermore, the text generation device 100 controls the communication unit 180 to transmit the persona information of user A read out from the storage unit 190 to the terminal device 200. When the terminal device 200 receives the persona information of user A from the text generation device 100, it displays the received persona information of user A on a persona details display screen 260 shown in FIG. 8. This allows the user to check the registered persona information.
[0055] Fig. 9 is a diagram showing an example of a similarity check result list screen 270 displayed on the display unit of the terminal device 200. As described above, when the user selects the similarity check button 238 shown in Fig. 5, the similarity check process is executed, and the similarity check result list screen 270 is displayed on the terminal device 200. The similarity check result list screen 270 displays a list of the results of the similarity check and a plurality of detail display buttons 271 to 274.
[0056] A list of pages on the Internet that are similar to the generated output sentence is displayed in descending order of overall similarity on the similarity check result list screen 270. As will be described in detail later, the overall similarity is a value calculated by the overall similarity calculation unit 176. The similarity check result list screen 270 also displays the titles and URLs of pages on the Internet that are similar to the generated output sentence.
[0057] When the user selects one of the multiple detail display buttons 271 to 274, a similarity check result detail screen 280 (FIG. 10) described later is displayed on the terminal device 200. In this embodiment, as an example, the similarity check result detail screen 280 when the user selects the detail display button 271 will be described.
[0058] FIG. 10 is a diagram showing an example of a similarity check result detail screen 280 displayed on the display unit of the terminal device 200. The similarity check result detail screen 280 displays an overall similarity 281, a first index value 282, a second index value 283, an output sentence 284, and a comparison sentence 285. The overall similarity 281, the first index value 282, and the second index value 283 are values calculated by a similarity check process described below. The output sentence 284 is an output sentence generated by the artificial intelligence server 300 and acquired by the output sentence acquisition unit 140 of the sentence generation device 100. The comparison sentence 285 is a sentence acquired from the Internet. In the similarity check process, the similarity calculation unit 170 of the sentence generation device 100 calculates an index (similarity) indicating the degree of similarity between the output sentence 284 and the comparison sentence 285. The similarity check process will be described in detail below.
[0059] First, we will explain the language analysis server 400 used in the similarity check process. The language analysis server 400 has various analyzers for dividing sentences, identifying the positions of words in sentences, acquiring feature vectors (sentence vectors), acquiring key phrases, etc., and provides dictionaries, libraries, etc. to be loaded into the various analyzers. For example, the language analysis server 400 can use a natural language processing model such as BERT (Bidirectional Encoder Representations from Transformers) to create a sentence vector corresponding to each sentence based on delimiters such as periods. The language analysis server 400 can also use, for example, spaCy / GiNZA (a type of Japanese morphological analyzer) to acquire important elements (key phrases) that make up each sentence.
[0060] For example, the language analysis server 400 clusters a corpus prepared in advance and calculates the score of each word for each classified cluster. When extracting key phrases from a sentence, the score of each word in the cluster to which the sentence belongs is used to calculate the score of the phrase candidate. The language analysis server 400 can obtain more accurate word scores by collecting a large number of similar sentences. Here, the language analysis server 400 may extract key phrases using corpora for each genre. For example, the language analysis server 400 may prepare corpora for each genre, such as press releases and product introductions, and calculate word scores using the corpus corresponding to the genre specified by the sentence vector acquisition unit 122. In this case, the sentence vector acquisition unit 122 may accept a specification of the genre from the terminal device 200.
[0061] A plurality of sentences collected by crawling the Internet are stored as comparison sentences in the storage unit 190. The similarity calculation unit 170 transmits the output sentence and the comparison sentence stored in the storage unit 190 to the language analysis server 400 to request the creation of sentence vectors, and acquires the sentence vectors corresponding to the output sentence and the comparison sentence. In this embodiment, the sentence vector created based on the output sentence is referred to as the first sentence vector, and the sentence vector created based on the comparison sentence is referred to as the second sentence vector.
[0062] Furthermore, the similarity calculation unit 170 acquires the output sentence and the comparison sentence stored in the storage unit 190, sends them to the language analysis server 400 to request extraction of key phrases from each of the output sentence and the comparison sentence, and acquires key phrases corresponding to each of the output sentence and the comparison sentence. In this embodiment, a key phrase created based on the output sentence is referred to as a first key phrase, and a key phrase created based on the comparison sentence is referred to as a second key phrase.
[0063] The similarity calculation unit 170 calculates the overall similarity between the output sentence and the comparison sentence. As described above, the similarity calculation unit 170 includes the sentence vector comparison unit 172, the key phrase comparison unit 174, and the overall similarity calculation unit 176.
[0064] The sentence vector comparison unit 172 calculates the similarity between the first sentence vector and the second sentence vector based on the inter-vector distance (Euclidean distance) or cosine similarity between the first sentence vector and the second sentence vector created based on the output sentence and the comparison sentence, respectively. The sentence vector comparison unit 172 comprehensively calculates the similarity between the first sentence vector and the second sentence vector, for example, and calculates a first index value for calculating the overall similarity between the output sentence and the comparison sentence.
[0065] 11 is a diagram showing an example of how the sentence vector comparison unit 172 calculates the similarity between sentence vectors. As shown in the figure, each of the output sentence and the comparison sentence is broken down into multiple sentences, such as sentence 1, sentence 2, and sentence 3. The similarity between the sentence vector of sentence 1 in the output sentence and the sentence vector of sentence 2 in the comparison sentence is 97%, the similarity between the sentence vector of sentence 1 in the output sentence and the sentence vector of sentence 3 in the comparison sentence is 35%, and the similarity between the sentence vector of sentence 3 in the output sentence and the sentence vector of sentence 4 in the comparison sentence is 97%. In this way, the sentence vector comparison unit 172 calculates the similarity between the sentence vector of each sentence included in the output sentence and the sentence vector of each sentence included in the comparison sentence.
[0066] For example, the sentence vector comparison unit 172 calculates the similarity between the sentence vectors and then determines whether the calculated similarity is equal to or greater than a threshold. The sentence vector comparison unit 172 then counts the similarity (including the maximum similarity) that is equal to or greater than the threshold and the number of sentence vector pairs whose similarity is equal to or greater than the threshold. In this embodiment, for example, the threshold for similarity between sentence vectors is set to 85%. In this case, the similarities of sentence vector pair (1), sentence vector pair (4), and sentence vector pair (5) in FIG. 11 are "97%, 88%, and 97%, respectively, which are equal to or greater than the 85% threshold. Therefore, the sentence vector comparison unit 172 calculates the similarity between the sentence vectors and the number of pairs, "3," and stores them in the storage unit 190.
[0067] The sentence vector comparison unit 172 may simply calculate the first index value based on the similarity between the calculated sentence vectors that is equal to or greater than a threshold, or may calculate the first index value based on the similarity that is equal to or greater than the threshold and the number of pairs of sentence vectors whose similarity is equal to or greater than the threshold. Furthermore, the sentence vector comparison unit 172 may calculate a weighted sum of the number of pairs, for example, by increasing the weight as the value that exceeds the threshold increases.
[0068] Furthermore, the sentence vector comparison unit 172 may calculate the first index value based on the maximum value of the similarity. In this embodiment, in order to calculate the overall similarity between the output sentence and the comparison sentence with high accuracy, the sentence vector comparison unit 172 calculates the first index value based on the maximum value of the similarity between sentence vectors and the number of sentence vector pairs whose similarity is equal to or greater than a threshold. For example, in the case of FIG. 11, the sentence vector comparison unit 172 calculates the first index value using "97%" and "3".
[0069] The sentence vector comparison unit 172 may calculate the first index value simply based on the number of sentence vector pairs whose similarity is equal to or greater than a threshold, or may calculate the first index value simply based on the maximum similarity. For example, the sentence vector comparison unit 172 calculates the overall similarity so that the greater the number of sentence vector pairs whose similarity is equal to or greater than a threshold, the greater the first index value, and so that the greater the maximum similarity value. As long as this tendency is observed, the sentence vector comparison unit 172 may calculate the first index value using any method.
[0070] The key phrase comparison unit 174 calculates a second index value for calculating the overall similarity between the output sentence and the comparison sentence based on the frequency with which matching key phrases extracted from the output sentence and the comparison sentence appear in the output sentence and the comparison sentence, respectively. The frequency of occurrence is an amount of information indicating the relative frequency or weight of appearance, taking into account the lengths of the output sentence and the comparison sentence.
[0071] 12 is a diagram showing an example of how the key phrase comparison unit 174 calculates the frequency of occurrence of matching key phrases in the output sentence and the comparison sentence. First, the key phrase comparison unit 174 counts the number of occurrences of key phrases in the output sentence and the comparison sentence. Then, the key phrase comparison unit 174 calculates the frequency of occurrence of the key phrase by dividing the number of occurrences of the key phrase by a coefficient corresponding to the length of the output sentence or the comparison sentence. This coefficient is a larger value as the output sentence or the comparison sentence is longer.
[0072] For example, as shown in the figure, the key phrases that appear in the output sentence and the comparison sentence are "expansion," "MEMORY," "memory," "PC," etc. The key phrase "expansion" appears five times in the output sentence and eight times in the comparison sentence. If the coefficient α1 corresponding to the output sentence is calculated as 50 and the coefficient α2 corresponding to the comparison sentence is calculated as 100, the occurrence frequency of "expansion" in the output sentence is calculated as 0.1, and its occurrence frequency in the comparison sentence is calculated as 0.08. It is possible for a key phrase to appear in only one of the output sentence and the comparison sentence. In such cases, the key phrase occurrence count and key phrase occurrence frequency for the sentence in which the key phrase does not appear are zero.
[0073] Then, for example, the key phrase comparison unit 174 virtually arranges key phrases that appear in at least one of the output sentence and the sentence to be compared, and defines a vector (key phrase vector) whose elements are the number of occurrences of the key phrases for each of the output sentence and the sentence to be compared. If the key phrase vector corresponding to the output sentence is the first key phrase vector V1 and the key phrase vector corresponding to the sentence to be compared is the second key phrase vector V2, then in the example of FIG. 12, this is expressed as in equation (1). V1=(0.1,0.06,0.2,0.14,…) V2=(0.08,0,0.1,0.05,…) …(1)
[0074] The key phrase comparison unit 174 calculates, for example, the inter-vector distance (Euclidean distance) or cosine similarity between the first key phrase vector V1 and the second key phrase vector V2, and calculates this as the second index value. The inter-vector distance (Euclidean distance) and cosine similarity calculated here are the similarity between the first key phrase vector V1 and the second key phrase vector V2, and are an example of the similarity between the frequency of appearance of key phrases in the output sentence and the sentence to be compared.
[0075] The overall similarity calculation unit 176 calculates the overall similarity between the output sentence and the comparison sentence based on the first index value and the second index value. For example, the overall similarity calculation unit 176 calculates the overall similarity so that the larger the first index value, the greater the overall similarity, and so that the larger the second index value, the greater the overall similarity. As long as this tendency is observed, the overall similarity calculation unit 176 may calculate the overall similarity using any method.
[0076] 13 is a diagram schematically illustrating the process of calculating the overall similarity between an output sentence and a comparison sentence by the similarity calculation unit 170. In this embodiment, for example, the number of pairs of sentence vectors whose similarity is equal to or greater than the threshold is calculated as n, the maximum similarity is calculated as m, the number of occurrences of the key phrase in the output sentence is P1, the number of occurrences of the key phrase in the comparison sentence is P2, the normalization coefficient of the output sentence is α1, and the normalization coefficient of the comparison sentence is α2.
[0077] The overall similarity calculation unit 176 defines the first index value calculated by the sentence vector comparison unit 172 based on n and m as F, and the second index value calculated by the key phrase comparison unit 174 based on P1, P2, α1, and α2 as Q. The calculation method of the first index value F is expressed, for example, as F=f(n,m). As described above, f(n,m) is a function that calculates the first index value F so that the larger the number n of sentence vector pairs whose similarity is equal to or greater than the threshold, the larger the first index value F becomes, and so that the larger the maximum similarity value m becomes, the larger the first index value F becomes. Furthermore, the calculation method of the second index value Q is expressed, for example, as Q=q(P1,P2,α1,α2). As mentioned above, Q=q(P1, P2, α1, α2) is a function that calculates the frequency of occurrence of key phrases in each sentence by dividing the number of occurrences P1 of key phrases in the output sentence by a coefficient α1 corresponding to the length of the output sentence and the number of occurrences P2 of key phrases in the comparison sentence by a coefficient α2 corresponding to the length of the comparison sentence, and calculates the second index value Q based on the calculated values.
[0078] Then, the overall similarity calculation unit 176 calculates the overall similarity S between the output sentence and the comparison sentence based on the first index value F and the second index value Q. The calculation method of the overall similarity S is expressed, for example, as S=h(F,Q). As described above, S=h(F,Q) is a function that calculates the overall similarity S so that the overall similarity S increases as the first index value F increases and so that the overall similarity S increases as the second index value Q increases.
[0079] FIG. 14 is a flowchart showing an example of processing executed by the writing generation device 100. When a template request is sent from the terminal device 200 to the writing generation device 100, the template acquisition unit 110 acquires a template including multiple input fields from the storage unit 190 based on the template request received from the terminal device 200 (step S100). The template request includes information indicating the template type (press release, product introduction, blog / column, etc.). The template acquisition unit 110 acquires from the storage unit 190 a template corresponding to the template type included in the template request. The template acquisition unit 110 controls the communication unit 180 to send the acquired template information to the terminal device 200.
[0080] 5 based on the template information received from the sentence generation device 100. When the user inputs data into multiple input fields of the template and selects the text creation button 235, the terminal device 200 transmits the contents of the multiple input fields of the template input by the user to the sentence generation device 100.
[0081] Next, the input item acquisition unit 120 acquires the contents of the multiple input items transmitted from the terminal device 200 (step S102). The input sentence generation unit 130 generates an input sentence based on the contents of the multiple input items acquired by the input item acquisition unit 120 (step S104). Thereafter, the input sentence generation unit 130 controls the communication unit 180 to transmit the generated input sentence to the artificial intelligence server 300.
[0082] The artificial intelligence server 300 generates an output sentence using a learning model trained by an algorithm such as deep learning, based on the input sentence received from the sentence generation device 100. Then, the artificial intelligence server 300 transmits the generated output sentence to the sentence generation device 100.
[0083] Next, the output sentence acquisition unit 140 acquires the output sentence transmitted from the artificial intelligence server 300 (step S106). After that, the similarity calculation unit 170 determines whether to perform a similarity check (step S108). For example, the similarity calculation unit 170 may determine to perform a similarity check when the similarity check button 238 shown in Fig. 5 is selected by the user.
[0084] If the similarity calculation unit 170 determines not to perform a similarity check, it ends the processing according to this flowchart. On the other hand, if the similarity calculation unit 170 determines to perform a similarity check, it executes a similarity calculation process (step S110).
[0085] Fig. 15 is a flowchart showing an example of the similarity calculation process of step S110 in Fig. 14. First, the similarity calculation unit 170 acquires the entire sentences of the output sentence and the comparison sentence from the storage unit 190 (step S200). The similarity calculation unit 170 also transmits the output sentence and the comparison sentence to the language analysis server 400 to request creation of sentence vectors. The similarity calculation unit 170 then acquires the sentence vectors of the output sentence and the comparison sentence from the language analysis server 400, as well as key phrases of the output sentence and the comparison sentence from the language analysis server 400 (step S202).
[0086] Next, the sentence vector comparison unit 172 calculates the similarity between the sentence vectors for each pair created based on the output sentence and the comparison target sentence (step S204). The sentence vector comparison unit 172 selects one sentence vector from the first sentence vectors and one sentence vector from the second sentence vectors, and calculates the similarity A between the selected sentence vectors. i,j The calculation of the similarity A between the calculated sentence vectors is then performed for all combinations. i,j It is determined whether or not A is equal to or greater than a threshold value Th (step S208). i,j represents the similarity between the i-th first sentence vector and the j-th second sentence vector. i,jIf the similarity A between the calculated sentence vectors is not equal to or greater than the threshold value Th, the sentence vector comparison unit 172 proceeds to step S216. i,j If is equal to or greater than the threshold value Th, the sentence vector comparison unit 172 counts up the number n of sentence vector pairs that are equal to or greater than the threshold value Th, and stores the count in the storage unit 190 (step S212).
[0087] Then, the sentence vector comparison unit 172 calculates the similarity A for all combinations of sentence vectors. i,j It is determined whether the similarity A has been calculated for all combinations of sentence vectors (step S216). i,j If the similarity A has not been calculated, the sentence vector comparison unit 172 returns to step S204, selects the next set of sentence vectors, and calculates the similarity A i,j Calculate the similarity A for all combinations of sentence vectors. i,j If n is calculated, the sentence vector comparison unit 172 extracts the maximum value m of the calculated similarities (step S220). Next, the sentence vector comparison unit 172 calculates a first index value F based on the number n counted in step S212 and the maximum value m of the similarities calculated in step S220 (step S222).
[0088] In this embodiment, the sentence generation device 100 may extract matching key phrases in the output sentence and the comparison sentence in parallel with the processing of step S204 (step S206).
[0089] The key phrase comparison unit 174 calculates the numbers of occurrences P1 and P2 of key phrases in the output sentence and the comparison sentence, respectively (step S210). Next, the key phrase comparison unit 174 calculates normalization coefficients α1 and α2 for the output sentence and the comparison sentence, respectively (step S214). Based on the calculated P1, P2, α1, and α2, the key phrase comparison unit 174 calculates a second index value Q (step S218).
[0090] Finally, the overall similarity calculation unit 176 calculates the overall similarity S between the output sentence and the comparison sentence based on the first index value F and the second index value Q (step S224).
[0091] By comparing key phrases, key phrases are extracted from the entire sentence, making it possible to determine the similarity of the entire sentence. However, if the sentence to be compared matches only part of the output sentence, the similarity may be determined to be low based on key phrase comparison alone. In contrast, by combining key phrase comparison and sentence vector comparison, as in this embodiment, the similarity can be determined with higher accuracy.
[0092] In other words, in this embodiment, by calculating the similarity between sentence vectors, the user can determine the local similarity between the output sentence and the comparison sentence. Also, by calculating the similarity of the occurrence frequency of key phrases, the user can determine the overall similarity between the output sentence and the comparison sentence.
[0093] The overall similarity, the first index value, and the second index value calculated by the similarity calculation process of Fig. 15 are transmitted to the terminal device 200 and displayed on the similarity check result details screen 280 shown in Fig. 10. This allows the user to understand the degree of similarity between the output sentence and the comparison sentence.
[0094] Next, an example of sentence generation that focuses more on each persona will be described. First, the sentence generation device 100 generates persona generation prompt 1. For example, persona generation prompt 1 quotes a persona input by the user and asks the artificial intelligence server 300, "Please provide a concise summary of lifestyle and life advice for the persona input by the user." In response, the artificial intelligence server 300 creates an advice sentence sprinkled with keywords that the persona is likely to be interested in. This advice sentence is generated differently each time depending on the internet information that the artificial intelligence server 300 references at that time. For example, if the persona is a diligent second-year junior high school student in the season of promotion, such as April in Japan or September in the United States, the advice generated might be, "It's the new semester. As you start the new school year, you should look back on what you've learned so far and thoroughly re-study your weak areas, as well as look over the items you plan to learn in the new school year and set your learning goals. Also, since this is your grade that plays a central role in club activities, it would be a good idea to think about not only yourself, but also what kind of activities you will be doing with the juniors who are joining for the first time."
[0095] Next, the sentence generation device 100 generates persona generation prompt 2. Persona generation prompt 2 quotes the advice statement output by persona generation prompt 1 and asks the artificial intelligence server 300 to "extract eight important words or phrases." The artificial intelligence server 300 then extracts key phrases that the persona selected by the user would be interested in from the advice statement. In the above example, it is assumed that "(1) new semester, (2) start of the school year, (3) reflection, (4) weak areas, (5) setting learning goals, (6) central role, (7) juniors joining for the first time, and (8) image of activities" are extracted.
[0096] Next, the sentence generation device 100 causes the artificial intelligence server 300 to create a final sentence by quoting the initial information (theme) input by the user and the key phrase. A final sentence is then generated that combines the theme and key phrase input by the user. This final sentence will be different each time because the initial advice sentence is different each time. Furthermore, since the final sentence uses phrases that interest the persona in terms of lifestyle habits and life, it will be a sentence that interests the persona while conforming to the theme the user wants to create. For example, in the above example, if the theme input by the user is "PR for a new lunch box product," a PR sentence such as "It's the new semester! Why not freshen up with a new lunch box to start the new school year? You might even get to eat lunch with your new classmates!" will be generated.
[0097] As described above, in this embodiment, the input sentence generation unit 130 extracts key phrases from the input sentence according to the persona information. The artificial intelligence server 300 generates a final sentence using a learning model based on the key phrases extracted by the input sentence generation unit 130 and multiple input items entered by the user. The output sentence acquisition unit 140 acquires the final sentence generated by the artificial intelligence server 300. This allows the sentence generation device 100 of this embodiment to cause the artificial intelligence server 300 to create a promotional sentence that will be more interesting to the persona.
[0098] It is important to assign a role to the AI server 300 when prompting for the final sentence. For example, when generating a press release for a new product, the role definition is "You are an excellent public relations professional" at the beginning of the question posed to the AI server 300. Even when explaining the same product, an engineer would explain the product's new features and the technical topics required to realize them, while an elementary school teacher would explain to students how to use the product safely. Even when discussing the same topic, "explaining a new product," if the perspective from which the explanation will be given is not clearly defined in advance, the generated sentences will often be off-topic and inefficient. In this embodiment, an instruction to assign the AI server 300 the following role at the beginning of the question is added to the prompt for generating the final sentence. This increases the probability of generating an accurate sentence. In this embodiment, by assigning the AI server 300 a role associated with the template selected by the user, the user can generate an appropriate sentence simply by selecting a template without having to consider the role to assign to the AI server 300. Examples of linking roles to the AI server 300 for each type of template are shown below.
[0099] [Template type] [Role given to GPT] Press release for new product You are a great PR person Summary You are an excellent web writer. Product Introduction You are a great salesperson Blog / Column You are an excellent web writer
[0100] Of course, the roles associated with each template are not limited to these, and more detailed role settings may be defined. However, according to the inventor's findings, there is a high probability that good sentences will be generated when the exemplified occupations are assigned as roles. Regardless of which occupation is assigned as a role, adding "excellent" tends to produce good results.
[0101] The sentence generation device 100 of this embodiment may include some or all of the functions of the artificial intelligence server 300, and the sentence generation device 100 may generate an output sentence using a learning model. The sentence generation device 100 of this embodiment may also include some or all of the functions of the language analysis server 400, and the sentence generation device 100 may perform natural language processing such as dividing a sentence, identifying the positions where words appear in a sentence, acquiring feature vectors (sentence vectors), and acquiring key phrases.
[0102] According to the embodiment described above, the sentence generation device 100 includes a template acquisition unit 110 that acquires a template including a plurality of input items, an input item acquisition unit 120 that acquires the contents of the plurality of input items input by a user using the template acquired by the template acquisition unit 110, an input sentence generation unit 130 that generates an input sentence based on the contents of the plurality of input items acquired by the input item acquisition unit 120, and an output sentence acquisition unit 140 that acquires an output sentence generated using a learning model based on the input sentence generated by the input sentence generation unit 130. In this way, the sentence generation device 100 can acquire an output sentence desired by the user.
[0103] Although the preferred embodiments of the present invention have been described above, the present invention is not limited to these embodiments. Addition, omission, substitution, and other modifications of the configuration are possible within the scope of the spirit of the present invention. The present invention is not limited by the above description, but is limited only by the scope of the appended claims. [Explanation of symbols]
[0104] 100 Sentence generator 110 Template Acquisition Unit 120 Input item acquisition section 130 Input sentence generation unit 140 Output sentence acquisition unit 150 Conversion Unit 160 Editorial Department 170 Similarity calculation unit 172 Sentence Vector Comparison Unit 174 Keyphrase Comparison Section 176 Overall similarity calculation unit 180 Communications Department 190 Storage section 200 Terminal Device 300 Artificial Intelligence Server 400 Language Analysis Server
Claims
1. A sentence generation device that acquires an output sentence related to topic information to be provided to a subject, a persona information setting unit that sets persona information indicating attributes of the subject; an input sentence generation unit that generates an advice sentence, which is a sentence related to the target person, using a learning model based on the persona information without using the theme information, and extracts key phrases from the advice sentence; an output sentence acquisition unit that acquires an output sentence generated using a learning model based on the key phrase extracted by the input sentence generation unit and the theme information; A sentence generation device comprising:
2. a conversion unit that changes a ratio of kanji or a ratio of colloquial expressions in the output sentence acquired by the output sentence acquisition unit according to the persona information, The sentence generation device according to claim 1.
3. further comprising an editing unit that edits the output sentence acquired by the output sentence acquisition unit, The sentence generation device according to claim 1.
4. a similarity calculation unit that acquires sentence vectors, which are feature vectors for each sentence obtained by breaking down the output sentence acquired by the output sentence acquisition unit and a comparison sentence, which is a sentence to be compared and acquired from the Internet, acquires key phrases that are included in the output sentence and the comparison sentence and are important elements that constitute the sentences, and calculates an overall similarity between the output sentence and the comparison sentence based on the similarity between the sentence vectors between the output sentence and the comparison sentence and the similarity between the occurrence frequencies of the same key phrases, The sentence generation device according to claim 1.
5. The similarity calculation unit a sentence vector comparison unit that comprehensively compares one or more first sentence vectors obtained from the output sentence with one or more second sentence vectors obtained from the comparison sentence to calculate a similarity between the sentence vectors, and calculates a first index value that represents a similarity between the output sentence and the comparison sentence based on the similarity between the sentence vectors; a key phrase comparison unit that calculates a second index value that indicates a similarity between the output sentence and the comparison sentence based on the frequency with which the key phrases that match between the key phrases obtained from the output sentence and the key phrases obtained from the comparison sentence appear in the output sentence and the comparison sentence, respectively; an overall similarity calculation unit that calculates an overall similarity between the output sentence and the comparison sentence based on the first index value and the second index value, The sentence generation device according to claim 4.
6. The sentence generation device according to claim 5 ; a terminal device that displays the overall similarity calculated by the overall similarity calculation unit of the sentence generation device, Text generation system.
7. A sentence generation device that acquires output sentences related to topic information to be provided to a subject, Acquire persona information indicating the attributes of the subject; Based on the acquired persona information, an advice sentence is generated, which is a sentence about the target person generated using a learning model without using the theme information, and key phrases are extracted from the advice sentence; obtaining an output sentence generated using a learning model based on the extracted key phrases and the theme information; Sentence generation method.
8. A sentence generation device for obtaining an output sentence related to topic information to be provided to a subject, acquiring persona information indicating attributes of the subject; Based on the acquired persona information, an advice sentence is generated, which is a sentence about the target person that is generated using a learning model without using the theme information, and key phrases are extracted from the advice sentence; obtaining an output sentence generated using a learning model based on the extracted key phrases and the theme information; program.
Citation Information
Patent Citations
Advice support system and advice support method
JP2017211852A
Program, computer apparatus, information output method, and information output system
JP2019153200A
Learning device, learning method and learning program
JP2020086549A