Sentence generation device, sentence generation system, sentence generation method, and program
The text generation device addresses inefficiencies in conventional systems by using persona information and a learning model to generate user-desired output sentences through key phrase extraction, enhancing efficiency and alignment with user preferences.
Patent Information
- Application Number
- JP2024172509
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-28
- Filing Date
- 2024-10-01
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-01-29
AI Technical Summary
Conventional text generation systems often require users to repeatedly modify input sentences to achieve desired output sentences, leading to inefficiency and user effort due to the dependency on the content of the input sentence.
A text generation device that utilizes persona information and a learning model to generate output sentences based on theme information, incorporating a key phrase extraction process to ensure the output aligns with user desires.
Enables the generation of user-desired output sentences efficiently by leveraging persona information and a learning model to align the content with user preferences, reducing the need for iterative input modifications.
Smart Images

Figure 2024174144000001_ABST
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 communicate 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] JP 2020-86549 A Summary of the Invention [Problem to be solved by the invention]
[0004] However, in conventional technology, 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. For this reason, the input sentence must be repeatedly corrected until the output sentence desired by the user is generated, which may take time and effort for the user.
[0005] The present invention has been made in consideration of the above circumstances, and one of its objectives 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 obtains output sentences related to theme information to be provided to a subject, and includes a persona information setting unit that sets persona information indicating the attributes of the subject, an input sentence generation unit that generates advice sentences, which are sentences related to the subject, 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 obtains output sentences generated using the learning model based on the key phrases extracted by the input sentence generation unit and the theme information. Effect 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 capable of acquiring a text desired by a user. [Brief description of the drawings]
[0008] [Figure 1] FIG. 1 is a diagram showing an overall configuration of a sentence generation system. [Diagram 2] FIG. 1 is a block diagram showing a sentence generation device 100. [Diagram 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. [Diagram 5] FIG. 2 shows 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] 2 is a diagram showing an example of a persona creation screen 250 displayed on the display unit of the terminal device 200. FIG. [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] 13 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. 13 is a diagram showing an example of how the sentence vector comparison unit 172 calculates the similarity between sentence vectors. [Figure 12] FIG. 13 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 in each sentence. [Figure 13] 13 is a diagram showing a schematic diagram of a process performed by a similarity calculation unit 170 to calculate an overall similarity between an output sentence and a comparison sentence. FIG. [Figure 14] 4 is a flowchart showing an example of a process 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 PREFERRED EMBODIMENTS
[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 text generation system. The text generation system includes a text generation device 100, a terminal device 200, an artificial intelligence server 300, and a language analysis server 400. The text generation device 100, the terminal device 200, the artificial intelligence server 300, and the language analysis server 400 are communicatively 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, and the like.
[0011] Although the details will be described later, the sentence generation device 100 is a computer that generates an input sentence (prompt) based on the contents of the input items entered into a template by a user. The terminal device 200 may be, for example, any of a desktop computer, a notebook computer, a tablet computer, and 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 position where a word appears in the sentence, acquiring a feature vector (sentence vector), and acquiring a key phrase. The details of these devices will be described later.
[0012] 2 is a block diagram showing the text generation device 100. The text 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 a combination of software and hardware.
[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 a plurality 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), receives screen data corresponding to the specified URL from the writing generation device 100, and displays 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. On the document display screen 210, 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 button 206, a search word input area 211, a new creation button 212, and an import button 213 are displayed.
[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 for selecting 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) in which no text has been input 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 generated 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. Also, 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 generated 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 (e.g., name, sex, age, occupation, etc.) of a target person (reader) to whom an output sentence obtained by the text generation device 100 is provided. When a user selects the persona display button 204, a persona display screen 240 (FIG. 6) described later 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, and the like.
[0025] A 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 (e.g., 30 days) has elapsed. On the trash can screen, it is possible to perform a process for emptying the trash can and a process for removing 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 in the search word input area 211, a list of folders and documents containing the input search word is displayed.
[0027] New creation button 212 is a button for instructing the creation of a folder or document. When the user selects new creation button 212, options for folder and document are displayed in a pull-down menu. A new folder is created when the user selects the folder option and enters a folder name. Also, when the user selects the document option, the same process 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 a document to be imported, the specified document is transmitted 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 will be described for the case where the user selects the press release template.
[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 a summary of the press release. The headline input area 233 is an area for inputting a 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 is to 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 text generation device 100. Therefore, the terminal device 200 may acquire the plurality of registered persona information from the text 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 in which the user is allowed to directly input persona information (e.g., name, sex, age, occupation, etc.) of a target person (reader) to whom a press release is to be provided.
[0037] Note that the input items included in the press release template are not limited to these items. For example, other input items such as the background of the press release may be included in the press release template. Furthermore, in addition to the personas that set people, personas that set media may be displayed. Media include, for example, television variety shows, documentary shows, SNS 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 information entered into each item 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 items of the template entered by the user to the writing generation device 100. The input item acquisition unit 120 of the writing generation device 100 acquires the contents of the multiple input items transmitted from the terminal device 200. In addition, the input sentence generation unit 130 of the writing generation device 100 generates an input sentence based on the contents of the multiple input items acquired by the input item 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 storage 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 using a learning model learned by an algorithm such as deep learning based on an input sentence received from the sentence generation device 100. When the artificial intelligence server 300 generates 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 has the user input a plurality of input items using a template, and generates the input sentence based on the contents of the input plurality of input items. For example, when the artificial intelligence server 300 generates a sentence for a press release, the essential contents to be incorporated in the input sentence are input by the user 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. In this way, the sentence generation device 100 can 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 for causing the artificial intelligence server 300 to generate an output sentence according to the attributes (e.g., name, sex, age, occupation, etc.) of a target person (reader) to whom the output sentence is provided.
[0042] Furthermore, the conversion unit 150 of the text generation device 100 may convert the output text acquired by the output text 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 ratio of kanji and the ratio of colloquial expressions in the output text according to the persona information. Specifically, the conversion unit 150 may convert the content of the output text so that the lower the age indicated by the persona information, the lower the ratio of kanji and the higher the ratio of colloquial expressions. Furthermore, the conversion unit 150 may convert the content of the output text so that the higher the age indicated by the persona information, the higher the ratio of kanji and the lower the ratio of colloquial expressions. In this way, the text generation device 100 can convert the output text so that the content corresponds to the attributes (for example, name, sex, age, occupation, etc.) of the target person (reader) to whom the output text is provided.
[0043] The output sentence acquisition unit 140 of the sentence generation device 100 controls the communication unit 180 to transmit 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 document save 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 text generation device 100. The text 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 text generation device 100. The editing unit 160 of the text 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 or not a sentence similar to the generated output sentence exists on the Internet. If the generated output sentence is similar to a sentence that has already been published on the Internet, the generated output sentence may not be usable due to copyright considerations of the sentence. 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-246 are displayed.
[0048] The search word input area 241 is an area in which a search word is input in response to a user's operation on the terminal device 200. When a search word is input in the search word input area 241, a list of persona information including 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 multiple persona selection buttons 243-246 is associated with multiple pieces 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. Although details will be described later, when the user selects one of the multiple persona selection buttons 243-246, a persona detail display screen 260 (FIG. 8) corresponding to the selected button is displayed.
[0051] FIG. 7 is a diagram showing 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 person (reader) to whom the output sentence is provided, and a persona registration button 251. As shown in FIG. 7, the attribute information of the target person (reader) to whom the output sentence is provided includes information on the target person's (reader's) image, name, sex, age, occupation, annual income, family, residence, hobbies, how to spend holidays, and personality. Note that the attribute information of the target person (reader) is not limited to these pieces of information, and may include information such as consumption tendencies, advantages, disadvantages, and worries. By setting an image and a name to the persona, the operator can recall a specific individual image, and compared to a dry collection of personas, the operator can more specifically imagine the person to whom the sentence is to be provided, and can easily select the most suitable persona. In addition, since hobbies and how to spend holidays are set, sentences can be generated according to the product to be promoted.
[0052] When the user inputs information into all input areas 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] Fig. 8 is a diagram showing an example of a persona detail display screen 260 displayed on the display unit of the terminal device 200. Here, as an example, a screen displayed on the terminal device 200 when the user selects the persona selection button 243 shown in Fig. 6 will be described.
[0054] When the user selects the persona selection button 243 shown in Fig. 6, the terminal device 200 transmits a persona information request for user A to the text generation device 100. The text generation device 100 reads out the persona information for user A from the storage unit 190 based on the persona information request for user A received from the terminal device 200. Furthermore, the text generation device 100 controls the communication unit 180 to transmit the persona information for user A read out from the storage unit 190 to the terminal device 200. When the terminal device 200 receives the persona information for user A from the text generation device 100, it displays the received persona information for 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. Although details will be described 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 obtained by a similarity check process described later. 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 writing 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 writing generation device 100 calculates an index (similarity) indicating how similar the output sentence 284 is to the comparison sentence 285. The similarity check process will be described in detail below.
[0059] First, the language analysis server 400 used when performing the similarity check process will be described. The language analysis server 400 has various analyzers for dividing sentences, identifying the positions where words appear in sentences, acquiring feature vectors (sentence vectors), acquiring key phrases, etc., and provides dictionaries, libraries, etc. to be read into the various analyzers. For example, the language analysis server 400 can use a natural language processing model of BERT (Bidirectional Encoder Representations from Transformers) to create a sentence vector corresponding to each sentence based on a delimiter such as a full stop. In addition, the language analysis server 400 can use, for example, spaCy / GiNZA (a type of Japanese morphological analyzer) to acquire important elements (key phrases) that constitute 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 a key phrase from a sentence, the score of the phrase candidate is obtained using the score of each word of the cluster to which the sentence belongs. The language analysis server 400 can obtain a more accurate word score by collecting a large number of similar sentences. Here, the language analysis server 400 may extract a key phrase using a corpus for each genre. For example, the language analysis server 400 prepares a corpus for each genre, such as press releases and product introductions, in advance, and calculates the score of the word 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 generation of sentence vectors, and obtains the sentence vectors corresponding to the output sentence and the comparison sentence, respectively. In this embodiment, the sentence vector generated based on the output sentence is referred to as a first sentence vector, and the sentence vector generated based on the comparison sentence is referred to as a second sentence vector.
[0062] Furthermore, the similarity calculation unit 170 acquires the output sentence and the comparison sentence stored in the storage unit 190, transmits them to the language analysis server 400 to request extraction of key phrases from the output sentence and the comparison sentence, respectively, and acquires key phrases corresponding to the output sentence and the comparison sentence, respectively. 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 calculates the similarity between the first sentence vector and the second sentence vector, for example, comprehensively, 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 target sentence is decomposed into a plurality of sentences such as sentence 1, sentence 2, and sentence 3. The similarity between the sentence vector of sentence 1 of the output sentence and the sentence vector of sentence 2 of the comparison target sentence is 97%, the similarity between the sentence vector of sentence 1 of the output sentence and the sentence vector of sentence 3 of the comparison target sentence is 35%, and the similarity between the sentence vector of sentence 3 of the output sentence and the sentence vector of sentence 4 of the comparison target 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 target sentence.
[0066] For example, the text vector comparison unit 172 calculates the similarity between the text vectors, and then determines whether the calculated similarity is equal to or greater than a threshold. Then, the text vector comparison unit 172 counts the similarity (including the maximum similarity) that is equal to or greater than the threshold and the number of text vector pairs whose similarity is equal to or greater than the threshold. In this embodiment, for example, the similarity threshold between text vectors is set to 85%. In this case, the similarities of the text vector pair (1), the text vector pair (4), and the text vector pair (5) in FIG. 11 are "97%, " "88%, " "97%, " "which are equal to or greater than the threshold of 85%, respectively, so the text vector comparison unit 172 calculates the similarity between the text 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 a threshold and the number of pairs of sentence vectors whose similarity is equal to or greater than a threshold. Also, the sentence vector comparison unit 172 may calculate a weighted sum of the number of pairs by increasing the weight as the value exceeds the threshold.
[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 value. 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 text vector comparison unit 172 may simply calculate the first index value based on the number of text vector pairs whose similarity is equal to or greater than the threshold, or may simply calculate the first index value based on the maximum similarity. For example, the text vector comparison unit 172 calculates the overall similarity so that the first index value increases as the number of text vector pairs whose similarity is equal to or greater than the threshold increases, and so that the first index value increases as the maximum similarity increases. As long as this tendency is observed, the text vector comparison unit 172 may calculate the first index value by 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 occurrence frequency of matching key phrases between the key phrases extracted from the output sentence and the comparison sentence in the output sentence and the comparison sentence. The occurrence frequency is an amount of information indicating the relative frequency or weight of occurrence in the output sentence and the comparison sentence, 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 occurrence frequency 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 divides the number of occurrences of the key phrase by a coefficient according to the length of the output sentence or the comparison sentence to calculate the occurrence frequency of the key phrase. The longer the output sentence or the comparison sentence is, the larger this coefficient is.
[0072] For example, as shown in the figure, the key phrases appearing 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. In contrast, 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 the occurrence frequency in the comparison sentence is calculated as 0.08. There may be a key phrase that appears only in one of the output sentence and the comparison sentence. In that case, 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, the key phrase comparison unit 174 virtually arranges key phrases appearing in at least one of the output sentence and the sentence to be compared, and defines a vector (key phrase vector) whose element is 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, it is expressed as shown in formula (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 it 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 of the occurrence frequency 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 overall similarity increases as the first index value increases, and the overall similarity increases as the second index value increases. As long as this tendency is observed, the overall similarity calculation unit 176 may calculate the overall similarity by any method.
[0076] 13 is a diagram showing a schematic diagram of 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 first index value F increases as the number n of sentence vector pairs whose similarity is equal to or greater than the threshold value increases, and the first index value F increases as the maximum value m of similarity increases. 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 the key phrase in each sentence by dividing the number of occurrences P1 of the key phrase in the output sentence by the coefficient α1 corresponding to the length of the output sentence and the number of occurrences P2 of the key phrase in the comparison sentence by the 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 as, for example, S=h(F,Q). As described above, S=h(F,Q) is a function that calculates the overall similarity S such that the larger the first index value F is, the larger the overall similarity S is, and the larger the second index value Q is, the larger the overall similarity S is.
[0079] 14 is a flowchart showing an example of processing executed by the text generation device 100. When a template request is transmitted from the terminal device 200 to the text generation device 100, the template acquisition unit 110 acquires a template including a plurality of input items 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 type of template (press release, product introduction, blog / column, etc.). The template acquisition unit 110 acquires a template corresponding to the template type included in the template request from the storage unit 190. The template acquisition unit 110 controls the communication unit 180 to transmit the acquired template information to the terminal device 200.
[0080] 5 based on the template information received from the text generation device 100. When the user inputs data into multiple input items of the template and selects the text creation button 235, the terminal device 200 transmits the contents of the multiple input items of the template input by the user to the text 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). After that, 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. After that, 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 the similarity check, the process according to this flowchart ends. On the other hand, if the similarity calculation unit 170 determines to perform the similarity check, the similarity calculation unit 170 executes a similarity calculation process (step S110).
[0085] Fig. 15 is a flowchart showing an example of the similarity calculation process in 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 the generation 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, and acquires 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 not, 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 text vector comparison unit 172 extracts the maximum value m of the calculated similarities (step S220). Next, the text 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 process of step S204 (step S206).
[0089] The key phrase comparison unit 174 calculates the number of occurrences P1 and P2 of the key phrase in each of the output sentence and the comparison sentence (step S210). Next, the key phrase comparison unit 174 calculates the normalization coefficients α1 and α2 of the output sentence and the comparison sentence (step S214). Based on the calculated P1, P2, α1, and α2, the key phrase comparison unit 174 calculates the 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] In key phrase comparison, key phrases are extracted from the entire sentence, so that the similarity of the entire sentence can be determined. However, when the sentence to be compared matches only a part of the output sentence, the similarity may be determined to be low by only comparing key phrases. In contrast, by combining key phrase comparison and sentence vector comparison as in this embodiment, the similarity can be determined with a higher degree of accuracy.
[0092] That is, in this embodiment, by calculating the similarity between the 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 focusing on each persona will be described. First, the sentence generation device 100 generates a persona generation prompt 1. For example, the persona generation prompt 1 quotes a persona input by the user, and asks the artificial intelligence server 300, "Please provide a brief summary of lifestyle and life advice for the persona input by the user." The artificial intelligence server 300 then creates an advice sentence sprinkled with keywords that the persona would be interested in. This advice sentence is generated differently each time depending on the Internet information that the artificial intelligence server 300 refers to at that time. For example, in the season of promotion, such as April in Japan and September in the United States, if the persona is a diligent second-year junior high school student, 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, and also look over the items you plan to learn in the new school year and set study 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 about 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 a persona generation prompt 2. The persona generation prompt 2 quotes the advice statement output by the 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) review, (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. Then, a final sentence is generated by combining the theme and the key phrase input by the user. This final sentence will be different every time because the initial advice sentence is different every time. In addition, the final sentence will be a sentence that uses phrases that the persona is interested in in terms of lifestyle and life, so it will be a sentence that is in line with the theme that the user wants to create and that the persona is interested in. For example, in the above example, if the theme input by the user is "PR for a new lunch box product," a PR sentence will be generated that reads, "It's the new semester! Why not refresh yourself with a new lunch box to start the new school year? You may even have lunch with your juniors who are joining for the first time!"
[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. In this way, the sentence generation device 100 of this embodiment can cause the artificial intelligence server 300 to create a promotional sentence that will further interest the persona.
[0098] In the prompt for creating the final sentence, it is important to assign a role to the artificial intelligence server 300. For example, when generating a press release for a new product, the role is defined as "You are an excellent publicist" at the beginning of the question to be posed to the artificial intelligence server 300. Even when explaining the same product, an engineer will explain the new functions of the product and the technical topics to realize them, while an elementary school teacher will explain to students how to use the product safely. Even with the same theme of "explaining a new product", if the position from which the explanation will be given is not clarified in advance, off-target sentences are often generated, which is inefficient. In this embodiment, an instruction to give the artificial intelligence server 300 the role shown below 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 giving the artificial intelligence server 300 the role associated with the template selected by the user, the user does not have to consider the role to be given to the artificial intelligence server 300, and appropriate sentences are generated just by selecting the template. Below are examples of linking roles to be given to the artificial intelligence server 300 for each type of template.
[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 if the exemplified occupations are given as roles. Regardless of which occupation is associated as a role, adding "excellent" tends to produce good results.
[0101] The text generation device 100 of this embodiment may include some or all of the functions of the artificial intelligence server 300, and the text generation device 100 may generate an output sentence using a learning model. The text generation device 100 of this embodiment may include some or all of the functions of the language analysis server 400, and the text generation device 100 may perform natural language processing such as dividing a sentence, identifying the position where a word appears in a sentence, acquiring a feature vector (sentence vector), and acquiring a key phrase.
[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 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 by using a learning model based on the input sentence generated by the input sentence generation unit 130. This allows the sentence generation device 100 to 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 without departing from 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 attached claims. [Explanation of symbols]
[0104] 100 Sentence generator 110 Template Acquisition Section 120 Input item acquisition section 130 Input sentence generation unit 140 Output text acquisition unit 150 Converter 160 Editorial Department 170 Similarity calculation unit 172 Text Vector Comparison Unit 174 Keyphrase Comparison Section 176 Overall Similarity Calculation Unit 180 Communications Department 190 Memory section 200 Terminal Equipment 300 AI 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, by using a learning model based on the persona information without using the theme information, and extracts a key phrase 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.
2. The text generating apparatus according to claim 1.
3. The output sentence acquisition unit may further include an editing unit that edits the output sentence acquired by the output sentence acquisition unit.
2. The text generating apparatus according to claim 1.
4. a similarity calculation unit that acquires sentence vectors, which are feature vectors for each sentence obtained by decomposing the output sentence acquired by the output sentence acquisition unit and a comparison sentence, which is a sentence to be compared acquired from the Internet, acquires key phrases, which are important elements that constitute sentences, included in each of the output sentence and the comparison sentence, and calculates an overall similarity between the output sentence and the comparison sentence based on a similarity between the sentence vectors between the output sentence and the comparison sentence and a similarity between the occurrence rates of the same key phrases, 2. The text generating apparatus according to claim 1.
5. The similarity calculation unit is 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 representing a similarity between the output sentence and the comparison target sentence based on the frequency of occurrence of the key phrase that matches between the key phrase obtained from the output sentence and the key phrase obtained from the comparison target sentence in each of the output sentence and the comparison target sentence; 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 text generating device according to claim 4.
6. A sentence generating 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 for obtaining output sentences related to topic information to be provided to a subject, Acquire persona information indicating attributes of the subject; generating an advice sentence, which is a sentence about the target person generated using a learning model without using the theme information, based on the acquired persona information, and extracting key phrases 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 output sentences related to topic information to be provided to a subject, Acquire 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 generated by using a learning model without using the theme information, and a key phrase is 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
Cited By
Press release creation support program, apparatus, and method
JP2026123753A
Press release creation support program, device, and method
JP7745304B1
