Dialogue assisting method and device and storage medium
By using dialogue assistance methods in the 120 first aid scheduling system, using the first model and the second model to provide auxiliary information for information collection and rescue guidance, the problem of existing systems relying on schedulers' professional qualities and fixed processes is solved, and the professionalism and flexibility of scheduling effects are improved.
Patent Information
- Application Number
- CN202311490629.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-08
- Publication Date
- 2025-05-16
AI Technical Summary
The existing 120 first aid dispatching system relies on the professional qualities and fixed processes of the dispatcher, resulting in poor scheduling results.
A dialogue assisting method is adopted, and auxiliary information is provided through the first model and the second model in the information collection stage and the rescue guidance stage respectively to help the dispatcher determine the dialogue statement.
It reduces the dispatcher's dependence on professional qualities and experience, and improves the professionalism and flexibility of dispatching and guidance.
Smart Images

Figure CN120011485A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vertical industry technology, and in particular to a conversation assistance method, device and storage medium. Background Art
[0002] In the current 120 emergency dispatch system, after receiving an emergency call, the dispatcher needs to collect the content of the caller's call during the call and provide first aid guidance to the caller based on his or her own professional qualities. These are usually completed through regular training and improvisation of the dispatcher, which may lead to poor dispatch results due to the dispatcher's lack of professional ability. Summary of the invention
[0003] In order to solve the existing technical problems, the embodiments of the present invention provide a conversation assistance method, device and storage medium.
[0004] The technical solution of the present invention is achieved in this way:
[0005] An embodiment of the present invention provides a conversation assistance method, the method comprising:
[0006] According to a first dialogue sentence associated with a target event between a first object and a second object, a first model is used to determine first auxiliary information; wherein the first auxiliary information is used to determine a second dialogue sentence of the first object; and the second dialogue sentence is used by the first object to determine information of the second object;
[0007] Based on the third dialogue statement between the first object and the second object associated with the target event, a second model is used to determine second auxiliary information; wherein the second auxiliary information is used to determine a fourth dialogue statement of the first object; and the fourth dialogue statement is used to provide the first object with guidance information on how the second object should deal with the target event.
[0008] In the above scheme, the method further comprises:
[0009] dividing the historical dialogue sentences into first historical dialogue sentences corresponding to the first model and second historical dialogue sentences corresponding to the second model;
[0010] The first historical dialogue sentence is used to train the first model, and the second historical dialogue sentence is used to train the second model. In the above scheme, the first model is used to determine the first auxiliary information, including:
[0011] Using the first model, taking at least one of the plurality of first candidate sentences as a second dialogue sentence in the first auxiliary information; wherein the first candidate sentence is determined from the first historical dialogue sentences;
[0012] The adopting the second model to determine the second auxiliary information includes:
[0013] The second model is used to select at least one of the plurality of second candidate sentences as a fourth dialogue sentence in the second auxiliary information; wherein the second candidate sentence is determined from the second historical dialogue sentence. In the above scheme, the historical dialogue sentence is divided into the first historical dialogue sentence corresponding to the first model and the second historical dialogue sentence corresponding to the second model, including:
[0014] Using the first label and the second label, respectively determining the first historical dialogue sentence and the second historical dialogue sentence;
[0015] The step of using the first historical dialogue sentence to train the first model and using the second historical dialogue sentence to train the second model includes:
[0016] The first historical dialogue sentence identified by the first label forms a first prompt learning template, and the first prompt learning template is used to train the first model;
[0017] The second historical dialogue sentence identified by the second label constitutes a second prompt learning template, and the second prompt learning template is used to train the second model.
[0018] In the above scheme, the method further includes:
[0019] Using a first model, determining a predicted correspondence between an Nth first candidate sentence in the first historical dialogue sentence and a first designated sentence in the first historical dialogue sentence; wherein the first designated sentence includes one or more sentences;
[0020] updating the first model according to the actual correspondence between the Nth first candidate sentence and the first designated sentence in the first historical dialogue sentence and the predicted correspondence;
[0021] Using a second model, determining a predicted correspondence between an Mth second candidate sentence in the second historical dialogue sentence and a second designated sentence in the second historical dialogue sentence; wherein the second designated sentence includes one or more sentences;
[0022] The second model is updated according to the actual correspondence between the Mth second candidate sentence and the second designated sentence in the second historical dialogue sentence and the predicted correspondence.
[0023] In the above solution, the adopting of the first model to use at least one of the plurality of first candidate sentences as the second dialogue sentence in the first auxiliary information includes:
[0024] Using the first model, determining a probability that the first dialogue sentence has a predetermined corresponding relationship with each of the first candidate sentences;
[0025] At least one of the first candidate sentences whose probability satisfies a preset condition is determined as the second dialogue sentence.
[0026] In the above solution, the adopting of the second model to use at least one of the plurality of second candidate sentences as the fourth dialogue sentence in the second auxiliary information includes:
[0027] Using the second model, determining a probability that the third dialogue sentence has a predetermined corresponding relationship with each of the second candidate sentences;
[0028] At least one of the second candidate sentences whose probability satisfies a preset condition is determined as the fourth dialogue sentence.
[0029] In the above solution, the adopting the second model to determine the second auxiliary information includes:
[0030] When it is determined that the preset condition is met, the second model is used to determine the second auxiliary information;
[0031] The preset conditions include at least one of the following:
[0032] The number of the first dialogue sentences is greater than or equal to a preset number;
[0033] The first auxiliary information is a preset ending sentence;
[0034] The prediction accuracy probability value corresponding to the first auxiliary information is less than a preset probability threshold.
[0035] An embodiment of the present invention provides a conversation assistance device, the device comprising: a first determination module and a second determination module; wherein:
[0036] The first determination module is used to determine first auxiliary information using a first model according to a first dialogue sentence associated with a target event between a first object and a second object; wherein the first auxiliary information is used to determine a second dialogue sentence of the first object; and the second dialogue sentence is used by the first object to determine information of the second object;
[0037] The second determination module is used to determine second auxiliary information using a second model based on a third dialogue statement between the first object and the second object associated with the target event; wherein the second auxiliary information is used to determine a fourth dialogue statement of the first object; and the fourth dialogue statement is used to provide the first object with guidance information on how the second object should respond to the target event.
[0038] In the above solution, the device further comprises: a division module and a training module; wherein,
[0039] The division module is used to divide the historical dialogue sentences into first historical dialogue sentences corresponding to the first model and second historical dialogue sentences corresponding to the second model;
[0040] The training module is used to train the first model using the first historical dialogue sentence, and to train the second model using the second historical dialogue sentence.
[0041] In the above solution, the first determination module is used to use the first model to take at least one of the plurality of first candidate sentences as the second dialogue sentence in the first auxiliary information; wherein the first candidate sentence is determined from the first historical dialogue sentences;
[0042] The second determination module is used to adopt the second model to use at least one of the multiple second candidate sentences as the fourth dialogue sentence in the second auxiliary information; wherein the second candidate sentence is determined from the second historical dialogue sentences.
[0043] In the above solution, the division module is used to use the first label and the second label to respectively determine the first historical dialogue sentence and the second historical dialogue sentence;
[0044] The training module is used to form a first prompt learning template from the first historical dialogue sentence identified by the first label, and train the first model using the first prompt learning template;
[0045] The second historical dialogue sentence identified by the second label constitutes a second prompt learning template, and the second prompt learning template is used to train the second model.
[0046] In the above scheme, the training module is further used to use a first model to determine a predicted correspondence between the Nth first candidate sentence in the first historical dialogue sentence and a first designated sentence in the first historical dialogue sentence; wherein the first designated sentence includes one or more sentences;
[0047] updating the first model according to the actual correspondence between the Nth first candidate sentence and the first designated sentence in the first historical dialogue sentence and the predicted correspondence;
[0048] Using a second model, determining a predicted correspondence between an Mth second candidate sentence in the second historical dialogue sentence and a second designated sentence in the second historical dialogue sentence; wherein the second designated sentence includes one or more sentences;
[0049] The second model is updated according to the actual correspondence between the Mth second candidate sentence and the second designated sentence in the second historical dialogue sentence and the predicted correspondence.
[0050] In the above solution, the first determination module is used to use the first model to determine the probability that the first dialogue sentence has a predetermined corresponding relationship with each of the first candidate sentences;
[0051] At least one of the first candidate sentences whose probability satisfies a preset condition is determined as the second dialogue sentence.
[0052] In the above solution, the second determination module is used to use the second model to determine the probability that the third dialogue sentence has a predetermined corresponding relationship with each of the second candidate sentences;
[0053] Determine at least one of the second candidate sentences whose probability meets the preset condition as the fourth dialogue sentence. In the above scheme, the second determination module is used to determine the second auxiliary information using the second model when the preset condition is met;
[0054] The preset conditions include at least one of the following:
[0055] The number of the first dialogue sentences is greater than or equal to a preset number;
[0056] The first auxiliary information is a preset ending sentence;
[0057] The prediction accuracy probability value corresponding to the first auxiliary information is less than a preset probability threshold.
[0058] In a third aspect, an embodiment of the present invention further provides a conversation assistance device, comprising a memory, a processor, and an executable program stored in the memory and capable of being run by the processor, wherein the processor executes any step of the conversation assistance method when running the executable program.
[0059] In a fourth aspect, an embodiment of the present invention further provides a storage medium having an executable program stored thereon, wherein the executable program, when executed by a processor, implements the steps of any one of the dialogue assistance methods.
[0060] The dialogue assistance method, device and storage medium provided in the embodiment of the present invention adopt a first model to determine first auxiliary information according to a first dialogue statement between a first object and a second object associated with a target event; wherein the first auxiliary information is used to determine a second dialogue statement of the first object; the second dialogue statement is used by the first object to determine information of the second object; according to a third dialogue statement between the first object and the second object associated with the target event, a second model is adopted to determine second auxiliary information; wherein the second auxiliary information is used to determine a fourth dialogue statement of the first object; the fourth dialogue statement is used to provide the first object with guidance information on how the second object responds to the target event. In the scheme of the embodiment of the present invention, by adopting the first model to determine the first auxiliary information and by using the second model to determine the second auxiliary information, the first object can be helped to obtain auxiliary information for determining the dialogue statement, so that the first object does not need to rely on its own professional accumulation to complete the dialogue, thereby improving the dialogue effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 A flowchart of a conversation assistance method provided by an embodiment of the present invention;
[0062] Figure 2 A schematic diagram of a model structure of a conversation assistance method provided by an embodiment of the present invention;
[0063] Figure 3 A flowchart of another conversation assistance method provided by an embodiment of the present invention;
[0064] Figure 4 A schematic diagram of the structure of a conversation assistance device provided by an embodiment of the present invention;
[0065] Figure 5 A schematic diagram of the structure of another conversation assistance device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0066] The Medical Priority Dispatch System (MPDS) is a knowledge system software used for on-site assessment, graded medical treatment and telephone guidance in emergency dispatch. Dispatchers use the system to assess the condition, prioritize and dispatch emergency resources and provide telephone guidance to callers in emergency command and dispatch. MPDS requires sufficient training for emergency dispatchers before they receive emergency requests from patients. According to the patient's condition, the emergency dispatcher manually selects the plan to which they belong. Based on the system prompts, the dispatcher conducts multiple rounds of questioning of the caller. Based on the caller's answers, the system will simply determine the level of the current patient and give corresponding guidance. The process is rigorous and fixed, requiring dispatchers to follow the system prompts and not read a word more or less.
[0067] Other non-MPDS dispatch systems are mainly used for event registration and vehicle dispatch.
[0068] However, the above scheduling system has the following problems:
[0069] First, the existing dispatching system is overly dependent on dispatchers, who are required to be familiar with various emergency plan cases and to quickly judge and select appropriate plan content, and the dispatchers' professional qualities are required to be high.
[0070] Second, the existing dispatch process is too rigid. In the MPDS system, once the dispatcher has determined and selected a plan, the content and order of the questions asked are preset fixed processes and cannot be flexibly adjusted. In the non-MPDS system, there is no unified standard for the inquiries and guidance after the ambulance is dispatched. The guidance of the callers is usually completed by the dispatcher's regular training and on-the-spot performance, resulting in poor guidance from the dispatcher to the callers.
[0071] The present invention will be further described in detail below in conjunction with the embodiments.
[0072] Figure 1 A flowchart of a conversation assistance method provided by an embodiment of the present invention; Figure 1 As shown, the method includes:
[0073] Step 101: Determine first auxiliary information using a first model according to a first dialogue sentence associated with a target event between a first object and a second object; wherein the first auxiliary information is used to determine a second dialogue sentence of the first object; and the second dialogue sentence is used by the first object to determine information of the second object;
[0074] Step 102: Determine second auxiliary information using a second model based on a third dialogue statement between the first object and the second object associated with the target event; wherein the second auxiliary information is used to determine a fourth dialogue statement of the first object; and the fourth dialogue statement is used to provide guidance information to the first object regarding how the second object responds to the target event.
[0075] In a possible implementation, the method is applied to an emergency dispatch system; the emergency dispatch system is used to execute the method.
[0076] In one possible implementation, the first object and the second object may be people; for example, the first object may be a dispatcher, and the second object may be a person calling for help; the target event may be that the dispatcher answers the call for help made by the person calling for help, and the first dialogue sentence associated with the target event may be that the dispatcher asks the person calling for specific information, and the person calling for help answers the dispatcher with relevant specific information; the third dialogue sentence associated with the target event may be that the dispatcher provides rescue guidance to the person calling for help, and the person calling for help responds to the dispatcher's rescue guidance.
[0077] Exemplarily, the first dialogue sentence may be the dispatcher asking the rescuer the patient's age, symptoms, and address, and the rescuer answering the dispatcher's questions. For example, the dispatcher asks "where is the patient now", and the rescuer replies "in a certain room in a certain building in a certain community"; the third dialogue sentence may be the dispatcher providing rescue guidance to the rescuer. For example, the dispatcher gives rescue guidance such as "rinse the wound with clean water" and "clear the mouth, nose and respiratory tract", and the rescuer replies "OK".
[0078] Here, the patient may or may not be the person calling for help.
[0079] In one possible implementation, in an actual application scenario, due to poor communication signals, the caller's lack of concentration, etc., there may be incoherent dialogue between the first and third dialogue statements; if the caller does not speak during the interval between the dispatcher's two speeches, the caller's answer statement can be retained and the answer statement can be left blank, with the blank information occupying one of the caller's sentences.
[0080] For example, in the third dialogue sentence, the dispatcher said "rinse the wound with clean water", and the caller did not respond, then the caller's sentence was left blank, and the dispatcher continued to provide the caller with the next rescue guidance.
[0081] In one possible implementation, the first model and the second model may be models determined by training using a preset method; the first model may be a question-and-answer assisted model, and the second model may be a guidance assisted model; for example, the preset method may be deep learning, and / or prompt learning.
[0082] Here, hint learning can be a pre-training model method suitable for low-resource scenarios, that is, obtaining good task results in zero-shot or few-shot scenarios.
[0083] In one possible implementation, the dialogue between the first object and the second object can be divided into two stages, namely a first dialogue stage and a second dialogue stage; the first dialogue stage can be a stage for conducting a second dialogue statement, and the first auxiliary information can provide auxiliary suggestions for the second dialogue statement to the first object in the first dialogue stage; the second dialogue stage can be a stage for conducting a fourth dialogue statement, and the second auxiliary information can provide auxiliary suggestions for the fourth dialogue statement to the first object in the second dialogue stage.
[0084] Here, the second dialogue statement may be the dispatcher further asking the caller for specific information, and the fourth dialogue statement may be the dispatcher further providing rescue guidance and suggestions to the caller.
[0085] Exemplarily, the first dialogue stage is the information collection stage, the second dialogue stage is the rescue guidance stage, the first auxiliary information is to provide suggestions to the dispatcher on how to ask for information in the information collection stage, and the second auxiliary information is to provide suggestions to the dispatcher on how to provide rescue guidance in the rescue guidance stage.
[0086] Specifically, the dispatcher answers the call for help from the caller and, based on the conversation in which the dispatcher asks the caller for specific information during the information collection phase, uses a question-and-answer assistance model to provide the dispatcher with auxiliary suggestion information for further asking for information; based on the conversation in which the dispatcher provides the caller with specific rescue guidance during the rescue guidance phase, uses a guidance assistance model to provide the dispatcher with auxiliary suggestion information for further providing rescue guidance to the caller.
[0087] Through the above method, the emergency dispatch process is divided into the information collection stage and the rescue guidance stage. Information collection suggestions are provided to dispatchers in the information collection stage, and rescue guidance suggestions are provided to dispatchers in the rescue guidance stage. This can reduce the dispatch system's dependence on the dispatcher's professional level and experience accumulation, making the dispatcher's rescue guidance more professional.
[0088] In some embodiments, the method further comprises:
[0089] dividing the historical dialogue sentences into first historical dialogue sentences corresponding to the first model and second historical dialogue sentences corresponding to the second model;
[0090] The first historical dialogue sentence is used to train the first model, and the second historical dialogue sentence is used to train the second model.
[0091] In a possible implementation, the historical conversation sentences may refer to historically stored scheduling question and answer records; and complete conversation voice records are selected from the historical conversations as training data for the first model and the second model.
[0092] In one possible implementation, the first historical dialogue sentence may be the dispatcher's sentence content in the information collection phase in the historical dispatch question and answer record; the second historical dialogue sentence may be the dispatcher's sentence content in the rescue guidance phase in the historical dispatch question and answer record.
[0093] Specifically, the historically stored dispatch question and answer records between the dispatcher and the caller are determined as historical dialogue sentences, the dispatch question and answer records are divided, the sentence content of the dispatcher in the information collection stage is determined as the training data of the first model, and the sentence content of the dispatcher in the rescue guidance stage is determined as the training data of the second model.
[0094] In a possible implementation, the conversation voice record of the historical conversation sentence is converted into a text version of the conversation record, that is, the semantic information of the historical conversation sentence, through a speech-to-text module.
[0095] In one possible implementation, when converting a conversation voice record into semantic information, the conversation voice information can be differentiated according to preset features of the voice information, and the sentences corresponding to the dispatcher and the caller in the conversation voice can be distinguished, and the conversation voice information can be converted into semantic information in a standard format.
[0096] Here, the preset features may include: audio signal source, voiceprint data and sound frequency.
[0097] Exemplarily, the semantic information in the standard format may be:
[0098] Dispatcher: Sentence 1;
[0099] The one who calls for help: Sentence 2;
[0100] Dispatcher: Sentence 3;
[0101] The one who calls for help: Sentence 4;
[0102] Dispatcher:……;
[0103] The person calling for help:…….
[0104] Here, the empty semantic information can be represented by NULL.
[0105] For example, if the caller does not respond between sentences 1 and 3 asked by the dispatcher, sentence 2 corresponding to the caller can be left blank; at this time, the semantic information of the conversation can be:
[0106] Dispatcher: Sentence 1;
[0107] Caller: NULL;
[0108] Dispatcher: Sentence 3.
[0109] In a possible implementation, the method of training the second model may include but is not limited to: a first method and a second method.
[0110] Exemplarily, the first method may be to perform a plan type judgment after determining the second historical dialogue sentence, determine whether the scenario in the second historical dialogue sentence corresponds to one or more plan types, and train respective second models under different plan types; the second method may be to not perform a plan type judgment after determining the second historical dialogue sentence, and use the overall data of the second historical dialogue sentence to train the second model.
[0111] Here, the plan type may refer to the event type corresponding to the target event. For example, the plan types for the caller to call for help from the dispatcher may include: skin burns, bone fractures, heart disease, and food poisoning.
[0112] Furthermore, if the first method is adopted to train the second model, the corresponding second model can be determined based on the conversation between the caller and the dispatcher to determine the plan type of the caller, and second auxiliary information for the plan type can be given.
[0113] Through the above method, the historical dialogue sentences are divided, the first historical dialogue sentences and the second historical dialogue sentences are determined, the first model is trained according to the first historical dialogue sentences, and the second model is trained according to the second historical dialogue sentences. The first model and the second model can provide appropriate rescue guidance suggestions to the dispatcher respectively, so that the dispatcher can handle the rescue case more flexibly and intelligently; in addition, the dispatcher does not need to manually classify the rescue plan for the rescue situation, avoiding the misjudgment of the plan caused by overlapping plan content and insufficient professional level of the dispatcher.
[0114] In some embodiments, the adopting the first model to determine the first auxiliary information includes:
[0115] Using the first model, taking at least one of the plurality of first candidate sentences as a second dialogue sentence in the first auxiliary information; wherein the first candidate sentence is determined from the first historical dialogue sentences;
[0116] The adopting the second model to determine the second auxiliary information includes:
[0117] The second model is adopted to use at least one of the plurality of second candidate sentences as a fourth dialogue sentence in the second auxiliary information; wherein the second candidate sentence is determined from the second historical dialogue sentences.
[0118] Specifically, the content of the dispatcher's sentences in the information collection stage in the historical dialogue sentences is taken as the first historical dialogue sentence and determined as the first candidate sentence, and the content of the dispatcher's sentences in the rescue guidance stage in the historical dialogue sentences is taken as the second historical dialogue sentence and determined as the second candidate sentence; the first model is used to determine the second dialogue sentence in the first auxiliary information in the first candidate sentence; and the second model is used to determine the fourth dialogue sentence in the second auxiliary information in the second candidate sentence.
[0119] In one possible implementation, when the first model is used to determine the first auxiliary information, the first dialogue sentence between the dispatcher and the caller is input into the first model, and at least one of the multiple first candidate sentences is selected as the second dialogue sentence in the first auxiliary information; when the second model is used to determine the second auxiliary information, the third dialogue sentence between the dispatcher and the caller is input into the second model, and at least one of the multiple second candidate sentences is selected as the fourth dialogue sentence in the second auxiliary information.
[0120] Through the above method, the first model is used to determine the second dialogue sentence in the first auxiliary information, and the second model is used to determine the fourth dialogue sentence in the second auxiliary information; this allows the dispatcher to provide complete and comprehensive information collection and professional rescue guidance to the caller based on the prompts of the auxiliary information without professional vocational training.
[0121] In some embodiments, dividing the historical dialogue sentences into first historical dialogue sentences corresponding to the first model and second historical dialogue sentences corresponding to the second model includes:
[0122] Using the first label and the second label, respectively determining the first historical dialogue sentence and the second historical dialogue sentence;
[0123] The step of using the first historical dialogue sentence to train the first model and using the second historical dialogue sentence to train the second model includes:
[0124] The first historical dialogue sentence identified by the first label forms a first prompt learning template, and the first prompt learning template is used to train the first model;
[0125] The second historical dialogue sentence identified by the second label constitutes a second prompt learning template, and the second prompt learning template is used to train the second model.
[0126] In a possible implementation, a portion of the historical conversation sentences is selected for labeling, a first label and a second label are determined, the first historical conversation is determined by the first label, and the second historical conversation is determined by the second label.
[0127] Exemplarily, the first label may be an information collection stage label, used to determine a first historical dialogue sentence in the information collection stage, and the second label may be a rescue guidance stage label, used to determine a second historical dialogue sentence in the rescue guidance stage.
[0128] Furthermore, the third label and the fourth label can be determined through annotation processing. The third label can be the dispatcher object label, and the fourth label can be the caller object label. The third label can be used to determine the sentences corresponding to the dispatcher in the first historical dialogue sentence and the second historical dialogue sentence, and the fourth label can be used to determine the sentences corresponding to the caller in the first historical dialogue sentence and the second historical dialogue sentence.
[0129] Here, the first tag may be represented by "collect", the second tag may be represented by "guide", the third tag may be represented by "dispatcher", and the fourth tag may be represented by "caller".
[0130] In a possible implementation, the historical dialogue sentences may be labeled by manual labeling or machine learning labeling.
[0131] Exemplarily, the method of labeling through machine learning can be to first manually label some historical conversation sentences, train the machine learning model with the labeled historical conversation sentences, and determine the labeling model; label the remaining unlabeled historical conversation sentences through the labeling model, thereby completing the labeling process of all historical conversation sentences.
[0132] The annotated historical dialogue sentences and the corresponding annotations are stored in a storage unit.
[0133] Here, the storage method may include but is not limited to: plain text storage and feature storage.
[0134] Exemplarily, plain text storage may refer to directly storing historical conversation sentences and corresponding annotations; feature storage may refer to converting historical conversation sentences and corresponding annotations through a preset model, determining feature vectors and storing them; through feature storage, the first model and the second model can read data more easily during training, thereby improving the training speed of the model.
[0135] In a possible implementation, if the first method is used to train the second model, it is necessary to determine the plan type corresponding to the historical dialogue sentence.
[0136] Exemplarily, the semantic information of the historical dialogue sentences after the plan type is determined may be as shown in Table 1:
[0137] Dialogue Characters Conversation content Dialogue Stage Tags Conversation object label Plan Type Label Dispatcher Sentence 1 collect dispatcher Protocol Caller: Sentence 2 collect caller PX Dispatcher: Sentence 3 collect dispatcher PX Caller: Sentence 4 collect caller PX Dispatcher: Sentence 5 collect dispatcher PX Caller: Sentence 6 collect caller PX Dispatcher: Sentence 7 guide dispatcher PX Dispatcher: Sentence 8 guide dispatcher PX Caller: Sentence 9 guide caller PX Dispatcher: Sentence 10 guide dispatcher PX Dispatcher: …… …… …… …… Caller: …… …… …… ……
[0138] Table 1
[0139] "Protocol" and "PX" in Table 1 are plan type labels, and the plan type to which the corresponding statement belongs can be determined through the plan type label.
[0140] In a possible implementation, if the second model is trained using the second method, it is not necessary to mark the plan type when marking the historical dialogue sentences.
[0141] For example, the semantic information of the annotated historical dialogue sentences may be as shown in Table 2:
[0142] Dialogue Characters Conversation content Dialogue Stage Tags Dialogue Character Tags Dispatcher Sentence 1 collect dispatcher Caller: Sentence 2 collect caller Dispatcher: Sentence 3 collect dispatcher Caller: Sentence 4 collect caller Dispatcher: Sentence 5 collect dispatcher Caller: Sentence 6 collect caller Dispatcher: Sentence 7 guide dispatcher Dispatcher: Sentence 8 guide dispatcher Caller: Sentence 9 guide caller Dispatcher: Sentence 10 guide dispatcher Dispatcher: …… …… …… Caller: …… …… ……
[0143] Table 2
[0144] In a possible implementation, after the historical dialogue sentences are annotated, the dispatcher's sentence content in the information collection phase can be stored in the first database, and the dispatcher's sentence content in the rescue guidance phase can be stored in the second database.
[0145] Here, the first library may refer to a question library, and the second library may refer to a guidance library.
[0146] For example, sentences 1 and 3 in Table 1 may be stored in the question library, and sentences 7 and 8 in Table 1 may be stored in the guidance library.
[0147] In one possible implementation, when the first method is used to train the second model, when the sentence content is stored in the question library and the guidance library, the plan type label corresponding to the sentence needs to be stored in the corresponding question library or guidance library to distinguish the plan type described in the sentence.
[0148] In one possible implementation, each first historical dialogue sentence in the question library constitutes a corresponding first prompt learning template, and all first prompt learning templates are used as training data for the first model; each second historical dialogue sentence in the guidance library constitutes a corresponding second prompt learning template, and all second prompt learning templates are used as training data for the second model.
[0149] Through the above method, the historical dialogue sentences are annotated and processed, and the sentences corresponding to the dispatcher and the caller in the first dialogue sentence and the second historical dialogue sentence are determined according to the stage label and the object label, and the first dialogue sentence is stored in the question library, and the second dialogue sentence is stored in the guidance library, and the first prompt learning template and the second prompt learning template are further constructed. The corresponding models can be trained according to different historical dialogue sentences, thereby improving the accuracy of the first model in the information collection stage and the second model in the rescue guidance stage, and further improving the efficiency of the training of the first model and the second model.
[0150] In some embodiments, the method further comprises:
[0151] Using a first model, determining a predicted correspondence between an Nth first candidate sentence in the first historical dialogue sentence and a first designated sentence in the first historical dialogue sentence; wherein the first designated sentence includes one or more sentences;
[0152] updating the first model according to the actual correspondence between the Nth first candidate sentence and the first designated sentence in the first historical dialogue sentence and the predicted correspondence;
[0153] Using a second model, determining a predicted correspondence between an Mth second candidate sentence in the second historical dialogue sentence and a second designated sentence in the second historical dialogue sentence; wherein the second designated sentence includes one or more sentences;
[0154] The second model is updated according to the actual correspondence between the Mth second candidate sentence and the second designated sentence in the second historical dialogue sentence and the predicted correspondence.
[0155] In a possible implementation, the first designated sentence may refer to the first N-1 sentences of the conversation between the dispatcher and the caller in the first historical conversation sentence.
[0156] Specifically, when training the first model, the question library is traversed, and the predicted correspondence between each first candidate sentence in all first candidate sentences and the first N-1 sentences in the first historical dialogue sentence is determined through the first model, and all first candidate sentences predicted to be able to be used as the Nth sentence of the first historical dialogue are determined. The relationship between the Nth sentence of dialogue in the first historical dialogue sentence and the first N-1 sentences of dialogue is used as the actual correspondence, and the loss function of the first model is determined, and the parameters of the loss function are updated, thereby updating the first model, and the loss function with the minimum value is determined as the first model.
[0157] Exemplarily, when training the first model, the first and second sentences in the first historical dialogue sentences are concatenated as the input sentence of the first model to predict the third sentence, and the predicted probability of each sentence in all first candidate sentences as the third sentence is determined. A loss function is constructed based on the predicted probability and the true probability of each first candidate sentence, and the loss function is updated until the loss function is minimized, and then the first model is determined.
[0158] Through the above method, all the statements of the dispatcher in the information collection stage in the first historical dialogue sentences are traversed, and the first model is trained according to the actual correspondence between the first candidate sentences and the first designated sentences, which can improve the accuracy and professionalism of the first model in predicting the second dialogue sentences.
[0159] In a possible implementation, the second designated sentence may refer to the first M-1 sentences of the conversation between the dispatcher and the caller in the second historical conversation sentence.
[0160] Specifically, when training the second model, the guidance library is traversed to determine the predicted correspondence between each second candidate sentence in all second candidate sentences and the first M-1 sentences in the second historical dialogue sentences, and the relationship between the Mth sentence of dialogue in the second historical dialogue sentences and the first M-1 sentences of dialogue is taken as the actual correspondence, and the loss function of the second model is determined, and the parameters of the loss function are updated to update the second model, and the loss function with the minimum value is determined as the second model.
[0161] Exemplarily, when training the second model, sentences 1-6 in the first historical dialogue sentences are concatenated as input sentences of the second model to predict the 7th sentence, the predicted probability of each sentence of all second candidate sentences as the 7th sentence is determined, and a loss function is constructed based on the predicted probability and true probability of each second candidate sentence. The loss function is updated until the loss function is minimized, and then the second model is determined.
[0162] In one possible implementation, when training the first model, each of the first candidate sentences and the first designated sentence in all the first candidate sentences can be combined into a preset template according to the prompt learning method; for example, the first preset template can be in the form of "(candidate)[mask] as a follow-up question of (input)".
[0163] Here, input may refer to an input sentence, i.e., an input sentence composed of the concatenation of the first N-1 first designated dialogue lines; candidate may refer to each first candidate sentence in the question library; [mask] may refer to a prediction result output by the first model, and the standard content of [mask] may include "suitable" or "incapable", and the prediction correspondence between the first candidate sentence and the first designated sentence is determined according to the prediction result corresponding to [mask].
[0164] Exemplarily, when training the first model, the first and second sentences in the first historical dialogue sentence are concatenated as the input in the first preset template, the third and fifth sentences of the first candidate sentence are respectively used as candidates of the first preset template, and the third and fifth sentences are determined by the first model as the prediction results [mask] of the first and second follow-up questions respectively. The loss function of the first model is determined based on the predicted results and the actual results, and the loss function is updated until the loss function is minimized, and then the first model is determined.
[0165] In one possible implementation, when training the second model, each second candidate sentence among all the second candidate sentences and the second designated sentence can be combined into the form of a second preset template; for example, the form of the second preset template can be "(candidate) [mask] as (input) the next guiding measure".
[0166] Here, input may refer to an input sentence, i.e., an input sentence composed of the concatenation of the second designated dialogue lines of the first M-1 sentences; candidate may refer to each second candidate sentence in the guidance library; [mask] may refer to a prediction result output by the second model, and the standard content of [mask] may include "suitable" or "incapable", and the prediction correspondence between the second candidate sentence and the second designated sentence is determined according to the prediction result corresponding to [mask].
[0167] Exemplarily, when training the second model, sentences 1-6 in the second historical dialogue sentences are concatenated as input in the second preset template, sentences 7, 9, and 11 of the first candidate sentence are respectively used as candidates for the second preset template, and sentences 7, 9, and 11 are determined by the second model as prediction results [mask] for subsequent questions 1-6, respectively. The loss function of the second model is determined based on the predicted results and the actual results, and the loss function is updated until the loss function is minimized, and then the second model is determined.
[0168] Through the above method, all the statements of the dispatcher in the rescue guidance stage in the second historical dialogue sentences are traversed, and the second model is trained according to the actual correspondence between the second candidate sentences and the second designated sentences, which can improve the accuracy and professionalism of the second model in predicting the fourth dialogue sentence.
[0169] In some embodiments, the adopting the first model to use at least one of the plurality of first candidate sentences as the second dialogue sentence in the first auxiliary information includes:
[0170] Using the first model, determining a probability that the first dialogue sentence has a predetermined corresponding relationship with each of the first candidate sentences;
[0171] At least one of the first candidate sentences whose probability satisfies a preset condition is determined as the second dialogue sentence.
[0172] In a possible implementation, having a predetermined corresponding relationship may mean that the first candidate sentence can be used as the next sentence of the first dialogue sentence (ie, the second dialogue sentence).
[0173] Specifically, when using the first model to determine the second dialogue sentence in the first auxiliary information, the first N-1 first dialogue sentences between the dispatcher and the caller are input into the first model, the probability of each first candidate sentence being the second dialogue sentence is determined, and the first candidate sentence whose probability meets the preset conditions is determined as the second dialogue sentence in the first auxiliary information, which is used to assist the dispatcher in determining the question that should be asked in the Nth sentence.
[0174] Exemplarily, sentence 1 and sentence 2 in Table 1 are concatenated as the input sentence of the first model. The first model traverses all first candidate sentences in the question library according to the input sentence input, and takes each first candidate sentence as a candidate in the first preset template (i.e., "(candidate)[mask] as a subsequent question of (input)"). The first model determines the prediction probability corresponding to [mask] of each candidate as a subsequent question of input; if the prediction probability of the first candidate sentence as a candidate is greater than the preset probability, the prediction result of [mask] is "suitable"; if the prediction probability of the first candidate sentence as a candidate is less than the preset probability, the prediction result of [mask] is "unable".
[0175] For example, a new sentence formed by embedding all first candidate sentences in the question library into the first preset template may be:
[0176] (Sentence 3) [is suitable] as a follow-up question to (Sentence 1, Sentence 2);
[0177] (Sentence 5) [cannot] serve as a follow-up question to (Sentence 1, Sentence 2);
[0178] (Sentence 7) [cannot] serve as a follow-up question to (Sentence 1, Sentence 2);
[0179] …
[0180] When the prediction result corresponding to a first candidate sentence in the question library is "suitable", the sentence is embedded in the first preset template to form a new sentence as the first auxiliary information and displayed to the dispatcher; when the prediction result corresponding to a first candidate sentence in the question library is "cannot", the sentence is not used as the second dialogue sentence in the first auxiliary information.
[0181] In a possible implementation, the first auxiliary information may include, but is not limited to, "Are you feeling unwell?" which may be used as a current follow-up question.
[0182] Through the above method, the first model is used to determine whether each first candidate sentence in the first historical dialogue sentence can be used as the next question sentence of the current first dialogue sentence, which can improve the comprehensiveness and professionalism of the dispatcher in information collection and reduce the dependence on the dispatcher's own professional qualities.
[0183] In some embodiments, the adopting the second model to use at least one of the plurality of second candidate sentences as the fourth dialogue sentence in the second auxiliary information includes:
[0184] Using the second model, determining a probability that the third dialogue sentence has a predetermined corresponding relationship with each of the second candidate sentences;
[0185] At least one of the second candidate sentences whose probability satisfies a preset condition is determined as the fourth dialogue sentence.
[0186] In a possible implementation, having a predetermined corresponding relationship may mean that the second candidate sentence can be used as the next sentence of the third dialogue sentence (ie, the fourth dialogue sentence).
[0187] Specifically, when using the second model to determine the fourth dialogue sentence in the second auxiliary information, the first M-1 second dialogue sentences between the dispatcher and the caller are input into the second model, the probability of each second candidate sentence being the fourth dialogue sentence is determined, and the second candidate sentence whose probability meets the preset conditions is determined as the fourth dialogue sentence in the second auxiliary information, which is used to assist the dispatcher in determining the question that should be asked in the Mth sentence.
[0188] Exemplarily, when predicting sentence 7 in Table 1, sentences 1-6 in Table 1 can be concatenated as the input sentence input of the second model, and each second candidate sentence can be used as a candidate in the second preset template (i.e., "(candidate)[mask] as the next guiding measure for (input)"). The second model is used to determine the prediction probability corresponding to [mask] of the subsequent guiding sentence for each candidate as input; if the prediction probability of the second candidate sentence as a candidate is greater than the preset probability, the prediction result of [mask] is "suitable"; if the prediction probability of the first candidate sentence as a candidate is less than the preset probability, the prediction result of [mask] is "unable".
[0189] For example, a new sentence formed by embedding each second candidate sentence in the guidance library into the second preset template may be:
[0190] (Sentence 7) [Suitable] as the next step in guiding (Sentences 1-6);
[0191] (Sentence 8) [cannot] serve as the next guiding measure for (Sentences 1-6);
[0192] (Sentence 10) [cannot] serve as the next guiding measure for (Sentences 1-6);
[0193] …
[0194] When the prediction result corresponding to a second candidate sentence in the guidance library is "suitable", the sentence is embedded in the second preset template to form a new sentence as the second auxiliary information and displayed to the dispatcher; when the prediction result corresponding to a second candidate sentence in the guidance library is "cannot", the sentence is not used as the fourth dialogue sentence in the second auxiliary information.
[0195] In a possible implementation, the second auxiliary information may be in the form of, but not limited to: "Please clean the wound" may serve as the next step guiding measure for the current sentence.
[0196] Through the above method, the second model is used to determine whether each second candidate sentence in the second historical dialogue sentence can be used as the next sentence guidance of the current third dialogue sentence, which can improve the professionalism of the dispatcher when providing rescue guidance and avoid affecting the effect of rescue guidance due to the dispatcher's own lack of professionalism.
[0197] In a possible implementation, the structures of the first model and the second model can be as follows: Figure 2 As shown;
[0198] Taking the use of the first model to determine the second dialogue sentence as an example, x is the original input sentence, m is the length of the original sentence, x' is the new sentence determined after embedding the first preset template, n is the length of the new sentence, y is the probability matrix output by the new sentence after passing through the encoder encoder and the decoder decoder, p is the probability matrix of the [mask] position in the prompt learning template, l is the length of the number of words contained in the [mask] position, and y' is the Chinese character with the highest probability of appearing in the probability matrix of the [mask] position, that is, the text content predicted by the first model.
[0199] Here, the first preset template may be in the form of “(candidate)[mask] as a follow-up question of (input)”.
[0200] Among them, input can refer to the input sentence, that is, the input sentence formed by splicing the previous n - 1 conversations; candidate can refer to the historical questions of the dispatcher in the question bank; [mask] can refer to the prediction result output by the first model, and the standard content answer of [mask] can include "suitable" or "not".
[0201] Exemplarily, the conversation between the dispatcher and the caller can be spliced. For example, if the dispatcher asks "What is your age?", and the caller answers "30 years old", then "What is your age?" and "30 years old" can be spliced to form an input sentence; if the dispatcher asks "What is your age?", and the caller does not answer, then "What is your age?" and the empty semantic information NULL are spliced to form an input sentence.
[0202] In a possible implementation, the encoder - decoder framework can be a common architecture for processing sequence - to - sequence tasks; the encoder can be used to receive the input sentence sequence and convert it into a fixed - form encoding state; the decoder can be used to predict and generate the next token based on the encoding state output by the encoder and the partially generated sequence; the encoder and the decoder can include, but are not limited to, the recurrent neural network (RNN, Recurrent Neural Network) and the long short - term memory network (LSTM, Long short - term memory).
[0203] Exemplarily, the encoder converts the sentence "(Sentence 3)[mask] as the subsequent question of (Sentence 1, Sentence 2)" embedded in the first preset template into a feature sequence, and the decoder predicts and generates the text content at the [mask] position according to other positions in the feature sequence, and outputs the text content at the [mask] position and the corresponding probability matrix.
[0204] For example, taking the [mask] position with a character size of 2 as an example, the probability matrix output by the decoder at the [mask] position can be shown in Table 3:
[0205] The output content of the first character position of mask mask output content of the second character position -0.6 At -0.7 Ke-0.1 -0.2 Shell - 0.3 Instrument -0.1
[0206] Table 3
[0207] In the probability matrix of Table 3, the Chinese character "can" with the highest occurrence probability is used as the text content predicted by the first model.
[0208] In one possible implementation, when the first model and the second model output the prediction results of [mask], the output prediction results may not belong to the preset standard content (i.e., "suitable" or "incapable"). A mapping table of the prediction results of the first model and the second model can be set to perform result conversion on the actual output prediction results.
[0209] For example, the mapping table may be in the form of a table as shown in Table 4:
[0210] Model output content Result judgment Suitable Suitable Can Suitable should Suitable cannot cannot don't want cannot (Other content) cannot
[0211] Table 4
[0212] When the prediction results output by the first model and the second model are words expressing positive judgments such as "suitable", "can" or "should", they are uniformly mapped to the output "suitable". When the prediction results are words expressing negative judgments such as "cannot", "don't" or "cannot", they are uniformly mapped to "cannot".
[0213] In one possible implementation, it is determined whether the dispatcher adopts the first candidate sentence in the first auxiliary information as the second dialogue sentence, and it is determined whether the dispatcher adopts the second candidate sentence in the second auxiliary information as the fourth dialogue sentence.
[0214] Exemplarily, if the dispatcher adopts the second auxiliary information, the second candidate sentence in the second auxiliary information is used as the dispatcher's rescue guidance for the nth sentence; if the dispatcher does not adopt the second auxiliary information, the dispatcher selects a sentence as the rescue guidance for the nth sentence.
[0215] In one possible implementation, when the first auxiliary information is "(sentence 7) [is suitable] as a follow-up question to (sentences 1-6)", it can be determined whether the dispatcher adopts sentence 7 as the second dialogue.
[0216] For example, if the dispatcher adopts sentence 7 as the subsequent guidance sentence for sentences 1 to 6, sentences 1 to 8 are spliced into a new input sentence for the second model, and the second auxiliary information corresponding to the dispatcher's subsequent guidance measures for sentence 9 is predicted through the second model; if the dispatcher does not adopt sentence 7 as the subsequent guidance sentence for sentences 1 to 6, but instead gives guidance to the caller as a subsequent guidance measure, the guidance measures actually spoken by the dispatcher and the caller's answer are spliced into a new input sentence for the second model, and the second auxiliary information corresponding to the dispatcher's subsequent guidance measures for sentence 9 is predicted through the second model.
[0217] Here, the dispatcher can decide whether to adopt the first auxiliary information and the second auxiliary information, so that he can flexibly adjust the questions in the information collection stage and the rescue guidance in the rescue guidance stage according to the actual situation, thereby increasing the applicability of the first model and the second model.
[0218] Through the above method, the second model is used to determine whether each second candidate sentence in the second historical dialogue sentence can be used as the next guidance sentence of the current second dialogue sentence, which can improve the professionalism of the dispatcher in providing rescue guidance and reduce the dependence on the dispatcher's own professional qualities.
[0219] In some embodiments, the adopting the second model to determine the second auxiliary information includes:
[0220] When it is determined that the preset condition is met, the second model is used to determine the second auxiliary information;
[0221] The preset conditions include at least one of the following:
[0222] The number of the first dialogue sentences is greater than or equal to a preset number;
[0223] The first auxiliary information is a preset ending sentence;
[0224] The prediction accuracy probability value corresponding to the first auxiliary information is less than a preset probability threshold.
[0225] In a possible implementation, the preset number may refer to a preset number of questions, and the number of first conversations being greater than or equal to the preset number may indicate that the dispatcher has asked enough questions in the information collection phase, and thus may enter the rescue guidance phase.
[0226] The preset ending statement may refer to the final question asked by the dispatcher preset in the information collection phase; for example, the preset ending statement may be the dispatcher's question: "Do you have any other information you need to provide?" After obtaining a definite answer from the caller, the information collection phase may be followed by the rescue guidance phase.
[0227] The predicted accurate probability value corresponding to the first auxiliary information may refer to the predicted probability corresponding to the [mask] of the sentence content in the question library determined by the first model. When the predicted probability of each sentence is less than the preset probability threshold, it may indicate that the first model can no longer provide the first auxiliary information in the information collection stage, and can enter the rescue guidance stage from the information collection stage.
[0228] Here, the preset probability threshold can be specifically set according to actual needs and is not specifically limited here.
[0229] Specifically, when the preset conditions are met in the information collection phase, it indicates that the information collection phase has ended, and the first auxiliary information can be determined using the first model in the information collection phase, and the second auxiliary information can be determined using the second model in the rescue guidance phase.
[0230] In a possible implementation, the method of determining whether the dispatcher adopts the first auxiliary information and the second auxiliary information may include but is not limited to:
[0231] Determine based on clickable buttons;
[0232] Determined by voice-to-text conversion method;
[0233] Determined based on text familiarity.
[0234] Exemplarily, determining whether to adopt based on a clickable button may refer to setting a clickable button in the emergency dispatch system, so that the dispatcher manually clicks the button to inform the system whether the first auxiliary information and / or the second auxiliary information has been adopted; determining based on the speech-to-text method may refer to performing speech-to-text processing on the sentence actually spoken by the dispatcher, and comparing the semantic information after the text conversion with the sentence information in the first auxiliary information and / or the second auxiliary information to determine whether they are consistent; determining based on text similarity may refer to setting a text similarity threshold, and when the sentence actually spoken by the dispatcher is subjected to speech-to-text processing, it is compared with the sentence information in the first auxiliary information and / or the second auxiliary information. If the similarity is greater than the text similarity threshold, it is considered that the dispatcher has adopted the first auxiliary information and / or the second auxiliary information.
[0235] In a possible implementation, when the second preset condition is met, the use of the second model to determine the second auxiliary information ends.
[0236] The second preset condition includes at least one of the following:
[0237] The number of the first dialogue sentences is greater than or equal to a preset number;
[0238] The second auxiliary information is a preset ending sentence;
[0239] The prediction accuracy probability value corresponding to the second auxiliary information is less than a preset probability threshold.
[0240] Specifically, when the second preset condition is met, the use of the second model to determine the second auxiliary information in the rescue guidance stage is terminated, that is, the dispatcher ends the conversation with the caller.
[0241] In one possible implementation, the preset number may refer to a preset number of guidance measures, and the number of first conversations being greater than or equal to the preset number may indicate that the dispatcher has provided sufficient guidance measures during the rescue guidance phase and can end the call with the caller.
[0242] The preset ending statement may refer to the final guidance measures of the dispatcher preset in the rescue guidance stage; for example, the preset ending statement may be the dispatcher explaining to the caller: "Please stay calm and wait for the arrival of our ambulance where you are". After receiving a definite answer from the caller, the conversation with the caller may be ended.
[0243] The predicted accurate probability value corresponding to the second auxiliary information may refer to the predicted probability corresponding to the [mask] of the sentence content in the guidance library determined by the second model. When the predicted probability of each sentence is less than the preset probability threshold, it may indicate that the second model can no longer provide the second auxiliary information in the rescue guidance stage, and the conversation with the caller may be ended.
[0244] Here, the preset probability threshold can be specifically set according to actual needs and is not specifically limited here.
[0245] Through the above method, when the preset conditions are met, the information collection stage is switched to the rescue guidance stage. When the second preset condition is met, the call between the dispatcher and the caller is ended. The stage switching and the call end are performed only when the conditions are met, thereby ensuring that the dispatcher collects information and provides rescue guidance as completely and comprehensively as possible in two different stages, thereby improving the dispatcher's guidance effect.
[0246] In one possible implementation, after the information collection stage and the rescue guidance stage are completed, the first conversation between the dispatcher and the caller can be stored in the repository as a historical conversation, so that the quality of the historical conversations can be regularly traced back and abnormal data in the historical conversations can be removed. The first model and the second model can also be further improved, thereby further improving the auxiliary accuracy of the first model and the second model in emergency dispatch work.
[0247] The method provided by the embodiment of the present invention adopts a first model to determine first auxiliary information according to a first dialogue statement associated with a target event between a first object and a second object; wherein the first auxiliary information is used to determine a second dialogue statement of the first object; the second dialogue statement is used by the first object to determine information of the second object; according to a third dialogue statement associated with the target event between the first object and the second object, a second model is used to determine second auxiliary information; wherein the second auxiliary information is used to determine a fourth dialogue statement of the first object; the fourth dialogue statement is used to provide the first object with guidance information on how the second object responds to the target event; there is no need to classify emergency plans for emergency situations, thereby avoiding situations such as overlapping emergency plan contents and insufficient professional level of dispatchers, etc.; the dispatcher can also be gradually assisted in collecting the injured situation and giving appropriate rescue guidance suggestions, which is more flexible and intelligent compared with the fixed problem process and guidance steps of the prior art; training can also be carried out based on a large number of real emergency call records, and authoritative and standard medical knowledge can be transformed into a dialogue record format and incorporated into the emergency call records for model learning, so that the model can learn more experience and professional knowledge and reduce dependence on the dispatcher's professional level and experience accumulation.
[0248] Figure 3 A flowchart of another conversation assistance method provided by an embodiment of the present invention; Figure 3 As shown, the method includes:
[0249] Step 301, 120 emergency call record.
[0250] Here, the 120 emergency call record (equivalent to the historical dialogue sentence) is determined.
[0251] Step 302: Convert speech to text.
[0252] Here, the 120 emergency call record is processed by voice-to-text conversion (equivalent to determining the historical dialogue sentences).
[0253] Step 303: Data cleaning.
[0254] Here, data cleaning may refer to removing data from the 120 emergency call records that cannot be used as model training samples and retaining the complete conversation information between the dispatcher and the caller.
[0255] Step 304: Data storage.
[0256] Here, the 120 emergency call records are annotated to determine the sentences corresponding to the dispatcher and the caller in the information collection stage and the rescue guidance stage respectively, and all the sentences are stored in a repository in a standard form.
[0257] Step 305: Question and answer record (equivalent to the first historical dialogue sentence).
[0258] Here, the statements of the dispatcher in the information collection stage in the 120 emergency call record after the marking process are determined and stored in the question library as question and answer records.
[0259] Step 306: preprocessing.
[0260] Here, the question and answer records are preprocessed so that they can be used as training data for the first model.
[0261] Step 307: Model training (equivalent to training the model, determining the first model).
[0262] Here, the question and answer records are used as training data to train the model, and the parameters corresponding to the first model are determined when the loss function corresponding to the model is minimized.
[0263] Step 308: guide recording (equivalent to the second historical dialogue statement).
[0264] Here, the statements of the dispatcher in the rescue guidance stage in the 120 emergency call record after the marking process are determined and stored in the guidance library as guidance records.
[0265] Step 309: preprocessing.
[0266] Here, the guidance records are preprocessed so that they can be used as training data for the second model.
[0267] Step 310: Model training (equivalent to training the model and determining the second model).
[0268] Here, the guidance records are used as training data to train the model, and the parameters corresponding to the second model are determined when the loss function corresponding to the model is minimized.
[0269] Steps 311 and 120 call for help (equivalent to determining the first dialogue statement).
[0270] Here, the 120 rescue call main complaint between the caller and the dispatcher is determined (equivalent to determining the first dialogue sentence between the second object and the first object associated with the target event).
[0271] Step 312: Convert speech to text.
[0272] Here, the 120 emergency call complaint is voice-to-text processed (equivalent to determining the first dialogue sentence).
[0273] Step 313: Question-answer auxiliary model (equivalent to the first model).
[0274] Here, according to the model training in step 307, a question-answering auxiliary model is determined, and the first auxiliary information is provided to the dispatcher in the information collection stage according to the question-answering auxiliary model.
[0275] Step 314: guide the auxiliary model (equivalent to the second model).
[0276] Here, according to the model training in step 310, a guidance assistance model is determined, and second auxiliary information is provided to the dispatcher in the rescue guidance stage according to the guidance assistance model.
[0277] Step 315: Record the call for help.
[0278] Here, it is determined whether the dispatcher adopts the first auxiliary information and the second auxiliary information as actual dialogue information, and the question-and-answer dialogue between the dispatcher and the caller after the information collection phase and the rescue guidance phase is stored as a call record in the 120 call record of step 301.
[0279] The following provides multiple specific examples in combination with any of the above embodiments:
[0280] 1.1 Overall process
[0281] The present invention proposes an intelligent first aid assistance solution based on deep learning (i.e., a dialogue assistance method), which is mainly divided into a speech-to-text module, a data storage module, a data cleaning and annotation module, a preprocessing module, a model training module, a question-answering assistance module, a guidance assistance module, and the like. The overall process steps of the entire intelligent first aid assistance solution are as follows: Figure 3 As shown, the present invention is based on the 120 historical call records (i.e., historical dialogue sentences), uses AI technology to train a question-answering auxiliary model (i.e., the first model) and a guidance auxiliary model (i.e., the second model), recommends and selects appropriate sentences from the historical call records, and provides suggestions for dispatchers in the information collection stage and the guidance stage (i.e., providing the first auxiliary information and the second auxiliary information), thereby improving the situation where the dispatchers' experience varies greatly and improving the stability of the dispatch and guidance quality.
[0282] Step 1: First, select relatively complete voice records that can be included in the training data from the historically stored 120 dispatch question and answer records (i.e. historical conversation sentences), and convert the voice into a text version of the conversation record (i.e. determine the historical conversation sentences) through the speech-to-text module. During the conversion process, the conversation record can be converted into the following standard format based on the audio signal source, voiceprint data, sound frequency and other characteristics:
[0283] Dispatcher: Sentence 1;
[0284] The one who calls for help: Sentence 2;
[0285] Dispatcher: Sentence 3;
[0286] The one who calls for help: Sentence 4;
[0287] Dispatcher:……;
[0288] The person calling for help:…….
[0289] Step 2: Take part of the conversation records for labeling, mainly to distinguish the first stage of the dispatcher's connection process - information collection (i.e., information collection stage) and the second stage - rescue guidance (rescue guidance stage). Choose one of the two labels, label 1 and label 2, and label each sentence to distinguish between information collection and rescue guidance. For example, label each sentence with "collect" or "guide". The sentences expressed by the dispatcher under the two labels are respectively classified into the question library (i.e., the first library) and the guidance library (i.e., the second library) for storage. The machine learning model is trained with the labeled data. After the training is completed, the remaining conversation records are inferred to complete the data labeling in all records. Data can be stored in plain text or feature storage. Feature storage can be processed by the pre-trained language model and converted into feature vectors for storage, which is convenient for the model to use (equivalent to selecting part of the historical conversation sentences for labeling, and using different labels to distinguish the information collection stage and rescue guidance stage in the historical conversation, as well as the dispatcher and the caller in the historical conversation).
[0290] Step 3: The data divided into stages in step 2 are summarized into two parts: question-answering records (i.e., the first historical dialogue sentences) and guidance records (i.e., the second historical dialogue sentences). The question-answering records and guidance records are preprocessed separately, and then the model is trained by combining deep learning and prompt learning to obtain the question-answering auxiliary model (i.e., the first model) and the guidance auxiliary model (i.e., the second model).
[0291] The guidance assistance model can be used in two ways: one is to first classify and judge the plans based on the information collected in the information collection stage, determine whether the current situation is more suitable for one or more plans, train the respective models under the corresponding plan types, and give guidance suggestions in the reasoning stage; the second is to include all historical guidance records in the training scope of the guidance assistance model without distinguishing the plan types, and train a guidance assistance model with wider coverage (which is equivalent to the training method of the second model, which can include but is not limited to: the first method and the second method).
[0292] Step 4: When a new 120 emergency call is input, speech-to-text conversion runs in real time. During the patient information collection stage, the caller's complaint is converted into text (equivalent to determining the first dialogue sentence) through speech-to-text conversion and input into the question-answering auxiliary model (i.e., the first model). The question-answering auxiliary model selects appropriate content from the question library as the next question suggestion (i.e., the first auxiliary information), and the dispatcher confirms whether to adopt it. During the rescue guidance stage, the guidance auxiliary model (i.e., the second model) selects appropriate content from the guidance library as the next guidance suggestion, and the dispatcher confirms whether to adopt it. After the rescue process is completed, a new rescue record is formed based on the actual expression of the dispatcher, which can be used for subsequent model optimization training.
[0293] 1.2 Training Process
[0294] 1.2.1. Historical data processing and annotation
[0295] For the historical 120 emergency call record data, since the current 120 emergency call data is mainly stored in audio format, it is first necessary to convert the audio data into text conversation records through voice-to-text conversion. The conversation records can be distinguished by roles through features such as audio signal source, voiceprint data or sound frequency, which is convenient for the next step of annotation (equivalent to determining the semantic information in a standard format). Considering the possible situation in actual situations where the caller does not understand or the signal is poor, if the caller does not speak during the interval between the dispatcher's two speeches, the text of the caller can be left blank, but it still occupies the position of a sentence.
[0296] Dispatcher: Sentence 1;
[0297] The one who calls for help: Sentence 2;
[0298] Dispatcher: Sentence 3;
[0299] The one who calls for help: Sentence 4;
[0300] Dispatcher:……;
[0301] The person calling for help:…….
[0302] Each sentence in the text conversation record is then labeled (annotated). The labels are mainly used to distinguish: (1) the caller and the dispatcher, for example, the labels can be set to "caller" (first label) and "dispatcher" (second label); (2) whether the current sentence is in the information collection stage or the rescue guidance stage, for example, the labels can be set to "collect" (third label) and "guide" (fourth label).
[0303] Labeling can be done manually or by machine learning. If machine learning is used for labeling, some text conversation records can be manually labeled first, and then labeled by training the machine learning model. The trained model is used to complete the labeling of the remaining text conversation records. The format of the labeled text conversation records is shown in Table 1.
[0304] When the guidance auxiliary model is trained by plan, each distress call record needs to be additionally labeled with a plan category, such as PX shown in Table 1.
[0305] 1.2.2. Construction of question bank and guidance bank
[0306] According to the annotated historical distress call records (i.e., historical dialogue sentences) in 1.2.1, the contents expressed by the dispatcher in the information collection phase are classified into the question library and saved in the question library, such as sentences 1 and 3 marked as collect and dispatcher in Table 1; the contents expressed by the dispatcher in the rescue guidance phase are classified into the guidance library and saved in the guidance library, such as sentences 5 and 7 marked as guide and dispatcher in Table 1.
[0307] When the guidance assistance model is trained by plan, the plan category label protocol needs to be stored when building the question library and guidance library to distinguish which plan it belongs to.
[0308] 1.2.3 Question-answering auxiliary model (i.e. first model) training
[0309] Using the text conversation records that have been divided into the information collection stage (i.e., the first historical conversation sentence), a deep learning model is constructed for training, and the previous n-1 questions and answers are used to predict the questions that the dispatcher should ask in the current nth step. Since the first sentence of the 120 operator after answering the call in the actual scenario is generally a fixed expression, taking the example in Table 2 as an example, first concatenate sentences 1 and 2 as input sentences, and then generate new sentences based on the prompt learning template. The prompt template can select the template with the best effect by trying different expressions. For example, the template can be designed as:
[0310] (candidate)[mask] as a follow-up question to (input)
[0311] Among them, input represents the input sentence, candidate represents the dispatcher's historical question sentence in the question library (i.e., the first historical dialogue sentence), and [mask] represents the content predicted by the model. The length and specific content can be set manually. The length of [mask] can be set to l Chinese characters, and the standard answer is designed to be "suitable" or "unable".
[0312] For example, input the input sentence of integrated sentences 1 and 2 for training, traverse the question library, take the sentences in the question library as candidates one by one, and let the model predict the mask. If the candidate is sentence 3, the standard answer of the mask should be "suitable". If the candidate sentence is other sentences in the question library, the standard answer of the mask is "no". Embedding into the template can form a new sentence:
[0313] (Sentence 3) [suitable] as a follow-up question to (Sentence 1, Sentence 2)
[0314] (Sentence 5) [cannot] be a follow-up question to (Sentence 1, Sentence 2)
[0315] (Sentence 7) [cannot] be a follow-up question to (Sentence 1, Sentence 2)
[0316] …
[0317] According to this rule, each sentence in the question bank is traversed to construct the training corpus (i.e., training data) of the current sentence 3. Similarly, when the caller answers sentence 4, sentences 1-4 are integrated as input sentences, and a suitable sentence is selected from the question bank for inquiry. At this time, if the candidate sentence is sentence 5, the standard answer of the mask is "suitable", and if the candidate sentence is another sentence in the question bank, the standard answer of the mask is "no", and the training corpus of sentence 5 is constructed according to this rule.
[0318] The new sentence is input into the encoder as input to obtain its hidden layer information matrix, and then the decoder outputs the probability matrix of the predicted sentence. The position information of [mask] in the prompt template is used to extract the predicted [mask] content probability matrix, and the value with the highest probability is converted into the corresponding Chinese character to obtain the text content of the [mask] part of the model prediction output. The model structure is as follows Figure 2 shown.
[0319] Among them, x is the original sentence, m is the length of the original sentence; x' is the new sentence after embedding the prompt template, n is the length of the new sentence; y is the probability matrix output by the decoder, p is the probability matrix of the [mask] position, l is the length of the number of words contained in the [mask] position, and y' is the Chinese character with the highest probability of appearing in the probability matrix of the [mask] position, that is, the text content predicted by the model.
[0320] Since it is impossible to limit the text range of the model output, the [mask] content predicted by the model may exceed the standard answer range. Therefore, for the [mask] content predicted by the model, a mapping table of the model prediction output can be set to convert the predicted content (equivalent to setting a mapping table of the first model prediction result and converting the predicted result of the actual output). For example, when the Chinese characters predicted by the model are positive judgment words such as "suitable", "can", and "should", the output is deemed to be "suitable", otherwise the output is deemed to be "cannot". The form of the mapping table can be shown in Table 4.
[0321] A loss function is constructed by combining the standard answer and the model prediction result. The model is trained and its parameters are updated using the data from all information collection stages in the distress call record, so as to train the question-answering auxiliary model to select the next suitable sentence for inquiry from the historical question library (equivalent to determining the first auxiliary information based on the first model).
[0322] The end node of the information collection phase can be solved by setting the number of predicted questions, the threshold of the model prediction probability value, specifying the end statement, etc. For example, by counting the number of questions in the historical call records, setting the appropriate number of questions to be asked, and ending the inquiry process when the number is reached; or setting a prediction probability threshold for the question-answering auxiliary model, if the maximum probability value in the prediction result vector of the current sentence is lower than the threshold, the inquiry process is stopped; or certain sentences in the question library can be marked with specific marks as the end statement of the inquiry stage. If the model predicts and selects these sentences, the inquiry stage can be considered to be over and the rescue guidance stage can be entered (equivalent to determining that when the preset conditions are met, the second model is used to determine the second auxiliary information).
[0323] For plans that require judgment of the plan type, the dispatcher is required to manually judge the plan category, or use the data from the information collection phase to train a plan classification model to automatically determine the plan type suitable for the current situation for the dispatcher to judge.
[0324] 1.2.4. Guiding auxiliary model (i.e. second model) training
[0325] Similar to the process of training the question-answering auxiliary model in 1.2.3, the first n-1 rescue instructions are used to predict the guidance measures that the dispatcher should take in the current step. The initial input is all the sentences in the information collection stage, and all the sentences in the information collection stage are concatenated as input sentences (equivalent to using the second historical dialogue sentences to train the second model). Taking the rescue record in Table 2 as an example, when predicting sentence 7, sentences 1-6 are concatenated as input sentences.
[0326] Construct a prompt learning template. You can try different expressions and select the best template. For example, you can design the template as follows:
[0327] (candidate)[mask] as the next step for (input)
[0328] Among them, input represents the input sentence, candidate represents the dispatcher's historical guidance measures in the question library (equivalent to the second historical dialogue sentence), mask represents the content predicted by the model, and the mask length can be set to n Chinese characters manually, such as the standard answer is designed to be "yes" or "no".
[0329] For example, we use the input sentence of sentences 1-6 as input to fill in the template, traverse the guidance library, and fill in the template with the sentences in the guidance library one by one as candidates, and let the model predict [mask]. If the candidate is sentence 7, the standard answer of the mask should be "yes", and if the candidate sentence is another sentence in the guidance library, the standard answer of the mask should be "no". Embedding into the template can form a new sentence:
[0330] (Sentence 7) [can] serve as the next step in guiding measures for (Sentences 1-6)
[0331] (Sentence 8) [cannot] serve as the next step in guiding measures for (Sentences 1-6)
[0332] (Sentence 10) [cannot] serve as the next step in guiding measures for (Sentences 1-6)
[0333] …
[0334] Similarly, when the caller answers sentence 9, sentences 1-8 are integrated as input sentences, and appropriate sentences are selected from the guidance library for rescue guidance. At this time, if the candidate sentence is sentence 10, the standard answer of [mask] is "suitable"; if the candidate sentence is other sentences in the guidance library, the standard answer of [mask] is "no". The training corpus of sentence 10 is constructed according to this rule.
[0335] For the vector predicted by the model, the index with the highest probability is taken as the output Chinese character, and the mapping table of the model prediction output is set to convert the predicted Chinese characters of the model. For example, when the Chinese characters predicted by the model are positive judgment words such as "suitable", "can", and "should", the current sentence is considered "suitable" as the next question, otherwise it is considered unsuitable, similar to Table 4.
[0336] A loss function is constructed by combining the standard answer and the model prediction result. The model is trained and its parameters are updated using the data of all rescue guidance stages in the call record, so as to train the guidance auxiliary model to select the next suitable sentence for inquiry from the historical question library (equivalent to determining the second auxiliary information based on the second model).
[0337] For the end node of rescue guidance, similar to the method in 1.2.4, it can be solved by presetting the number of guidance contents, setting the model prediction probability value threshold, specifying the end statement, etc. For example, the prediction probability threshold is set for the guidance auxiliary model. If the maximum probability value in the prediction result vector of the current sentence is lower than the threshold, the process is stopped; some sentences in the question library can also be marked with specific marks as the end statement of the inquiry stage. If the model predicts and selects these sentences, it can be considered that this guidance is over (equivalent to ending the rescue guidance stage when the second preset condition is met).
[0338] For the scheme that adopts separate plans for guidance, when training the guidance auxiliary model, the annotated protocol label information can be used to train the question and answer and guidance data of different plans separately, and the training method is the same as above.
[0339] 1.3 Reasoning Process
[0340] When a new 120 emergency call is received, the voice of the dispatcher and the caller is first converted into text (i.e., the first dialogue sentence associated with the target event) through the voice-to-text module.
[0341] 1.3.1 Question and answer auxiliary process
[0342] The process is similar to the question-answering auxiliary model (i.e., the first model) in 1.2.3, but the reasoning process is only a forward calculation process, and there is no need to update the model parameters. When the text of the first n-1 steps is concatenated and input into the question-answering auxiliary model, a new sentence is first generated by using the input text and the sentences in the question library, combined with the prompt template used in the training in 1.2.3, and then the [mask] part in the new sentence is predicted by the encoder and decoder. According to the prediction result mapping table, the sentences in the question library are judged one by one whether they are suitable as the next inquiry question suggestion for the dispatcher's reference. If the dispatcher adopts it, the sentence continues to be input into the model as a historical record for the next suggestion prediction. If the dispatcher does not adopt it, the dispatcher's actual words are used as historical records to continue the next suggestion prediction (equivalent to determining that the dispatcher adopts the first candidate sentence in the first auxiliary information as the second dialogue sentence).
[0343] 1.3.2 Guidance and Assistance Process
[0344] Similar to the guidance auxiliary model (i.e., the second model) process in 1.2.4, the reasoning process is also only a forward calculation process, and there is no need to update the model parameters. After the text of the first n-1 steps is concatenated, it is input into the guidance auxiliary model. First, the input text and the sentences in the question bank are combined with the prompt template used in the training in 5.2.4 to generate new sentences. Then, the [mask] part in the new sentence is predicted through the encoder and decoder. According to the prediction result mapping table, the sentences in the question bank are judged one by one whether they are suitable as the next rescue guidance measure suggestion for the dispatcher's reference. If the dispatcher adopts it, the sentence continues to be input into the model as a historical record for the next suggestion prediction. If the dispatcher does not adopt it, the words actually spoken by the dispatcher are used as historical records to continue the next suggestion prediction (equivalent to determining that the dispatcher adopts the second candidate sentence in the second auxiliary information as the fourth dialogue sentence).
[0345] There are many ways to determine whether the dispatcher adopts the recommended sentence, such as (1) adding a clickable button and allowing the dispatcher to manually click to inform the system whether the recommendation is adopted. In this case, if the dispatcher clicks to feedback acceptance, even if the dispatcher's actual words are different from the suggested sentence, the suggested sentence is still recorded as the result of the current step; (2) using speech-to-text technology to convert the dispatcher's actual words into text, and compare the converted text with the recommended sentence to determine whether they are consistent; (3) converting the dispatcher's actual words into text, and using a text similarity model to determine the degree of similarity with the recommended sentence, setting a similarity threshold, and if the similarity reaches the threshold, it is considered that the dispatcher has adopted the suggestion, otherwise it is considered that the suggestion is not adopted (equivalent to the method of determining whether the dispatcher adopts the first auxiliary information and the second auxiliary information, which may include but is not limited to: determining based on a clickable button; determining based on speech-to-text method; determining based on text familiarity).
[0346] After completing the entire 120 emergency call process, the actual expression of the dispatcher shall prevail. The emergency call record can be included in the data storage module, and the quality of the emergency call record can be regularly traced to eliminate abnormal data, improve inappropriate terms and content, and conduct incremental training on the question-answering auxiliary model and the guidance auxiliary model when necessary to form a virtuous circle and help the model better assist the dispatcher in rescue (equivalent to further improving the auxiliary accuracy of the first model and the second model in emergency dispatch work).
[0347] Figure 4 A structural diagram of a conversation assistance device provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown; the device 40 shown includes: a first determination module 401, a second determination module 402; wherein,
[0348] The first determination module 401 is used to determine first auxiliary information using a first model according to a first dialogue sentence associated with a target event between a first object and a second object; wherein the first auxiliary information is used to determine a second dialogue sentence of the first object; and the second dialogue sentence is used by the first object to determine information of the second object;
[0349] The second determination module 402 is used to determine second auxiliary information using a second model based on a third dialogue statement between the first object and the second object associated with the target event; wherein the second auxiliary information is used to determine a fourth dialogue statement of the first object; and the fourth dialogue statement is used to provide the first object with guidance information on how the second object should respond to the target event.
[0350] Specifically, the device 40 further includes: a division module 403 and a training module 404; wherein,
[0351] The division module 403 is used to divide the historical dialogue into a first historical dialogue sentence corresponding to the first model and a second historical dialogue sentence corresponding to the second model;
[0352] The training module 404 is used to train the first model using the first historical dialogue sentence, and to train the second model using the second historical dialogue sentence.
[0353] Specifically, the first determination module 401 is used to adopt the first model to use at least one of the plurality of first candidate sentences as the second dialogue sentence in the first auxiliary information; wherein the first candidate sentence is determined from the first historical dialogue sentences;
[0354] The second determination module 402 is used to adopt the second model to use at least one of the multiple second candidate sentences as the fourth dialogue sentence in the second auxiliary information; wherein the second candidate sentence is determined from the second historical dialogue sentences.
[0355] Specifically, the training module 404 is used to form a first prompt learning template from the first historical dialogue sentence identified by the first tag, and train the first model using the first prompt learning template;
[0356] The second historical dialogue sentence identified by the second label constitutes a second prompt learning template, and the second prompt learning template is used to train the second model.
[0357] Specifically, the training module 404 is further used to use a first model to determine a predicted correspondence between an Nth first candidate sentence in the first historical dialogue sentence and a first designated sentence in the first historical dialogue sentence; wherein the first designated sentence includes one or more sentences;
[0358] updating the first model according to the actual correspondence between the Nth first candidate sentence and the first designated sentence in the first historical dialogue sentence and the predicted correspondence;
[0359] Using a second model, determining a predicted correspondence between an Mth second candidate sentence in the second historical dialogue sentence and a second designated sentence in the second historical dialogue sentence; wherein the second designated sentence includes one or more sentences;
[0360] The second model is updated according to the actual correspondence between the Mth second candidate sentence and the second designated sentence in the second historical dialogue sentence and the predicted correspondence.
[0361] Specifically, the first determination module 401 is used to determine the probability that the first dialogue sentence has a predetermined corresponding relationship with each of the first candidate sentences by using the first model;
[0362] At least one of the first candidate sentences whose probability satisfies a preset condition is determined as the second dialogue sentence.
[0363] Specifically, the second determination module 402 is used to determine the probability that the third dialogue sentence has a predetermined corresponding relationship with each of the second candidate sentences by using the second model;
[0364] At least one of the second candidate sentences whose probability satisfies a preset condition is determined as the fourth dialogue sentence.
[0365] Specifically, the second determination module 402 is used to determine the second auxiliary information by using the second model when a preset condition is met;
[0366] The preset conditions include at least one of the following:
[0367] The number of the first dialogue sentences is greater than or equal to a preset number;
[0368] The first auxiliary information is a preset ending sentence;
[0369] The prediction accuracy probability value corresponding to the first auxiliary information is less than a preset probability threshold.
[0370] It should be noted that: the conversation assistance device 50 provided in the above embodiment only uses the division of the above program modules as an example to illustrate when implementing the corresponding conversation assistance method. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the above-described processing. In addition, the conversation assistance device 50 provided in the above embodiment and the conversation assistance method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0371] To implement the method of the embodiment of the present invention, the embodiment of the present invention provides a conversation assistance device, such as Figure 5 As shown, the device 50 includes: a processor 501 and a memory 502 for storing a computer program that can be run on the processor; wherein,
[0372] When the processor 501 is used to run the computer program, it executes: according to the first dialogue statement associated with the target event between the first object and the second object, using the first model, determining the first auxiliary information; wherein the first auxiliary information is used to determine the second dialogue statement of the first object; the second dialogue statement is used by the first object to determine the information of the second object; according to the third dialogue statement associated with the target event between the first object and the second object, using the second model, determining the second auxiliary information; wherein the second auxiliary information is used to determine the fourth dialogue statement of the first object; the fourth dialogue statement is used to provide the first object with guidance information on how the second object should deal with the target event. Specifically, the device 50 can execute as follows Figure 1 The method shown, and Figure 1 The target result probability prediction method embodiment shown belongs to the same concept, and its specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0373] In practical application, such as Figure 5 As shown, the device 50 may also include: at least one network interface 503. The various components in the conversation assistance device 50 are coupled together via a bus system 504. It is understood that the bus system 504 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 504 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 5 In the figure, various buses are labeled as bus system 504. There may be at least one processor 501. The network interface 503 is used for wired or wireless communication between the conversation assistance device 50 and other devices.
[0374] The memory 502 in the embodiment of the present invention is used to store various types of data to support the operation of the device 50 .
[0375] The method disclosed in the above embodiment of the present invention can be applied to the processor 501, or implemented by the processor 501. The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 501 or the instruction in the form of software. The above processor 501 can be a general processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 501 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The general processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be combined to execute. The software module can be located in a storage medium, which is located in the memory 502. The processor 501 reads the information in the memory 502 and completes the steps of the above method in combination with its hardware.
[0376] In an exemplary embodiment, the conversation assistance device 50 can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.
[0377] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon; when the computer program is executed by a processor, the following is performed: based on a first dialogue statement between a first object and a second object associated with a target event, using a first model to determine first auxiliary information; wherein the first auxiliary information is used to determine a second dialogue statement of the first object; the second dialogue statement is used by the first object to determine information of the second object; based on a third dialogue statement between the first object and the second object associated with the target event, using a second model to determine second auxiliary information; wherein the second auxiliary information is used to determine a fourth dialogue statement of the first object; the fourth dialogue statement is used to provide the first object with guidance information on how the second object should deal with the target event. Specifically, the computer program can also perform the following operations: Figure 1 The method shown, and Figure 1 The method embodiments shown belong to the same concept, and their specific implementation processes are detailed in the method embodiments, which will not be repeated here.
[0378] In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0379] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0380] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0381] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, etc. Various media that can store program codes.
[0382] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0383] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0384] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0385] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A conversation assistance method, characterized in that: The method comprises: According to a first dialogue sentence associated with a target event between a first object and a second object, a first model is used to determine first auxiliary information; wherein the first auxiliary information is used to determine a second dialogue sentence of the first object; and the second dialogue sentence is used by the first object to determine information of the second object; Based on the third dialogue statement between the first object and the second object associated with the target event, a second model is used to determine second auxiliary information; wherein the second auxiliary information is used to determine a fourth dialogue statement of the first object; and the fourth dialogue statement is used to provide the first object with guidance information on how the second object should deal with the target event.
2. The method according to claim 1, characterized in that: The method further comprises: dividing the historical dialogue sentences into first historical dialogue sentences corresponding to the first model and second historical dialogue sentences corresponding to the second model; The first historical dialogue sentence is used to train the first model, and the second historical dialogue sentence is used to train the second model.
3. The method according to claim 2, characterized in that The adopting the first model to determine the first auxiliary information includes: Using the first model, taking at least one of the plurality of first candidate sentences as a second dialogue sentence in the first auxiliary information; wherein the first candidate sentence is determined from the first historical dialogue sentences; The adopting the second model to determine the second auxiliary information includes: The second model is adopted to use at least one of the plurality of second candidate sentences as a fourth dialogue sentence in the second auxiliary information; wherein the second candidate sentence is determined from the second historical dialogue sentences.
4. The method according to claim 2, characterized in that: The dividing the historical dialogue sentences into first historical dialogue sentences corresponding to the first model and second historical dialogue sentences corresponding to the second model includes: Using the first label and the second label, respectively determining the first historical dialogue sentence and the second historical dialogue sentence; The step of using the first historical dialogue sentence to train the first model and using the second historical dialogue sentence to train the second model includes: The first historical dialogue sentence identified by the first label forms a first prompt learning template, and the first prompt learning template is used to train the first model; The second historical dialogue sentence identified by the second label constitutes a second prompt learning template, and the second prompt learning template is used to train the second model.
5. The method according to claim 2, characterized in that: The method further comprises: Using a first model, determining a predicted correspondence between an Nth first candidate sentence in the first historical dialogue sentence and a first designated sentence in the first historical dialogue sentence; wherein the first designated sentence includes one or more sentences; updating the first model according to the actual correspondence between the Nth first candidate sentence and the first designated sentence in the first historical dialogue sentence and the predicted correspondence; Using a second model, determining a predicted correspondence between an Mth second candidate sentence in the second historical dialogue sentence and a second designated sentence in the second historical dialogue sentence; wherein the second designated sentence includes one or more sentences; The second model is updated according to the actual correspondence between the Mth second candidate sentence and the second designated sentence in the second historical dialogue sentence and the predicted correspondence.
6. The method according to claim 3, characterized in that The step of adopting the first model and taking at least one of the plurality of first candidate sentences as the second dialogue sentence in the first auxiliary information includes: Using the first model, determining a probability that the first dialogue sentence has a predetermined corresponding relationship with each of the first candidate sentences; At least one of the first candidate sentences whose probability satisfies a preset condition is determined as the second dialogue sentence.
7. The method according to claim 3, characterized in that The adopting the second model to use at least one of the plurality of second candidate sentences as the fourth dialogue sentence in the second auxiliary information includes: Using the second model, determining a probability that the third dialogue sentence has a predetermined corresponding relationship with each of the second candidate sentences; At least one of the second candidate sentences whose probability satisfies a preset condition is determined as the fourth dialogue sentence.
8. The method according to claim 1, characterized in that The adopting the second model to determine the second auxiliary information includes: When it is determined that the preset condition is met, the second model is used to determine the second auxiliary information; The preset conditions include at least one of the following: The number of the first dialogue sentences is greater than or equal to a preset number; The first auxiliary information is a preset ending sentence; The prediction accuracy probability value corresponding to the first auxiliary information is less than a preset probability threshold.
9. A conversation assistance device, characterized in that: The device comprises: a first determining module and a second determining module; wherein, The first determination module is used to determine first auxiliary information using a first model according to a first dialogue sentence associated with a target event between a first object and a second object; wherein the first auxiliary information is used to determine a second dialogue sentence of the first object; and the second dialogue sentence is used by the first object to determine information of the second object; The second determination module is used to determine second auxiliary information using a second model based on a third dialogue statement between the first object and the second object associated with the target event; wherein the second auxiliary information is used to determine a fourth dialogue statement of the first object; and the fourth dialogue statement is used to provide the first object with guidance information on how the second object should respond to the target event.
10. A conversation assistance device, characterized in that: The device includes a network interface, a memory and a processor; wherein the network interface is used to realize connection communication between components; the memory is used to store a computer program that can be run on the processor; and the processor is used to execute the method described in any one of claims 1 to 8 when running the computer program.
11. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program is executed by at least one processor, the method according to any one of claims 1 to 8 is implemented.