Question-answering model template answering method and apparatus

By setting zero-width characters in the variables of the Q&A model template and converting them into a structure in the target format, the problem that the template structure is easily destroyed during the user editing process is solved, and the accuracy of the Q&A model to identify the problem is improved.

WO2025130199A1PCT designated stage expired Publication Date: 2025-06-26CHINA TELECOM CORP LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/119117
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-22
Filing Date
2024-09-14
Publication Date
2025-06-26

AI Technical Summary

Technical Problem

During the interaction process of large-scale Q&A models, users tend to delete brackets when editing the propt template, destroying the template structure, resulting in the question-answer model's accuracy in identifying questions.

Method used

The target template is obtained by setting zero-width characters in the variables in the question template and converting the set completed question template into a structure in the target format. Output the target template into the text input box, and receive the questions to be answered in the target template. Extract the keywords of the questions to be answered from the variables corresponding to the questions to be answered to generate the answer.

Benefits of technology

It effectively avoids the target template being destroyed, improves the accuracy of problem recognition, and solves the problem of low accuracy of question-and-answer model recognition due to the easy destruction of the problem template structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024119117_26062025_PF_FP_ABST
    Figure CN2024119117_26062025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a question-answering model template answering method and apparatus. The method comprises: acquiring a question template, wherein the question template includes a variable, and the variable is used for representing a keyword of a question to be answered; setting a zero-width character in the variable in the question template, and converting the set question template into a structural body in a target format, so as to obtain a target template, wherein the zero-width character is used for marking the position where the variable is located; outputting the target template to a text input box, and receiving a question to be answered that fills the target template; extracting a keyword of said question from a variable corresponding to said question, and generating an answer of said question at least on the basis of the keyword.
Need to check novelty before this filing date? Find Prior Art

Description

Question and answer model template answering method and device

[0001] Related applications

[0002] This application claims priority to Chinese patent application number 2023117931300, filed on December 22, 2023, entitled “Question and Answer Model Template Answering Method and Device,” the entire text of which is hereby incorporated by reference. Technical Field

[0003] The present application relates to the field of text processing, and in particular to a method and device for answering a question and answer model template. Background Art

[0004] During the interaction process of large-scale question-answering models, in order to help users ask high-quality questions that are easily recognized by large-scale question-answering models, relevant technologies provide prompt (prompt word) templates, allowing users to perform secondary editing based on the prompt templates. As shown in Figure 1, relevant technologies generally use a pair of brackets to wrap the variables in the prompt template to form a variable box, and display a pair of brackets in the text input box. However, users can directly delete the brackets, thereby destroying the structure of the prompt template, resulting in a decrease in the accuracy of the question-answering model in recognizing the question.

[0005] To address the above-mentioned problems, no effective solutions have been proposed so far.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a question-answering model template answering method and device.

[0008] According to one aspect of an embodiment of the present application, a question-answering model template answering method is provided, including: obtaining a question template, the question template containing variables, the variables being used to represent keywords of the question to be answered; setting zero-width characters in the variables in the question template, and converting the set question template into a structure in a target format to obtain a target template, the zero-width characters being used to mark the location of the variables; outputting the target template into a text input box, and receiving the question to be answered filled in the target template; extracting keywords of the question to be answered from the variables corresponding to the question to be answered, and generating an answer to the question to be answered based at least on the keywords.

[0009] In one embodiment, a zero-width character is set in the variable in the question template, and the set question template is converted into a structure in a target format to obtain a target template, including: setting a zero-width character at the first character in the variable; and converting the set question template into a structure in a target format through a predefined conversion function to obtain a target template.

[0010] In one embodiment, the method further includes: when executing a delete event and deleting characters in the text input box, detecting characters in the variable; and when the variable contains only zero-width characters, preventing the delete event from being executed.

[0011] In one embodiment, the method further includes: when executing a delete event and deleting characters in the text input box, detecting whether the text input box contains a target mark; and when the target mark is detected, determining that the variable is allowed to be deleted.

[0012] In one embodiment, a target template is output to a text input box, and a question to be answered that is filled in the target template is received, including: adding a target element before and after a variable, the target element is used to select all characters in the variable, and the target element is set to be invisible in the text input box; all characters in the question to be answered are obtained through a preset command; a regular expression for matching zero-width characters is created using a target encoding, and the regular expression is used to match all characters in the question to be answered, and the matched characters are determined to be zero-width characters; and zero-width characters in the selected characters are removed to obtain the question to be answered that is filled in the target template.

[0013] In one embodiment, the method further comprises:

[0014] Use Cascading Style Sheets to set the target element to be invisible within the text input box.

[0015] In one embodiment, keywords of the question to be answered are extracted from the variables corresponding to the question to be answered, and an answer to the question to be answered is generated based at least on the keywords, including: traversing all characters in the question to be answered filled in the target template; and determining all characters framed by the target element as keywords of the question to be answered.

[0016] In one embodiment, outputting the target template into the text input box includes: adding the target template into the text input box; determining the position of the variable of the target template in the text input box, and highlighting the position of the variable.

[0017] In one embodiment, the text input box is a rich media text input box.

[0018] In one embodiment, obtaining the question template includes: obtaining the question template in a pre-selected manner.

[0019] In one embodiment, the target format structure includes an HTML structure.

[0020] In one embodiment, the target markup includes a span tag.

[0021] According to another aspect of an embodiment of the present application, a question-answering model template answering device is also provided, including: a receiving module for obtaining a question template, the question template containing variables, and the variables being used to represent keywords of the question to be answered; a conversion module for setting zero-width characters in the variables in the question template, and converting the set question template into a structure in a target format to obtain a target template, and the zero-width characters are used to mark the location of the variables; an output module for outputting the target template into a text input box, and receiving the question to be answered filled in the target template; a generation module for extracting keywords of the question to be answered from the variables corresponding to the question to be answered, and generating an answer to the question to be answered based at least on the keywords.

[0022] According to another aspect of an embodiment of the present application, a non-volatile storage medium is also provided, which includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned question and answer model template answering method.

[0023] According to another aspect of an embodiment of the present application, a computer device is also provided, including a memory and a processor, wherein the processor is used to run a program, wherein the above-mentioned question and answer model template answering method is executed when the program is running.

[0024] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.

[0026] FIG1 is a schematic diagram of a question interface of a question-answering model in the related art;

[0027] FIG2 is a hardware structure block diagram of a computer terminal (or mobile device) for a question-answering model template answering method according to an embodiment of the present application;

[0028] FIG3 is a flow chart of a question-answering model template answering method according to the present application;

[0029] FIG4 is a schematic diagram of a question-answering model interface according to an embodiment of the present application;

[0030] FIG5a is a schematic diagram of another question-answering model interface according to an embodiment of the present application;

[0031] FIG5 b is a schematic diagram of another question-answering model interface according to an embodiment of the present application;

[0032] Figure 6 is a schematic structural diagram of an optional question-answer model template answering device according to an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0035] According to an embodiment of the present application, an embodiment of a question-answering model template answering method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0036] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal, a cloud server or a similar computing device. Figure 2 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing the question-answering model template answering method. As shown in Figure 2, the computer terminal 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used in the figure to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that the structure shown in Figure 2 is only illustrative and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 may also include more or fewer components than shown in Figure 2, or have a configuration different from that shown in Figure 2.

[0037] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be fully or partially integrated into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0038] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the data modification method of the database in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above-mentioned data modification method of the database. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0039] The transmission module 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission module 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission module 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.

[0040] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0041] According to an embodiment of the present application, an embodiment of a question-answering model template answering method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0042] FIG3 is a flow chart of a question-answering model template answering method according to an embodiment of the present application. As shown in FIG3 , the method includes the following steps:

[0043] Step S202: Obtain a question template, wherein the question template contains variables, and the variables are used to represent keywords of the question to be answered;

[0044] Step S204: setting zero-width characters in the variables in the question template, and converting the set question template into a structure of a target format to obtain a target template. The zero-width characters are used to mark the locations of the variables.

[0045] Step S206: Output the target template into the text input box and receive the question to be answered filled in the target template;

[0046] Step S208: extract keywords of the question to be answered from the variables corresponding to the question to be answered, and generate an answer to the question to be answered based at least on the keywords.

[0047] Through the above steps, it is possible to obtain a question template, which contains variables, and the variables are used to represent the keywords of the question to be answered; set zero-width characters in the variables in the question template, and convert the set question template into a structure in the target format to obtain a target template, and the zero-width characters are used to mark the positions of the variables; output the target template to a text input box, and receive the question to be answered filled in the target template; extract the keywords of the question to be answered from the variables corresponding to the question to be answered, and generate the answer to the question to be answered based on the keywords at least. By marking the positions of the variables with zero-width characters, the purpose of avoiding the destruction of the target template is achieved, thereby achieving the technical effect of improving the accuracy of question recognition, and thus solving the technical problem of low accuracy of question recognition by the question and answer model due to the easy destruction of the structure of the question template.

[0048] In step S202 , the question template may be obtained by preselection.

[0049] In step S204, the zero-width character is a special Unicode (a computer character encoding) character, whose character width is zero and does not occupy any display space in the text. The HTML format entity of the zero-width character is "‌".

[0050] It should be noted that the target format structure is an HTML structure (a document structure).

[0051] The above steps S202 to S208 are described in detail below through a specific embodiment.

[0052] In some embodiments of the present application, a zero-width character is set at the position of the variable in the question template, and the question template is converted into a structure in the target format. The specific process of obtaining the target template is: setting a zero-width character at the first character in the variable; converting the set question template into a structure in the target format through a predefined conversion function to obtain the target template.

[0053] In actual application scenarios, after receiving a delete event, if no zero-width character is set, the entire variable box will be deleted after deleting the last text character in the text input box, which will cause the template to be unstable and cannot meet the user's need to clear the variable content and re-enter the content. In an embodiment of the present application, when executing a delete event and deleting the characters in the text input box, the characters in the variable are detected; when the variable only contains zero-width characters, the delete event is prevented from being executed, so as to achieve the purpose of preventing the variable from being merged and deleted. At the same time, the character width of the zero-width character is zero, and adding it will not have any visual impact on the user.

[0054] By introducing zero-width characters, the fill-in-the-blank input box can get the input focus when the content is empty. The input focus is used to mark the keywords of the question.

[0055] In another optional method, if you want to delete a variable as a whole, you can append a target tag after the variable, for example: add a span tag (an Html tag) to mark it, and when executing the delete event and deleting the characters in the text input box, detect whether the text input box contains the target tag; when the target tag is detected, determine that the variable is allowed to be deleted as a whole.

[0056] It should be noted that the span tag can be named class: dxfe-chat-varInput-notDel (this input box is used to enter variable values ​​in the dialog box, and deletion of entered content is not allowed).

[0057] It is understandable that in rich text editing, the browser rollback deletion process is to delete characters one by one. The target tag introduces zero-width characters, which can automatically obtain the input focus when the keyboard rolls back. By intercepting the rollback event, the trigger node for listening to the rollback event is dxfe-chat-varInput-notDel, which prevents the browser from deleting the event (rolling back character by character) and uses the delete element function to delete the entire variable, thereby achieving the effect of deleting the entire variable.

[0058] In an optional method, the target template is output to a text input box, and the process of receiving the question to be answered filled in the target template is as follows: add target elements before and after the variable, the target element is used to select all characters in the variable, and the target element is set to be invisible in the text input box; obtain all characters in the question to be answered through a preset command; use the target encoding to create a regular expression for matching zero-width characters, and use the regular expression to match all characters in the question to be answered, and determine the matched characters as zero-width characters; remove the zero-width characters in the selected characters to obtain the question to be answered filled in the target template.

[0059] Specifically, the effect of the variable after adding the target element to the output to the backend is "[variable]", and the zero-width character "variable" is removed to obtain "[variable]".

[0060] Taking the target element as a bracket as an example, brackets can be added before and after the variable field to frame the variable field. The target element can be set to be invisible in the text input box through CSS (Cascading Style Sheets).

[0061] Add an HTML element with the content '[' before the variable field and set it to invisible using CSS. Add an HTML element with the content ']' after the variable field and set it to invisible using CSS to reduce user comprehension and improve the interactive experience.

[0062] It's important to note that CSS is a markup language used in web design that defines the style and layout of various elements on a web page. The primary function of CSS is to separate the content and style of a web page, making the page structure clearer and easier to maintain and modify. The design goals of CSS are to make it easier for web designers to create richly styled web pages and for browsers to render them more easily.

[0063] The native capabilities of the DOM (Document Object Model) are used to obtain the innerText value (a method for obtaining plain text content) of the top-level DOM of the input text box. However, this value includes zero-width characters, which are not entered by the user and may affect the response of the large model. However, by leveraging the cross-end uniqueness of Unicode and regular matching, the zero-width characters ("‌") in the string are filtered out, and the final output to the backend is "[variable]", thus ensuring the data structure required by the large model. At the same time, because innerText obtains plain text content, it does not obtain HTML tags, which also solves the XSS (Cross-Site Scripting) problem brought about by the introduction of rich text technology.

[0064] In one embodiment, keywords of the question to be answered are extracted from the variables corresponding to the question to be answered, and an answer to the question to be answered is generated based at least on the keywords, including: traversing all characters in the question to be answered filled in the target template; and determining all characters framed by the target element as keywords of the question to be answered.

[0065] In one embodiment, outputting the target template to a text input box includes: adding the target template to the text input box; determining the location of the variables of the target template in the text input box, and highlighting the location of the variables. In some examples, the text input box is a rich media text input box. Figure 4 shows a question input interface of a question-answering model according to an embodiment of the present application. It can be understood that the highlighted portion in the text input box in the figure is the variable portion, and the box below is the question content recognized by the model.

[0066] Figure 5a shows a question input interface of a question-answering model in another embodiment of the present application. As shown in Figure 5a, the cursor is located in the input box corresponding to the variable.

[0067] Figure 5b shows a question input interface of a question-answering model in another embodiment of the present application. As shown in Figure 5b, the cursor is located in the top-level text input box.

[0068] The question-answer model template answering method provided in the embodiment of the present application is also applied to a question-answer model template answering device provided in the embodiment of the present application, as shown in Figure 6, including: a receiving module 40, used to obtain a question template, the question template contains variables, and the variables are used to represent the keywords of the question to be answered; a conversion module 42, used to set zero-width characters in the variables in the question template, and convert the set question template into a structure in the target format to obtain a target template, and the zero-width characters are used to mark the location of the variables; an output module 44, used to output the target template to a text input box, and receive the question to be answered filled in the target template; a generation module 46, used to extract the keywords of the question to be answered from the variables corresponding to the question to be answered, and generate an answer to the question to be answered based on at least the keywords.

[0069] In one embodiment, the conversion module 42 includes: a first setting submodule and a first conversion submodule, wherein the first setting submodule is used to set a zero-width character at the first character in the variable; the first conversion submodule is used to convert the set problem template into a structure in a target format through a predefined conversion function to obtain a target template.

[0070] In one embodiment, the device further includes: a deletion module and a resistance module, wherein the deletion module is used to detect characters in the variable when executing a deletion event and deleting characters in the text input box; the resistance module is used to prevent the deletion event from being executed when the variable only contains zero-width characters.

[0071] In one embodiment, the device further includes: a detection module and a determination module, wherein the detection module is used to detect whether the text input box contains a target mark when executing a deletion event and deleting characters in the text input box; and is used to determine whether the variable is allowed to be deleted when the target mark is detected.

[0072] In one embodiment, the output module 44 includes: a first adding submodule, a first acquiring submodule, a first matching submodule and a first deleting submodule, wherein the first adding submodule is used to add a target element before and after the variable, the target element is used to select all characters in the variable, and the target element is set to be invisible in the text input box; the first acquiring submodule is used to acquire all characters in the question to be answered through a preset command; the first matching submodule is used to use the target encoding to create a regular expression for matching zero-width characters, and use the regular expression to match all characters in the question to be answered, and determine the matched characters as zero-width characters; the first deleting submodule is used to remove the zero-width characters in the selected characters to obtain the question to be answered filled in the target template.

[0073] In one embodiment, the generation module 46 includes a filling submodule and a first determination submodule, wherein the filling submodule is used to traverse all characters in the question to be answered that are filled in the target template; the first determination submodule is used to determine all characters framed by the target element as keywords of the question to be answered.

[0074] In one embodiment, the output module 44 includes: a first input submodule and a second determination submodule, wherein the first input submodule is used to add the target template to a text input box, wherein the text input box is a rich media text input box; the second determination submodule is used to determine the location of the variable of the target template in the text input box, and highlight the location of the variable.

[0075] According to another aspect of an embodiment of the present application, a non-volatile storage medium is also provided, including a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned question and answer model template answering method.

[0076] According to another aspect of an embodiment of the present application, a computer device is also provided, including a memory and a processor, wherein the processor is used to run a program, wherein the above-mentioned question and answer model template answering method is executed when the program is running.

[0077] The above-mentioned computer device executes the above-mentioned question-answering model template answering method by obtaining a question template, which contains variables, and the variables are used to represent the keywords of the question to be answered; setting zero-width characters in the variables in the question template, and converting the set question template into a structure in the target format to obtain a target template, and the zero-width characters are used to mark the positions of the variables; outputting the target template to a text input box, and receiving the question to be answered filled in the target template; extracting the keywords of the question to be answered from the variables corresponding to the question to be answered, and generating the answer to the question to be answered based on the keywords at least. By marking the positions of the variables with zero-width characters, the purpose of avoiding the destruction of the target template is achieved, thereby achieving the technical effect of improving the accuracy of question recognition, and thus solving the technical problem of low accuracy of question recognition by the question answering model due to the easy destruction of the structure of the question template.

[0078] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0079] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0080] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0081] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.

[0082] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0083] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.

[0084] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0085] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A question-answering model template answering method, comprising: Obtaining a question template, wherein the question template contains variables, and the variables are used to represent keywords of the question to be answered; Setting a zero-width character in the variable in the question template, and converting the question template after setting into a structure in a target format to obtain a target template, wherein the zero-width character is used to mark the position of the variable; Outputting the target template into a text input box, and receiving the unanswered question filled in the target template; as well as Keywords of the question to be answered are extracted from the variables corresponding to the question to be answered, and an answer to the question to be answered is generated based at least on the keywords.

2. The method according to claim 1, wherein: Setting a zero-width character in the variable in the question template, and converting the question template after setting into a structure in a target format to obtain a target template, including: Setting the zero-width character at the first character in the variable; and The problem template that has been set is converted into a structure in the target format through a predefined conversion function to obtain the target template.

3. The method according to claim 2, wherein: The method further comprises: When a delete event is executed to delete characters in the text input box, detecting the characters in the variable; and In the case where the variable contains only the zero-width character, the delete event is prevented from being executed.

4. The method according to claim 2, wherein: The method further comprises: When a deletion event is executed to delete characters in the text input box, detecting whether the text input box contains a target mark; and In case the target marker is detected, it is determined that the variable is allowed to be deleted.

5. The method according to claim 1, wherein: Outputting the target template into a text input box and receiving the question to be answered filled in the target template includes: Adding a target element before and after the variable, the target element is used to select all characters in the variable, and the target element is set to be invisible in the text input box; Obtain all characters in the question to be answered through a preset command; Using the target encoding to create a regular expression for matching the zero-width character, and using the regular expression to match all characters in the question to be answered, and determining the matched characters as the zero-width characters; and Zero-width characters in the variable are eliminated to obtain the question to be answered that is filled into the target template.

6. The method according to claim 5, wherein: The method further comprises: The target element is set to be invisible in the text input box through a cascading style sheet.

7. The method according to claim 5, wherein: Extracting keywords of the question to be answered from the variable corresponding to the question to be answered, and generating an answer to the question to be answered based at least on the keywords, includes: Traversing all characters of the question to be answered that is filled in the target template; and All characters framed by the target element are determined as keywords of the question to be answered.

8. The method according to claim 1, wherein: Outputting the target template into a text input box includes: Adding the target template to the text input box; and Determine the location of the variable of the target template in the text input box, and highlight the location of the variable.

9. The method according to claim 8, wherein: The text input box is a rich media text input box.

10. The method according to claim 1, wherein: The step of obtaining the question template includes: The question template is obtained by preselection.

11. The method according to claim 1, wherein: The structure of the target format includes an html structure.

12. The method according to claim 1, wherein: The target tag includes a span tag.

13. A question-answering model template answering device, comprising: A receiving module, used for obtaining a question template, wherein the question template contains variables, and the variables are used for representing keywords of the question to be answered; A conversion module, used for setting a zero-width character in the variable in the question template, and converting the question template after setting into a structure in a target format to obtain a target template, wherein the zero-width character is used to mark the position of the variable; An output module, used for outputting the target template into a text input box and receiving the unanswered question filled in the target template; as well as A generating module is used to extract keywords of the question to be answered from the variables corresponding to the question to be answered, and generate an answer to the question to be answered based at least on the keywords.

14. A non-volatile storage medium, the non-volatile storage medium comprising a stored program, wherein: When the program is running, the device where the non-volatile storage medium is located is controlled to execute the question-and-answer model template answering method described in any one of claims 1 to 12.

15. A computer device comprising a memory and a processor, wherein the processor is used to run a program, wherein: When the program is running, it executes the question and answer model template answering method described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Task-based dialogue robot interaction method and device, equipment and storage medium

    CN113299294A

  • Research report question and answer generation method and system and computer readable storage medium

    CN114492362A

  • Enterprise intelligent question-answering system, control method, medium, equipment and terminal

    CN114722169A

  • Question and answer model template answering method and device

    CN117973349A

  • Remote document receiving server, remote document receiving method, and program

    JP2008015701A