Generative question answering system and generative question answering method
By introducing a role database and a text knowledge database into the generative question-answering system, and combining it with a context-aware module and a style transfer module, the problem that generative question-answering systems cannot provide customized responses to different user inputs is solved, and personalized responses with rich emotions are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DELTA ELECTRONICS INC(CN)
- Filing Date
- 2024-12-18
- Publication Date
- 2026-06-19
AI Technical Summary
Existing generative question-answering systems cannot provide customized responses to different user inputs, and the answers lack emotion, making it difficult to serve as a means of psychological communication or support.
By introducing a role database and a text knowledge database, and utilizing a large language model combined with a context-aware module and a style transfer module, stylized text responses are generated.
The generative question-and-answer system enables users to generate more emotionally rich and personalized responses based on their input, thereby enhancing the effectiveness of psychological communication.
Smart Images

Figure CN122242712A_ABST
Abstract
Description
Technical Field
[0001] This case relates to a generative question-answering system and a generative question-answering method, and more particularly to a speech-to-text generative question-answering system and a generative question-answering method. Background Technology
[0002] Generative question answering is an artificial intelligence system that can generate text, images, or other media in response to user input. It allows models to learn patterns and structures from input data and then produce new content that is similar to the training data but possesses a degree of novelty. Chatbots are one application of generative question answering, often used in customer service, but they mostly only extract keywords from the input text and then search a database for the most suitable response.
[0003] Several generative pre-trained models have been proposed. A generative pre-trained model is a large language model (LLM) that can learn from a large amount of language data in text to simulate relatively natural and fluent human conversation and answer user-customized questions.
[0004] However, generative pre-trained models learn only from language data in text, resulting in standardized responses that cannot be customized to different user inputs. Furthermore, the responses lack emotion and are unlikely to provide psychological communication or support.
[0005] Therefore, how to enable generative question-answering systems to generate responses that incorporate emotions or are more customized is one of the problems to be solved in this field. Summary of the Invention
[0006] One embodiment of the present invention provides a generative question-answering system. This generative question-answering system is used to generate stylized text. The generative question-answering system includes input / output devices, a memory, and a processor. The input / output devices are used to receive input information. The memory is used to store a role database and a text knowledge database. The role database records multiple role templates and multiple dialogue examples corresponding to the multiple role templates, wherein the text knowledge database stores multiple candidate texts. The processor is coupled to the memory and the input / output devices to execute the following program: obtaining at least one of the multiple candidate texts from the text knowledge database based on the input information, and generating a first output text based on the input information and at least one of the multiple candidate texts; obtaining a first role template from the multiple role templates and at least one of the multiple dialogue examples corresponding to the first role template from the role database based on the input information; and generating a second output text based on the input information, the first role template, at least one of the multiple dialogue examples, and the first output text.
[0007] Another embodiment of the present invention provides a generative question-answering method. This generative question-answering method is applicable to a generative question-answering system comprising a role database and a text knowledge database, wherein the role database records multiple role templates and multiple dialogue examples corresponding to the multiple role templates, and the text knowledge database stores multiple candidate texts, wherein the generative question-answering method comprises the following steps: obtaining at least one of the multiple candidate texts from the text knowledge database based on input information, and generating a first output text based on the input information and at least one of the multiple candidate texts; obtaining a first role template from the multiple role templates and at least one of the multiple dialogue examples corresponding to the first role template from the role database based on the input information; and generating a second output text based on the input information, the first role template, at least one of the multiple dialogue examples, and the first output text. Attached Figure Description
[0008] To make the above and other objects, features, advantages and embodiments disclosed herein more apparent and understandable, the accompanying drawings are described below:
[0009] Figure 1 This is a schematic diagram of a generative question-answering system according to some embodiments of the present invention;
[0010] Figure 2 This is a schematic diagram of a generative question-answering system according to some embodiments of the present invention;
[0011] Figure 3 This is a schematic diagram of a generative question-answering system according to some embodiments of the present invention;
[0012] Figure 4 This is a flowchart illustrating a generative question-answering method according to some embodiments of the present invention;
[0013] Figure 5 This is a schematic diagram illustrating the operation of a text retrieval module according to some embodiments of the present invention;
[0014] Figure 6 This is a schematic diagram illustrating the operation of an answer generation module according to some embodiments of the present invention;
[0015] Figure 7 This is a schematic diagram illustrating the operation of a context-aware module according to some embodiments of the present invention;
[0016] Figure 8 This is a schematic diagram illustrating the operation of a style conversion module according to some embodiments of the present invention; and
[0017] Figure 9This is a schematic diagram illustrating the collaborative operation of a text retrieval module, an answer generation module, a context-aware module, and a style transfer module according to some embodiments of the present invention.
[0018] Explanation of reference numerals in the attached figures
[0019] 100, 100A, 100B: Generative Question Answering System
[0020] 110, 110A: Input / output devices
[0021] 130, 130A, 130B: Processors
[0022] 150: Memory
[0023] 152: Character Database
[0024] 154: Text Knowledge Database
[0025] 156: User Database
[0026] 212: Select Unit
[0027] 214: Input Unit
[0028] 216: Document Processing Unit
[0029] 232: Character Template Construction Module
[0030] 234: Domain Text Construction Module
[0031] 232A: Character Description Unit
[0032] 232B: Character Drawing Unit
[0033] 232C: Role Storage Unit
[0034] 234A: Paragraph Separation Unit
[0035] 234B: Text parsing unit
[0036] 234C: Information Extraction Unit
[0037] 234D: De-identification unit
[0038] 234E: Vector Transformation Unit
[0039] 310: Text Retrieval Module
[0040] 330: Answer Generation Module
[0041] 350: Context-Aware Module
[0042] 370: Style Transfer Module
[0043] 400: Generative Question Answering Methods
[0044] S410, S420, S430: Steps
[0045] IB: User Basic Information
[0046] IC: User Input Content
[0047] ID: Application Area Information
[0048] ST: Candidate Text
[0049] L: Large language model
[0050] PM: Character Template
[0051] DE: Dialogue Example
[0052] IM: Input Information
[0053] OT1, OT2: Output text
[0054] P1, P2, P3: Prompt Templates
[0055] P1a, P2a, P3a: Prompts
[0056] 510: Text Knowledge Similarity Calculation Mechanism
[0057] 610: Hint integration mechanism for answer generation
[0058] 710: Role-Context Matching Mechanism
[0059] 720: Dialogue Paradigm Similarity Calculation Mechanism
[0060] 810: Language Style Conversion Hint Integration Mechanism Detailed Implementation
[0061] The following discloses various features of the invention, providing numerous different embodiments or examples for carrying out the invention. Elements and configurations in the specific examples are used in the following discussion to simplify the subject matter. Any examples discussed are for illustrative purposes only and do not in any way limit the scope or significance of the invention or its examples. The operation of “determining” or “obtaining” as used herein may be replaced by an operation of “generating” or “calculating”.
[0062] Please see Figure 1 . Figure 1 This is a schematic diagram of a generative question-answering system 100 according to some embodiments of the present invention. The generative question-answering system 100 includes an input / output device 110, a processor 130, and a memory 150.
[0063] In terms of connectivity, input / output device 110 is coupled to processor 130, and processor 130 is coupled to memory 150. Figure 1 In the memory 150, there are a role database 152, a text knowledge database 154, and a user database 156.
[0064] Please see Figure 2 . Figure 2 This is a schematic diagram of a generative question-answering system 100A according to some embodiments of the present invention. Figure 2 The generative question-answering system 100A in China is Figure 1 One implementation of the generative question-answering system 100 in the example.
[0065] At Figure 2 In the processor, input / output device 110A includes a selection unit 212, an input unit 214, and a file processing unit 216. Processor 130A includes a character template construction module 232 and a domain text construction module 234. Character template construction module 232 includes a character description unit 232A, a character drawing unit 232B, and a character storage unit 232C. Domain text construction module 234 includes a paragraph separation unit 234A, a text parsing unit 234B, an information extraction unit 234C, a de-identification unit 234D, and a vector conversion unit 234E.
[0066] In some embodiments, the role database 152 and the text knowledge database 154 can be accessed through methods such as... Figure 2 The input / output device 110A and processor 130A shown herein construct or modify the contents of the role database 152 and the text knowledge database 154. In some embodiments, the system administrator can connect to the input / output device 110A via a user device (not shown) to perform operations such as adding, modifying, and deleting data in the role database 152 and the text knowledge database 154.
[0067] In some embodiments, the user device may be a handheld mobile device or a browser interface, used to provide a user interface. Any device that can be used to input text, voice, images, and documents can be used as a user device.
[0068] In some embodiments, the selection unit 212 is used to process input signals from selection operations such as options and fields performed on the user interface. The input unit 214 is used to process text input, voice input, or graphic input transmitted by the user device. In some embodiments, the input unit 214 converts voice input into plain text input. The file processing unit 216 is used to parse various file formats. In some embodiments, the system administrator can select a category through the selection unit 212. Based on the category input signal received by the selection unit 212, the input / output device 110A transmits the received input, files, signals, data, etc., to the role database 152 through the role template construction module 232, or to the text knowledge database 154 through the domain text construction module 234.
[0069] In some embodiments, the role template construction module 232 is used to process role templates related to a specific application domain and multiple dialogue examples corresponding to each of the role templates. The role template includes textual descriptions or graphics of situational roles constructed according to a specific application context. In some embodiments, the dialogue examples are historical dialogue records between a user and a specific role template.
[0070] In some embodiments, the character description unit 232A processes the text input signal for the character background description of the character template, the character drawing unit 232B processes the graphic input signal matching the character template, and the character storage unit 232C stores historical dialogue examples matching the character template as dialogue examples. Finally, the results processed by the character description unit 232A, the character drawing unit 232B, and the character storage unit 232C are stored in the character database 152 in a specific format. In the character database 152, each character template contains corresponding text description information and specific graphic description information.
[0071] In some embodiments, the domain text construction module 234 processes all text file data related to a specific application domain as candidate texts. The paragraph separation unit 234A segments the text file data into paragraphs, the text parsing unit 234B parses the content of the text file data, the information extraction unit 234C extracts the text information (metadata) from the text file data, the de-identification unit 234D removes private information from the text file data, and the vector conversion unit 234E converts the text file data into vector information (Embedding). Finally, the text content, text information, and vector information of the generated candidate texts are stored in the text knowledge database 154 in a specific format.
[0072] Through the above operations, the data stored in the role database 152 and the text knowledge database 154 can be created and updated for use in subsequent generative question-and-answer operations.
[0073] In addition, in some embodiments, the user database 156 stores user basic information and application domain information corresponding to the user.
[0074] For ease of understanding, Table 1 below is an embodiment of a role database 152. However, the implementation of this invention is not limited to Table 1.
[0075] Table 1
[0076]
[0077] Table 1 above lists three different character templates, each belonging to a different category. However, the character templates in Character Database 152 are not limited to these three types, and each category may contain more character templates.
[0078] Please see Figure 3 . Figure 3 This is a schematic diagram of a generative question-answering system 100B according to some embodiments of the present invention. Figure 3 The generative question-answering system 100B in China is Figure 1 One implementation of the generative question-answering system 100 in the example.
[0079] At Figure 3 In the processor 130B, there are a text retrieval module 310, an answer generation module 330, a context-aware module 350, and a style transfer module 370. Regarding... Figure 3 Detailed instructions on how to operate the generative question-answering system 100B shown below will be provided. Figure 4 This will be explained together.
[0080] Figure 4 This is a flowchart illustrating a generative question-answering method 400 according to some embodiments of the present invention. The generative question-answering method 400 can be applied to... Figure 1 Generative question answering system 100 Figure 2 Generative question answering system 100A in China Figure 3 The generative question-answering system 100B or a system with the same or similar structure. For simplicity, the following will use... Figure 3 The method of operation is described using examples, but this invention does not use examples. Figure 3 Its application is limited.
[0081] Please see Figure 4The generative question-answering method 400 includes the following steps S410 to S430. In step S410, at least one of multiple candidate texts is obtained from a text knowledge database based on the input information, and a first output text is generated based on the input information and at least one of the multiple candidate texts. In step S420, based on the input information, a first role template and at least one dialogue example from multiple dialogue examples corresponding to the first role template are obtained from a role database. In step S430, a second output text is generated based on the input information, the first role template, at least one of the multiple dialogue examples, and the first output text. Steps S410 to S430 will be described in detail below.
[0082] In step S410, the text retrieval module 310 retrieves at least one of multiple candidate texts from the text knowledge database 154 based on the input information, and then the answer generation module 330 generates the first output text based on the input information and at least one of the multiple candidate texts. A detailed implementation of step S410 will be provided below. Figure 5 and Figure 6 This will be explained together.
[0083] In some embodiments, the input information includes user input content, user basic information, and application domain information. User input content is text or voice input from the user's desired inquiry or conversation. User basic information may include the user's age, gender, occupation, etc. Application domain information may be the application domain of the content the user wants to inquire about or chat about.
[0084] In some embodiments, the user input content, user basic information, and application domain information may all be input by the user using a user device. In some embodiments, the user input content may be input by the user using a user device, while the user basic information and application domain information may be obtained by the processor 130B by searching the user database 156 based on the user login information or user input content.
[0085] Please participate Figure 5 . Figure 5 This is a schematic diagram illustrating the operation of a text retrieval module 310 according to some embodiments of the present invention. In some embodiments, after receiving user input content IC, the text retrieval module 310 executes a text knowledge similarity calculation mechanism 510 to search the text knowledge database 154 to obtain candidate text ST corresponding to the user input content IC. The aforementioned candidate text ST may contain one or more texts.
[0086] In some embodiments, when executing the text knowledge similarity calculation mechanism 510, text retrieval methods, vector retrieval methods, or any other common retrieval methods can be used to find the top few candidate texts ST in the text knowledge database 154 that have the highest similarity to the user input content IC. In some embodiments, the execution of the text knowledge similarity calculation mechanism 510 includes calculating multiple similarities between the user input content IC and multiple candidate texts in the text knowledge database, and obtaining the top few candidate texts ST with the highest similarity based on the multiple similarities.
[0087] In some embodiments, the text retrieval method calculates the text similarity between the user input content IC and the text fields of all candidate texts in the text knowledge database 154. The vector retrieval method calculates the vector similarity between the vector information of the user input content IC and the vector information of all candidate texts in the text knowledge database 154, and takes the top few similarities as candidate texts ST corresponding to the user input content IC.
[0088] Please continue reading. Figure 6 . Figure 6 This is a schematic diagram illustrating the operation of an answer generation module 330 according to some embodiments of the present invention. In some embodiments, after receiving user input content IC and candidate text ST, the answer generation module 330 executes an answer generation prompt integration mechanism 610 to generate a prompt P1a based on the user input content IC, candidate text ST, and prompt template P1, and then inputs the prompt P1a into a large language model L to generate output text OT1.
[0089] In some embodiments, such as Figure 6 As shown, during the execution of the answer generation prompt integration mechanism 610, the answer generation module 330 fills the user input content IC into the Query field of the prompt template P1, and fills the candidate text ST (including candidate text 1, candidate text 2, candidate text 3, and other candidate texts) into the Content field, so as to integrate the prompts according to a certain format and generate the prompt P1a. Based on the prompt P1a, the large language model L generates text to produce the output text OT1.
[0090] Please refer back to this. Figure 4 In step S420, based on the input information, the first role template PM and at least one dialogue example DE from the multiple dialogue examples of the first role template PM are obtained from the role database 152.
[0091] Please refer to the following: Figure 7 . Figure 7This is a schematic diagram illustrating the operation of a context-aware module 350 according to some embodiments of the present invention. In some embodiments, after receiving user input content IC, user basic information IB, and application domain information ID, the context-aware module 350 executes a role-context matching mechanism 710 to generate a prompt P2a based on the user input content IC, user basic information IB, application domain information ID, prompt template P2, and role database 152. The prompt P2a is then input into a large language model L to obtain a role template PM corresponding to the input information.
[0092] In some embodiments, when executing the role context matching mechanism 710, the context awareness module 350 extracts the fields of all role templates in the role database 152 and integrates the input information with the role database according to a certain format. Specifically, the context awareness module 350 fills the user input content IC into the Query field of the prompt template P2, fills the application domain information ID into the Domain field, fills the user basic information IB (including age, gender, occupation, etc.) into the Information field, and fills multiple role templates in the role database (including the role description of role template number 0, role description of role template number 1, role description of role template number 2, etc.) into the Personal field, so as to integrate the prompts according to a certain format and generate the prompt P2a.
[0093] Next, the large language model L classifies and scores multiple role templates (including role template number 0, role template number 1, role template number 2, etc.) in the role database based on the integrated prompt P2a. Then, based on the confidence level of the classification and scoring results, it selects the role template PM corresponding to the input information from the categories or role templates with confidence levels above a threshold. In some embodiments, role template PM is the role template with the highest confidence level.
[0094] After selecting the role template PM corresponding to the input information, the context-aware module 350 executes the dialogue example similarity calculation mechanism 720 to obtain multiple candidate dialogue examples corresponding to the corresponding category or role template PM. Next, the context-aware module 350 converts the user input content IC into input content vector information, and converts the multiple candidate dialogue examples corresponding to the corresponding category or role template PM into multiple vector information, then calculates the similarity between the input content vector information and the vector information of the candidate dialogue examples. The similarity calculation method can use a distance-based similarity method (e.g., Euclidean distance) or an angle-based similarity method (e.g., cosine). In some embodiments, the context-aware module 350 selects the candidate dialogue example with the highest similarity ranking or a similarity higher than a threshold as the dialogue example DE corresponding to the role template PM and the input information, and outputs the dialogue example DE.
[0095] In some embodiments, the context-aware module 350 can parse various forms of perception, including text, images, sounds, structured information, etc. The implementation methods described herein are not limited to text or images.
[0096] Please refer back to this. Figure 4 In step S430, output text OT2 is generated based on the input information, role template PM, dialogue example DE, and output text OT1.
[0097] Please refer to the following: Figure 8 . Figure 8 This is a schematic diagram illustrating the operation of a style conversion module 370 according to some embodiments of the present invention. In some embodiments, after receiving the role template PM, dialogue example DE, user input content IC, and output text OT1, the style conversion module 370 executes a language style conversion prompt integration mechanism 810 to generate a prompt P3a based on the role template PM, dialogue example DE, user input content IC, output text OT1, and prompt template P3. The prompt P3a is then input into a large language model L to obtain an output text OT2 with a specific language style.
[0098] In detail, the language style conversion prompt integration mechanism 810 first determines whether the role template PM and dialogue example DE output by the context-aware module 350 have content (the presence or absence of content is determined by the threshold of the context-aware module 350). Based on the prompt template P3, the style conversion prompt with added context-aware information is combined with the user input content IC and the output text OT1 of the answer generation module 330, and the prompt is integrated according to a certain format. In some embodiments, the style conversion module 370 fills the role description of the role template PM into the role (Personal) field, fills the dialogue example (including dialogue example 1, dialogue example 2, etc.) corresponding to the input information into the history dialogue example (History Dialogue) field, fills the user input content IC into the query field of the prompt template P1, and fills the output text OT1 of the answer generation module 330 into the answer field to generate the prompt P3a.
[0099] Next, the large language model L transforms the integrated prompt P3a to generate output text OT2 with a specific language style.
[0100] Please see Figure 9 . Figure 9 This is a schematic diagram illustrating the collaborative operation of a text retrieval module 310, an answer generation module 330, a context-aware module 350, and a style transfer module 370 according to some embodiments of the present invention.
[0101] like Figure 9 As shown, the text retrieval module 310, answer generation module 330, context-aware module 350, and style conversion module 370 operate collaboratively along two paths. One path consists of the text retrieval module 310 and the answer generation module 330, generating output text OT1 without a specific language style. The other path consists of the context-aware module 350 and the style conversion module 370, transforming the output text OT1 without a specific language style into output text OT2 with a specific language style using a role template.
[0102] Specifically, in some embodiments, the text retrieval module 310 retrieves text based on the user input content IC in the input information IM, such as... Figure 1The text knowledge database 154 shown identifies suitable candidate texts ST as the basis for answer generation. Next, the answer generation module inputs the user input content IC and candidate texts ST into a large language model using specific prompts to generate output text OT1 without a specific language style. Then, the context-aware module 350 analyzes the user input content IC, user basic information IB, and application domain information ID in the input information IM to identify the role template PM and dialogue example DE that match the input information IM. Finally, the style conversion module 370, based on the role template PM and dialogue example DE, transforms the output text OT1 without a specific language style into output text OT2 with a specific language style.
[0103] To facilitate understanding, the following example illustrates the collaborative operation of the text retrieval module 310, the answer generation module 330, the context awareness module 350, and the style transfer module 370.
[0104] In one embodiment, the user input content IC includes "I had dinner with my high school classmates last week, and I think it might be related to poisoning by Wang Steak. Where can I go for treatment or make an appointment?". The user basic information IB includes "Age: Youth, Gender: Male, Occupation: Student.". The application domain information ID includes "Public Health".
[0105] Based on the user input content IC, the text retrieval module 310 performs a retrieval and outputs candidate text ST, which includes candidate text 1 to candidate text 4. The content of candidate text 1 includes "Wang Steak Poisoning Incident Special Clinic", the content of candidate text 2 includes "Eye Care Program for School-Aged Children", the content of candidate text 3 includes "How to become a health volunteer", and the content of candidate text 4 includes "How to prevent food poisoning".
[0106] The answer generation module 330 fills in the above user input content IC as follows: Figure 6 In the prompt template P1 shown, fill in the Query field with the candidate text ST (including candidate text 1 to candidate text 4) and then fill in the Content field to integrate the prompts according to a certain format and generate a prompt like this. Figure 6 The prompt P1a is shown. Based on the prompt P1a, the large language model L generates text to produce the output text OT1. The output text OT1 contains "You can register for the Food Safety Special Clinic at the Renai Campus of United Christian Hospital and the Department of Family Medicine at the Chung Hsing Campus between April 9th and 15th".
[0107] On the other hand, the context-aware module 350 fills in the user input content IC. Figure 7In the prompt template P2, the application domain information ID is entered into the Domain field, the user's basic information IB (including age, gender, occupation, etc.) is entered into the Information field, and multiple role templates from the role database 152 (including the role descriptions of role template number 0, role template number 1, role template number 2, etc.) are entered into the Personal field. This process integrates the prompts according to a specific format to generate prompt P2a. Based on prompt P2a, the Personal output by the large language model L is role template PM. The confidence score calculated by the large language model L for role template PM is 8 points, and the Reason output by the large language model L includes "Using a mother's perspective and a friendly tone, this will prevent students from being afraid and encourage them to actively seek outpatient information."
[0108] In some embodiments, when there are no historical dialogue examples or the similarity of candidate dialogue examples is not higher than a threshold, the dialogue example output by the context-aware module 350 is blank.
[0109] Finally, based on the prompt template P3 shown in Figure 8, the style conversion module 370 fills in the role description of the role template PM into the Personal field, the dialogue example corresponding to the input information (since there is no corresponding dialogue example, it will be filled in as No Dialogue Example) into the History Dialogue field, the user input content IC into the Query field of the prompt template P1, and the output text OT1 of the answer generation module 330 into the Answer field, to generate the prompt P3a as shown in Figure 8. Based on the prompt P3a, the large language model L generates a stylized answer, namely the output text OT2 of a specific language style. The output text OT2 includes the following: "Oh dear, the recent food poisoning incidents are really scary! From April 9th to 15th, you can visit the 'Food Safety Special Clinic' at the Renai Branch of United Christian Hospital or the 'Food Safety Special Clinic under the Department of Family Medicine' at the Zhongxing Branch. Remember to take good care of your health, especially regarding your diet. If you feel unwell, don't hesitate to see a doctor immediately!"
[0110] It should be noted that the prompt templates P1 to P3 and prompts P1a to P3a mentioned above are for illustrative purposes only. System developers can modify the prompt templates or prompts as needed based on the usage scenario and project requirements.
[0111] It should be noted that, in some embodiments, the generative question-answering method 400 can also be implemented as a computer program or instructions and stored in, for example, Figure 1 In the memory 150, and make as Figure 1 The processor 130 in the generative question-answering system 100 reads the computer program or instructions and executes this operation method. The processor 130 may consist of one or more chips. The memory 150 may be a read-only memory, flash memory, floppy disk, hard disk, optical disk, USB flash drive, magnetic tape, network-accessible database, or other non-transitory computer-readable recording media with the same function that can be easily conceived by those skilled in the art.
[0112] Furthermore, it should be understood that the operations of the generative question-answering method 400 mentioned in this embodiment, unless otherwise specified, can be adjusted in order according to actual needs, and may even be executed simultaneously or partially simultaneously. Moreover, in different embodiments, these operations can also be adaptively added, replaced, and / or omitted.
[0113] In some embodiments, Figure 1 The processor 130 can be a server, circuit, central processing unit (CPU), microprocessor (MCU), or other circuit, component, or device with equivalent functions, including storage, computation, data reading, receiving signals or information, and transmitting signals or information. Furthermore, Figure 1 The processor in the middle can contain at the same time Figure 2 The processor 130A or Figure 3 All circuits, modules, or components in the processor 130B.
[0114] In some embodiments, Figure 1 The input / output device 110 can be a circuit or element with signal output / input, information output / input or similar functions.
[0115] In some embodiments, Figure 2 and Figure 3 All modules, units, and components can be implemented as circuits or elements.
[0116] As can be seen from the above implementation method of this case, the embodiments of this case provide a generative question-answering system and a generative question-answering method. By importing the context-aware module, role templates are used to replace the traditional data-based model training, which reduces training costs. Large Language Models (LLMs) are used to classify input information to generate classification results or role templates that match the input information, thereby obtaining the dialogue example that best matches the role template of the input information. Furthermore, through the text retrieval module, highly relevant texts are first selected from the text knowledge database, and then the answer generation module generates the text. Finally, through the style conversion module, based on the role templates and dialogue examples generated by the context-aware module, and based on the output text without a specific language style generated by the answer generation module, the style conversion module can generate output text with a specific language style to produce customized output answers, allowing users to resonate or feel empathized with.
[0117] In this implementation, two parallel paths operate collaboratively. One path consists of a text retrieval module and an answer generation module, producing output text without a specific language style. The other path consists of a context-aware module and a style conversion module, which uses role templates to convert the output text without a specific language style into output text with a specific language style. Compared to directly using a stylization model to output answers or generate output text, this approach reduces the occurrence of nonsensical statements and outdated knowledge.
[0118] Furthermore, the above illustrations include sequential exemplary steps, but these steps need not be performed in the order shown. Performing these steps in a different order is within the scope of this disclosure. Within the spirit and scope of the embodiments of this disclosure, these steps may be added, substituted, changed in order, and / or omitted as appropriate. The terms "first" and "second" above are used only to distinguish identical statements and are not intended to limit any order between these statements, nor to limit any order between the steps involved in these statements.
[0119] Although the embodiments have been disclosed above, they are not intended to limit the scope of this invention. Any person skilled in the art may make various modifications and alterations without departing from the spirit and scope of this invention. Therefore, the scope of protection of this invention shall be determined by the claims.
Claims
1. A generative question-answering system for generating stylized text, comprising: Input / output device, used to receive input information; The memory is used to store a character database and a text knowledge database, wherein the character database records multiple character templates and multiple dialogue examples corresponding to the multiple character templates, and the text knowledge database stores multiple candidate texts. as well as A processor, coupled to the memory and the input / output device, is configured to execute the following programs: Based on the input information, at least one of the plurality of candidate texts is obtained from the text knowledge database, and a first output text is generated based on the input information and at least one of the plurality of candidate texts; Based on the input information, obtain at least one of the first character template and the corresponding dialogue examples from the character database among the plurality of character templates; as well as Based on the input information, the first role template, at least one of the plurality of dialogue examples, and the first output text, a second output text is generated.
2. The generative question-answering system according to claim 1, wherein the processor is further configured to execute the following program: Calculate multiple similarities between the user input content in the input information and the multiple candidate texts in the text knowledge database; and At least one of the candidate texts is obtained based on the multiple similarities.
3. The generative question-answering system according to claim 1, wherein the processor is further configured to execute the following program: Based on the user input in the input information and at least one of the candidate texts, a prompt is generated; and The prompt is input into a large language model to produce the first output text.
4. The generative question-answering system according to claim 1, wherein the processor is further configured to execute the following program: A prompt is generated based on the input information and the character database; The prompt is input into a large language model to obtain the first character template with the highest confidence level.
5. The generative question-answering system according to claim 4, wherein the input information includes user input content, user basic information, and application domain information.
6. The generative question-answering system of claim 4, wherein the plurality of candidate dialogue examples in the plurality of dialogue examples correspond to the first role template, wherein the processor is further configured to execute the following program: Convert the user input content in the input information into input content vector information; Convert the multiple candidate dialogue examples into multiple vector information; and When the similarity between the first vector information in the plurality of vector information and the input content vector information is higher than a threshold, one of the plurality of candidate dialogue examples corresponding to the first vector information is selected as at least one of the plurality of dialogue examples corresponding to the first role template.
7. The generative question-answering system of claim 1, wherein the processor is further configured to execute the following program: Generate a prompt based on the input information, the first role template, at least one of the plurality of dialogue examples, and the first output text; and The prompt is input into a large language model to produce the second output text.
8. The generative question answering system according to claim 1, wherein the text knowledge database includes the plurality of candidate texts, the plurality of text information of the plurality of candidate texts, and the plurality of vector information.
9. The generative question-answering system according to claim 1, wherein the role database further includes multiple textual descriptions and multiple graphical descriptions corresponding to the multiple role templates.
10. The generative question-answering system of claim 1, wherein the memory is further configured to store a user database, wherein the user database includes multiple user basic information corresponding to multiple users and multiple application domain information.
11. A generative question-answering method, applicable to a generative question-answering system comprising a role database and a text knowledge database, wherein the role database records multiple role templates and multiple dialogue examples corresponding to the multiple role templates, wherein the text knowledge database stores multiple candidate texts, and wherein the generative question-answering method comprises: Based on the input information, at least one of the multiple candidate texts is obtained from the text knowledge database, and a first output text is generated based on the input information and at least one of the multiple candidate texts; Based on the input information, obtain at least one of the first character template and the corresponding dialogue examples from the character database among the plurality of character templates; as well as Based on the input information, the first role template, at least one of the plurality of dialogue examples, and the first output text, a second output text is generated.
12. The generative question-answering method according to claim 11, further comprising: Calculate multiple similarities between the user input content in the input information and the multiple candidate texts in the text knowledge database; and At least one of the candidate texts is obtained based on the multiple similarities.
13. The generative question-answering method according to claim 11, further comprising: A prompt is generated based on the user input in the input information and at least one of the multiple candidate texts; The prompt is input into a large language model to produce the first output text.
14. The generative question-answering method according to claim 11, further comprising: Generate prompts based on the input information and the character database; and The prompt is input into a large language model to obtain the first character template with the highest confidence level.
15. The generative question-answering method according to claim 14, wherein the input information includes user input content, user basic information, and application domain information.
16. The generative question-answering method according to claim 14, wherein the plurality of candidate dialogue examples in the plurality of dialogue examples correspond to the first role template, and wherein the generative question-answering method further comprises: Convert the user input content in the input information into input content vector information; Convert the multiple candidate dialogue examples into multiple vector information; and When the similarity between the first vector information in the plurality of vector information and the input content vector information is higher than a threshold, one of the plurality of candidate dialogue examples corresponding to the first vector information is selected as at least one of the plurality of dialogue examples corresponding to the first role template.
17. The generative question-answering method according to claim 11, further comprising: Generate a prompt based on the input information, the first role template, at least one of the plurality of dialogue examples, and the first output text; and The prompt is input into a large language model to produce the second output text.
18. The generative question answering method according to claim 11, wherein the text knowledge database includes the plurality of candidate texts, the plurality of text information of the plurality of candidate texts, and the plurality of vector information.
19. The generative question-answering method according to claim 11, wherein the character database further includes multiple textual descriptions and multiple graphical descriptions corresponding to the multiple character templates.
20. The generative question-answering method according to claim 11, further comprising: A user database is stored, wherein the user database contains basic information of multiple users and information on multiple application domains corresponding to multiple users.