TWM629035U - Character generator - Google Patents

Character generator Download PDF

Info

Publication number
TWM629035U
TWM629035U TW111201143U TW111201143U TWM629035U TW M629035 U TWM629035 U TW M629035U TW 111201143 U TW111201143 U TW 111201143U TW 111201143 U TW111201143 U TW 111201143U TW M629035 U TWM629035 U TW M629035U
Authority
TW
Taiwan
Prior art keywords
candidate
processing module
generated
string
generation
Prior art date
Application number
TW111201143U
Other languages
Chinese (zh)
Inventor
黃日泓
陳皓遠
吳瑞琳
沈虹伶
鄭明奇
宋政隆
王俊權
Original Assignee
中國信託商業銀行股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中國信託商業銀行股份有限公司 filed Critical 中國信託商業銀行股份有限公司
Priority to TW111201143U priority Critical patent/TWM629035U/en
Publication of TWM629035U publication Critical patent/TWM629035U/en

Links

Images

Abstract

一種用於生成多個文字的文字生成裝置,該文字生成裝置接收到一包含一生成條件的生成請求後,將該生成條件編碼為一固定格式的待生成輸入資料,根據該待生成輸入資料利用一文字生成模型生成N個候選文字,將該等N個候選文字加入該候選字串,以更新該候選字串,對於每一個評分條件,根據該候選字串及該評分條件,獲得一相關於該候選字串的評分,判定該至少一評分之總分是否大於一評分閥值,當判定該至少一評分之總分大於該評分閥值時,判定該候選字串是否符合一生成終止條件,當判定該候選字串符合該生成終止條件時,輸出該候選字串。A character generation device for generating a plurality of characters, after the character generation device receives a generation request including a generation condition, encodes the generation condition into input data to be generated in a fixed format, and uses the input data to be generated according to the input data to be generated. A character generation model generates N candidate characters, and adds the N candidate characters to the candidate character string to update the candidate character string. For each scoring condition, according to the candidate character string and the scoring condition, obtain a The score of the candidate string, determine whether the total score of the at least one score is greater than a scoring threshold, when it is determined that the total score of the at least one score is greater than the scoring threshold, determine whether the candidate string meets a generation termination condition, when When it is determined that the candidate string meets the generation termination condition, the candidate string is output.

Description

文字生成裝置text generation device

本新型是有關於一種用於生成文字的文字生成裝置,特別是指一種用於生成符合條件之多個文字的文字生成裝置。The present invention relates to a character generation device for generating characters, in particular to a character generation device for generating a plurality of characters that meet conditions.

當商業公司在產生行銷文案時,除了要了解客戶對於文案的喜好,亦需要知道文案中哪些文字能夠吸引客戶注意,且在網路時代中,客戶接觸的數位通路眾多,文案的需求也較以往的紙本廣告大幅增加,然而,要根據大量的文案產出最佳的行銷文案,其現有的方法是仰賴業務專家,依照產品特質與行銷目的,以人工的方式產生行銷文案,此方法缺點有二,第一是所產出的行銷文案會因為不同的業務專家而有品質差異,連帶會影響行銷結果,第二是為了產生最佳行銷文案,勢必得需閱讀大量的文案及找靈感,便會花費很多時間,因此,若是能提供一個可以快速且精準地生成能夠吸引客戶注意的最佳行銷文案,便能降低時間及人力成本。When commercial companies generate marketing copy, in addition to understanding customers’ preferences for copy, they also need to know which words in the copy can attract customers’ attention. In the Internet age, customers are exposed to many digital channels, and the demand for copy is also higher than before. However, to produce the best marketing copy based on a large amount of copywriting, the existing method is to rely on business experts to manually generate marketing copy according to product characteristics and marketing purposes. The disadvantages of this method are: Second, the first is that the quality of the produced marketing copy will be different due to different business experts, which will jointly affect the marketing results. The second is that in order to generate the best marketing copy, it is bound to have to read a lot of copywriting and find inspiration. It can take a lot of time, so if you can provide a quick and accurate generation of the best marketing copy that will catch the customer's attention, you can reduce time and labor costs.

因此,本新型之目的,即在提供一種可即時且自動地生成符合條件的多個文字之文字生成裝置。Therefore, the purpose of the present invention is to provide a character generation device that can instantly and automatically generate a plurality of characters that meet the conditions.

於是本發明文字生成裝置,用於生成多個文字,該文字生成裝置包含一輸出模組、一儲存模組,及一處理模組。Therefore, the character generating device of the present invention is used for generating a plurality of characters, and the character generating device includes an output module, a storage module, and a processing module.

該輸出模組用於輸出該等文字。The output module is used to output the text.

該儲存模組用於儲存一用於生成多個文字的文字生成模型、至少一用於評分所生成之文字的評分條件,及一初始值為空的候選字串。The storage module is used for storing a character generation model for generating a plurality of characters, at least one scoring condition for scoring the generated characters, and a candidate character string whose initial value is empty.

該處理模組電連接該輸出模組及該儲存模組。The processing module is electrically connected to the output module and the storage module.

其中,該處理模組接收到一包含一生成條件的生成請求後,將該生成條件編碼為一固定格式的待生成輸入資料,該生成條件包括一待生成產品類別,及一指示出該待生成產品類別是否有優惠的待生成優惠屬性,該處理模組根據該待生成輸入資料利用該文字生成模型生成N個候選文字,並將該等N個候選文字加入該儲存模組存有的該候選字串,以更新該候選字串,對於每一評分條件,該處理模組根據該儲存模組儲存的該候選字串及該評分條件,獲得一相關於該候選字串的評分,並判定該至少一評分之總分是否大於一評分閥值,當該處理模組判定該至少一評分之總分大於該評分閥值時,判定該候選字串是否符合一生成終止條件,當該處理模組判定該候選字串符合該生成終止條件時,該處理模組經由該輸出模組輸出該候選字串。Wherein, after receiving a generation request including a generation condition, the processing module encodes the generation condition into input data to be generated in a fixed format, the generation condition includes a product category to be generated, and a Whether the product category has a preferential to-be-generated preferential attribute, the processing module uses the text generation model to generate N candidate characters according to the to-be-generated input data, and adds the N candidate characters to the candidate stored in the storage module. character string to update the candidate character string, for each scoring condition, the processing module obtains a score related to the candidate character string according to the candidate character string and the scoring condition stored in the storage module, and determines the Whether the total score of at least one score is greater than a score threshold, when the processing module determines that the total score of the at least one score is greater than the score threshold, it is determined whether the candidate string meets a generation termination condition, when the processing module determines whether the candidate string meets a generation termination condition. When it is determined that the candidate character string meets the generation termination condition, the processing module outputs the candidate character string through the output module.

本新型的功效在於:藉由該文字生成裝置生成N個候選文字並加入該候選字串,且根據該候選字串利用該至少一評分條件獲得該總分,並判定該總分是否大於該評分閥值,當判定大於時,判定該候選字串是否符合生成終止條件,當判定符合時,輸出該等候選字串,藉此利用該至少一評分條件對所生成的N個候選文字評分以即時且自動地生成符合條件的字句。The function of the present invention is: generating N candidate characters by the character generating device and adding the candidate character string, obtaining the total score according to the candidate character string using the at least one scoring condition, and determining whether the total score is greater than the score Threshold, when it is determined that it is greater than the threshold, it is determined whether the candidate character string meets the generation termination condition, and when it is determined that the candidate character string is met, the candidate character string is output, thereby using the at least one scoring condition to score the generated N candidate characters to instantly And automatically generate matching words.

參閱圖1,本新型文字生成裝置之實施例,適用於生成多個文字,並包含一輸出模組1、一儲存模組2,及一電連接該輸出模組1及該儲存模組2的處理模組3。Referring to FIG. 1 , an embodiment of the novel character generating device is suitable for generating multiple characters, and includes an output module 1 , a storage module 2 , and an output module 1 and the storage module 2 that are electrically connected Process module 3.

該輸出模組1用於輸出多個文字。The output module 1 is used for outputting a plurality of characters.

該儲存模組2用於儲存一用於生成該等文字的文字生成模型、至少一用於評分所生成之文字的評分條件、多個特定關鍵字、一初始值為空的候選字串、多個與金融相關的訓練語句、多個服務產品類別,及多個與優惠相關的優惠關鍵字,每一訓練語句對應有一待設定產品類別,及一待設定優惠屬性,每一服務產品類別包含多個產品類別關鍵字。The storage module 2 is used for storing a text generation model for generating the text, at least one scoring condition for scoring the generated text, a plurality of specific keywords, a candidate string with an empty initial value, a plurality of A training sentence related to finance, a plurality of service product categories, and a plurality of preferential keywords related to discounts. Each training sentence corresponds to a product category to be set and a preferential attribute to be set. Each service product category contains multiple product category keywords.

參閱圖1,該文字生成裝置可為一平板電腦、一筆記型電腦、一伺服器或一個人電腦,但不以此為限。Referring to FIG. 1 , the text generating device may be a tablet computer, a notebook computer, a server or a personal computer, but not limited thereto.

以下將藉由一文字生成方法來說明該文字生成裝置的運作細節,並依序包含一用於建立該文字生成模型的模型建立程序,及一用於生成該等文字的字串生成程序。The operation details of the text generating device will be described below through a text generating method, and sequentially include a model building program for building the text generation model, and a string generating program for generating the text.

該模型建立程序包含一步驟61、一步驟62、一步驟63、一步驟64、一步驟65、一步驟66,及一步驟67。The model building procedure includes a step 61 , a step 62 , a step 63 , a step 64 , a step 65 , a step 66 , and a step 67 .

該字串生成程序包含一步驟71、一步驟72、一步驟73、一步驟74、一步驟75、一步驟76、一步驟77、一步驟78,及一步驟79。The string generating procedure includes a step 71 , a step 72 , a step 73 , a step 74 , a step 75 , a step 76 , a step 77 , a step 78 , and a step 79 .

參閱圖1與圖2,該模型建立程序包含以下步驟。Referring to Figures 1 and 2, the model building procedure includes the following steps.

在步驟61中,對於每一訓練語句,該處理模組3判定該儲存模組2存有的該訓練語句中是否存在對應該等服務產品類別中之一目標產品類別下的該等產品類別關鍵字之任一者。當判定該訓練語句中存在對應該目標產品下的該等產品類別關鍵字之任一者時,流程進行步驟62。當判定該訓練語句中不存在對應該目標產品下的該等產品類別關鍵字之任一者時,流程結束(亦即,不繼續進行優惠屬性設定)。In step 61, for each training sentence, the processing module 3 determines whether the training sentence stored in the storage module 2 contains the product category key corresponding to one of the target product categories in the service product category any of the words. When it is determined that there is any one of the product category keywords corresponding to the target product in the training sentence, the process proceeds to step 62 . When it is determined that there is no one of the product category keywords corresponding to the target product in the training sentence, the process ends (that is, the preferential attribute setting is not continued).

在步驟62中,對於每一訓練語句,該處理模組3將該訓練語句所對應的該待設定產品類別設定為該目標產品類別。In step 62, for each training sentence, the processing module 3 sets the to-be-set product category corresponding to the training sentence as the target product category.

在步驟63中,對於每一訓練語句,該處理模組3判定該訓練語句中是否存在該等優惠關鍵字之任一者。當判定該訓練語句中存在該等優惠關鍵字之任一者時,流程進行步驟64。當判定該訓練語句中不存在該等優惠關鍵字之任一者時,流程進行步驟65。In step 63, for each training sentence, the processing module 3 determines whether any one of the preferential keywords exists in the training sentence. When it is determined that any one of the preferential keywords exists in the training sentence, the process proceeds to step 64 . When it is determined that none of the preferential keywords exists in the training sentence, the process proceeds to step 65 .

在步驟64中,對於每一訓練語句,該處理模組3將該訓練語句所對應的該待設定優惠屬性設定為有優惠的優惠屬性。In step 64, for each training sentence, the processing module 3 sets the to-be-set preferential attribute corresponding to the training sentence as a preferential preferential attribute.

在步驟65中,對於每一訓練語句,該處理模組3將該訓練語句所對應的該待設定優惠屬性設定為無優惠的優惠屬性。In step 65, for each training sentence, the processing module 3 sets the to-be-set preferential attribute corresponding to the training sentence as a preferential attribute without preferential treatment.

在步驟66中,對於每一訓練語句,該處理模組3根據該訓練語句、該訓練語句對應的目標產品類別,及該訓練語句對應的優惠屬性,編碼為一固定格式的訓練資料。In step 66, for each training sentence, the processing module 3 encodes the training data in a fixed format according to the training sentence, the target product category corresponding to the training sentence, and the preferential attribute corresponding to the training sentence.

舉例來說,該等訓練語句之其中一者若為一起來換匯吧,且對應的目標產品類別及優惠屬性分別為外幣及無,則編碼後的固定格式之訓練資料為<PRODUCT>外幣<DISCOUNT>無<SLOGAN>一起來換匯吧。For example, if one of these training sentences is to exchange foreign currency together, and the corresponding target product category and preferential attribute are foreign currency and none, then the encoded training data in a fixed format is <PRODUCT>foreign currency< DISCOUNT>No <SLOGAN> Let's exchange currency together.

在步驟67中,該處理模組3根據該等訓練資料,利用一機器學習演算法,建立該文字生成模型。其中,該機器學習演算法可為變換器神經網路(Transformer Neural Network)。In step 67, the processing module 3 uses a machine learning algorithm to establish the text generation model according to the training data. The machine learning algorithm may be a Transformer Neural Network.

參閱圖1與圖3,該字串生成程序包含以下步驟。Referring to FIG. 1 and FIG. 3 , the string generation process includes the following steps.

在步驟71中,該處理模組3接收到一包含一生成條件的生成請求後,將該生成條件編碼為該固定格式的待生成輸入資料,該生成條件包括一待生成產品類別,及一指示出該待生成產品類別是否有優惠的待生成優惠屬性。其中,該待生成產品類別為該等服務產品類別之其中一者。In step 71, after receiving a generation request including a generation condition, the processing module 3 encodes the generation condition into the input data to be generated in the fixed format, and the generation condition includes a product category to be generated and an instruction Find out whether the product category to be generated has preferential preferential properties to be generated. Wherein, the product category to be generated is one of the service product categories.

在步驟72中,該處理模組3根據該待生成輸入資料利用該儲存模組2存有的該文字生成模型生成N個候選文字。其中N可為20,但不以此為限。In step 72, the processing module 3 generates N candidate characters by using the character generation model stored in the storage module 2 according to the input data to be generated. Wherein, N can be 20, but not limited thereto.

參閱圖1與圖4,值得特別說明的是,步驟72包含以下子步驟。Referring to FIG. 1 and FIG. 4 , it is worth noting that step 72 includes the following sub-steps.

在步驟721中,該處理模組3根據該待生成輸入資料利用該文字生成模型生成一個候選文字。In step 721, the processing module 3 uses the text generation model to generate a candidate text according to the input data to be generated.

在步驟722中,該處理模組3判定所有執行步驟721所生成的所有候選文字之一總字數是否大於等於N。當判定該總字數不大於等於N時,流程進行步驟723。當判定該總字數大於等於N時,流程進行步驟724。In step 722, the processing module 3 determines whether the total number of characters in one of all candidate characters generated by executing step 721 is greater than or equal to N. When it is determined that the total number of words is not greater than or equal to N, the flow proceeds to step 723 . When it is determined that the total number of words is greater than or equal to N, the flow proceeds to step 724 .

在步驟723中,該處理模組3將所有執行步驟721所生成的所有候選文字組合於該待生成輸入資料之後以作為又一待生成輸入資料,且流程回到步驟721。In step 723 , the processing module 3 combines all candidate characters generated by executing step 721 after the input data to be generated as another input data to be generated, and the process returns to step 721 .

在步驟724中,該處理模組3將所有執行步驟721所生成的所有候選文字依序排列以獲得該等N個候選文字。In step 724, the processing module 3 arranges all candidate characters generated by executing step 721 in order to obtain the N candidate characters.

在步驟73中,該處理模組3將該等N個候選文字加入該儲存模組2存有的該候選字串,以更新該候選字串。In step 73, the processing module 3 adds the N candidate characters to the candidate character string stored in the storage module 2 to update the candidate character string.

在步驟74中,對於每一評分條件,該處理模組3根據該儲存模組2儲存的該候選字串及該評分條件,獲得一相關於該候選字串的評分。In step 74 , for each scoring condition, the processing module 3 obtains a score related to the candidate string according to the candidate string and the scoring condition stored in the storage module 2 .

參閱圖1與圖5,值得特別說明的是,該儲存模組2存有的該至少一評分條件包含用於判定該候選字串是否符合一語法規則、用於判定該候選字串中是否存在該等特定關鍵字之任一者,及用於判定該候選字串是否符合該生成條件之待生成產品類別,且步驟74包含以下子步驟。Referring to FIG. 1 and FIG. 5 , it is worth noting that the at least one scoring condition stored in the storage module 2 includes for determining whether the candidate string complies with a grammatical rule, for determining whether the candidate string exists Any one of the specific keywords and the product category to be generated for determining whether the candidate string meets the generation condition, and step 74 includes the following sub-steps.

在步驟741中,對於相關於該語法規則的該評分條件,該處理模組3將該候選字串進行一詞性標註,以獲得一相關於該候選字串的詞性標記結果。In step 741, for the scoring condition related to the grammar rule, the processing module 3 performs part-of-speech tagging on the candidate word string to obtain a part-of-speech tagging result related to the candidate word string.

在步驟742中,該處理模組3判定該詞性標記結果是否符合該語法規則,以獲得相關於該候選字串的該評分。其中,該語法規則可為該候選字串中不可以連接詞(例如,和、並)作結尾,但不以此為限,且當該處理模組3判定該詞性標記結果符合該語法規則時所獲的該評分例如,3分,高於當判定不符合該語法規則時所獲得的該評分例如,1分。值得特別說明的是,在其他實施方式中,該語法規則亦可為判定該候選字串中之特殊關鍵字後是否存在關聯關鍵字,此時,該處理模組3即無須進行步驟741,而是判定該候選字串是否存在如,利率、利息、折扣等的該特殊關鍵字,且當判定存在該特殊關鍵字時,判定該特殊關鍵字之後是否存在如,9折、8%等的關聯關鍵字,但不以此為限;又或者,該語法規則亦可為判定該候選字串中是否相鄰出現金融相關詞彙,此時,該處理模組3即無須進行步驟741,而是判定該候選字串中是否相鄰出現金融相關詞彙(例如,888元888元),但不以此為限。In step 742, the processing module 3 determines whether the part-of-speech tagging result complies with the grammar rule to obtain the score related to the candidate character string. Wherein, the grammatical rule may be that no connective words (for example, and, and) are allowed to end in the candidate string, but not limited thereto, and when the processing module 3 determines that the part-of-speech tagging result conforms to the grammatical rule The score obtained is, for example, 3 points, which is higher than the score obtained when it is determined that the grammar rule is not met, for example, 1 point. It is worth noting that, in other embodiments, the grammar rule can also be used to determine whether there is an associated keyword after the special keyword in the candidate string. In this case, the processing module 3 does not need to perform step 741, and It is to determine whether the candidate string has the special keyword such as interest rate, interest, discount, etc., and when it is determined that the special keyword exists, determine whether there is an association after the special keyword, such as 10% off, 8%, etc. keywords, but not limited to this; alternatively, the grammar rule can also be used to determine whether financial-related words appear adjacent to the candidate string. In this case, the processing module 3 does not need to perform step 741, but determines Whether financial-related words (for example, 888 yuan and 888 yuan) appear adjacent to each other in the candidate string, but not limited to this.

在步驟743中,對於相關於該等特定關鍵字的該評分條件,該處理模組3判定該候選字串中是否存在該等特定關鍵字之任一者,以獲得相關於該候選字串的該評分。其中,該等特定關鍵字可為吸引客戶之詞彙(例如,優惠或折扣),但不以此為限,且當該處理模組3判定該候選字串中存在該等特定關鍵字之任一者時所獲的該評分例如,3分,高於當判定不存在該等特定關鍵字之任一者時所獲得的該評分例如,1分。值得特別說明的是,在其他實施方式中,該等特定關鍵字亦可為相關於公司規範的詞彙(例如,競爭公司的名稱或不雅文字等),且當該處理模組3判定該候選字串中存在該等特定關鍵字之任一者時所獲的該評分例如,1分,低於當判定不存在該等特定關鍵字之任一者時所獲得的該評分例如,3分,但不以此為限。In step 743, for the scoring conditions related to the specific keywords, the processing module 3 determines whether any of the specific keywords exists in the candidate string, so as to obtain the scoring conditions related to the candidate string the rating. Wherein, the specific keywords may be words that attract customers (for example, offers or discounts), but not limited thereto, and when the processing module 3 determines that any of the specific keywords exists in the candidate string The score obtained when one of the specific keywords is determined, for example, 3 points, is higher than the score obtained when it is determined that none of the specific keywords exists, for example, 1 point. It is worth noting that, in other embodiments, the specific keywords can also be words related to company specifications (for example, the name of a competitor company or indecent words, etc.), and when the processing module 3 determines the candidate The score obtained when any of the specific keywords is present in the string, eg, 1 point, is lower than the score obtained when it is determined that any of the specific keywords is absent, eg, 3 points, But not limited to this.

在步驟744中,對於相關於該生成條件的該評分條件,該處理模組3判定該候選字串中是否存在對應該待生成產品類別下的該等產品類別關鍵字之任一者,以判定該候選字串是否符合該生成條件之待生成產品類別,進而獲得相關於該候選字串的該評分。其中,當該處理模組3判定該候選字串符合該待生成產品類別時所獲的該評分例如,3分,高於當判定不符合該待生成產品類別時所獲得的該評分例如,1分。In step 744, for the scoring condition related to the generation condition, the processing module 3 determines whether there is any one of the product category keywords corresponding to the product category to be generated in the candidate string, so as to determine Whether the candidate string complies with the generation condition for the product category to be generated, and then obtain the score related to the candidate string. Wherein, the score obtained when the processing module 3 determines that the candidate character string conforms to the product category to be generated is, for example, 3 points, which is higher than the score obtained when it is determined that the candidate string does not conform to the product category to be generated, such as 1 point.

在步驟75中,該處理模組3判定該至少一評分之總分是否大於一評分閥值。當該處理模組3判定該總分大於該評分閥值時,流程進行步驟76。當判定該總分不大於該評分閥值時,流程進行步驟78。In step 75, the processing module 3 determines whether the total score of the at least one score is greater than a score threshold. When the processing module 3 determines that the total score is greater than the scoring threshold, the process proceeds to step 76 . When it is determined that the total score is not greater than the score threshold, the process proceeds to step 78 .

在步驟76中,該處理模組3判定該候選字串是否符合一生成終止條件。當判定該候選字串符合該生成終止條件時,流程進行步驟77。當判定該候選字串不符合該生成終止條件時,流程進行步驟79。其中,該生成終止條件可為判定該候選字串中是否存有一相關於句尾(EOS, End of Sentence)的終止符號(例如,句號),或判定該候選字串之字數是否等於一輸出字數閥值,但不以此為限。In step 76, the processing module 3 determines whether the candidate string meets a generation termination condition. When it is determined that the candidate character string meets the generation termination condition, the flow proceeds to step 77 . When it is determined that the candidate character string does not meet the generation termination condition, the flow proceeds to step 79 . Wherein, the generation termination condition may be to determine whether there is a termination symbol (for example, a period) related to the end of sentence (EOS, End of Sentence) in the candidate string, or to determine whether the number of characters in the candidate string is equal to an output Word count threshold, but not limited to this.

在步驟77中,該處理模組3經由該輸出模組1輸出該候選字串。In step 77 , the processing module 3 outputs the candidate string via the output module 1 .

在步驟78中,該處理模組3清空該儲存模組2儲存的該候選字串,並將該待生成輸入資料設定為步驟71的該待生成輸入資料,且流程回到步驟72。In step 78 , the processing module 3 clears the candidate string stored in the storage module 2 , and sets the input data to be generated as the input data to be generated in step 71 , and the process returns to step 72 .

在步驟79中,該處理模組3將該等N個候選文字組合於該待生成輸入資料之後以作為另一待生成輸入資料,且流程回到步驟72。In step 79 , the processing module 3 combines the N candidate characters after the input data to be generated as another input data to be generated, and the process returns to step 72 .

綜上所述,本新型文字生成裝置,藉由該處理模組3根據該生成條件利用該文字生成模型生成N個候選文字並加入該候選字串,且根據該儲存模組2存有的該候選字串、該語法規則、該等特定關鍵字,及該生成條件之待生成產品類別,獲得相關於該候選字串的該總分,並判定該總分是否大於該評分閥值,當判定大於時,判定該候選字串是否符合生成終止條件,當判定符合時,輸出該等候選字串,藉此利用該至少一評分條件對所生成的N個候選文字評分以即時且自動地生成符合條件的字句,便能降低時間及人力成本,故確實能達成本新型的目的。To sum up, in the novel character generation device of the present invention, the processing module 3 uses the character generation model to generate N candidate characters according to the generation conditions and adds the candidate character string, and according to the The candidate string, the grammar rule, the specific keywords, and the product category to be generated for the generation condition, obtain the total score related to the candidate string, and determine whether the total score is greater than the scoring threshold, when determining When it is greater than , determine whether the candidate character string meets the generation termination condition, and when it is determined that the candidate character string is met, output the candidate character string, thereby using the at least one scoring condition to score the generated N candidate characters to instantly and automatically generate a matching Conditional words can reduce time and labor costs, so it can indeed achieve the purpose of this new model.

惟以上所述者,僅為本新型之實施例而已,當不能以此限定本新型實施之範圍,凡是依本新型申請專利範圍及專利說明書內容所作之簡單的等效變化與修飾,皆仍屬本新型專利涵蓋之範圍內。However, the above are only examples of the present invention, which should not limit the scope of the present invention. Any simple equivalent changes and modifications made according to the scope of the patent application for this new model and the contents of the patent specification are still within the scope of the present invention. within the scope of this new patent.

1:輸出模組 2:儲存模組 3:處理模組 61~67:步驟 71~79:步驟 721~724:步驟 741~744:步驟 1: output module 2: storage module 3: Processing modules 61~67: Steps 71~79: Steps 721~724: Steps 741~744: Steps

本新型之其他的特徵及功效,將於參照圖式的實施方式中清楚地呈現,其中: 圖1是一方塊圖,說明本新型文字生成裝置之實施例; 圖2是一流程圖,說明利用本新型文字生成裝置之實施例實現一文字生成方法的一模型建立程序; 圖3是一流程圖,說明利用本新型文字生成裝置之實施例實現該文字生成方法的一字串生成程序; 圖4是一流程圖,說明該文字生成裝置如何逐字生成文字;及 圖5是一流程圖,說明該文字生成裝置如何獲得評分。 Other features and effects of the present invention will be clearly presented in the embodiments with reference to the drawings, wherein: FIG. 1 is a block diagram illustrating an embodiment of the novel character generation device of the present invention; FIG. 2 is a flow chart illustrating a model building procedure for realizing a character generation method using an embodiment of the novel character generation device; FIG. 3 is a flow chart illustrating a string generation program for realizing the character generation method using an embodiment of the novel character generation device; FIG. 4 is a flow chart illustrating how the text generating device generates text character by character; and FIG. 5 is a flow chart illustrating how the text generating apparatus obtains the score.

1:輸出模組 1: output module

2:儲存模組 2: storage module

3:處理模組 3: Processing modules

Claims (8)

一種用於生成多個文字的文字生成裝置,包含:一輸出模組,用於輸出該等文字;一儲存模組,用於儲存一用於生成多個文字的文字生成模型、至少一用於評分所生成之文字的評分條件,及一初始值為空的候選字串;及一處理模組,電連接該輸出模組及該儲存模組;其中,該處理模組接收到一包含一生成條件的生成請求後,將該生成條件編碼為一固定格式的待生成輸入資料,該生成條件包括一待生成產品類別,及一指示出該待生成產品類別是否有優惠的待生成優惠屬性,該處理模組根據該待生成輸入資料利用該文字生成模型生成N個候選文字,並將該等N個候選文字加入該儲存模組存有的該候選字串,以更新該候選字串,對於每一評分條件,該處理模組根據該儲存模組儲存的該候選字串及該評分條件,獲得一相關於該候選字串的評分,並判定該至少一評分之總分是否大於一評分閥值,當該處理模組判定該至少一評分之總分大於該評分閥值時,判定該候選字串是否符合一生成終止條件,當該處理模組判定該候選字串符合該生成終止條件時,該處理模組經由該輸出模組輸出該候選字串。 A character generation device for generating a plurality of characters, comprising: an output module for outputting the characters; a storage module for storing a character generation model for generating a plurality of characters, at least one for Scoring conditions for the text generated by scoring, and a candidate string whose initial value is empty; and a processing module electrically connected to the output module and the storage module; wherein, the processing module receives a After the conditional generation request, encode the generation condition into a fixed-format input data to be generated, the generation condition includes a product category to be generated, and a to-be-generated discount attribute indicating whether the to-be-generated product category has a discount, the The processing module uses the text generation model to generate N candidate characters according to the input data to be generated, and adds the N candidate characters to the candidate character string stored in the storage module to update the candidate character string. a scoring condition, the processing module obtains a score related to the candidate string according to the candidate string and the scoring condition stored in the storage module, and determines whether the total score of the at least one score is greater than a scoring threshold , when the processing module determines that the total score of the at least one score is greater than the scoring threshold, determines whether the candidate character string meets a generation termination condition, and when the processing module determines that the candidate character string meets the generation termination condition, The processing module outputs the candidate string via the output module. 如請求項1所述的文字生成裝置,其中,當該處理模組判定該候選字串不符合該生成終止條件時,將該等N個候選文字組合於該待生成輸入資料之後以作為另一待生成輸入資料,並重複根據該另一待生成輸入資料利用該文字生 成模型生成另一N個候選文字,且更新該候選字串及獲得至少另一相關於該候選字串的評分,並判定該至少另一評分之總分是否大於該評分閥值,且判定該候選字串是否符合該生成終止條件,直到該候選字串符合該生成終止條件。 The character generation device of claim 1, wherein when the processing module determines that the candidate character string does not meet the generation termination condition, the N candidate characters are combined after the input data to be generated as another Input data to be generated, and repeatedly use the text to generate according to the other input data to be generated generating another N candidate characters into a model, and updating the candidate character string and obtaining at least one other score related to the candidate character string, and determining whether the total score of the at least one other score is greater than the score threshold, and determining the Whether the candidate string meets the generation termination condition, until the candidate string meets the generation termination condition. 如請求項1所述的文字生成裝置,其中,該處理模組根據該待生成輸入資料利用該儲存模組儲存的該文字生成模型生成一個候選文字,該處理模組判定所有利用該文字生成模型所生成的所有候選文字之一總字數是否大於等於N,當判定該總字數不大於等於N時,將所有利用該文字生成模型所生成的所有候選文字組合於該待生成輸入資料之後以作為又一待生成輸入資料,並重複根據該又一待生成輸入資料利用該文字生成模型生成另一候選文字,並判定所有利用該文字生成模型所生成的所有另一候選文字之總字數是否大於等於N,直到該總字數大於等於N,當該處理模組判定該總字數大於等於N時,該文字生成裝置將所有利用該文字生成模型所生成的所有候選文字依序排列以獲得該等N個候選文字。 The character generation device according to claim 1, wherein the processing module generates a candidate character by using the character generation model stored in the storage module according to the input data to be generated, and the processing module determines all characters using the character generation model Whether the total number of characters in one of the generated candidate characters is greater than or equal to N, when it is determined that the total number of characters is not greater than or equal to N, all candidate characters generated by using the character generation model are combined with the input data to be generated. As another input data to be generated, and according to the further input data to be generated, use the text generation model to generate another candidate text repeatedly, and determine whether the total number of characters of all the other candidate texts generated by using the text generation model is not greater than or equal to N, until the total number of characters is greater than or equal to N, when the processing module determines that the total number of characters is greater than or equal to N, the character generation device arranges all candidate characters generated by the character generation model in order to obtain the N candidate words. 如請求項1所述的文字生成裝置,其中,該儲存模組儲存的該至少一評分條件之其中一者是用於判定該候選字串是否符合一語法規則,對於相關於該語法規則的該評分條件,該處理模組是判定該候選字串是否符合該語法規則,以獲得相關於該候選字串的該評分。 The text generation device of claim 1, wherein one of the at least one scoring condition stored in the storage module is used to determine whether the candidate character string complies with a grammar rule, and for the Scoring condition, the processing module determines whether the candidate character string complies with the grammar rule to obtain the score related to the candidate character string. 如請求項1所述的文字生成裝置,其中,該儲存模組還存 有多個特定關鍵字,該儲存模組儲存的該至少一評分條件之其中一者是用於判定該候選字串中是否存在該等特定關鍵字之任一者,對於相關於該等特定關鍵字的該評分條件,該處理模組是判定該候選字串中是否存在該等特定關鍵字之任一者,以獲得相關於該候選字串的該評分。 The character generation device according to claim 1, wherein the storage module further stores There are a plurality of specific keywords, and one of the at least one scoring condition stored in the storage module is used to determine whether any one of the specific keywords exists in the candidate string. The scoring condition of the word, the processing module is to determine whether any one of the specific keywords exists in the candidate word string, so as to obtain the score related to the candidate word string. 如請求項1所述的文字生成裝置,其中,該儲存模組還存有多個服務產品類別,該待生成產品類別為該等服務產品類別之其中一者,每一服務產品類別包含多個產品類別關鍵字,該儲存模組儲存的該至少一評分條件之其中一者是用於判定該候選字串是否符合該生成條件之待生成產品類別,對於相關於該生成條件的該評分條件,該處理模組判定該候選字串中是否存在對應該待生成產品類別下的該等產品類別關鍵字之任一者,以判定該候選字串是否符合該生成條件之待生成產品類別,進而獲得相關於該候選字串的該評分。 The text generation device according to claim 1, wherein the storage module further stores a plurality of service product categories, the to-be-generated product category is one of the service product categories, and each service product category includes a plurality of service product categories Product category keyword, one of the at least one scoring condition stored in the storage module is a product category to be generated for determining whether the candidate string meets the generating condition, and for the scoring condition related to the generating condition, The processing module determines whether there is any one of the product category keywords corresponding to the product category to be generated in the candidate string, so as to determine whether the candidate string meets the generation condition for the to-be-generated product category, and then obtains The score relative to the candidate string. 如請求項1所述的文字生成裝置,其中,當該處理模組判定該至少一評分之總分不大於該評分閥值時,該處理模組清空該儲存模組儲存的該候選字串,並將該待生成輸入資料設定為該處理模組將該生成條件編碼後的該待生成輸入資料,且重複根據該待生成輸入資料利用該文字生成模型生成另外N個候選文字,且更新該候選字串及獲得至少另一相關於該候選字串的評分,並判定該至少另一評分之總分是否大於該評分閥值,且判定該候選字串是否符合該生成終止條件,直到該候選字串符合該生成終止條件。 The text generation device of claim 1, wherein when the processing module determines that the total score of the at least one score is not greater than the score threshold, the processing module clears the candidate string stored in the storage module, The input data to be generated is set as the input data to be generated after the processing module encodes the generation conditions, and the text generation model is repeatedly used to generate another N candidate characters according to the input data to be generated, and the candidate characters are updated. character string and obtain at least one other score related to the candidate character string, and determine whether the total score of the at least one other score is greater than the score threshold, and determine whether the candidate character string meets the generation termination condition, until the candidate character The string satisfies this generation termination condition. 如請求項1所述的文字生成裝置,其中,該儲存模組還存有多個與金融相關的訓練語句、多個服務產品類別,及多個與優惠相關的優惠關鍵字,每一訓練語句對應有一待設定產品類別,及一待設定優惠屬性,每一服務產品類別包含多個產品類別關鍵字,對於每一訓練語句,該處理模組判定該訓練語句中是否存在對應該等服務產品類別中之一目標產品類別下的該等產品類別關鍵字之任一者,對於每一訓練語句,當該處理模組判定該訓練語句存在該目標產品類別下的該等產品類別關鍵字之任一者時,該處理模組將該訓練語句所對應的該待設定產品類別設定為該目標產品類別,對於每一訓練語句,該處理模組判定該訓練語句中是否存在該等優惠關鍵字之任一者,對於每一訓練語句,當該處理模組判定該訓練語句中存在該等優惠關鍵字之任一者時,該處理模組將該訓練語句所對應的該待設定優惠屬性設定為有優惠的優惠屬性,對於每一訓練語句,當該處理模組判定該訓練語句中不存在該等優惠關鍵字之任一者時,該處理模組將該訓練語句所對應的該待設定優惠屬性設定為無優惠的優惠屬性,對於每一訓練語句,該處理模組根據該訓練語句、該訓練語句對應的目標產品類別,及該訓練語句對應的優惠屬性,編碼為一固定格式的訓練資料,並根據該等訓練資料,利用一機器學習演算法,建立該文字生成模型。 The text generation device according to claim 1, wherein the storage module further stores a plurality of training sentences related to finance, a plurality of service product categories, and a plurality of preferential keywords related to discounts, each training sentence Correspondingly, there is a product category to be set, and a preferential attribute to be set. Each service product category includes a plurality of product category keywords. For each training sentence, the processing module determines whether there is a corresponding service product category in the training sentence. any one of the product category keywords under one of the target product categories, for each training sentence, when the processing module determines that the training sentence contains any one of the product category keywords under the target product category In the case of the above, the processing module sets the to-be-set product category corresponding to the training sentence as the target product category, and for each training sentence, the processing module determines whether there is any task for the preferential keywords in the training sentence. One, for each training sentence, when the processing module determines that there is any one of the preferential keywords in the training sentence, the processing module sets the to-be-set preferential attribute corresponding to the training sentence to have The preferential attribute of the preferential treatment. For each training sentence, when the processing module determines that there is no one of the preferential keywords in the training sentence, the processing module corresponds to the preferential attribute to be set corresponding to the training sentence. It is set as a preferential attribute without preferential treatment. For each training sentence, the processing module encodes the training data in a fixed format according to the training sentence, the target product category corresponding to the training sentence, and the preferential attribute corresponding to the training sentence. And according to the training data, a machine learning algorithm is used to establish the text generation model.
TW111201143U 2022-01-27 2022-01-27 Character generator TWM629035U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW111201143U TWM629035U (en) 2022-01-27 2022-01-27 Character generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW111201143U TWM629035U (en) 2022-01-27 2022-01-27 Character generator

Publications (1)

Publication Number Publication Date
TWM629035U true TWM629035U (en) 2022-07-01

Family

ID=83437340

Family Applications (1)

Application Number Title Priority Date Filing Date
TW111201143U TWM629035U (en) 2022-01-27 2022-01-27 Character generator

Country Status (1)

Country Link
TW (1) TWM629035U (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI823242B (en) * 2022-01-27 2023-11-21 中國信託商業銀行股份有限公司 Text generation method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI823242B (en) * 2022-01-27 2023-11-21 中國信託商業銀行股份有限公司 Text generation method and device

Similar Documents

Publication Publication Date Title
US20240078386A1 (en) Methods and systems for language-agnostic machine learning in natural language processing using feature extraction
WO2021012645A1 (en) Method and device for generating pushing information
CN108363790A (en) For the method, apparatus, equipment and storage medium to being assessed
US10949753B2 (en) Causal modeling and attribution
US20080215555A1 (en) Hybrid Approach for Query Recommendation in Conversation Systems
JP2012160201A (en) Review processing method and system
CN112507248A (en) Tourist attraction recommendation method based on user comment data and trust relationship
WO2020199600A1 (en) Sentiment polarity analysis method and related device
CN110134799B (en) BM25 algorithm-based text corpus construction and optimization method
US11126783B2 (en) Output apparatus and non-transitory computer readable medium
CN111737961B (en) Method and device for generating story, computer equipment and medium
CN110874536A (en) Corpus quality evaluation model generation method and bilingual sentence pair inter-translation quality evaluation method
CN111930792A (en) Data resource labeling method and device, storage medium and electronic equipment
CN112487151A (en) File generation method and device, storage medium and electronic equipment
CN112328857A (en) Product knowledge aggregation method and device, computer equipment and storage medium
TWM629035U (en) Character generator
CN112417155B (en) Court trial query generation method, device and medium based on pointer-generation Seq2Seq model
Jin et al. Towards improving coherence and diversity of slogan generation
CN113392218A (en) Training method of text quality evaluation model and method for determining text quality
CN112632950A (en) PPT generation method, device, equipment and computer-readable storage medium
CN113051894A (en) Text error correction method and device
CN110222181B (en) Python-based film evaluation emotion analysis method
CN111274384B (en) Text labeling method, equipment and computer storage medium thereof
TWI823242B (en) Text generation method and device
TWM638301U (en) Computing device for generating marketing copywriting