Training method and strategy identification method, device and equipment of network model

By training a network model and combining a loss function based on policy category and dialogue turn, the problem of high probability of fallback policies in intelligent dialogue is solved, thereby improving the accuracy of policy recognition and enhancing the user experience.

CN116894498BActive Publication Date: 2026-03-31PING AN TECH (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-24
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In existing technologies, when using keyword matching to identify strategies in intelligent dialogue, the probability of fallback strategies increases, reducing the accuracy of strategy identification.

Method used

By training the network model, the first loss function between the policy category and the sample policy category, and the second loss function between the dialogue turn and the sample dialogue turn, are calculated until the sum of the loss values ​​is less than a preset threshold. The policy category is then identified in conjunction with the dialogue turn to improve accuracy.

Benefits of technology

This improved the accuracy of strategy category identification, thereby enhancing the accuracy of online consultations and the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116894498B_ABST
    Figure CN116894498B_ABST
Patent Text Reader

Abstract

This application discloses a method for training a network model, a method for policy recognition, an apparatus, and a device. The method for training the network model includes: acquiring query dialogue samples, the policy category to which the query dialogue samples belong, and the dialogue turn to which the query dialogue samples belong; inputting the query dialogue samples into a network model, whereby the network model outputs the policy category of the query dialogue samples and the dialogue turn to which the query dialogue samples belong; calculating a first loss function between the output policy category and the sample policy category, and calculating a second loss function between the output dialogue turn and the sample dialogue turn; training the network model with the goal of minimizing the sum of the loss values ​​of the first and second loss functions, until the sum of the loss values ​​of the first and second loss functions determined by the trained network model is less than a preset loss threshold. This application improves the accuracy of policy category recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and more specifically, to a method for training a network model, a method for policy recognition based on interrogation dialogue, an apparatus, and an electronic device. Background Technology

[0002] Intelligent dialogue is applied in various fields, such as healthcare and telecommunications, where interaction with users is crucial. In healthcare, for example, intelligent dialogue can be used in online consultations. In this scenario, a corresponding intelligent robot converses with the patient, providing further feedback on the patient's questions and answers. This involves identifying policy categories based on the user's questions and responses. Currently, the approach involves extracting keywords from the patient's current dialogue information and then identifying the corresponding policy category based on these keywords. However, this keyword-based policy category matching method may increase the probability of fallback policies appearing, thus reducing the accuracy of policy identification. Summary of the Invention

[0003] To address the aforementioned technical problems, embodiments of this application provide a method for training a network model, a method for identifying policies based on query dialogue, an apparatus, and an electronic device.

[0004] According to one aspect of the embodiments of this application, a method for training a network model is provided, the method comprising:

[0005] Obtain a query dialogue sample, the sample policy category to which the query dialogue sample belongs, and the sample dialogue round in which the query dialogue sample is located; input the query dialogue sample into the network model, the network model is used to output the policy category to which the query dialogue sample belongs and the dialogue round in which the query dialogue sample is located; calculate a first loss function between the output policy category and the sample policy category, and calculate a second loss function between the output dialogue round and the sample dialogue round; train the network model with the goal of reducing the sum of the loss values ​​of the first loss function and the second loss function, until the sum of the loss values ​​of the first loss function and the second loss function determined by the trained network model is less than a preset loss threshold.

[0006] According to one aspect of the embodiments of this application, a policy recognition method based on query dialogue is provided. The method includes: inputting a query dialogue of a target object into a network model to obtain the policy category to which the query dialogue belongs and the current dialogue round in which the query dialogue is located; if the policy category output by the network model is a fallback policy, then fine-tuning the fallback policy output by the network model to obtain the target policy category to which the query dialogue belongs, wherein the network model is a network model trained by the network model training method described above.

[0007] According to one aspect of the embodiments of this application, a training apparatus for a network model is provided. The apparatus includes: an acquisition module configured to acquire a query dialogue sample, a sample policy category to which the query dialogue sample belongs, and a sample dialogue turn in which the query dialogue sample is located; an input module configured to input the query dialogue sample into the network model, wherein the network model is used to output the policy category to which the query dialogue sample belongs and the dialogue turn in which the query dialogue sample is located; a calculation module configured to calculate a first loss function between the output policy category and the sample policy category, and to calculate a second loss function between the output dialogue turn and the sample dialogue turn; and a training module configured to train the network model with the goal of reducing the sum of the loss values ​​of the first loss function and the second loss function, until the sum of the loss values ​​of the first loss function and the second loss function determined by the trained network model is less than a preset loss threshold.

[0008] According to one aspect of the embodiments of this application, a policy recognition device based on query dialogue is provided. The device includes: a determination module configured to input a query dialogue of a target object into a network model to obtain the policy category to which the query dialogue belongs and the current dialogue round in which the query dialogue is located; and a fine-tuning module configured to fine-tune the fallback policy output by the network model if the policy category output by the network model is a fallback policy to obtain the target policy category to which the query dialogue belongs, wherein the network model is a network model trained by the above-described network model training method.

[0009] According to one aspect of the embodiments of this application, an electronic device is provided, including: a memory storing computer-readable instructions; and a processor reading the computer-readable instructions stored in the memory to execute a training method for a network model and / or a policy recognition method based on interrogation dialogue as described above.

[0010] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, on which computer-readable instructions are stored, which, when executed by a computer's processor, cause the computer to perform the training method of the network model and / or the policy recognition method based on the interrogation dialogue as described above.

[0011] In the technical solution provided by the embodiments of this application, the acquired query dialogue samples are input into a network model to obtain the strategy category and dialogue turn of the query dialogue samples output by the network model. A first loss function is calculated using the strategy category of the query dialogue samples output by the network model and the acquired sample strategy category. A second loss function is calculated using the dialogue turn of the query dialogue samples output by the network model and the acquired sample dialogue turn. The network model is then trained with the goal of reducing the sum of the losses between the first and second loss functions until the sum of the loss values ​​of the first and second loss functions determined by the network model is less than a preset loss threshold. This allows the network model training to focus primarily on strategy category recognition and secondarily on dialogue turn recognition. By introducing the sample dialogue turn of the query dialogue samples, the network model can combine the dialogue turn of the query dialogue for strategy category recognition, improving the accuracy of strategy category recognition. Furthermore, when the trained network model is applied in the medical field, it can accurately identify the strategy category corresponding to the patient, improving the accuracy of online consultations and the user experience.

[0012] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0013] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:

[0014] Figure 1 This is a flowchart of an existing online consultation.

[0015] Figure 2 This is a schematic diagram of one implementation environment involved in this application;

[0016] Figure 3 This is a flowchart illustrating a training method for a network model, as shown in an exemplary embodiment of this application.

[0017] Figure 4 This is a flowchart illustrating a method for training a network model, as shown in yet another exemplary embodiment of this application.

[0018] Figure 5 This is a flowchart illustrating a method for training a network model, as shown in yet another exemplary embodiment of this application.

[0019] Figure 6 This is a flowchart of the present application showing how to process query dialogue samples using a feature extractor and a policy category recognizer to obtain their policy category and dialogue round;

[0020] Figure 7 This is a flowchart illustrating an exemplary embodiment of the present application of a strategy recognition method based on interrogation dialogue;

[0021] Figure 8 This is a flowchart illustrating a policy recognition method based on interrogation dialogue, which is another exemplary embodiment of this application;

[0022] Figure 9 This is a flowchart illustrating a policy recognition method based on interrogation dialogue, which is another exemplary embodiment of this application;

[0023] Figure 10 This is a flowchart illustrating a policy recognition method based on interrogation dialogue, which is another exemplary embodiment of this application;

[0024] Figure 11 This is a block diagram illustrating a network model training apparatus according to an exemplary embodiment of this application;

[0025] Figure 12 This is a block diagram illustrating a policy recognition device based on query dialogue, as shown in an exemplary embodiment of this application;

[0026] Figure 13 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation

[0027] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0028] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0029] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0030] It should also be noted that "multiple" as mentioned in this application refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0031] First, it's important to note that intelligent dialogue is applied across various fields, such as healthcare and telecommunications, where interaction with users is crucial. During these interactions, further feedback on user questions and answers is necessary. In the healthcare field, for example, intelligent dialogue is frequently used in online inquiry scenarios. In this scenario, the online system needs to provide further feedback based on the patient's questions and answers, which involves identifying strategy categories and corresponding action responses. For more details, please refer to [link to relevant documentation / reference]. Figure 1 , Figure 1 The diagram illustrates the current online consultation flowchart. Specifically, the online system extracts and processes information about the patient's intent, disease, and symptoms from the patient's input dialogue. Based on this extracted information, the system updates the patient's consultation status. Then, it identifies a strategy category based on the extracted key information. If the identified strategy category is not a dialogue-ending strategy, the system proceeds to the next round of dialogue identification until a dialogue-ending strategy is identified, at which point the consultation process ends. This method of determining strategy categories by matching key information from the extracted dialogue increases the probability of identifying fallback strategies. This is because the method of matching key information to strategy categories is too limited, causing some key information to be identified as fallback strategies because it cannot accurately match non-fallback strategies.

[0032] Based on this, in order to improve the accuracy of policy category identification and avoid increasing the probability of identifying fallback policies, embodiments of this application propose a network model training method, a policy identification method based on query dialogue, an apparatus, an electronic device, and a computer-readable storage medium.

[0033] The embodiments of this application involve: inputting acquired query dialogue samples into a network model to obtain the strategy category and dialogue turn of the query dialogue samples output by the network model; calculating the loss value of a first loss function using the strategy category of the query dialogue samples output by the network model and the acquired sample strategy category; calculating the loss value of a second loss function using the dialogue turn of the query dialogue samples output by the network model and the acquired sample dialogue turn; and training the network model with the goal of reducing the sum of the losses of the first and second loss functions until the sum of the losses of the first and second loss functions determined by the network model is less than a preset loss threshold. This enables the training of the network model to focus on strategy category recognition and supplement it with dialogue turn recognition. By introducing the sample dialogue turn of the query dialogue samples, the network model can combine the dialogue turn of the query dialogue to perform strategy category recognition, thereby improving the accuracy of strategy category recognition.

[0034] Figure 2 This is a schematic diagram of an implementation environment related to this application. The implementation environment includes a server 210 and a device terminal 220, and the server 210 and the device terminal 220 have a pre-established wired or wireless network connection.

[0035] like Figure 2 As shown, server 210 obtains query dialogue samples, the sample policy category to which the query dialogue samples belong, and the sample dialogue rounds to which the query dialogue samples belong from device terminal 220, and inputs the query dialogue samples into the network model. Then, it calculates the loss value of the first loss function between the policy category output by the network model and the sample policy category, and calculates the loss value of the second loss function between the dialogue rounds output by the network model and the sample dialogue rounds. After that, server 210 trains the network model with the goal of reducing the sum of the loss values ​​of the first loss function and the second loss function until the sum of the loss values ​​of the first loss function and the second loss function determined by the trained network model is less than a preset loss threshold.

[0036] in, Figure 2 The device terminal 220 shown can be any device that supports the collection of data such as query dialogue samples, such as a smartphone, in-vehicle computer, tablet computer, laptop computer, or wearable device, but is not limited to these. Figure 2The server 210 shown is a server, which can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. No restrictions are placed on this. The device terminal 220 can communicate with the server 210 via wireless networks such as 3G (third-generation mobile information technology), 4G (fourth-generation mobile information technology), and 5G (fifth-generation mobile information technology). No restrictions are placed on this as well.

[0037] Please see Figure 3 , Figure 3 This is a flowchart illustrating a network model training method according to an exemplary embodiment of this application. This method can be applied to... Figure 2 The implementation environment shown is specifically executed by server 210 within that implementation environment. It should be understood that this method can also be applied to other exemplary implementation environments and executed by devices in other implementation environments; this embodiment does not limit the implementation environment to which the method is applicable.

[0038] The following section will describe in detail the training method of the network model proposed in this application embodiment, using the server as the specific execution entity.

[0039] like Figure 3 As shown, in an exemplary embodiment, the training method for the network model includes at least steps S310 to S340, which are described in detail below:

[0040] Step S310: Obtain the query dialogue sample, the sample strategy category to which the query dialogue sample belongs, and the sample dialogue round in which the query dialogue sample is located.

[0041] A dialogue sample refers to the dialogue information between the responder and the user in an intelligent dialogue. In the medical field, the aforementioned dialogue sample represents the dialogue information between the patient and doctor during an online consultation. This dialogue sample can be from Traditional Chinese Medicine or Western medicine. It should be noted that, considering the sequential nature of the dialogue process, with each stage containing its own specific questions, the entire dialogue process between the user and the responder can be divided into multiple rounds, with each round corresponding to a dialogue sample.

[0042] Specifically, the network model training method provided in this application, when applied in the medical field, can be used in scenarios such as intelligent diagnosis and treatment, and remote consultation. When training the network model in a medical scenario, a query dialogue source file is obtained. This file records the complete dialogue between the patient and doctor during an online consultation, including the patient's vital signs, symptom descriptions, duration, etc., as well as the doctor's responses regarding pathological information, medication information, treatment cycle, allergies, and precautions. The entire process is gradual. The query dialogue source file is split into multiple dialogue rounds. For example, a patient asking how to use medication and the doctor replying with a list of available medications can constitute a dialogue round; or the doctor informing the patient of medication-related matters and the patient replying "I understand" can constitute a dialogue round. Each dialogue round corresponds to a query dialogue sample.

[0043] Additionally, it should be noted that the server can retrieve query dialogues stored on multiple connected device terminals and use them as query dialogue samples for training the network model. Alternatively, the server can retrieve query dialogues from a large database and use them as query dialogue samples for training the network model. The large database includes data information on query dialogues conducted on various device terminals.

[0044] The strategy category to which the query dialogue sample belongs refers to the strategy category determined based on the query dialogue samples corresponding to each round. Specifically, it can be a strategy category manually labeled based on the query dialogue samples. This strategy category can be a dialogue termination strategy, a fallback strategy, or other strategy categories.

[0045] The server obtains the query dialogue sample, its corresponding sample strategy category, and the round of the sample dialogue.

[0046] Step S320: Input the query dialogue sample into the network model. The network model is used to output the policy category to which the query dialogue sample belongs and the dialogue round in which the query dialogue sample is located.

[0047] A network model refers to a deep neural network capable of identifying policy categories from input query dialogue samples. Specifically, the network model in this application embodiment can be an autoencoder language network model, i.e., a BERT model.

[0048] The output policy category refers to the policy category to which the query dialogue sample predicted by the network model belongs.

[0049] The output dialogue turn refers to the dialogue turn in which the query dialogue sample predicted by the network model belongs.

[0050] The server inputs query dialogue samples into the network model so that the network model outputs the predicted policy category of the query dialogue sample and the predicted dialogue round in which the query dialogue sample belongs.

[0051] Step S330: Calculate the loss value of the first loss function between the output strategy category and the sample strategy category, and calculate the loss value of the second loss function between the output dialogue round and the sample dialogue round.

[0052] The loss value of the first loss function represents the class similarity between the policy category of the query dialogue sample and the policy category predicted by the network model. In other words, it reflects the class similarity between the predicted policy category and the labeled policy category corresponding to the query dialogue sample. A smaller loss value indicates a greater similarity between the sample policy category and the policy category output by the network model, and vice versa.

[0053] The loss value of the second loss function refers to the degree of similarity between the dialogue turn in which the query dialogue sample is located and the dialogue turn predicted by the network model. A smaller loss value indicates a more similar dialogue turn between the sample and the dialogue turn output by the network model, and vice versa.

[0054] The server calculates the loss value of the first loss function between the predicted policy category and the sample policy category, and calculates the loss value of the second loss function between the predicted dialogue rounds and the sample dialogue rounds.

[0055] Step S340: Train the network model with the goal of reducing the sum of the loss values ​​of the first loss function and the second loss function, until the sum of the loss values ​​of the first loss function and the second loss function determined by the trained network model is less than a preset loss threshold.

[0056] The preset loss threshold is a numerical value used to measure the training accuracy of the network model. A lower preset loss threshold results in higher accuracy in identifying the policy category of a query dialogue, while a higher preset loss threshold results in lower accuracy. It should be noted that the preset loss threshold can be set by staff based on actual circumstances and is not limited here.

[0057] Considering the impact of the dialogue turn in a query on policy category recognition, training the network model solely based on the policy category of the query may lead to low accuracy in policy recognition. Therefore, to improve the accuracy of policy category recognition and avoid increasing the probability of fallback policies due to inaccurate recognition, the server in this embodiment prioritizes policy category recognition and secondarily focuses on dialogue turn recognition. This aims to make the policy category output by the network model increasingly similar to the sample policy category, and to make the dialogue turns output by the network model increasingly similar to the turn information between dialogue turns, thereby achieving the goal of leveraging dialogue turns to influence policy category recognition. Specifically, the server trains the network model with the goal of minimizing the loss value of the first loss function between the output policy category and the sample policy category, and the loss value of the second loss function between the output dialogue turn and the sample dialogue turn, until the sum of the loss values ​​of the first and second loss functions determined by the trained network model is less than a preset loss threshold.

[0058] As can be seen, the training method of the network model in this embodiment inputs the acquired query dialogue samples into the network model to obtain the policy category and dialogue turn of the query dialogue samples output by the network model. Then, it calculates a first loss function using the policy category of the query dialogue samples output by the network model and the acquired sample policy category, and calculates a second loss function using the dialogue turn of the query dialogue samples output by the network model and the acquired sample dialogue turn. The network model is then trained with the goal of reducing the sum of the losses between the first and second loss functions until the sum of the loss values ​​of the first and second loss functions determined by the network model is less than a preset loss threshold. This enables the network model training to focus on policy category recognition and supplement it with dialogue turn recognition. By introducing the sample dialogue turn of the query dialogue samples, the network model can combine the dialogue turn of the query dialogue to perform policy category recognition, thereby improving the accuracy of policy category recognition.

[0059] Figure 4 yes Figure 3 The flowchart illustrates an exemplary embodiment of step S320 in the training method of the network model shown. Figure 4 In the illustrated embodiment, the policy category and dialogue turn to which the query dialogue sample output by the network model belongs are specifically determined based on the feature extractor and policy category recognizer included in the network model. For other steps in training the network model, please refer to the content described in the foregoing embodiments, which will not be repeated here.

[0060] like Figure 4As shown, in an exemplary embodiment, step S320, which inputs the query dialogue sample into the network model, and the process by which the network model outputs the policy category to which the query dialogue sample belongs and the dialogue round in which the query dialogue sample is located, further includes at least steps S321 to S322, which are detailed below:

[0061] Step S321: Perform feature vector extraction processing on the query dialogue sample according to the feature extractor, so as to use the vector parameter at the first position in the end hidden layer of the feature extractor as the feature vector representation output by the feature extractor.

[0062] A feature extractor is a model capable of extracting feature vectors from query dialogue samples. For example, considering the strong feature extraction capability of autoencoder language network models, the feature extractor can be an autoencoder language network model, namely the BERT model, which utilizes the Transformer model architecture to fully encode the semantic information of query dialogue samples in both the policy category and dialogue turn directions.

[0063] The terminal hidden layer of a feature extractor refers to the last hidden layer in the feature extractor.

[0064] The vector parameter at the first position refers to the word embedding parameter of the sentence vector (CLS) at the first position of the last hidden layer in the feature extractor.

[0065] Feature vector representation refers to the vector representation of features extracted from query dialogue samples.

[0066] The server uses a feature extractor to extract feature vectors from query dialogue samples, and uses the word vector parameters of the sentence vector at the first position of the last hidden layer in the feature extractor as the feature vector representation output by the feature extractor.

[0067] Step S322: The feature vector representation is processed by the strategy category recognizer to obtain the strategy category to which the query dialogue sample belongs and the dialogue round in which the query dialogue sample is located.

[0068] A strategy category recognizer is a model that uses the feature vector representation output by a feature extractor to identify the strategy category and dialogue turn.

[0069] The server uses a policy category recognizer to identify the feature vector representation output by the feature extractor, thereby obtaining the policy category of the query dialogue sample predicted by the network model and the dialogue round in which the predicted query dialogue sample belongs.

[0070] Optional, can be adopted Figure 5 Steps S510 to S520 in the illustrated embodiment implement step S322, as detailed below:

[0071] Step S510: Map the feature vector representation output by the feature extractor to a fully connected layer for policy category identification to obtain the policy category to which the query dialogue sample belongs.

[0072] Considering that the network model needs to predict the policy category and dialogue turn of the input query dialogue sample, i.e., it needs to implement a network model training method that prioritizes policy category recognition and supplements it with dialogue turn recognition, this embodiment of the application splits the network model training task. Specifically, a fully connected layer for policy category recognition and a fully connected layer for dialogue turn recognition are set in the policy category recognizer. Specifically, for the fully connected layer for policy category recognition, the server maps the feature vector representation output by the feature extractor to the fully connected layer for policy category recognition, so as to predict the policy category of the query dialogue sample based on the fully connected layer for policy category recognition.

[0073] Step S520: Map the feature vector representation output by the feature extractor to a fully connected layer for dialogue turn recognition to obtain the dialogue turn in which the query dialogue sample is located.

[0074] For the fully connected layer for dialogue turn recognition, the server maps the feature vector representation output by the feature extractor to the fully connected layer for dialogue turn recognition, so as to predict the policy category to which the query dialogue sample belongs based on the fully connected layer for dialogue turn recognition.

[0075] For details, please refer to Figure 6 , Figure 6 The diagram illustrates the process of processing query dialogue samples using a feature extractor and a policy category recognizer to determine their policy category and dialogue turn. Specifically, the server inputs the query dialogue sample into the feature extractor in the network model. The feature extractor outputs a feature vector representation, which is then mapped to a fully connected layer A for policy category recognition and a fully connected layer B for dialogue turn recognition, respectively. This allows the policy category of the query dialogue sample to be predicted based on the fully connected layer for policy category recognition, and the policy category of the query dialogue sample to be predicted based on the fully connected layer for dialogue turn recognition.

[0076] As can be seen, the training method of the network model in this embodiment performs feature vector extraction processing on the query dialogue samples by the feature extractor. The vector parameter at the first position in the hidden layer at the end of the feature extractor is used as the feature vector representation output by the feature extractor. The feature vector representation is then mapped to the fully connected layer for strategy category recognition and the fully connected layer for dialogue turn recognition included in the strategy category recognizer. The strategy category to which the query dialogue sample belongs is predicted based on the fully connected layer for strategy category recognition and the strategy category to which the query dialogue sample belongs is predicted based on the fully connected layer for dialogue turn recognition. This enables a network model training method that prioritizes strategy category recognition and supplements it with dialogue turn recognition. By introducing the sample dialogue turn of the query dialogue sample to train the network model, the network model can combine the dialogue turn of the query dialogue to perform strategy category recognition, thereby improving the accuracy of strategy category recognition.

[0077] Please continue reading Figure 7 , Figure 7 This is a flowchart illustrating an embodiment of the policy recognition method based on query dialogue shown in this application. The policy recognition method based on query dialogue in this embodiment can apply the network model trained using the above-described network model training method, thereby improving the accuracy of the network model in identifying the policy category to which the query dialogue belongs. The following uses a server for the policy recognition method based on query dialogue as an example to describe the policy recognition method based on query dialogue provided in this application. This embodiment of the policy recognition method based on query dialogue specifically includes the following steps:

[0078] Step S710: Input the query dialogue of the target object into the network model to obtain the policy category to which the query dialogue belongs and the current dialogue round in which the query dialogue is located.

[0079] The target audience refers to the users who are engaging in the dialogue.

[0080] The current dialogue turn refers to the dialogue turn to which the query dialogue in the input network model belongs.

[0081] The server inputs the query dialogue from the target object into the network model, and obtains the policy category and dialogue turn output by the network model.

[0082] Step S720: If the policy category output by the network model is a fallback policy, then the feature vector representation output by the network model is fine-tuned to obtain the target policy category to which the query dialogue belongs.

[0083] A fallback strategy is used when the exact strategy category of a dialogue cannot be determined, and the strategy category of the dialogue is then designated as a fallback strategy. After identifying the strategy category of the dialogue as a fallback strategy, the feature vector representation output by the network model is fine-tuned to obtain the target strategy category to which the dialogue belongs. Specifically, the server combines the feature vector representations output by the network model from the previous few dialogue rounds to fine-tune the feature vector representation of the current dialogue round, and determines the target strategy category to which the dialogue belongs in the current round based on the fine-tuned feature vector representation.

[0084] The target policy category refers to the policy category to which the query dialogue is predicted by the network model.

[0085] In this embodiment, when the above-mentioned strategy recognition method based on inquiry dialogue is applied in the medical field, the target object refers to the patient or their family member undergoing online consultation, and the corresponding network model is trained using inquiry dialogue samples from Traditional Chinese Medicine and / or Western Medicine. The inquiry dialogue input by the patient or their family member is fed into the trained network model to obtain the strategy category and current dialogue round corresponding to the inquiry dialogue. Considering that in actual consultations, doctors need to combine the inquiry dialogues from previous rounds with the current round to make a comprehensive determination, the server fine-tunes the feature vector representation output by the network model when it determines that the strategy category of the current dialogue round's inquiry dialogue output by the network model is a fallback strategy, thus obtaining the target strategy category to which the inquiry dialogue belongs. Through the technical solution provided in this embodiment, the corresponding target strategy category can be more accurately identified for inquiry dialogues formed during online consultations by patients or their families, thereby providing corresponding responses.

[0086] As can be seen, the policy recognition method based on query dialogue in this application predicts the policy category of the query dialogue of the target object through the network model trained in the above embodiments. When the predicted policy category is a fallback policy, the feature vector representation output by the network model is fine-tuned, thereby further determining the policy category to which the query dialogue of the target object belongs and improving the accuracy of policy category recognition.

[0087] For details, please refer to [link / reference]. Figure 8 , Figure 8 yes Figure 7 The flowchart illustrates an exemplary embodiment of step S720 in the query-based policy recognition method. In one exemplary embodiment, fine-tuning is performed based on the output of the network model, and the target policy category is identified based on the fine-tuned vector. Other steps for target policy category identification are described in the foregoing embodiments and will not be repeated here.

[0088] like Figure 8As shown, in an exemplary embodiment, step S720, which involves fine-tuning the feature vector representation output by the network model to obtain the target policy category to which the query dialogue belongs, further includes at least steps S810 to S840, which are detailed below:

[0089] Step S810: Determine the policy weight matrix for each dialogue round based on the feature vector representation output by the network model in each dialogue round.

[0090] The strategy weight matrix refers to the learnable weight matrix, which is determined based on the feature vector representation of each dialogue turn.

[0091] The server determines the policy weight matrix for each dialogue turn based on the feature vector representations output by the network model at each dialogue turn. For example, if the server needs to determine the policy weight matrix for the current dialogue turn, it needs to determine the policy weight matrix for the current dialogue turn based on the feature vector representations of the dialogue turns preceding the current dialogue turn and the feature vector representation of the current dialogue turn.

[0092] Optional, can be adopted Figure 9 Steps S910 to S920 in the illustrated embodiment are implemented in the following detail:

[0093] Step S910: Sort the feature vector representations of the corresponding dialogue rounds and the feature vectors of other dialogue rounds earlier than the corresponding dialogue rounds according to the dialogue round number from smallest to largest.

[0094] The corresponding dialogue turn refers to the dialogue turn in which the strategy weight matrix needs to be calculated. Specifically, it can be the current dialogue turn or other dialogue turns preceding the current dialogue turn. Among them, the current dialogue turn refers to the ongoing dialogue turn during the patient's consultation process.

[0095] The server sorts the feature vector representations of the corresponding dialogue round and other dialogue rounds in ascending order of dialogue round. For example, if the corresponding dialogue round is the 4th dialogue round in the consultation process, and the feature vector representation of the first dialogue round is 'a', the feature vector representation of the second dialogue round is 'b', the feature vector representation of the third dialogue round is 'c', and the feature vector representation of the fourth dialogue round is 'd', then the feature vector representations corresponding to the first to fourth dialogue rounds are sorted to obtain the sorted feature vector representations a, b, c, and d.

[0096] Step S920: Determine the strategy weight matrix for the corresponding dialogue round based on the sorted feature vector representation, so as to obtain the strategy weight matrix for each dialogue round.

[0097] The server determines the policy weight matrix for the corresponding dialogue round based on the sorted feature vector representation. Continuing with the example in step S910 above, the server matrices the sorted feature vector representations a, b, c, d, that is, it transforms them into matrix form, thus obtaining the policy weight matrix [a, b, c, d] for the corresponding dialogue round.

[0098] Step S820: Determine the probability matrix of the current dialogue round based on the strategy weight matrix of the current dialogue round and the strategy weight matrices of other dialogue rounds earlier than the current dialogue round.

[0099] The probability matrix is ​​determined based on the strategy weight matrix of the current dialogue round and the strategy weight matrices of other dialogue rounds.

[0100] The server determines the probability matrix for the current dialogue round based on the policy weight matrix of the current dialogue round and the policy weight matrices of other dialogue rounds.

[0101] Optional, can be adopted Figure 10 The details of step S820 in the illustrated embodiment are as follows:

[0102] Step 1010: Calculate the similarity of the strategy weight matrix between the current dialogue round and the strategy weight matrix of other dialogue rounds.

[0103] Weight matrix similarity refers to the degree of similarity between the weight matrices of two dialogue rounds.

[0104] The server calculates the similarity between the strategy weight matrix of the current dialogue round and the weight matrix of other dialogue rounds, thus obtaining the similarity between the weight matrix of the current dialogue round and each dialogue round in other dialogue rounds.

[0105] Step 1020: Select the maximum weight matrix similarity.

[0106] The server selects the maximum similarity among the calculated similarity of multiple weight matrices.

[0107] Step 1030: The product of the strategy weight matrix of the dialogue round corresponding to the maximum weight matrix similarity and the strategy weight matrix of the current dialogue round is used as the probability matrix of the current dialogue round.

[0108] The server calculates the product between the policy weight matrix of the dialogue round corresponding to the maximum weight matrix similarity and the policy weight matrix of the current dialogue round, and uses the calculated product as the probability matrix of the current dialogue round.

[0109] Step S830: The product of the probability matrix of the current dialogue round and the policy weight matrix of the current dialogue round is used as the fine-tuning vector.

[0110] The fine-tuning vector refers to the vector obtained by fine-tuning the feature vector of the current dialogue turn output by the network model.

[0111] The server uses the product of the probability matrix of the current dialogue turn and the policy weight matrix of the current dialogue turn as the fine-tuning vector.

[0112] Step S840: Input the fine-tuning vector into the network model to obtain the target policy category to which the query dialogue belongs.

[0113] The server inputs the calculated fine-tuning vector into the network model to obtain the target policy category of the query dialogue. It should be noted that the network model at this time can be a bidirectional long short-term memory network (Bi-LSTM).

[0114] As can be seen, the policy recognition method based on query dialogue in this embodiment determines the policy weight matrix of each dialogue round according to the feature vector representation output by the network model in each dialogue round; and determines the probability matrix of the current dialogue round according to the policy weight matrix of the current dialogue round and the policy weight matrices of other dialogue rounds earlier than the current dialogue round; then determines the product between the probability matrix of the current dialogue round and the policy weight matrix of the current dialogue round as the fine-tuning vector; inputting the fine-tuning vector into the network model, the target policy category to which the query dialogue belongs is obtained. Thus, when the policy category of the query dialogue identified by the network model is a fallback policy, a secondary recognition can be performed to reduce the probability of identifying the fallback policy by combining other dialogue rounds earlier than the current dialogue round.

[0115] Figure 11 This is a block diagram illustrating a network model training apparatus according to an exemplary embodiment of this application. The apparatus can be applied to… Figure 1 The implementation environment shown is not limited to this embodiment. This device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applicable.

[0116] like Figure 11 As shown, the exemplary network model training device 1100 includes an acquisition module 111, an input module 112, a calculation module 113, and a training module 114. Specifically:

[0117] The acquisition module 111 is configured to acquire query dialogue samples, the sample strategy category to which the query dialogue samples belong, and the sample dialogue round to which the query dialogue samples belong.

[0118] Input module 112 is configured to input query dialogue samples into the network model, which outputs the strategy category of the query dialogue sample and the dialogue round in which the query dialogue sample is located.

[0119] The calculation module 113 is configured to calculate a first loss function between the output policy category and the sample policy category, and to calculate a second loss function between the output dialogue turn and the sample dialogue turn.

[0120] Training module 114 is configured to train the network model with the goal of reducing the sum of the loss values ​​of the first loss function and the second loss function, until the sum of the loss values ​​of the first loss function and the second loss function determined by the trained network model is less than a preset loss threshold.

[0121] In another exemplary embodiment, the input module 112 further includes a feature vector extraction module and a policy category recognition module. Specifically:

[0122] The feature vector extraction module is configured to perform feature vector extraction processing on the query dialogue sample according to the feature extractor, so as to use the vector parameter at the first position in the end hidden layer of the feature extractor as the feature vector representation of the output of the feature extractor.

[0123] The strategy category recognition module is configured to perform recognition processing on the feature vector representation according to the strategy category recognizer in order to obtain the strategy category of the query dialogue sample and the dialogue round in which the query dialogue sample belongs.

[0124] In another exemplary embodiment, the policy category identification module further includes a first mapping module and a second mapping module. Specifically:

[0125] The first mapping module is configured to map the feature vector representation output by the feature extractor to a fully connected layer for policy category recognition, so as to obtain the policy category of the query dialogue sample.

[0126] The second mapping module is configured to map the feature vector representation output by the feature extractor to a fully connected layer for dialogue turn recognition, so as to obtain the dialogue turn in which the query dialogue sample is located.

[0127] Figure 12 This is a block diagram illustrating a policy recognition device based on query dialogue, as shown in an exemplary embodiment of this application. This device can be applied to... Figure 1 The implementation environment shown is not limited to this embodiment. This device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applicable.

[0128] like Figure 12As shown, the exemplary question-based dialogue-based strategy recognition device 1200 includes a strategy category and current dialogue turn determination module 121 and a fine-tuning module 122, specifically:

[0129] The strategy category and current dialogue turn determination module 121 is configured to input the query dialogue of the target object into the network model to obtain the strategy category and the current dialogue turn of the query dialogue.

[0130] The fine-tuning module 122 is configured to fine-tune the feature vector representation output by the network model if the policy category output by the network model is a fallback policy, so as to obtain the target policy category to which the query dialogue belongs. The network model is the network model trained by the above method.

[0131] In another exemplary embodiment, the fine-tuning module 122 further includes a strategy weight matrix determination module, a probability matrix determination module for the current dialogue turn, a fine-tuning vector calculation module, and a target strategy category acquisition module. Specifically:

[0132] The strategy weight matrix determination module is configured to determine the strategy weight matrix for each dialogue round based on the feature vector representation output by the network model in each dialogue round.

[0133] The probability matrix determination module for the current dialogue round is configured to determine the probability matrix for the current dialogue round based on the strategy weight matrix of the current dialogue round and the strategy weight matrices of other dialogue rounds that are earlier than the current dialogue round.

[0134] The fine-tuning vector calculation module is configured to determine the product between the probability matrix of the current dialogue round and the policy weight matrix of the current dialogue round as the fine-tuning vector.

[0135] The target policy category acquisition module is configured to input the fine-tuning vector into the network model to obtain the target policy category to which the query dialogue belongs.

[0136] In another exemplary embodiment, the probability matrix determination module for the current dialogue turn further includes a weight matrix similarity calculation module, a selection module, and a product calculation module. Specifically:

[0137] The weight matrix similarity calculation module is configured to calculate the weight matrix similarity between the strategy weight matrix of the current dialogue round and the strategy weight matrix of other dialogue rounds, and obtain multiple weight matrix similarities.

[0138] The selection module is configured to select the maximum weight matrix similarity among multiple weight matrix similarities.

[0139] The product calculation module is configured to use the product of the strategy weight matrix of the dialogue round corresponding to the maximum weight matrix similarity and the strategy weight matrix of the current dialogue round as the probability matrix of the current dialogue round.

[0140] In another exemplary embodiment, the strategy weight matrix determination module further includes a sorting module and a strategy weight matrix determination module for each dialogue round. Specifically:

[0141] The sorting module is configured to sort the feature vector representations of the corresponding dialogue turn and the feature vectors of other dialogue turns that precede the corresponding dialogue turn in ascending order of dialogue turn number.

[0142] The strategy weight matrix determination module for each dialogue round is configured to determine the strategy weight matrix for the corresponding dialogue round based on the sorted feature vector representation, so as to obtain the strategy weight matrix for each dialogue round.

[0143] It should be noted that the network model training device and / or query-based policy recognition device provided in the above embodiments belong to the same concept as the network model training method and / or query-based policy recognition method provided in the above embodiments. The specific methods by which each module and unit performs its operations have been described in detail in the method embodiments and will not be repeated here. In practical applications, the network model training device and / or query-based policy recognition device provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. This is not a limitation here.

[0144] Embodiments of this application also provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the network model training method and / or the query dialogue-based policy recognition method provided in the above embodiments.

[0145] Figure 13 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown.

[0146] It should be noted that, Figure 13 The computer system 1300 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0147] like Figure 13As shown, the computer system 1300 includes a Central Processing Unit (CPU) 1301, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1302 or programs loaded from storage portion 1308 into Random Access Memory (RAM) 1303, such as performing the methods described in the above embodiments. Various programs and data required for system operation are also stored in RAM 1303. The CPU 1301, ROM 1302, and RAM 1303 are interconnected via bus 1304. An Input / Output (I / O) interface 1305 is also connected to bus 1304.

[0148] The following components are connected to I / O interface 1305: an input section 1306 including a keyboard, mouse, etc.; an output section 1307 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. Drive 1 is also connected to I / O interface 1305 as needed. Removable media 1311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1310 as needed so that computer programs read from them can be installed into storage section 1308 as needed.

[0149] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1310, and / or installed from removable medium 1311. When the computer program is executed by central processing unit (CPU) 1301, it performs various functions defined in the system of this application.

[0150] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. The transmitted data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

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

[0152] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0153] Another aspect of this application provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.

[0154] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various embodiments described above.

[0155] The above description is merely a preferred exemplary embodiment of this application and is not intended to limit the implementation of this application. Those skilled in the art can easily make corresponding modifications or alterations based on the main concept and spirit of this application. Therefore, the scope of protection of this application should be determined by the scope of protection claimed in the claims.

Claims

1. A method for policy recognition based on an interrogation dialogue, characterized in that, The method comprises: inputting an inquiry dialogue of a target object into a network model to obtain a policy category to which the inquiry dialogue belongs and a current dialogue round in which the inquiry dialogue is located; if the policy category output by the network model is a catch-all policy, performing fine-tuning processing on a feature vector representation output by the network model to obtain a target policy category to which the inquiry dialogue belongs; wherein the step of performing fine-tuning processing on the catch-all policy output by the network model to obtain the target policy category to which the inquiry dialogue belongs comprises: determining a policy weight matrix of each dialogue round according to feature vector representations output by the network model in each dialogue round; determining a probability matrix of the current dialogue round according to the policy weight matrix of the current dialogue round and policy weight matrices of other dialogue rounds earlier than the current dialogue round; taking a product between the probability matrix of the current dialogue round and the policy weight matrix of the current dialogue round as a fine-tuning vector; inputting the fine-tuning vector into the network model to obtain the target policy category to which the inquiry dialogue belongs.

2. The method of claim 1, wherein, The training method of the network model comprises: obtaining an inquiry dialogue sample, a sample policy category to which the inquiry dialogue sample belongs, and a sample dialogue round in which the inquiry dialogue sample is located; inputting the inquiry dialogue sample into the network model, the network model being configured to output a policy category to which the inquiry dialogue sample belongs and a dialogue round in which the inquiry dialogue sample is located; calculating a loss value of a first loss function between the output policy category and the sample policy category, and calculating a loss value of a second loss function between the output dialogue round and the sample dialogue round; training the network model with the aim of reducing the sum of the loss value of the first loss function and the loss value of the second loss function until the sum of the loss value of the first loss function and the loss value of the second loss function determined by the trained network model is less than a preset loss threshold.

3. The method of claim 2, wherein, The network model comprises a feature extractor and a policy category identifier, and the step of inputting the inquiry dialogue sample into the network model, the network model being configured to output a policy category to which the inquiry dialogue sample belongs and a dialogue round in which the inquiry dialogue sample is located, comprises: performing feature vector extraction processing on the inquiry dialogue sample according to the feature extractor to take a vector parameter at a first position in a terminal hidden layer of the feature extractor as a feature vector representation output by the feature extractor; performing identification processing on the feature vector representation according to the policy category identifier to obtain a policy category to which the inquiry dialogue sample belongs and a dialogue round in which the inquiry dialogue sample is located.

4. The method of claim 3, wherein, The policy category identifier comprises a fully connected layer for policy category identification and a fully connected layer for dialogue round identification, and the step of performing identification processing on the feature vector representation according to the category identifier to obtain a policy category to which the inquiry dialogue sample belongs and a dialogue round in which the inquiry dialogue sample is located comprises: map the feature vector representation output by the feature extractor into the fully connected layer for policy category recognition to obtain a policy category to which the inquiry dialogue sample belongs; map the feature vector representation output by the feature extractor into the fully connected layer for dialogue turn recognition to obtain a dialogue turn in which the inquiry dialogue sample is located.

5. The method of claim 1, wherein, The step of determining the probability matrix of the current dialogue turn according to the policy weight matrix of the current dialogue turn and the policy weight matrix of other dialogue turns located between the current dialogue turn, comprises: calculating a weight matrix similarity between the policy weight matrix of the current dialogue turn and the policy weight matrix of the other dialogue turns; selecting a maximum weight matrix similarity; taking a product between the policy weight matrix of the dialogue turn corresponding to the maximum weight matrix similarity and the policy weight matrix of the current dialogue turn as the probability matrix of the current dialogue turn.

6. The method of claim 1, wherein, The step of determining the policy weight matrix of each dialogue turn according to the feature vector representation output by the network model at each dialogue turn, comprises: performing sorting processing on the feature vector representation of the corresponding dialogue turn and the feature vectors of other dialogue turns located before the corresponding dialogue turn according to the dialogue turns from small to large; determining the policy weight matrix of the corresponding dialogue turn based on the sorted feature vector representation to obtain the policy weight matrix of each dialogue turn.

7. An apparatus for policy recognition based on a question-answer dialogue, characterized by The device comprises: a determination module configured to input an inquiry dialogue of a target object into a network model to obtain a policy category to which the inquiry dialogue belongs and a current dialogue turn in which the inquiry dialogue is located; a fine-tuning module configured to fine-tune a bottom-up policy output by the network model to obtain a target policy category to which the inquiry dialogue belongs if the policy category output by the network model is the bottom-up policy; The fine-tuning module is further configured to determine a policy weight matrix of each dialogue turn according to the feature vector representation output by the network model at each dialogue turn, determine a probability matrix of the current dialogue turn according to the policy weight matrix of the current dialogue turn and the policy weight matrix of other dialogue turns earlier than the current dialogue turn, take a product between the probability matrix of the current dialogue turn and the policy weight matrix of the current dialogue turn as a fine-tuning vector, and input the fine-tuning vector into the network model to obtain the target policy category to which the inquiry dialogue belongs.

8. The apparatus of claim 7, wherein, The device further comprises a training device configured to train the network model, the training device comprising: an acquisition module configured to acquire inquiry dialogue samples, sample policy categories to which the inquiry dialogue samples belong, and sample dialogue turns in which the inquiry dialogue samples are located; an input module configured to input the inquiry dialogue samples into the network model, the network model being used to output policy categories to which the inquiry dialogue samples belong and dialogue turns in which the inquiry dialogue samples are located; The calculation module is configured to calculate a first loss function between the output strategy category and the sample strategy category, and to calculate a second loss function between the output dialogue turn and the sample dialogue turn; The training module is configured to train the network model with the goal of reducing the sum of the loss values ​​of the first loss function and the second loss function, until the sum of the loss values ​​of the first loss function and the second loss function determined by the trained network model is less than a preset loss threshold.

9. An electronic device, comprising: include: Memory, which stores computer-readable instructions; The processor reads computer-readable instructions stored in memory to execute the policy recognition method based on interrogation dialogue as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Training method, device and system of intelligent voice robot

    CN112992128A

  • Dialogue strategy model training and dialogue method and system

    CN113010653A

  • Multi-round dialogue recognition model training method and device, equipment and storage medium

    CN115358243A