Dialogue information processing method and device, equipment and storage medium

By presenting the received streaming response in chronological order and using syntax checking to correct syntax errors, the problem of out-of-order or missing characters in streaming transmission is solved, thus achieving accuracy and stability of the response.

CN121233701APending Publication Date: 2025-12-30BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410832682.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2025-12-30

AI Technical Summary

Technical Problem

In existing technologies, responses generated by machine learning models may be out of order or have missing characters due to streaming transmission, which may result in grammatical errors in the text received by the user, affecting the accuracy of the response.

Method used

After receiving the streaming response generated by the language model, it is presented in the order of the text units received, and the current response is processed using grammar check data to identify and correct grammatical errors. The erroneous parts are replaced by requesting the complete grammatically correct text fragments.

Benefits of technology

This improves the accuracy of responses, ensures that the text stream received by the user is free of syntax errors, and enhances the stability and accuracy of information transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121233701A_ABST
    Figure CN121233701A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a dialogue information processing method and device, equipment and a storage medium. The method includes: in a conversational page, receiving a first set of text units from a language model, the first set of text units being included in a first portion of a response of the language model, the response being a text stream generated by the language model in a streaming manner based on cues; according to the received time sequence of each text unit in the first group of text units, presenting a current response for the cue word; and processing the current response based on syntax check data, the syntax check data indicating a syntax error in the current response. In this way, it can be determined whether a syntax error exists in the received text stream, and in the event that the syntax error exists, the response is processed to obtain a correct response. Therefore, the response accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Example embodiments of the present disclosure generally relate to the field of text processing, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for checking grammatical errors in text. BACKGROUND

[0002] Machine learning techniques have been widely used in various technical fields. In the prior art, machine learning models are provided to assist users in various task processing needs in different applications and scenarios. A trained machine learning model can have a specific task processing capability. For example, a trained language model can dynamically generate an answer to a question according to a user's question. The process of generating an answer by a language model is often generated word by word and issued in a streaming manner. Due to network delay and other reasons, the text received by the user in the answer can be out of order and thus have errors. It is desirable to improve the accuracy of the answer ultimately obtained by the user. SUMMARY

[0003] In a first aspect of the present disclosure, a method for processing conversational information is provided. The method comprises: receiving, in a conversational page, a first set of text units from a language model, the first set of text units being included in a first portion of an answer of the language model, the answer being a text stream generated by the language model in a streaming manner based on a prompt word; presenting a current answer for the prompt word in a time order in which the text units in the first set of text units are received; and processing the current answer based on grammar checking data, the grammar checking data indicating a grammatical error in the current answer.

[0004] In a second aspect of the present disclosure, a device for processing conversational information is provided. The device comprises: a text receiving module configured to receive, in a conversational page, a first set of text units from a language model, the first set of text units being included in a first portion of an answer of the language model, the answer being a text stream generated by the language model in a streaming manner based on a prompt word; an answer presenting module configured to present a current answer for the prompt word in a time order in which the text units in the first set of text units are received; and an answer processing module configured to process the current answer based on grammar checking data, the grammar checking data indicating a grammatical error in the current answer.

[0005] In a third aspect of the present disclosure, an electronic device is provided. The device comprises at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit. The instructions, when executed by the at least one processing unit, cause the device to perform the method of the first aspect of the present disclosure.

[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided. The computer-readable storage medium has stored thereon a computer program, the computer program being executable by a processor to implement the method of the first aspect of the present disclosure.

[0007] In a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program, when executed by a processor, implements the method of the first aspect of the present disclosure.

[0008] It should be understood that nothing in this Summary is intended to limit the scope of the embodiments of the present disclosure or the accompanying claims in any way. BRIEF DESCRIPTION OF DRAWINGS

[0009] The above and other features, aspects and advantages of embodiments of the present disclosure will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, like reference numerals refer to like elements, in which:

[0010] Figure 1 a schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;

[0011] Figure 2 a flowchart showing a dialog information processing procedure according to some embodiments of the present disclosure;

[0012] Figure 3 a schematic diagram showing a dialog information processing example according to some embodiments of the present disclosure;

[0013] Figure 4 a block diagram showing a dialog information processing apparatus according to some embodiments of the present disclosure; and

[0014] Figure 5 a block diagram showing an electronic device in which one or more embodiments of the present disclosure can be implemented. DETAILED DESCRIPTION

[0015] Embodiments of the present disclosure will be described below in greater detail with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be interpreted as being limited to the embodiments set forth herein, but rather, these embodiments are provided so as to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for exemplary purposes only and are not intended to limit the scope of protection of the present disclosure.

[0016] In the description of embodiments of the disclosure, the term "comprising" and similar terms are to be interpreted as open-ended, i.e., "including but not limited to". The term "based on" is to be interpreted as "based, at least in part, on". The term "one embodiment" or "the embodiment" is to be interpreted as "at least one embodiment". The term "some embodiments" is to be interpreted as "at least some embodiments". Other explicit and implicit definitions can also be included below.

[0017] In this document, unless explicitly stated, performing a step "in response to A" does not mean performing the step immediately after A, but can include one or more intermediate steps.

[0018] It can be understood that the data involved in the technical solutions of the present disclosure (including but not limited to the data itself, the obtaining or use of the data) should comply with the requirements of the corresponding laws and regulations and relevant provisions.

[0019] It can be understood that, before using the technical solutions disclosed in the embodiments of the present disclosure, the type of personal information involved in the present disclosure, the use range, the use scenario, etc. should be informed to the user and the authorization of the user should be obtained through appropriate means according to relevant laws and regulations.

[0020] For example, in response to receiving the active request of the user, prompt information is sent to the user to explicitly prompt the user that the operation requested to be performed will need to obtain and use the personal information of the user, so that the user can voluntarily choose whether to provide the personal information to the software or hardware such as electronic device, application program, server or storage medium, etc. performing the operation of the technical solutions of the present disclosure according to the prompt information.

[0021] As an optional but non-limiting implementation manner, in response to receiving the active request of the user, the manner of sending prompt information to the user can be, for example, the manner of pop-up window, and the prompt information can be presented in the form of text in the pop-up window. In addition, the pop-up window can also carry selection controls for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0022] It can be understood that the above notification and user authorization process is only illustrative and does not limit the implementation manner of the present disclosure, and other manners meeting the relevant laws and regulations can also be applied to the implementation manner of the present disclosure.

[0023] As used herein, the term“model” can learn the relationship between the corresponding input and output from the training data, so that after the training is completed, the corresponding output can be generated for a given input. The generation of the model can be based on machine learning techniques. Deep learning is a machine learning algorithm that processes input and provides a corresponding output by using multiple layers of processing units. Neural network model is one example of a model based on deep learning. In this document, the“model” can also be referred to as“machine learning model”,“learning model”,“machine learning network” or“learning network”, which are used interchangeably herein.

[0024] A“neural network” is a machine learning network based on deep learning. Neural networks are capable of processing input and providing a corresponding output, which typically includes an input layer and an output layer and one or more hidden layers between the input layer and the output layer. Neural networks used in deep learning applications typically include many hidden layers, thereby increasing the depth of the network. The layers of a neural network are connected in sequence, so that the output of a previous layer is provided as input to a subsequent layer, with the input layer receiving the input to the neural network and the output of the output layer as the final output of the neural network. Each layer of the neural network includes one or more nodes (also referred to as processing nodes or neurons), each of which processes input from the previous layer.

[0025] Generally, machine learning can include three stages, namely a training stage, a testing stage and an application stage (also referred to as an inference stage). In the training stage, a given model can be trained using a large amount of training data, iteratively updating the parameter values until the model is able to obtain consistent inferences from the training data that meet the expected target. Through training, the model can be considered to be able to learn the relationship between the input and the output (also referred to as the mapping from input to output) from the training data. The parameter values of the trained model are determined. In the testing stage, the test input is applied to the trained model to test whether the model can provide the correct output, so as to determine the performance of the model. The testing stage can sometimes be merged into the training stage. In the application or inference stage, the trained model can be used to process the actual model input based on the parameter values obtained by training to determine the corresponding model output.

[0026] Figure 1A schematic diagram illustrating an example environment 100 in which embodiments of the present disclosure can be implemented is shown. In this example environment 100, a terminal device 110 can present a corresponding page 140 to a user 130 based on an operation of the user 130 to output and / or receive information from the user 130. For example, the terminal device 110 can receive a user query (also referred to as a user question, a user request, etc.) from the user 130 via the page 140. The terminal device 110 can determine a response to the user query and provide the response to the user 130 via the page 140.

[0027] In some embodiments, the terminal device 110 can determine the response to the user query with the help of a language model (LM) 120. The language model 120 can be capable of question-answering by learning from a large amount of corpus. The language model 120 can be deployed locally at the terminal device 110 or at other devices (e.g., remote devices). If the language model 120 is deployed locally at the terminal device 110, the terminal device 110 can determine the response directly with the help of the language model 120. If the language model 120 is deployed at other devices, the terminal device 110 can send the user query to the other devices via a communication connection between the terminal device 110 and the other devices. The other devices can generate the response to the user query with the help of the language model 120. The terminal device 110 can obtain the response from the other devices.

[0028] The terminal device 110 can be any type of mobile terminal, fixed terminal, or portable terminal including a mobile handset, a tablet computer, a notebook computer, a laptop computer, a netbook computer, a smartbook, a tablet computer, a media computer, a multimedia tablet, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an electronic book device, a game device, or any combinations of the aforementioned and the like, including accessories and peripherals related thereto, or any combinations thereof. In some embodiments, the terminal device 110 can also be capable of supporting any type of interface to the user (such as "wearable" circuitry, etc.). The server 130 can be any type of computing system / server capable of providing computing capabilities, including but not limited to a mainframe, an edge computing node, a computing device in a cloud environment, and the like.

[0029] It should be understood that the structures and functions of the various elements in the environment 100 are described for illustrative purposes only and do not imply any limitation on the scope of the present disclosure.

[0030] As mentioned previously, a trained language model can dynamically generate a response to a user's question according to the question. The process of the language model generating the response is often word-by-word generation and streaming delivery (rendering an effect similar to a typewriter outputting words one by one at the terminal device side). In order to improve the speed and stability of information transmission, multiple communication links can be established between the terminal device and the language model, and multiple text units (e.g., multiple words) in the response generated by the language model can be sent to the terminal device through different links respectively. However, simultaneous transmission through multiple links cannot guarantee that the time sequence of each text unit reaching the terminal device is consistent with the normal sequence. The terminal device assembles the received streaming message into a text sequence (e.g., a sentence), which is the response. It cannot be determined whether the thus-obtained response has grammatical errors (e.g., out-of-order, missing words, etc.).

[0031] In view of this, according to an embodiment of the present disclosure, a dialogue information processing improvement scheme is provided. According to the scheme, in a dialogue page, a first set of text units from a language model is received. The first set of text units is included in a first part of a response of the language model. The response is a text stream generated by the language model in a streaming manner based on a prompt word. A current response to the prompt word is rendered in a time sequence in which the text units in the first set of text units are received. The current response is processed based on grammar check data, which indicates a grammatical error in the current response.

[0032] Here, a text unit can represent a language unit of a natural language. For example, in a Chinese language environment, a text unit can represent a Chinese character; for another example, in an English language environment, a text unit can represent an English word, etc. Thus, it can be determined whether the received text stream has a grammatical error, and the response is processed to obtain a correct response in the case where there is a grammatical error. This can improve the accuracy of the response.

[0033] Some example embodiments of the present disclosure will be described in detail below with reference to examples of the accompanying drawings. Figure 2 A flowchart of a dialogue information processing process 200 according to some embodiments of the present disclosure is shown. The process 200 can be implemented at the terminal device 110. The following refers to the terminal device 110 and the language model 120. Figure 1 The process 200 is described.

[0034] At block 210, the terminal device 110 receives, in a dialogue page, a first set of text units from a language model, the first set of text units being included in a first part of a response of the language model, the response being a text stream generated by the language model in a streaming manner based on a prompt word, and each text unit in the text stream being transmitted to the client terminal device 110 step by step.

[0035] In some embodiments, terminal device 110 may determine user input received via a conversational page as a user query (also referred to as a user question, etc.). Terminal device 110 may, for example, generate prompts for a language model based on a predetermined prompt template and the user query. Terminal device 110 may provide the prompts to the language model so that the language model can generate a response to the user query based on the prompts. Terminal device 110 may then obtain the response from the language model.

[0036] In some embodiments, the language model generates a text stream in a streaming manner, with the length of the text stream gradually increasing over time, and individual text units in the text stream can be continuously transmitted to the terminal device. In some embodiments, the terminal device 110 may have an application that can provide a conversational page (e.g., a social application, a chat application, a query application, etc.) installed on it; the terminal device 110 may also be referred to as the client device of the application. If the language model is deployed on a remote device (e.g., a server device), the terminal device 110 can receive multiple text units (e.g., a first group of text units) via multiple communication links with the server device of the language model. In this way, data reception bandwidth can be improved.

[0037] In box 220, terminal device 110 determines the current response to the prompt word according to the chronological order in which the text units in the first group of text units are received, and presents the current response to the prompt word on the dialog page. At this time, the current response is determined based on the text units in the first group of text units and their chronological order of reception. For example, if terminal device 110 receives the text units "I", "very", "love", "kick", and "ball" respectively in seconds 1 to 5, then terminal device 110 can present the first group of text units "I love playing football" on the dialog page; that is, the current response should include "I love playing football".

[0038] Furthermore, terminal device 110 can also receive a second set of text units from the language model. This second set of text units is included in the second part of the response, which follows the first part. Terminal device 110 can add text units from the second set of text units to the current response in the order they were received, so as to continue processing the current response based on the syntax check data. It is understood that terminal device 110 can continuously receive responses from the language model, part by part, until all are received. In this way, subsequent text units generated over time can be continuously received and syntax checks performed.

[0039] In box 230, terminal device 110 processes the current response based on syntax check data, which indicates syntax errors in the current response.

[0040] This grammar check data can be obtained locally on the terminal device 110 or from a remote grammar check service (such as a Natural Language Processing (NLP) service). Specifically, the terminal device 110 can send the current response to the grammar check service. The grammar check service can generate grammar check data based on the current response and send the generated grammar check data to the terminal device 110. The terminal device 110 can receive the grammar check data from the grammar check service. This grammar check data may include, for example, the location of the grammar error in the current response, and the type of the grammar error, etc. Error types may include, for example, out-of-order (i.e., the word order in the response is incorrect), missing (i.e., the response contains missing content), and / or incomplete (i.e., the response is not finished). In this way, the processing capabilities of the grammar check service can be invoked to determine various types of errors that may exist in the response, thereby providing the user with a more accurate response.

[0041] In some embodiments, since the response is a text stream generated in a streaming manner, there is a possibility that the current response may not be fully sent to the terminal device. Therefore, if it is determined that the error position is at the end of the current response and the error type is incomplete, the terminal device 110 can ignore the syntax error. In this way, it is not necessary to handle incomplete syntax errors, but to focus on handling other types of syntax errors.

[0042] In some embodiments, if the syntax check data indicates that the current response contains a syntax error, the terminal device 110 may request a text block from the currently generated portion of the response from the language model and update the current response using the received text block. This text block may, for example, be a text fragment within the response. In this way, a text fragment with correct grammatical structure generated by the language model can be directly used to replace the text fragment containing error information presented at the terminal device.

[0043] Specifically, for the user query "What are the characteristics of ###?", the language model can generate a response word by word and send the response word by word to the client through multiple links. Suppose the client combines the first n received words in the order they were received to get "### is a famous heritage city of world culture, possessing rich cultural and natural landscapes". After a grammar check, a grammatical error is found. The client can then request the language model to send the complete generated content "### is a famous world cultural heritage city, possessing rich cultural and natural landscapes" all at once (instead of sending it word by word), and then replace it. Because the subsequent content is sent all at once (e.g., in string format), rather than word by word through multiple links, the accuracy of the subsequently received content is guaranteed, without out-of-order issues or missing words.

[0044] In some embodiments, text fragments that meet predetermined conditions can be selected from the response of the language model. The end of the text fragment may include, for example, punctuation marks indicating grammatical meaning, such as periods, semicolons, and question marks. In the example above, suppose the client receives the response "...possesses abundant...". At this point, the response is incomplete, and the client can wait for the subsequent content of the response. Alternatively, upon receiving the response "...possesses abundant cultural and natural landscapes...", a grammatical error can be determined. In this way, it can be ensured that the selected text fragment has the correct grammatical structure. For example, for the first set of text units, if a grammatical error is determined in the received first set of text units, the terminal device 110 can request a text block from the language model in the first part and use this text block to update the response in the first part. Furthermore, the updated response can be presented at the terminal device 110.

[0045] During the process of determining whether a grammatical error exists, the language model also generates new text units, and the terminal device 110 can also receive new text units from the language model. The terminal device 110 can request a complete text block from the text generated by the language model and use this text block to update the first part of the response. In some embodiments, the terminal device 110 can, for example, determine the part of the current response corresponding to the text block to be replaced and use the text block to update the part to be replaced. In some embodiments, the terminal device 110 can also use grammar check data to determine whether the updated response contains grammatical errors.

[0046] In some embodiments, before performing a syntax check on the current response, it can be determined whether the current response includes a portion that has already undergone syntax checking. If the determination result is "yes", the portion that has already undergone syntax checking can be removed from the current response. Specifically, when using a syntax checking service, during the process of sending the current response to the syntax checking service, in response to determining that the current response includes a portion that has previously been sent to the syntax checking service, said portion is removed from the current response.

[0047] In some embodiments, if it is determined that the part to be replaced has been updated, the terminal device 110 may also determine the remaining parts of the current response after the part to be replaced as the current response. For example, if the first round of syntax checking finds an error in text units 1-10 and has successfully replaced them, the terminal device subsequently receives text units 11-20. In the second round of syntax checking, the checked parts (i.e., text units 1-10) can be removed, and only the unchecked parts (i.e., text units 11-20) are retained in the current response. That is, the second round of syntax checking only processes the unchecked parts. Since the replaced parts do not involve syntax errors, they do not need to be processed repeatedly, which helps reduce the computational load of the terminal device 110. Alternatively and / or additionally, parts that have been confirmed not to involve syntax errors can be removed from the current response, thereby reducing the computational load of the terminal device 110.

[0048] Figure 3 A schematic diagram of a dialogue information processing example 300 according to some embodiments of the present disclosure is shown. Example 300 relates to a terminal device 110, a language model 120, and an NLP service 301 (the NLP service 301 may be an example of a syntax checking service).

[0049] Terminal device 110 can send user queries (also known as user questions) from the user to language model 120 (302). Terminal device 110 can receive streaming responses generated by language model 120 (304). Since terminal device 110 receives streaming responses via multiple links, if the streaming responses are assembled according to the receiving order, there may be cases where terminal device 110 does not receive some streaming responses sent by language model 120 (i.e., text units are lost) and / or the assembled streaming responses have word order errors.

[0050] Terminal device 110 may send (306) the currently received response to NLP service 301 to query NLP service 301 for syntax errors. Simultaneously, terminal device 110 may continue to receive (308) streaming responses from language model 120. NLP service 301 may determine if there are syntax errors in the response and send (310) syntax check data to terminal device 110 to indicate whether there are syntax errors in the response.

[0051] Terminal device 110 can determine syntax errors in the current response based on the received syntax check data. For example, terminal device 110 can request (312) a text block (e.g., a complete paragraph, sentence, etc.) of the currently generated portion of the response from language model 120. Language model 120 can return (314) the text block (e.g., a complete paragraph) to terminal device 110. Terminal device 110 can determine the replacement portion in the response corresponding to the text block and use the text block to update (316) the replacement portion to update the response.

[0052] In summary, according to the embodiments of this disclosure, it is possible to determine whether a received text stream contains syntax errors, and if syntax errors are present, the response can be processed to obtain a correct response. This can improve the accuracy of the response.

[0053] According to some embodiments of this disclosure, a dialogue information processing apparatus is also provided. Figure 4 A block diagram of a dialogue information processing apparatus 400 according to some embodiments of the present disclosure is shown. The apparatus 400 may be implemented as or included in a terminal device 110. The various modules / components in the apparatus 400 may be implemented by hardware, software, firmware, or any combination thereof.

[0054] like Figure 4 As shown, device 400 includes a text receiving module 410 configured to receive a first set of text units from a language model in a conversational page. The first set of text units is included in a first part of a response from the language model, the response being a text stream generated by the language model in a streaming manner based on prompt words. Device 400 also includes a response presentation module 420 configured to present the current response to the prompt words in the chronological order in which the text units in the first set of text units are received. Device 400 further includes a response processing module 430 configured to process the current response based on syntax check data indicating grammatical errors in the current response.

[0055] In some embodiments, the response processing module 430 includes: a text block request module configured to request a text block from the currently generated portion of the response in response to determining that the syntax check data indicates that the current response includes a syntax error; and a response update module configured to update the current response using the received text block.

[0056] In some embodiments, a text block is a text segment in a response, the end of which includes punctuation marks indicating grammatical meaning.

[0057] In some embodiments, the response update module includes: a replacement determination module configured to determine a replacement portion corresponding to a text block in the current response; and a text block update module configured to update the replacement portion using the text block.

[0058] In some embodiments, the apparatus 400 further includes: a response identification module configured to identify other parts of the current response besides the replacement part as the current response in response to determining that the replacement part has been updated.

[0059] In some embodiments, the apparatus 400 further includes: a second text receiving module configured to receive a second set of text units from a language model, the second set of text units being included in a second part of the response, the second part being located after the first part; and a text adding module configured to add each text unit in the second set of text units to the current response in the chronological order in which each text unit in the second set of text units is received, so as to continue processing the current response based on syntax check data.

[0060] In some embodiments, the syntax check data includes: the error position of the syntax error in the current response, and the error type of the syntax error, which includes at least one of the following: out-of-order type, missing type, and incomplete type.

[0061] In some embodiments, processing the current response includes: ignoring syntax errors in response to determining that the error location is at the end of the current response and the error type is incomplete.

[0062] In some embodiments, the text receiving module 410 is specifically configured to receive multiple text units at a client device providing a conversational page via multiple communication links between the client device and a server device for a language model.

[0063] In some embodiments, the apparatus 400 further includes: a response sending module configured to send a current response to a syntax checking service; and a data receiving module configured to receive syntax checking data from the syntax checking service, the syntax checking data being generated by the syntax checking service based on the current response.

[0064] In some embodiments, the response sending module is further configured to: remove a portion from the current response in response to determining that the current response includes a portion that has previously been sent to the syntax checking service.

[0065] The units and / or modules included in device 400 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units and / or modules can be implemented using software and / or firmware, such as machine-executable instructions stored on a storage medium. In addition to or as an alternative to machine-executable instructions, some or all of the units and / or modules in device 400 can be implemented at least partially by one or more hardware logic components. By way of example and not limitation, exemplary types of hardware logic components that can be used include field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chips (SoCs), complex programmable logic devices (CPLDs), and so on.

[0066] Figure 5 A block diagram of an electronic device 500 in which one or more embodiments of the present disclosure may be implemented is shown. It should be understood that... Figure 5 The electronic device 500 shown is merely exemplary and should not be construed as limiting the functionality and scope of the embodiments described herein. Figure 5 The electronic device 500 shown can be used to achieve Figure 1 Terminal device 110, server 130, and / or, Figure 4 Device 400.

[0067] like Figure 5 As shown, electronic device 500 is in the form of a general-purpose computing device. Components of electronic device 500 may include, but are not limited to, one or more processors or processing units 510, memory 520, storage device 530, one or more communication units 540, one or more input devices 550, and one or more output devices 560. Processing unit 510 may be a physical or virtual processor and is capable of performing various processes according to programs stored in memory 520. In a multiprocessor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing capability of electronic device 500.

[0068] Electronic device 500 typically includes multiple computer storage media. Such media can be any available media accessible to electronic device 500, including but not limited to volatile and non-volatile media, removable and non-removable media. Memory 520 can be volatile memory (e.g., registers, cache, random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. Storage device 530 can be removable or non-removable media and can include machine-readable media, such as flash drives, disks, or any other media capable of storing information and / or data and accessible within electronic device 500.

[0069] Electronic device 500 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not explicitly stated... Figure 5 As shown, disk drives for reading from or writing to removable, non-volatile disks (e.g., "floppy disks") and optical disk drives for reading from or writing to removable, non-volatile optical disks can be provided. In these cases, each drive can be connected to a bus (not shown) via one or more data media interfaces. Memory 520 may include computer program product 525 having one or more program modules configured to perform various methods or actions of various implementations of this disclosure.

[0070] The communication unit 540 enables communication with other computing devices via a communication medium. Additionally, the functionality of the components of the electronic device 500 can be implemented as a single computing cluster or multiple computing machines capable of communicating via communication connections. Therefore, the electronic device 500 can operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or another network node.

[0071] Input device 550 can be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 560 can be one or more output devices, such as a monitor, speaker, printer, etc. Electronic device 500 can also communicate with one or more external devices (not shown) via communication unit 540 as needed. These external devices include storage devices, display devices, etc., and can communicate with one or more devices that enable user interaction with electronic device 500, or with any device that enables electronic device 500 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication can be performed via input / output (I / O) interface (not shown).

[0072] According to an exemplary implementation of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions thereon, wherein the computer-executable instructions are executed by a processor to implement the methods described above. According to an exemplary implementation of this disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, which are executed by a processor to implement the methods described above.

[0073] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0074] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0075] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0076] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0077] Various implementations of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.

Claims

1. A method for processing dialogue information, comprising: In a conversational page, a first set of text units is received from a language model, the first set of text units being included in a first part of the response of the language model, the response being a text stream generated by the language model in a streaming manner based on prompt words; Present the current response to the prompt word in the order in which each text unit in the first group of text units is received; as well as The current response is processed based on syntax check data, which indicates syntax errors in the current response.

2. The method of claim 1, wherein processing the current response comprises: In response to determining that the syntax check data indicates that the current response includes a syntax error, a request is made to the language model of the text block in the currently generated portion of the response; as well as The current response is updated using the received text block.

3. The method of claim 2, wherein the text block is a text segment in the response, and the end of the text segment includes punctuation marks indicating grammatical meaning.

4. The method of claim 2, wherein updating the current response using the received text block comprises: Determine the portion of the current response that corresponds to the text block to be replaced; as well as The text block is used to update the part to be replaced.

5. The method of claim 1, further comprising: Receive a second set of text units from the language model, the second set of text units being included in a second part of the response, the second part being located after the first part; as well as According to the time sequence in which each text unit in the second group of text units is received, each text unit in the second group of text units is added to the current response so as to continue processing the current response based on the syntax check data.

6. The method of claim 1, wherein the syntax check data comprises: The syntax error is defined as the location of the error in the current response and the error type of the syntax error, wherein the error type includes at least one of the following: out-of-order type, missing type, and incomplete type.

7. The method of claim 6, wherein processing the current response comprises: In response to determining that the error location is at the end of the current response and that the error type is incomplete, the syntax error is ignored.

8. The method of claim 1, wherein receiving the first group of text units comprises: At the client device providing the conversational page, the plurality of text units are received via multiple communication links between the client device and the server device of the language model.

9. The method of claim 1, further comprising: Send the current response to the syntax checking service; as well as Receive the syntax check data from the syntax check service, the syntax check data being generated by the syntax check service based on the current response.

10. The method of claim 9, wherein sending the current response further comprises: In response to determining that the current response includes a portion that has previously been sent to the syntax checking service, the portion is removed from the current response.

11. A dialogue information processing device, comprising: The text receiving module is configured to receive a first set of text units from a language model in a conversational page. The first set of text units is included in a first part of the response of the language model, which is a text stream generated by the language model in a streaming manner based on prompt words. The response presentation module is configured to present the current response to the prompt word in the order in which each text unit in the first group of text units is received. as well as The response processing module is configured to process the current response based on syntax check data, which indicates syntax errors in the current response.

12. An electronic device, comprising: At least one processing unit; as well as At least one memory, coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 10 when executed by the at least one processing unit.

13. A computer-readable storage medium having a computer program stored thereon, the computer program being executable by a processor to implement the method according to any one of claims 1 to 10.

14. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 10.