Answer display method and device, equipment and storage medium
By constructing a mixed answer list and rendering the preset backup answers invisible in the intelligent interaction system, the problem of blank display or loading issues in the user interface when the review is rejected was solved, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MERCHANTS BANK
- Filing Date
- 2026-06-18
- Publication Date
- 2026-07-24
AI Technical Summary
In intelligent interactive systems, under the existing "post-submission, post-review" model, the user interface is prone to displaying blank answers or loading placeholders for a long time before the alternative answers are returned, resulting in a poor user experience.
By obtaining the user's input text to be replied to and preset backup answers, placeholders are created, a mixed answer list is constructed, and the preset backup answers are rendered invisible while the placeholders are rendered visible. The streaming content generated by the preset model is displayed, and the placeholder elements are hidden and the preset backup answers are displayed when the review is rejected.
This avoids blank content or long loading times for placeholders in the user interface when an application is rejected, thus improving the user experience.
Smart Images

Figure CN122451097A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent interactive technology, and in particular to an answer display method, apparatus, device, and storage medium. Background Technology
[0002] With the development of artificial intelligence technology, the sources of answers in intelligent interactive systems (such as intelligent customer service and online Q&A) are becoming increasingly diversified, typically including dynamic content generated in real time by a preset model and static content pre-set in a knowledge base. In interactive scenarios such as intelligent customer service and online Q&A, after a user inputs a question, the system generates dynamic content in real time as the answer output through a preset model. To ensure the compliance of the output content, the system usually adopts a "post-release, post-review" model, that is, the content generated by the preset model is output and displayed simultaneously, while the background performs asynchronous machine review. If the review fails, the displayed content is withdrawn or replaced. In the existing "post-release, post-review" model, rejection results are usually handled by directly deleting or overwriting the displayed content. However, this method requires temporarily requesting, generating, or retrieving an alternative answer from a remote source. Before the alternative answer is returned, the user interface may display a blank answer or a placeholder for a long time, resulting in a poor user experience. Summary of the Invention
[0003] The main purpose of this application is to provide an answer display method, apparatus, device, and storage medium, which aims to solve the technical problem that when a temporary alternative answer is needed, the user interface will display a blank answer or load a placeholder for a long time before the alternative answer is returned, resulting in a poor user experience.
[0004] To achieve the above objectives, this application proposes an answer display method, the method comprising: Obtain the user-inputted text to be replied to and the corresponding preset backup answers, create placeholders, and construct a mixed answer list based on the preset backup answers and the placeholders; The preset backup answers in the mixed answer list are rendered to generate a first page element, which is then set to invisible. The placeholders in the mixed answer list are also rendered to generate a second page element, which is then set to visible. The second page element displays the streaming content generated by the preset model based on the text to be replied to, and reviews the streaming content after it is fully generated to obtain the review result of the streaming content; If the review result is rejection, hide the second page element and display the first page element.
[0005] In one embodiment, the step of obtaining the user-inputted text to be replied to and the preset backup answer corresponding to the text to be replied to includes: The system obtains the text to be replied to by the user and performs word segmentation on the text according to a preset word segmentation rule to obtain a word sequence. The word sequence is stopped according to a preset stop word list to obtain a candidate word list; The candidate words that appear more than a preset frequency threshold in the candidate word list are used as keywords to obtain a keyword list; Each keyword in the keyword list is entered into a preset answer database for matching to obtain an initial answer corresponding to each keyword, and the initial answer that appears most frequently is used as a preset backup answer for the text to be replied to.
[0006] In one embodiment, the step of rendering the preset backup answers in the mixed answer list to generate a first page element and setting the first page element to be invisible includes: Extract the preset backup answer from the mixed answer list; Create a first document object model node and populate the first document object model node with the preset alternative answer; Insert the first document object model node into the document object model tree to generate the first page element; Set the visibility property of the Cascading Style Sheet for the first page element to invisible.
[0007] In one embodiment, the step of displaying streaming content generated by a preset model based on the text to be replied to through the second page element includes: The current streaming content returned by the preset model based on the text to be replied to is obtained. A custom tag is added after the current streaming content to obtain the current streaming content paragraph, and the current streaming content is displayed through the second page element. Determine whether the current streaming content contains an end marker; If the current streaming content does not contain the end marker, obtain the next streaming content returned by the preset model based on the text to be replied to, and divide the next streaming content into a next streaming content paragraph and a newly added content paragraph based on the custom tag; If there is no deviation between the next streaming content segment and the current streaming content segment, the newly added content segment is added to the current streaming content as the new current streaming content and displayed through the second page element. The custom tag is then moved to the new current streaming content to obtain the new current streaming content segment. Return to the step of determining whether the current streaming content contains an end marker, until the new current streaming content contains the end marker, then display the new current streaming content through the second page element.
[0008] In one embodiment, the step of reviewing the streaming content after it has been fully generated and obtaining the review result of the streaming content includes: After the streaming content is fully generated, the streaming content is matched with sensitive words in the preset sensitive word library to obtain the matching results, and the preset classification model is called to classify and identify the streaming content to obtain the classification results. If the matching result is a successful match and / or the classification result is non-compliant, the review will be rejected as the review result of the streaming content; If the matching result is a failure and the classification result is compliant, the approval will be taken as the review result of the streaming content.
[0009] In one embodiment, the step of matching the streaming content with sensitive words in a preset sensitive word library to obtain matching results includes: Punctuation marks and numbers are removed from the streaming content to obtain the streaming content text, and Chinese characters are extracted from the streaming content text to generate a Chinese character sequence; The Chinese characters in the Chinese character sequence are converted into pinyin by a preset pinyin library to obtain a full pinyin sequence, and the first letter of the pinyin in the full pinyin sequence is extracted to obtain a first letter sequence; The Chinese character sequence, the full pinyin sequence, and the initial letter sequence are respectively matched with sensitive words in the preset sensitive word database to obtain the corresponding preliminary matching results; If at least two of the preliminary matching results are successful, the successful match shall be taken as the matching result; If at most one of the preliminary matching results is a successful match, then a failed match is taken as the matching result.
[0010] In one embodiment, the step of hiding the second page element and displaying the first page element when the review result is rejection includes: If the review result is rejection, the visibility property of the Cascading Style Sheet corresponding to the second page element will be switched from visible to invisible to hide the second page element; Switch the visibility property of the Cascading Style Sheet corresponding to the first page element from invisible to visible to display the first page element.
[0011] Furthermore, to achieve the above objectives, this application also proposes an answer display device, the device comprising: The list building module is used to obtain the text to be replied to by the user and the preset backup answers corresponding to the text to be replied to, create placeholders, and build a mixed answer list based on the preset backup answers and the placeholders; The answer rendering module is used to render the preset backup answers in the mixed answer list, generate a first page element, set the first page element to be invisible, and render the placeholders in the mixed answer list to generate a second page element, and set the second page element to be visible. The content review module is used to display streaming content generated by a preset model based on the text to be replied to through the second page element, and to review the streaming content after it is fully generated, and obtain the review result of the streaming content. The result usage module is used to hide the second page element and display the first page element if the review result is rejection.
[0012] In addition, to achieve the above objectives, this application also proposes an answer display device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the answer display method as described above.
[0013] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the answer display method described above.
[0014] This application provides an answer display method, apparatus, device, and storage medium. The method includes: acquiring a user-inputted text to be replied to and a preset alternative answer corresponding to the text to be replied to; creating a placeholder; constructing a mixed answer list based on the preset alternative answer and the placeholder; rendering the preset alternative answer in the mixed answer list to generate a first page element; setting the first page element to invisible; rendering the placeholder in the mixed answer list to generate a second page element; setting the second page element to visible; displaying streaming content generated by a preset model based on the text to be replied to through the second page element; reviewing the streaming content after it is fully generated; obtaining the review result of the streaming content; and if the review result is rejection, hiding the second page element and displaying the first page element.
[0015] This application's answer display method obtains the user-inputted text to be replied to and the corresponding preset alternative answers, creates placeholders, further constructs a mixed answer list, renders the preset alternative answers in the mixed answer list to generate a first page element and sets it to invisible, renders the placeholders in the mixed answer list to generate a second page element and sets it to visible, displays the streaming content generated by the preset model based on the text to be replied to through the second page element, and performs review to obtain the review result after the streaming content is fully generated. If the review result is rejection, the second page element is hidden and the first page element is displayed. Compared to existing methods that require temporarily obtaining alternative answers, the user interface may display blank answers or long loading times for placeholders before the alternative answers are returned, resulting in a poor user experience. Because this application can render the preset alternative answers in the mixed answer list, generate a first page element and set it to invisible, and hide the second page element and display the first page element when the review result is rejection, the preset alternative answers can be displayed directly in the case of rejection, and the user interface will not display blank answers or long loading times for placeholders, thus improving the user experience. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application; Figure 2 This is a flowchart illustrating the first embodiment of the answer display method of this application; Figure 3 This is a diagram illustrating the rendering state of page elements in this application. Figure 4 This is a flowchart illustrating the second embodiment of the answer display method of this application; Figure 5 This is a flowchart illustrating the third embodiment of the answer display method of this application; Figure 6 This is a structural block diagram of the answer display device of this application.
[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0021] Reference Figure 1 , Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.
[0022] like Figure 1 As shown, the device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may be connected to a display screen; optionally, the user interface 1003 may include a standard wired interface or a wireless interface. In this application, the wired interface of the user interface 1003 may be a USB interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or non-volatile memory (NVM), such as a disk storage device. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0023] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0024] like Figure 1 As shown, the memory 1005, which is identified as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an answer display program.
[0025] exist Figure 1 In the device shown, the network interface 1004 is mainly used to connect to the backend server and communicate with the backend server; the user interface 1003 is mainly used to connect to the user device; the device calls the answer display program stored in the memory 1005 through the processor 1001 and executes the steps of the answer display method provided in the embodiments of this application.
[0026] It's important to note that with the development of artificial intelligence technology, the sources of answers in intelligent interactive systems (such as intelligent customer service and online Q&A) are becoming increasingly diversified. These typically include dynamic content generated in real-time by a preset model and static content pre-set in a knowledge base. In interactive scenarios like intelligent customer service and online Q&A, after a user inputs a question, the system generates dynamic content in real-time as the answer output using a preset model. To ensure the compliance of the output content, the system usually adopts a "post-release, post-review" model. This means that the content generated by the preset model is displayed as it is output, while the background performs asynchronous machine review. If the review fails, the displayed content is withdrawn or replaced. Currently, in the "post-release, post-review" model, rejection results are usually handled by directly deleting or overwriting the displayed content. However, this method requires temporarily requesting, generating, or retrieving an alternative answer from a remote source. Before the alternative answer is returned, the user interface may display a blank answer or experience a long loading time for placeholders, resulting in a poor user experience.
[0027] Therefore, to address the aforementioned deficiencies, this embodiment provides an answer display method, apparatus, device, and storage medium. The method includes: acquiring user-inputted text to be replied to and a preset alternative answer corresponding to the text to be replied to; creating a placeholder; constructing a mixed answer list based on the preset alternative answer and the placeholder; rendering the preset alternative answer in the mixed answer list to generate a first page element; setting the first page element to invisible; rendering the placeholder in the mixed answer list to generate a second page element; setting the second page element to visible; displaying streaming content generated by a preset model based on the text to be replied to through the second page element; reviewing the streaming content after it has been fully generated; obtaining the review result of the streaming content; and, if the review result is rejection, hiding the second page element and displaying the first page element.
[0028] This embodiment's answer display method obtains the user-inputted text to be replied to and the corresponding preset alternative answers, creates placeholders, further constructs a mixed answer list, renders the preset alternative answers in the mixed answer list to generate a first page element and sets it to invisible, renders the placeholders in the mixed answer list to generate a second page element and sets it to visible, displays the streaming content generated by the preset model based on the text to be replied to through the second page element, and performs a review to obtain the review result after the streaming content is fully generated. If the review result is rejection, the second page element is hidden and the first page element is displayed. Compared to existing methods that require temporarily obtaining alternative answers, the user interface may display blank answers or long loading times for placeholders before the alternative answers are returned, resulting in a poor user experience. Since this application can render the preset alternative answers in the mixed answer list, generate a first page element and set it to invisible, and hide the second page element and display the first page element when the review result is rejection, the preset alternative answers can be displayed directly in the case of rejection, and the user interface will not display blank answers or long loading times for placeholders, thus improving the user experience.
[0029] For ease of understanding, the following is combined with Figures 2 to 6 The answer display method provided in the embodiments of this application will be described in detail.
[0030] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the answer display method of this application. The first embodiment of the answer display method of this application is presented as follows: Figure 2 As shown, in this embodiment, the method includes: Step S10: Obtain the text to be replied to by the user and the preset backup answer corresponding to the text to be replied to, create a placeholder, and construct a mixed answer list based on the preset backup answer and the placeholder.
[0031] It is understood that the method of this embodiment can be applied to the above-mentioned answer display device, which can be any device with data processing, program running and data acquisition functions, such as a computer, server, etc., and is not limited in this embodiment.
[0032] It should be noted that the text to be replied to can be any natural language question or instruction entered by the user through an input device (such as a keyboard, touchscreen, or microphone), such as "What should I do if my bank card is lost?" entered by the user on the intelligent customer service dialogue interface; the preset backup answer can be the answer text associated with the text to be replied to, which is stored in a local database or remote knowledge base in advance, such as the text "Please call the bank's customer service hotline to report the loss immediately" pre-entered for the "bank card loss reporting" scenario; the placeholder can be a markup or empty container used to reserve display space in the page layout, such as a piece of HyperText Markup Language (HTML) text. Tags; The above mixed answer list can be an ordered array or data structure containing multiple types of answer elements, used to uniformly manage the rendering order of preset backup answers, placeholders, and other types of answers.
[0033] In its implementation, the answer display device obtains the text to be replied to submitted by the user through the input interface, and simultaneously retrieves the corresponding preset backup answers from the local cache or a remote server. It then creates a placeholder, which does not contain any actual content but only indicates the position for subsequent rendering. Next, based on the obtained preset backup answers and the created placeholder, the answer display device constructs a mixed answer list according to a preset rendering order (e.g., placing the preset backup answers first, then the placeholders).
[0034] Step S20: Render the preset backup answers in the mixed answer list to generate a first page element, set the first page element to be invisible, and render the placeholders in the mixed answer list to generate a second page element, and set the second page element to be visible.
[0035] It should be noted that the first page element mentioned above can be a UI component or document object used to display preset alternative answers, such as a container containing the preset alternative answer text; the second page element mentioned above can be a UI component or document object used to display subsequent streaming content in the placeholder area, such as a blank container used to dynamically append content.
[0036] In the specific implementation, refer to Figure 3 , Figure 3 This is a diagram illustrating the rendering state of page elements in this application, such as... Figure 3As shown, within the page display area, the answer display device performs a rendering operation on the entries corresponding to the preset backup answers in the mixed answer list, generating a first page element. This first page element is then set to invisible; that is, the "preset backup answer content" is displayed inside the "first page element (invisible)" in the figure. Simultaneously, the answer display device performs a rendering operation on the placeholder entries in the mixed answer list, generating a second page element. This second page element is then set to visible; that is, the "second page element (visible)" in the figure contains a "placeholder area" and displays the message "(Waiting for streaming content input)". At this point, the user can only see the placeholder area in the visible second page element, while the backup answer content in the invisible first page element is hidden, preparing for the real-time display of subsequent streaming content.
[0037] Step S30: Display the streaming content generated by the preset model based on the text to be replied to through the second page element, and review the streaming content after it is fully generated to obtain the review result of the streaming content.
[0038] It should be noted that the aforementioned preset model can be a pre-trained artificial intelligence model used to generate response content in real time based on input text, such as a Large Language Model (LLM); the aforementioned streaming content can be the generated results returned by the aforementioned preset model in multiple and step-by-step manner, such as returning incremental text of 3 to 5 characters each time; the aforementioned review can be the process of checking the compliance of the generated streaming content; the aforementioned review result can be the conclusion generated by the aforementioned review process, such as review passed or review rejected.
[0039] In its implementation, the answer display device uses a second page element, already rendered and visible, to display in real-time the streaming content generated by the preset model based on the text to be replied to. During the display process, whenever the preset model returns a portion of the streaming content, the device appends that portion to the second page element. When the preset model returns an end marker, indicating that the streaming content has been fully generated, the answer display device performs an audit on the complete streaming content. After the audit is completed, the device obtains the result of the audit.
[0040] Step S40: If the review result is rejection, hide the second page element and display the first page element.
[0041] It should be noted that the above rejection may refer to the status of failure to pass the review, that is, the streaming content generated by the preset model fails the compliance check.
[0042] In the specific implementation, if the review result is rejection, the answer display device hides the second page element, making the area on the user interface that originally displayed the streaming content invisible. Then, the answer display device displays the first page element, making the previously rendered but invisible preset backup answer visible. Through this method, when streaming content is rejected due to non-compliance, the user interface can smoothly switch from the rejected content to the pre-prepared backup answer, avoiding blank content or prolonged loading of placeholders.
[0043] This embodiment constructs a mixed answer list by pre-obtaining preset backup answers corresponding to the text to be replied to and creating placeholders. The backup answers are rendered as invisible first page elements, and the placeholders are rendered as visible second page elements. The streaming content is displayed using the second page elements, and the second page elements are hidden and the first page elements are displayed when the review is rejected. This allows for the immediate switching and display of backup answers without the need to temporarily obtain alternative answers when the streaming content is rejected, avoiding blank interfaces or long loading times, and improving the user experience.
[0044] Reference Figure 4 , Figure 4 This is a flowchart illustrating the second embodiment of the answer display method of this application. Based on the first embodiment described above, a second embodiment of the answer display method of this application is proposed.
[0045] To accurately extract core keywords from the complex natural language input by the user when obtaining the preset backup answers corresponding to the text to be replied to, avoiding interference from irrelevant words and stop words, and improving the matching accuracy between the backup answers and the user's intent, this embodiment includes the following steps: Step S11: Obtain the text to be replied to input by the user, and perform word segmentation on the text to be replied to according to the preset word segmentation rules to obtain a word sequence.
[0046] It should be noted that the above-mentioned preset word segmentation rules can be a set of rules for segmenting continuous text according to preset semantic units, such as the maximum positive matching rule based on the dictionary or the word segmentation rule based on statistics; the above-mentioned word sequence can be a list formed by arranging multiple words obtained after segmenting the text to be replied to in their original order, such as: "I", "bank card", "lost", "what to do".
[0047] In its implementation, the above-mentioned answer display device acquires the text to be replied to submitted by the user through the input interface. Subsequently, it performs word segmentation processing on the text to be replied to according to preset word segmentation rules, dividing the continuous text into independent word units, thereby obtaining a word sequence.
[0048] Step S12: Remove stop words from the word sequence according to a preset stop word list to obtain a candidate word list.
[0049] It should be noted that the above preset stop word list can be a pre-configured set containing common words without actual meaning, such as a list containing words like "of", "already", "right", "呢", "how", "what"; the above stop word removal can be an operation of deleting words belonging to the stop word list from the word sequence; the above candidate word list can be a list composed of the remaining valid words in the original order after stop word removal.
[0050] In a specific implementation, the above answer display device performs a stop word removal operation on the word sequence obtained in the previous step according to the preset stop word list, that is, traverses each word in the word sequence, and if the word exists in the preset stop word list, it is deleted, otherwise it is retained. After the traversal is completed, the device obtains a candidate word list, and only candidate words with actual meaning are included in this list.
[0051] Step S13: Use the candidate words in the candidate word list whose occurrence times are greater than a preset number threshold as keywords to obtain a keyword list.
[0052] It can be understood that the above candidate word list can contain multiple candidate words, and the same candidate word may appear multiple times; the above preset number threshold can be a preset value used to judge whether a candidate word is representative, such as setting the threshold to 1 or 2; the above keywords can be words screened from the candidate word list whose occurrence frequencies meet the preset conditions; the above keyword list can be a list formed by the screened keywords in the original order or after removing duplicates.
[0053] In a specific implementation, the above answer display device counts the candidate word list obtained in the previous step and calculates the occurrence times of each candidate word in the list. Subsequently, the occurrence times of each candidate word are compared with the preset number threshold, and the candidate words whose occurrence times are greater than the preset number threshold are used as keywords. Finally, all the screened keywords are summarized to generate a keyword list.
[0054] Step S14: Input each keyword in the keyword list into a preset answer library for matching to obtain an initial answer corresponding to each keyword, and use the initial answer with the most occurrences as the preliminary standby answer corresponding to the text to be replied.
[0055] It should be noted that the keyword list mentioned above can be a collection of one or more keywords arranged in a preset order, such as "modify" or "credit card"; the preset answer database mentioned above can be a pre-built database or knowledge base that stores the mapping relationship between keywords and answers, such as a database containing "credit card" corresponding to "credit card loss reporting and password modification process"; the initial answer mentioned above can be the answer text corresponding to the keyword obtained after inputting a single keyword into the preset answer database, such as "for credit card related services, please call the customer service hotline" obtained by inputting "credit card" into the preset answer database.
[0056] In its implementation, the device retrieves the keyword list obtained in the previous step and iterates through each keyword in the list. Each keyword is then input into a preset answer database for matching, and the initial answer corresponding to the keyword is retrieved from the database. After the iteration is complete, the frequency of all retrieved initial answers is counted, and the initial answer with the highest frequency is identified. Subsequently, the device determines this initial answer with the highest frequency as the preset backup answer for the text to be replied to.
[0057] To facilitate understanding, the following examples are provided for illustration, but they do not impose specific limitations on this embodiment. For instance, the keyword list is ["credit card", "password", "credit card", "report lost"]. In the preset answer database, the initial answer corresponding to "credit card" is "For credit card services, please call the customer service hotline", the initial answer corresponding to "password" is "For password reset, please go to a branch", and the initial answer corresponding to "report lost" is "For lost account services, please freeze the account immediately". If the matching shows that "For credit card services, please call the customer service hotline" appears twice, "For password reset, please go to a branch" appears once, and "For lost account services, please freeze the account immediately" appears once, then the initial answer with the most occurrences is "For credit card services, please call the customer service hotline", which is used as the preset backup answer.
[0058] This embodiment achieves automatic extraction of core keywords from the user's natural language input and matching of the most relevant backup answers by performing word segmentation, stop word removal, keyword extraction, and keyword input into a preset answer database for matching, and by using the initial answer that appears most frequently as the preset backup answer. This improves the matching degree between the backup answers and the user's intent.
[0059] Furthermore, in order to pre-render the backup answers when the page loads but not display them, the step of rendering the preset backup answers in the mixed answer list, generating a first page element, and setting the first page element to be invisible includes: Step S201: Extract the preset backup answer from the mixed answer list.
[0060] Step S202: Create a first document object model node and fill the first document object model node with the preset backup answer.
[0061] It should be noted that the aforementioned document object model node can be a basic unit in the document object model (DOM) tree, used to represent an element or text fragment on the page, such as a div element node; the aforementioned first document object model node can be a document object model node specifically used to carry preset alternative answers; the aforementioned padding can be the process of assigning the text content of the preset alternative answers into the interior of this node.
[0062] In its implementation, the aforementioned answer display device acquires the pre-constructed list of mixed answers, locates and extracts the entry corresponding to the preset backup answer from this list. Subsequently, a first document object model node is created, and the extracted text content of the preset backup answer is populated into the first document object model node, so that the first document object model node carries the content information of the backup answer.
[0063] Step S203: Insert the first document object model node into the document object model tree to generate the first page element.
[0064] It should be noted that the above document object model tree can be a hierarchical tree data structure in the Document Object Model (DOM) that represents the page structure, where each node represents an element or text fragment on the page.
[0065] In its implementation, the aforementioned answer display device inserts a first Document Object Model (DOM) node, already populated with preset backup answers, into the corresponding position in the DOM tree. After insertion, this node becomes part of the DOM tree, and the browser generates the corresponding first page element based on the node's position and attributes in the tree. This first page element is the interface component that the user actually sees (or hides) on the page.
[0066] Step S204: Set the visibility property of the Cascading Style Sheet of the first page element to invisible.
[0067] It should be noted that the aforementioned Cascading Style Sheets (CSS) can be style description languages used to control the appearance and layout of Hyper Text Markup Language (HTML) page elements, such as CSS. In CSS, the visibility, size, color, and other styles of elements are controlled through property settings (such as visibility and display). The aforementioned visibility property can be a property in CSS used to control whether an element is visible, such as the visibility property, whose value can be set to visible or hidden.
[0068] In its implementation, the above answer shows that the device obtains the generated first page element and manipulates the Cascading Style Sheet (CSS) corresponding to the first page element. The visibility property in the CSS is set to invisible, thus hiding the first page element on the page, preventing the user from seeing its content, but the element still occupies a position in the Document Object Model (DOM) tree.
[0069] This embodiment extracts a preset backup answer from the mixed answer list, creates a first document object model node and populates the backup answer, inserts the node into the document object model tree to generate a first page element, and then sets the Cascading Style Sheet visibility property of the page element to invisible, thus achieving the complete rendering of the backup answer in advance but hiding it when the page loads.
[0070] Furthermore, in order to create an independent display container for the streaming content on the page and ensure its initial visibility so that the streaming content generated by the subsequent model can be correctly appended and displayed, the step of rendering the placeholders in the mixed answer list to generate a second page element and setting the second page element to be visible includes: Step S211: Extract the placeholders from the mixed answer list.
[0071] Step S212: Create a second document object model node and fill the second document object model node with the placeholder.
[0072] It should be noted that the second Document Object Model node mentioned above can be a newly created Document Object Model (DOM) node, specifically used to hold the page element corresponding to the placeholder, such as an empty div container node; the above filling can be the process of assigning the content of the placeholder (which may be empty or initial prompt information) into the interior of the node.
[0073] In its implementation, the device retrieves the pre-constructed list of mixed answers, locates and extracts the entries corresponding to the placeholders from this list. Subsequently, the device creates a new second document object model node and populates the extracted placeholders into this second document object model node.
[0074] Step S213: Insert the second document object model node into the document object model tree to generate the second page element.
[0075] Step S214: Set the visibility property of the Cascading Style Sheet of the second page element to visible.
[0076] In its implementation, the answer display device inserts the second Document Object Model (DOM) node, already filled with placeholders, into the corresponding position in the DOM tree. After insertion, the node becomes part of the DOM tree, and a corresponding second page element is generated based on this node. Subsequently, the answer display device retrieves the second page element and sets its visibility property in the Cascading Style Sheet (CSS) to visible, allowing the second page element to be displayed normally on the page, and the user can see the placeholder area (usually a blank container or a loading indicator area).
[0077] This embodiment extracts placeholders from the mixed answer list, creates a second document object model node and populates the placeholder, inserts the node into the document object model tree to generate a second page element, and then sets the Cascading Style Sheet visibility property of the page element to visible. This achieves the pre-creation of an independent display container for streaming content on the page and ensures its initial visibility, thus ensuring that the streaming content generated by the subsequent model can be correctly appended and displayed.
[0078] Furthermore, in order to achieve paragraph-based incremental updates during the streaming content display process and reduce the redrawing range of the document object model, in this embodiment, the step of displaying the streaming content generated by the preset model based on the text to be replied to through the second page element includes: Step S31: Obtain the current streaming content returned by the preset model based on the text to be replied to, add a custom tag after the current streaming content to obtain the current streaming content paragraph, and display the current streaming content through the second page element.
[0079] It should be noted that the aforementioned custom tag can be a special marker embedded in the flowing content, used to identify paragraph boundaries or content delimiters, for example...<xz_card_in_prompt> Such custom HyperText Markup Language (HTML) tags; the aforementioned current streaming content paragraph can be a content unit formed by adding custom tags to the end of the current streaming content, used to identify the currently received complete paragraph.
[0080] Understandably, the answer above indicates that the device adds custom tags after streaming content to accurately identify which parts of the returned content belong to previously displayed paragraphs and which belong to new content each time new streaming content is received. Since the default model returns the full content each time (i.e., including all previously returned characters plus some new characters), without custom tags as boundary markers, the device cannot accurately determine the start position of new content, potentially leading to duplicate rendering or content errors. By fixing the custom tag at the end of the currently displayed content, the device, upon receiving the next stream of content, can locate the tag's position and identify the content before the tag as existing paragraphs and the content after the tag as new content paragraphs.
[0081] In its implementation, the device retrieves the current streaming content returned by the preset model based on the text to be replied to. Then, the device adds a custom tag to the end of this current streaming content, thus obtaining a paragraph of the current streaming content with a paragraph identifier. Next, the device displays this current streaming content (excluding the custom tag) through a visible second page element, allowing the user to see the generated content in real time.
[0082] Step S32: Determine whether the current streaming content contains an end marker.
[0083] Step S33: If the current streaming content does not contain the end marker, obtain the next streaming content returned by the preset model based on the text to be replied to, and divide the next streaming content into next streaming content paragraphs and newly added content paragraphs based on the custom tags.
[0084] It should be noted that the aforementioned end marker can be a preset special tag used to indicate that the preset model has generated all streaming content, such as a specific string " <end>" or a Boolean flag; the next stream content can be the full stream content returned by the preset model after returning the current stream content (including the previously returned content plus some newly added characters); the next stream content paragraph can be a unit formed by adding a custom tag to the end of the next stream content to identify the complete paragraph of the returned content; the newly added content paragraph can be the newly added text content remaining after removing the part that is the same as the current stream content paragraph from the next stream content.
[0085] In its implementation, the above answer shows that the device determines whether the current streaming content contains an end marker. If the current streaming content does not contain an end marker, it means that the preset model has not yet completed the generation of all content. In this case, the device obtains the next streaming content returned by the preset model based on the text to be replied to. Then, the device divides the next streaming content according to a custom tag: since the next streaming content is usually based on the current streaming content with several new characters appended, and the custom tag is located at the end of the previous content, the device can split the next streaming content into the part that is the same as the current streaming content segment (i.e., the next streaming content segment) and the newly added part (i.e., the newly added content segment).
[0086] Step S34: If there is no deviation between the next streaming content segment and the current streaming content segment, add the new content segment to the current streaming content as the new current streaming content and display it through the second page element, and move the custom tag to the new current streaming content to obtain the new current streaming content segment.
[0087] It should be noted that the above-mentioned "no deviation" can mean that the next streaming content paragraph is completely identical to the current streaming content paragraph in terms of character sequence, that is, there is no content change or misalignment; the above-mentioned new current streaming content can be the complete text formed by appending the new content paragraph to the end of the original current streaming content; the above-mentioned new current streaming content paragraph can be the paragraph unit formed by adding a custom tag to the end of the new current streaming content again, which is used to identify the next round of incremental updates.
[0088] In the specific implementation, when the answer display device determines that the next stream content segment is completely identical to the current stream content segment, it means that the part of the next stream content returned by the preset model before the custom tag is exactly the same as the already displayed content, and no rollback or modification has occurred. At this time, the answer display device extracts the new content segment and adds it to the end of the current stream content to form a new current stream content. Then, the new current stream content is displayed through a second page element, and the user can see the new content appear in real time. Subsequently, the custom tag is moved after the new current stream content, thus obtaining a new current stream content segment for comparison in the next round of stream updates.
[0089] Step S35: Return to the step of determining whether the current streaming content contains an end marker, until the new current streaming content contains the end marker, then display the new current streaming content through the second page element.
[0090] In its implementation, the answer display device, after displaying new content and moving custom tags, returns to the step of determining whether the current streaming content contains an end marker, forming a loop processing flow. In each loop, the answer display device checks if the currently held new streaming content contains an end marker. If it doesn't, it repeats the operations of obtaining the next streaming content, segmenting, comparing, appending, and moving tags. When, in a loop, the new streaming content contains an end marker, the answer display device stops looping and displays the new streaming content containing the end marker (i.e., the complete final streaming answer) through a second page element. It's important to note that the end marker itself is a marker character and can be filtered out or made invisible during display; the user only sees plain text content.
[0091] This embodiment obtains the current streaming content returned by the preset model and adds custom tags to form paragraph markers. When no end marker is detected, it continuously obtains the next streaming content. The next streaming content is divided into existing paragraphs and newly added content paragraphs using custom tags. When there is no deviation in the existing paragraphs, only the newly added content is appended and the custom tags are moved to the right. This process is repeated until the end marker appears, realizing paragraph-based incremental updates in the streaming content display process and reducing the redrawing range of the document object model.
[0092] Reference Figure 5 , Figure 5 This is a flowchart illustrating the third embodiment of the answer display method of this application. Based on the above embodiments, a third embodiment of the answer display method of this application is proposed.
[0093] In order to conduct a comprehensive compliance review of the streaming content after its generation is completed, in this embodiment, the step of reviewing the streaming content after it is fully generated and obtaining the review result of the streaming content includes: Step S301: After the streaming content is fully generated, the streaming content is matched with sensitive words in the preset sensitive word library to obtain the matching results, and the preset classification model is called to classify and identify the streaming content to obtain the classification results.
[0094] It should be noted that the aforementioned preset sensitive word library can be a pre-built collection containing sensitive or illegal words, such as a database containing words like "cash out," "money laundering," "usury," and "insider trading." The aforementioned sensitive word matching can be an operation that compares the text of streaming content with the entries in the preset sensitive word library. The aforementioned matching result can be a conclusion indicating whether there is a successfully matched sensitive word, such as a successful match or a failed match. The aforementioned preset classification model can be a pre-trained artificial intelligence model for semantic classification of text, such as a deep learning-based text classifier that can determine whether the text contains prohibited semantic information (such as illegal fundraising, false advertising, etc.). The aforementioned classification result can be a category label indicating whether the text is compliant, such as compliant or non-compliant.
[0095] In its implementation, after the streaming content is fully generated, the answer display device performs a sensitive word match between the streaming content and sensitive words in a preset sensitive word library, obtaining a matching result. Simultaneously, the device calls a preset classification model to classify and identify the streaming content, obtaining a classification result. These two review processes can be executed in parallel or sequentially, without dependency on each other.
[0096] To facilitate understanding, the following example illustrates the concept, but does not impose specific limitations on this embodiment. For instance, a user inquires about "methods for cashing out credit cards." The complete streaming content generated by the preset model is "You can cash out credit cards through fraudulent transactions." The answer display device matches this content against a preset sensitive word library (containing financially sensitive words such as "cash out" and "fraudulent transactions"), and finds a successful match. Simultaneously, the device calls a preset classification model to classify and identify the above text, and the model outputs "non-compliant" (involving illegal financial operations). Thus, the matching result is successful, and the classification result is non-compliant.
[0097] Step S302: If the matching result is a successful match and / or the classification result is non-compliant, the review rejection shall be taken as the review result of the streaming content.
[0098] Step S303: If the matching result is a failure and the classification result is compliant, the approval is taken as the review result of the streaming content.
[0099] It should be noted that the above-mentioned rejection may refer to the streaming content failing the compliance check and needing to be withdrawn or replaced; the above-mentioned approval may refer to the streaming content meeting compliance requirements and being able to be displayed or retained normally; the above-mentioned matching failure may refer to the state that no sensitive words were found during the sensitive word matching process.
[0100] In practice, the above answer displays the matching results obtained by the device from sensitive word matching and the classification results obtained by the classification model. The specific circumstances of these matching and classification results are then assessed. If the matching result is successful, or the classification result is non-compliant, or both are true, the review will be rejected as the review result for the streaming content. If the matching result is unsuccessful and the classification result is compliant, the review will be approved as the review result for the streaming content.
[0101] This embodiment implements a dual review mechanism for streaming content by simultaneously performing sensitive word matching and classification model identification after the streaming content is fully generated, and rejecting it based on a comprehensive judgment logic that accepts it only if the matching is successful or the classification does not meet the rules, and only if the matching fails but the classification is compliant. This improves the comprehensiveness of the review.
[0102] Furthermore, to improve the accuracy of sensitive word matching and prevent users or models from bypassing sensitive word detection through homophones, initials of pinyin, insertion of punctuation marks, or numbers, thus ensuring the compliance of streaming content, in this embodiment, the step of matching the streaming content with sensitive words in a preset sensitive word library to obtain matching results includes: Step S3011: Remove punctuation marks and numbers from the streaming content to obtain the streaming content text, and extract Chinese characters from the streaming content text to generate a Chinese character sequence.
[0103] Step S3012: Convert the Chinese characters in the Chinese character sequence into pinyin using a preset pinyin library to obtain a full pinyin sequence, and extract the first letter of the pinyin in the full pinyin sequence to obtain a first letter sequence.
[0104] It should be noted that the above punctuation marks can refer to punctuation characters such as full stops, commas, question marks, exclamation marks, semicolons, etc.; the above numbers can refer to Arabic numerals from 0 to 9; the above streaming content text can be the pure text obtained by removing punctuation marks and numbers from the original streaming content; the above Chinese characters can refer to characters belonging to the Chinese character set; the above Chinese character sequence can be a list formed by arranging the extracted Chinese characters in the original order; the above preset pinyin library can be a pre-constructed database storing the corresponding relationship between Chinese characters and pinyin, such as a mapping table containing the mapping of "银" to "yin" and "行" to "hang"; the above pinyin can refer to the pronunciation representation corresponding to the Chinese character; the above full pinyin sequence can be a pinyin list formed by converting each Chinese character in the Chinese character sequence into the complete pinyin; the above initial letter sequence can be a sequence formed by extracting the first letter from the complete pinyin of each Chinese character, for example, "银行" is converted to "yin" and "hang" and the initial letters are extracted to get "y", "h".
[0105] In specific implementation, the above answer display device first preprocesses the received complete streaming content: removes all punctuation marks and numbers in the complete streaming content to obtain the streaming content text. Then, only Chinese characters are retained from the streaming content text, any non-Chinese characters (such as English letters, spaces, etc.) are removed, and a Chinese character sequence is generated in the original order. Subsequently, the preset pinyin library is called to convert each Chinese character in the Chinese character sequence into the corresponding complete pinyin one by one, so as to obtain a full pinyin sequence. On this basis, the first letter of each pinyin is further extracted to generate an initial letter sequence in the original order.
[0106] Step S3013: Respectively perform sensitive word matching on the Chinese character sequence, the full pinyin sequence, and the initial letter sequence with sensitive words in the preset sensitive word library to obtain the corresponding preliminary matching results.
[0107] It should be noted that the above preliminary matching results can be the matching conclusions obtained by respectively matching the Chinese character sequence, the full pinyin sequence, or the initial letter sequence with the preset sensitive word library. For example, the matching result for the Chinese character sequence is "match successful" or "match failed", and the same applies to the matching result for the full pinyin sequence. The three sequences respectively correspond to three preliminary matching results.
[0108] In a specific implementation, the above answer display device respectively performs sensitive word matching on the Chinese character sequence, full pinyin sequence, and initial letter sequence obtained in the previous step with the sensitive words in a preset sensitive word library. Specifically, the device uses the Chinese character sequence as a group of strings to be matched and compares it with each sensitive word in the sensitive word library to obtain a preliminary matching result. Similarly, the full pinyin sequence is matched with the sensitive words in the sensitive word library (the pinyin form and initial letter form of the sensitive words can be pre-stored in the sensitive word library) to obtain a second preliminary matching result. Then, the initial letter sequence is matched with the sensitive words in the sensitive word library to obtain a third preliminary matching result. Each preliminary matching result is independently recorded for subsequent comprehensive judgment.
[0109] For ease of understanding, the following is explained by way of example, but no specific limitation is imposed on this embodiment. For example: The streaming content is "cash out", and after preprocessing, the Chinese character sequence is ["cash", "out"], the full pinyin sequence is "taoxian", and the initial letter sequence is ["t", "x"]. The preset sensitive word library contains the sensitive words "cash out" (Chinese characters), "taoxian" (pinyin), and "tx" (initial letters). The answer display device performs matching: The Chinese character sequence matches "cash out" successfully, and the preliminary matching result is successful; the full pinyin sequence matches "taoxian" successfully, and the preliminary matching result is successful; the initial letter sequence matches "tx" successfully, and the preliminary matching result is successful. All three preliminary matching results are successful. Another example is that the streaming content is "normal repayment". The Chinese character sequence does not match any sensitive words, but the full pinyin sequence "zheng chang huan kuan" may contain "huankuan" which matches the sensitive word "repayment", so the preliminary matching result of the full pinyin sequence is successful. The device records the matching results of each sequence separately.
[0110] Step S3014: When there are at least two of the preliminary matching results being successful, take the successful matching as the matching result.
[0111] Step S3015: When there is at most one of the preliminary matching results being successful, take the failed matching as the matching result.
[0112] In a specific implementation, the above answer display device obtains the three preliminary matching results obtained in the previous step (corresponding to the matching situations of the Chinese character sequence, full pinyin sequence, and initial letter sequence respectively). Count the number of these three preliminary matching results that are "successful". If the counted number of successful matches is greater than or equal to two (that is, at least two preliminary matching results are successful), then the device determines the final matching result as "successful". On the contrary, if the number of successful matches is less than or equal to one (that is, zero or one preliminary matching result is successful), then the device determines the final matching result as "failed".
[0113] For ease of understanding, the following is explained by way of examples, but no specific limitations are imposed on this embodiment. For example: the streaming content is "cash out", and all three preliminary matching results are successful (the quantity is 3, greater than or equal to 2), so the final matching result is successful. Another example: the streaming content is "tx behavior", where "tx" is successfully matched through the first letter sequence, but the Chinese character sequence and the full pinyin sequence are not successfully matched (the number of successful matches is 1), and the final matching result is failed. This can avoid determining a violation just by hitting the first letter and reduce misjudgments.
[0114] In this embodiment, by removing punctuation marks and numbers from the streaming content and extracting Chinese characters to generate a Chinese character sequence, then converting the Chinese character sequence into a full pinyin sequence and a first letter sequence, respectively matching the three sequences with a preset sensitive word library, and determining a successful match when at least two preliminary matching results are successful and a failed match when at most one is successful, the accuracy of sensitive word matching is improved, avoiding users or models from bypassing sensitive word detection through homophony, pinyin initials, inserting punctuation marks or numbers, etc., and ensuring the compliance of the streaming content.
[0115] In order to be able to instantaneously and smoothly switch from the streaming content to the pre-set alternative answer when the streaming content is rejected, in this embodiment, the step of hiding the second page element and displaying the first page element in the case where the review result is rejection includes: Step S41: In the case where the review result is rejection, switch the visibility attribute of the cascading style sheet corresponding to the second page element from visible to invisible to hide the second page element; Step S42: Switch the visibility attribute of the cascading style sheet corresponding to the first page element from invisible to visible to display the first page element.
[0116] In a specific implementation, after the above answer display device obtains a review result of rejection, it first locates the second page element that currently displays the streaming content. Switch the visibility attribute in the cascading style sheet corresponding to the second page element from the current visible state (visible) to the invisible state (hidden), thereby hiding the second page element, and the user can no longer see the previously displayed streaming content. Subsequently, the above answer display device locates the first page element that was pre-rendered but hidden, and switches the visibility attribute in the cascading style sheet corresponding to the first page element from the current invisible state (hidden) to the visible state (visible), thereby displaying the first page element, and the user immediately sees the content of the pre-set alternative answer.
[0117] This embodiment achieves an immediate and smooth switch from streaming content to preset backup answer when the review result is rejected. By switching the visibility attribute of the Cascading Style Sheet of the second page element from visible to invisible to hide the streaming content, and at the same time switching the visibility attribute of the first page element from invisible to visible to display the preset backup answer, the implementation can achieve an immediate and smooth switch from streaming content to preset backup answer when the streaming content is rejected.
[0118] In addition, refer to Figure 6 , Figure 6 This is a structural block diagram of the answer display device of this application. Figure 6 As shown in the figure, this application also proposes an answer display device, which includes: The list construction module 601 is used to obtain the text to be replied to by the user and the preset backup answer corresponding to the text to be replied to, create placeholders, and construct a mixed answer list based on the preset backup answer and the placeholders; The answer rendering module 602 is used to render the preset backup answers in the mixed answer list, generate a first page element, set the first page element to be invisible, and render the placeholders in the mixed answer list to generate a second page element, and set the second page element to be visible. The content review module 603 is used to display streaming content generated by a preset model based on the text to be replied to through the second page element, and to review the streaming content after it is fully generated, and obtain the review result of the streaming content. Module 604 is used to hide the second page element and display the first page element if the review result is rejection.
[0119] Furthermore, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the answer display method described above.
[0120] The device in this embodiment obtains the user-input text to be replied to and the corresponding preset alternative answers, creates placeholders, further constructs a mixed answer list, renders the preset alternative answers in the mixed answer list to generate a first page element and sets it to invisible, renders the placeholders in the mixed answer list to generate a second page element and sets it to visible, displays the streaming content generated by the preset model based on the text to be replied to through the second page element, and performs review to obtain the review result after the streaming content is fully generated. If the review result is rejection, the second page element is hidden and the first page element is displayed. Compared with the existing method that requires temporarily obtaining alternative answers, the user interface may display blank answers or long loading times for placeholders before the alternative answers are returned, resulting in a poor user experience. Since this application can render the preset alternative answers in the mixed answer list to generate a first page element and set it to invisible, and hide the second page element and display the first page element when the review result is rejection, the preset alternative answers can be displayed directly in the case of rejection, and the user interface will not display blank answers or long loading times for placeholders, thus improving the user experience.
[0121] Other embodiments or specific implementations of the answer display device described in this example can be found in the above-described method embodiments, and will not be repeated here.
[0122] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0123] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0124] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0125] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.< / end>
Claims
1. A method for displaying answers, characterized in that, The method includes: Obtain the user-inputted text to be replied to and the corresponding preset backup answers, create placeholders, and construct a mixed answer list based on the preset backup answers and the placeholders; The preset backup answers in the mixed answer list are rendered to generate a first page element, which is then set to invisible. The placeholders in the mixed answer list are also rendered to generate a second page element, which is then set to visible. The second page element displays the streaming content generated by the preset model based on the text to be replied to, and reviews the streaming content after it is fully generated to obtain the review result of the streaming content; If the review result is rejection, hide the second page element and display the first page element.
2. The method as described in claim 1, characterized in that, The step of obtaining the user-inputted text to be replied to and the corresponding preset backup answer includes: The system obtains the text to be replied to by the user and performs word segmentation on the text according to a preset word segmentation rule to obtain a word sequence. The word sequence is stopped according to a preset stop word list to obtain a candidate word list; The candidate words that appear more than a preset frequency threshold in the candidate word list are used as keywords to obtain a keyword list; Each keyword in the keyword list is entered into a preset answer database for matching to obtain an initial answer corresponding to each keyword, and the initial answer that appears most frequently is used as a preset backup answer for the text to be replied to.
3. The method as described in claim 1, characterized in that, The step of rendering the preset backup answers in the mixed answer list to generate a first page element and setting the first page element to be invisible includes: Extract the preset backup answer from the mixed answer list; Create a first document object model node and populate the first document object model node with the preset alternative answer; Insert the first document object model node into the document object model tree to generate the first page element; Set the visibility property of the Cascading Style Sheet for the first page element to invisible.
4. The method as described in claim 1, characterized in that, The step of displaying streaming content generated by the preset model based on the text to be replied to through the second page element includes: The current streaming content returned by the preset model based on the text to be replied to is obtained. A custom tag is added after the current streaming content to obtain the current streaming content paragraph, and the current streaming content is displayed through the second page element. Determine whether the current streaming content contains an end marker; If the current streaming content does not contain the end marker, obtain the next streaming content returned by the preset model based on the text to be replied to, and divide the next streaming content into a next streaming content paragraph and a newly added content paragraph based on the custom tag; If there is no deviation between the next streaming content segment and the current streaming content segment, the newly added content segment is added to the current streaming content as the new current streaming content and displayed through the second page element. The custom tag is then moved to the new current streaming content to obtain the new current streaming content segment. Return to the step of determining whether the current streaming content contains an end marker, until the new current streaming content contains the end marker, then display the new current streaming content through the second page element.
5. The method as described in claim 1, characterized in that, The step of reviewing the streaming content after it has been fully generated and obtaining the review result of the streaming content includes: After the streaming content is fully generated, the streaming content is matched with sensitive words in the preset sensitive word library to obtain the matching results, and the preset classification model is called to classify and identify the streaming content to obtain the classification results. If the matching result is a successful match and / or the classification result is non-compliant, the review will be rejected as the review result of the streaming content; If the matching result is a failure and the classification result is compliant, the approval will be taken as the review result of the streaming content.
6. The method as described in claim 5, characterized in that, The step of matching the streaming content with sensitive words in a preset sensitive word database to obtain matching results includes: Punctuation marks and numbers are removed from the streaming content to obtain the streaming content text, and Chinese characters are extracted from the streaming content text to generate a Chinese character sequence; The Chinese characters in the Chinese character sequence are converted into pinyin by a preset pinyin library to obtain a full pinyin sequence, and the first letter of the pinyin in the full pinyin sequence is extracted to obtain a first letter sequence; The Chinese character sequence, the full pinyin sequence, and the initial letter sequence are respectively matched with sensitive words in the preset sensitive word database to obtain the corresponding preliminary matching results; If at least two of the preliminary matching results are successful, the successful match shall be taken as the matching result; If at most one of the preliminary matching results is a successful match, then a failed match is taken as the matching result.
7. The method as described in claim 1, characterized in that, The step of hiding the second page element and displaying the first page element when the review result is rejection includes: If the review result is rejection, the visibility property of the Cascading Style Sheet corresponding to the second page element will be switched from visible to invisible to hide the second page element; Switch the visibility property of the Cascading Style Sheet corresponding to the first page element from invisible to visible to display the first page element.
8. An answer display device, characterized in that, The device includes: The list building module is used to obtain the text to be replied to by the user and the preset backup answers corresponding to the text to be replied to, create placeholders, and build a mixed answer list based on the preset backup answers and the placeholders; The answer rendering module is used to render the preset backup answers in the mixed answer list, generate a first page element, set the first page element to be invisible, and render the placeholders in the mixed answer list to generate a second page element, and set the second page element to be visible. The content review module is used to display streaming content generated by a preset model based on the text to be replied to through the second page element, and to review the streaming content after it is fully generated, and obtain the review result of the streaming content. The result usage module is used to hide the second page element and display the first page element if the review result is rejection.
9. An answer display device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the answer display method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the answer display method as described in any one of claims 1 to 7.