A method and system for processing semantics of consultation dialogues for smart health care

By performing circular adjustment and optimization of component parameter variables on the neural network of the smart health care consulting dialogue system, the system's understanding difficulties in semantic processing, the problem of dialogue dynamics and insufficient contextual information is solved, and more accurate dialogue feedback and better user experience is achieved.

CN119476305BActive Publication Date: 2025-03-18贵阳康养职业大学
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510045415.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-03-18
Estimated Expiration
2045-01-13

AI Technical Summary

Technical Problem

The existing smart health care consultation dialogue system has complex natural language expression comprehension difficulties in semantic processing and insufficient dialogue dynamics and contextual information, resulting in inaccurate or unrelated responses.

Method used

A consulting dialogue semantic processing method applied to smart health care is adopted. By obtaining training examples carrying prior marks, the training neural network is cyclically adjusted, the component parameter variables of multi-layer perceptron components are optimized, and the semantic feature extraction accuracy of dialogue feedback text is improved.

Benefits of technology

It improves the accuracy of the determination of dialogue feedback text, enhances the system's semantic understanding ability when handling complex consultations, and improves the user experience of the elderly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476305B_ABST
    Figure CN119476305B_ABST
Patent Text Reader

Abstract

The present application provides a method and system for processing the semantics of consultation dialogues applied to smart health care. When the network is repeatedly adjusted according to the first text sample library, the first text semantic features of each first training example are first obtained according to the initial multi-layer perceptron component, and the first training error of the reasoning component based on the first text semantic features is obtained at the same time. Then, the first text semantic features are optimized according to the first training error, and then the second training error of the reasoning component based on the optimized second text semantic features is obtained. The second text semantic features can characterize the information of the dialogue between the feedback and the consultation, and transition from the initial stage to the mature stage. The first training error and the second training error are jointly used to train the multi-layer perceptron component to obtain the multi-layer perceptron component that extracts features for the new dialogue feedback text, thereby increasing the accuracy of the multi-layer perceptron component in extracting the semantic features of the dialogue feedback text, and further improving the accuracy of the feedback text determination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of text processing, and more specifically, to a method and system for semantic processing of consulting dialogues applied to smart health care. Background Art

[0002] With the development of society and the aging of the population, the health and quality of life of the elderly have received more and more attention. As an emerging elderly care model, smart health care aims to use modern information technology, such as artificial intelligence, big data, and the Internet of Things, to provide more convenient, efficient, and personalized health management and life services for the elderly. In the field of smart health care, consultation dialogue is a form of interaction. The elderly can obtain health consultation, life advice and other information by talking to the intelligent system. The existing smart health care consultation dialogue system has some problems in semantic processing. On the one hand, traditional semantic processing methods are often based on rules or templates, which are difficult to handle complex natural language expressions and semantic understanding problems. For example, for some vague and colloquial consultations of the elderly, the system may not be able to accurately understand their intentions, resulting in inaccurate or irrelevant responses. On the other hand, the existing system can use a single training error to optimize the model during the training process, which cannot fully consider the dynamics and contextual information of the conversation. This may cause the model to be unable to accurately extract the semantic features of the dialogue feedback text when processing new consultations, thereby affecting the accuracy of the feedback text determination. Summary of the invention

[0003] The purpose of the present invention is to provide a method and system for processing semantics of consultation dialogues applied to smart health care. The present application is implemented as follows:

[0004] In a first aspect, the present application provides a method for semantic processing of consulting dialogues applied to smart health care, the method comprising: obtaining a first text sample library of a first dialogue context and a neural network to be trained, the first text sample library comprising multiple first training examples carrying prior labels, each first training example comprising a dialogue feedback text corresponding to the first dialogue context and a dialogue consultation text corresponding to the dialogue feedback text, the neural network to be trained comprising an initial multi-layer perceptron component and a pre-trained reasoning component, the prior label of the first training example being used to indicate an actual fit confidence of the dialogue feedback text in the first training example corresponding to the dialogue consultation text in the first training example; completing a first calibration process of the neural network to be trained cyclically according to the first text sample library until a first dialogue semantic processing network is obtained by meeting a first convergence requirement, and obtaining a target dialogue semantic processing network according to the first dialogue semantic processing network, so as to select dialogue feedback text according to the target dialogue semantic processing network.

[0005] Among them, the first adjustment process includes: loading each of the first training examples into the initial multi-layer perceptron component to obtain the first text semantic features of each of the first training examples; inputting each of the first training examples and the first text semantic features of each of the first training examples into the reasoning component to obtain the first reasoning fit confidence of each of the first training examples, and determining the first training error corresponding to each of the first training examples based on the first reasoning fit confidence and prior labels of each of the first training examples; optimizing the first text semantic features of each of the first training examples based on the first training errors of each of the first training examples to obtain the second text semantic features of each of the first training examples; determining the second training error corresponding to each of the first training examples based on the second text semantic features and prior labels of each of the first training examples; optimizing the component parameters of the initial multi-layer perceptron component based on the first training errors and the second training errors corresponding to each of the first training examples.

[0006] In a second aspect, the present application provides a computer system comprising: one or more processors; a memory; one or more computer programs; wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and when the one or more computer programs are executed by the processors, the method as described above is implemented.

[0007] The consultation dialogue semantic processing method for smart health care provided by the present application, in the process of repeatedly adjusting the training neural network according to the first text sample library, first obtains the first text semantic features of each first training example according to the initial multi-layer perceptron component, and obtains the first training error of the reasoning component according to the first text semantic features. Then, the first text semantic features are optimized according to the first training error, and then the second training error of the reasoning component according to the optimized second text semantic features is obtained. Because the first training error is the training error corresponding to the reasoning under the premise that there is no dialogue consultation text and dialogue feedback text, it is the training error in the initial stage, and the second text semantic feature is obtained by optimizing the dialogue environment of the dialogue feedback text and the dialogue consultation text, then the second text semantic feature can characterize the information of the dialogue between feedback and consultation, and transition from the initial stage to the mature stage, it is no longer a cold start, and the first training error and the second training error are combined to train the multi-layer perceptron component to obtain the multi-layer perceptron component that extracts features for the new dialogue feedback text, which increases the accuracy of the multi-layer perceptron component in extracting the semantic features of the dialogue feedback text, further improves the accuracy of the feedback text determination, and improves the user experience of the elderly. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0009] Figure 1 It is a flowchart of a method for semantic processing of consultation dialogues applied to smart health care provided in an embodiment of the present application.

[0010] Figure 2 It is a schematic diagram of the first calibration process provided in an embodiment of the present application.

[0011] Figure 3 It is a schematic diagram of the composition of a computer system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0012] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method part of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0013] The execution subject of the consultation dialogue semantic processing method applied to smart health care in the embodiment of the present application is a computer system, including but not limited to a server, a personal computer, a laptop, a tablet computer, a smart phone, etc. Figure 1 As shown, the method includes:

[0014] Step S100: Obtain a first text sample library of a first dialogue context and a neural network to be trained, wherein the first text sample library includes multiple first training examples carrying prior labels, each first training example includes a dialogue feedback text corresponding to the first dialogue context and a dialogue consultation text corresponding to the dialogue feedback text, the neural network to be trained includes an initial multi-layer perceptron component and a pre-trained reasoning component, and the prior label of the first training example is used to indicate the actual fit confidence of the dialogue feedback text in the first training example corresponding to the dialogue consultation text in the first training example.

[0015] The first dialogue context refers to the specific communication background and semantic environment in the smart health consultation dialogue. For example, in the scenario of health consultation for the elderly, the dialogue situation around the symptoms, treatment plans, rehabilitation suggestions and other aspects of common diseases of the elderly constitutes a specific first dialogue context. Different dialogue topics, participants and dialogue purposes will form different dialogue contexts. In this context, the computer system understands the semantic logic in order to accurately handle the relevant consultation dialogues.

[0016] The first text sample library includes a plurality of first training examples with priori markers, each of which consists of a dialogue feedback text corresponding to the first dialogue context and a dialogue consultation text corresponding to the dialogue feedback text. These text data can be obtained by converting the speech in the elderly dialogue into text. For example, when the elderly ask "I always feel dizzy recently, what's going on?" as the dialogue consultation text, the reply "dizziness may be caused by unstable blood pressure, anemia or lack of sleep" collected by the computer system is used as the dialogue feedback text, and this pair of texts constitutes a first training example. The priori marker is used to indicate the actual fit confidence of the dialogue feedback text corresponding to the dialogue consultation text, that is, to indicate the suitability of the dialogue feedback text as feedback of the dialogue consultation text. This suitability can be determined by professional medical knowledge evaluation or feedback data from a large number of users. For example, setting the fit confidence to 0.8 indicates that the feedback text has a high degree of match with the consultation text.

[0017] The implementation method of the computer system obtaining the first text sample library can be implemented in a variety of ways. One way is to use speech recognition technology to transcribe the recorded conversation between the elderly and the health care service personnel in real time. Currently, widely used speech recognition algorithms such as the combination of hidden Markov model (HMM) and deep neural network (DNN) in deep neural network (ie DNN-HMM) can accurately convert speech signals into text form. By training on a large amount of speech data, the model can learn the mapping relationship between speech features and text, thereby achieving efficient and accurate speech recognition.

[0018] After collecting the text data, the computer system organizes and annotates it to generate the first text sample library. In this process, professional annotators or automated annotation tools based on predefined rules will add a priori tags to each training example based on the degree of semantic matching between the dialogue feedback text and the dialogue consultation text. For example, a scoring system is used, from 0 to 1 to indicate the confidence level of fit, 0 indicates a complete mismatch, and 1 indicates a complete match. The annotators score and annotate each example based on their expertise and experience.

[0019] The neural network to be trained is the core model used by the computer system to process the semantics of the conversation. It includes an initial multi-layer perceptron component and a pre-training inference component. The initial multi-layer perceptron component is a feedforward neural network consisting of an input layer, multiple hidden layers, and an output layer. Each layer consists of multiple neurons, which are connected by weights. When processing the conversation text, the input layer receives the feature representation of the text, and finally outputs the processing result in the output layer through the nonlinear transformation of the hidden layer. For example, the input layer can receive the word vector representation of the conversation text, and output a vector representing the semantic features of the text through the calculation of the hidden layer.

[0020] The pre-trained reasoning component is a network layer with prediction capabilities. It can infer based on the input text semantic features to determine the degree of fit between the dialogue feedback text and the dialogue consultation text. For example, in the above example, the reasoning component receives the text semantic feature vector output by the multi-layer perceptron component, and after its own calculation, outputs a predicted fit confidence. This predicted value can be compared with the prior mark to evaluate the performance of the model.

[0021] The computer system obtains the neural network to be trained by, for example, loading a pre-trained model or initializing it according to a preset network structure. For pre-trained models, general language models trained on large-scale text data, such as BERT (Bidirectional Encoder Representations from Transformers), can be used, and some of its layers can be used as the basis for the initial multi-layer perceptron components and reasoning components, and then fine-tuned according to the characteristics of the smart health care field. If initialized according to a preset network structure, it is necessary to determine the number of network layers, the number of neurons in each layer, the activation function and other parameters, and then randomly initialize the weights to construct the neural network to be trained.

[0022] Step S200: completing a first calibration process for the neural network to be trained according to the first text sample library, until a first dialogue semantic processing network is obtained by meeting a first convergence requirement, and obtaining a target dialogue semantic processing network according to the first dialogue semantic processing network, so as to select dialogue feedback text according to the target dialogue semantic processing network.

[0023] The purpose of the first tuning process is to continuously adjust the parameters of the neural network so that it can process the conversation semantics more accurately and improve the ability to predict the fit between the conversation feedback text and the conversation consultation text. In each cycle, the computer system uses the data in the first text sample library to train and optimize the neural network.

[0024] For example, suppose that in a smart health care scenario, the first text sample library contains a large number of consultation dialogue examples about health issues for the elderly, such as "I have not been sleeping well recently, what should I do?" and its corresponding feedback text "You can try to adjust your work and rest time, avoid using electronic devices before going to bed, and do appropriate relaxation exercises, etc." The computer system inputs these examples into the neural network to be trained, and continuously adjusts the network parameters through the first adjustment process, so that the network can learn the semantic relationship between the consultation text and the feedback text, so that when faced with a new consultation text, it can accurately select the appropriate feedback text.

[0025] The first convergence requirement is the criterion for judging whether the first calibration process is finished. For example, a loss function can be defined to measure the difference between the model's prediction result and the true mark (prior mark). When the value of the loss function is less than a preset threshold, the model is considered to have converged and meets the first convergence requirement. For example, the loss function can be the mean square error (MSE), and its formula is:

[0026] ;

[0027] Where n is the number of samples, is the true label of the ith sample (the actual confidence level of the prior label), is the confidence level of the model's prediction of the i-th sample. When the MSE value is less than the preset threshold , the computer system believes that the model has converged and obtains the first dialogue semantic processing network.

[0028] After obtaining the first dialogue semantic processing network, the computer system obtains the target dialogue semantic processing network based on the network. This process may involve further optimization and adjustment to adapt to more complex dialogue situations and improve the generalization ability of the model. For example, the computer system can improve the first dialogue semantic processing network by introducing more data, adjusting the network structure, or performing transfer learning.

[0029] The target dialogue semantic processing network is used to select dialogue feedback text. When a new dialogue consultation text is input, the computer system inputs it into the target dialogue semantic processing network, and the network outputs multiple dialogue feedback texts that match the consultation text and their corresponding matching confidences. The computer system selects the feedback text with the highest matching confidence as the final response.

[0030] In order to implement the first calibration process and obtain the target dialogue semantic processing network, the computer system can adopt multiple implementation methods. During the training process, optimization algorithms such as stochastic gradient descent (SGD) and its variants Adagrad, Adadelta, Adam, etc. can be used to update the parameters of the neural network. Taking the Adam algorithm as an example, its update formula is as follows:

[0031] ;

[0032] ;

[0033] ;

[0034] ;

[0035] ;

[0036] in, are the first-order moment estimate and the second-order moment estimate, respectively. is the decay rate, is the gradient at the current moment, are the modified first-order moment estimates and second-order moment estimates, is the updated parameter, is the learning rate, is a small constant used to prevent the denominator from being zero.

[0037] In addition, to prevent overfitting, computer systems can use regularization techniques such as L1 regularization and L2 regularization. L1 regularization penalizes the complexity of the model by adding the sum of the absolute values ​​of the parameters to the loss function. The formula is:

[0038] ;

[0039] Among them, L is the original loss function, is the regularization parameter, is the parameter of the model. L2 regularization penalizes the complexity of the model by adding the sum of squares of the parameters. The formula is:

[0040] .

[0041] Please refer to Figure 2 In one embodiment of the present application, the first calibration process includes the following steps S10-S50:

[0042] Step S10: loading each first training example into an initial multi-layer perceptron component to obtain a first text semantic feature of each first training example.

[0043] The initial multi-layer perceptron component is a feedforward neural network having an input layer, a hidden layer and an output layer composed of multiple neurons. When the computer system executes step S10, each first training example in the first text sample library is input into the initial multi-layer perceptron component for processing.

[0044] Specifically, each first training example contains a dialogue feedback text and a corresponding dialogue consultation text. The computer system converts these text data into a form suitable for neural network processing, such as using a word vector representation method. For example, for a simple dialogue consultation text "I have not slept well recently, what should I do?", the computer system maps each word in it to a low-dimensional vector, such as "I" can be mapped to a vector of length 100 [0.1, 0.2, ..., 0.9], "recently" is mapped to another vector of length 100 [0.3, 0.4, ..., 0.8] and so on. The matrix composed of these word vectors constitutes the input data of the training example in the input layer.

[0045] When these word vectors are input to the input layer of the initial multi-layer perceptron component, the data will undergo a series of nonlinear transformations in the hidden layer. Each neuron in the hidden layer will perform a weighted summation of the input data and perform nonlinear mapping through an activation function. The activation function is the ReLU (Rectified Linear Unit) function, and its formula is:

[0046] f(x)=max(0, x)

[0047] For example, for a neuron with input x=-2, after the ReLU activation function, the output is f(-2)=max(0, -2)=0; for input x=3, the output is f(3)=max(0, 3)=3. Through this nonlinear transformation, the multi-layer perceptron component can learn complex semantic information in text data.

[0048] After being processed by multiple hidden layers, the first text semantic feature of the first training example is finally obtained in the output layer. This feature is a vector representation that condenses the key semantic information in the text data. For example, for the above training example about sleep problems, the first text semantic feature vector obtained may be a vector of length 50 [0.5, 0.6, …, 0.4], which can characterize the semantic content expressed by the consultation text to a certain extent, such as information related to sleep problems and seeking solutions.

[0049] Step S20: Input each first training example and the first text semantic feature of each first training example into the reasoning component to obtain the first reasoning fit confidence of each first training example, and determine the first training error corresponding to each first training example based on the first reasoning fit confidence and the prior label of each first training example.

[0050] The computer system inputs the first training example and the corresponding first text semantic feature into the reasoning component. The reasoning component is a network layer with prediction capabilities, such as a fully connected layer. Its function is to predict the confidence of the fit between the dialogue feedback text and the dialogue consultation text based on the input information. For example, suppose there is a first training example, the dialogue consultation text is "I always have a headache recently, what's going on?", and the corresponding dialogue feedback text is "Headache may be caused by excessive stress, lack of sleep or brain disease, etc." The computer system has obtained the first text semantic feature vector of the training example in step S10, such as [0.3, 0.5, 0.2, …, 0.1]. The computer system inputs the text information of this training example and the first text semantic feature vector into the reasoning component.

[0051] The reasoning component performs complex calculations and reasoning based on these inputs, and outputs the first reasoning fit confidence of the first training example. This fit confidence indicates the degree of match between the dialogue feedback text predicted by the model and the dialogue consultation text, and the value range is between 0 and 1. The closer the value is to 1, the higher the match. For example, for the above example, the reasoning component may output a first reasoning fit confidence of 0.85, indicating that the model believes that the dialogue feedback text and the dialogue consultation text have a high degree of match.

[0052] Next, the computer system determines the first training error corresponding to each first training example based on the first reasoning fit confidence and the prior mark of each first training example. The prior mark is the actual fit confidence of the dialogue feedback text corresponding to the dialogue consultation text, which is manually annotated or determined according to specific rules when constructing the first text sample library. For example, for the above example, assuming that its prior mark is 0.9, it means that based on professional knowledge or experience, the actual match between this dialogue feedback text and the dialogue consultation text is 0.9.

[0053] The first training error can be calculated using the mean square error function to measure the difference between the predicted value (first inference fit confidence) and the true value (prior label).

[0054] Step S30: optimizing the first text semantic features of each first training example according to the first training error of each first training example to obtain the second text semantic features of each first training example.

[0055] Step S30 adjusts and improves the initial text semantic features by utilizing the difference between the model prediction and the actual situation reflected by the training error, so as to improve the model's ability to understand and process the conversation semantics.

[0056] In the specific operation process, the computer system analyzes the first training error of each first training example. The first training error is calculated in step S20 by comparing the first inference fit confidence and the prior mark, which quantifies the degree of prediction deviation of the model for each training example in the current state. For example, suppose there is a first training example, and its dialogue consultation text is "I feel knee pain recently, how can I relieve it?", and the dialogue feedback text is "You can try hot compress, massage, and avoid standing for a long time." The actual fit confidence given by the prior mark is 0.9, and the first inference fit confidence obtained in step S20 is 0.8. According to the mean square error formula, the first training error of this example is calculated to be (0.9 - 0.8) 2 =0.01.

[0057] Based on these first training errors, the computer system optimizes the first text semantic feature in a targeted manner. The first text semantic feature is obtained by loading the first training example into the initial multi-layer perceptron component in step S10, and is a vector representation of the semantic information of the dialogue text. For example, the first text semantic feature corresponding to the training example of knee pain may be a vector [0.2, 0.3, 0.1, …, 0.4] with a length of 100.

[0058] The purpose of optimization is to make the text semantic features more accurately reflect the true semantics of the dialogue text, thereby reducing the training error. The computer system uses, for example, a gradient-based optimization method to achieve this goal. The gradient represents the rate of change of a function at a certain point. By calculating the gradient of the first training error relative to the first text semantic feature, the computer system can determine in which direction to adjust the text semantic features to reduce the training error the fastest.

[0059] Taking a simple linear model as an example, assuming that the first text semantic feature vector is , the first training error is E, then the gradient of the first training error with respect to the first text semantic feature can be expressed as:

[0060] ;

[0061] The computer system updates the first text semantic feature according to the calculated gradient information. One updating method is to use the gradient descent algorithm, the basic idea of ​​which is to update the feature in the opposite direction of the gradient, because the opposite direction of the gradient is the direction in which the function value decreases fastest. The updating formula can be expressed as:

[0062] ;

[0063] in, represents the updated text semantic features, represents the original first text semantic feature, is the learning rate, which is used to control the step size of each update. The choice of learning rate needs to be cautious. Too large a learning rate may cause the update process to be unstable or even fail to converge; too small a learning rate will make the convergence speed too slow.

[0064] In this way, the computer system optimizes the first text semantic features of each first training example to obtain the corresponding second text semantic features. These optimized features can better capture the semantic information of the conversation text, laying the foundation for further improving the performance of the model in subsequent steps.

[0065] Step S40: determining a second training error corresponding to each first training example according to the second text semantic feature and the priori label of each first training example.

[0066] Step S40 re-evaluates the model error based on the optimized second text semantic features, further providing an accurate basis for subsequent optimization of the multi-layer perceptron components.

[0067] In step S30, the computer system has optimized the first text semantic features of each first training example and obtained the second text semantic features. These second text semantic features are improvements on the original semantic features after taking into account the first training error, and in theory can more accurately reflect the true semantic information of the dialogue text. For example, for a first training example about "consultation on insomnia problems for the elderly", the dialogue consultation text is "I always can't sleep at night, how can I improve it?", and the dialogue feedback text is "Drink a glass of warm milk before going to bed, relax, and avoid strenuous exercise." The first text semantic feature vector is obtained in step S10, and the second text semantic feature vector is obtained after optimization in step S30. Assuming that this vector is [0.4, 0.5, 0.3,…, 0.2], it can better reflect the semantic connotation of the consultation on insomnia problems and related feedback in the dialogue example than the first text semantic feature vector.

[0068] The prior label is determined when the first text sample library is constructed, and represents the actual matching confidence of the dialogue feedback text corresponding to the dialogue consultation text in each first training example. Continuing with the above insomnia problem as an example, assuming that the prior label of this example is 0.85, it represents the matching degree between this dialogue feedback text and the dialogue consultation text determined based on professional knowledge or a large amount of actual verification.

[0069] The computer system determines the second training error by inputting the second text semantic feature into the reasoning component to obtain a new reasoning result, and then comparing it with the prior label. The reasoning component calculates and infers based on the second text semantic feature, and outputs a new fit confidence, namely the second reasoning fit confidence. For example, after the reasoning component processes the second text semantic feature vector of the above insomnia problem, the output second reasoning fit confidence is 0.88.

[0070] The method for calculating the second training error is still to use a loss function (such as mean square error) to measure the difference between the new prediction value (second reasoning fit confidence) and the true value (prior label). By performing such calculations on all first training examples, the computer system can obtain the second training error corresponding to each example. These error values ​​reflect the degree of deviation between the model prediction and the actual situation based on the optimized second text semantic features. If the second training error is reduced compared to the first training error, it means that the optimization of the first text semantic features has played a positive role, making the model's prediction closer to the actual situation; conversely, if the second training error has not improved or even increased, it indicates that there may be problems with the optimization process and further analysis and adjustment are needed.

[0071] Step S50: Optimizing component parameters of the initial multilayer perceptron component according to the first training errors and the second training errors corresponding to each first training example.

[0072] Step S50 adjusts the parameters of the initial multi-layer perceptron component by comprehensively considering the two training errors, so that it can more accurately extract the semantic features of the dialogue text, thereby improving the performance of the entire model.

[0073] In the scenario of smart health care consultation dialogue, the computer system processes a large number of first training examples. For example, there is a first training example about consultation on joint pain in the elderly. The dialogue consultation text is "My knee hurts and it's hard to walk. What's going on?" The dialogue feedback text is "Knee pain may be caused by arthritis, meniscus injury or overwork." In the previous steps, the computer system has obtained the first training error and the second training error of this example. Assume that the first training error is the deviation value obtained by comparing with the prior mark after reasoning based on the semantic features of the first text; the second training error is obtained by reasoning based on the optimized semantic features of the second text and then comparing with the prior mark.

[0074] The initial multilayer perceptron component consists of multiple layers, each containing multiple neurons, which are connected by weights. These weights and the bias of the neurons are the component parameters. The goal of the computer system is to adjust these parameters so that the multilayer perceptron component can output features that more accurately reflect the semantics when processing the dialogue text, thereby reducing the error between the predicted fit confidence and the prior label.

[0075] To achieve this goal, the computer system adopts an optimization strategy that comprehensively considers the first training error and the second training error. Specifically, the first training error and the second training error are assigned corresponding weights, that is, influence factors. For example, the first training error is assigned the first influence factor , giving the second influencing factor to the second training error The values ​​of these influencing factors can be adjusted according to actual conditions. Generally, appropriate values ​​are determined through experiments or experience to balance the impact of the two errors on the optimization of component parameters.

[0076] Then, for each first training example, the computer system fuses the first training error and the second training error according to their respective influencing factors. Assume that the first training error of the i-th first training example is , the second training error is , the error after fusion It can be calculated by the following formula:

[0077] ;

[0078] After obtaining the error after fusion of each example, the computer system optimizes the component parameters of the initial multi-layer perceptron component based on these combined training errors. The optimization algorithm is the gradient descent algorithm and its variants. Taking the stochastic gradient descent (SGD) algorithm as an example, for a certain weight parameter w in the multi-layer perceptron component, its update formula is:

[0079] ;

[0080] in, is the updated weight, is the current weight, is the learning rate, which is used to control the step size of each update, It is the gradient of the total error (here, the sum of the errors after the fusion of all the first training examples) to the weight w. By calculating this gradient, the computer system can determine in which direction the weight parameter w should be adjusted and by how much, so that the total error changes in the direction of reduction.

[0081] In one implementation, step S100, obtaining a first text sample library in a first dialogue context, includes:

[0082] Step S110: Continue to receive and store the first training example.

[0083] The method also includes:

[0084] Step S501: Determine the number of dialogue feedback text types corresponding to the stored first training examples, and the number of first training examples corresponding to each type of dialogue feedback text.

[0085] Step S50, optimizing the component parameters of the initial multilayer perceptron component according to the first training error and the second training error corresponding to each first training example, including:

[0086] Step S51: When the number of dialogue feedback text types and the number of examples corresponding to each dialogue feedback text meet the iteration condition, the component parameters of the initial multilayer perceptron component are optimized according to the first training error and the second training error corresponding to each first training example.

[0087] In the semantic processing of the smart health care consultation dialogue, the computer system needs to continuously collect and accumulate data to enrich the first text sample library. Step S110 is the key step to achieve this data collection and storage.

[0088] In actual application scenarios, the computer system continuously receives the first training examples through multiple channels. For example, on the smart health care platform, the conversation between the elderly and health care service personnel will be recorded in real time. When the elderly ask consulting questions, such as "I have been suffering from insomnia recently, is there any good solution?", the health care service personnel give corresponding feedback "You can try drinking a glass of hot milk before going to bed, or do some relaxing meditation activities", the computer system receives this pair of questions and answers as a first training example.

[0089] In order to achieve continuous reception, the computer system can use network communication technology, such as HTTP protocol or WebSocket protocol. When the client (such as the front-end interface of the smart health care platform) establishes a connection with the server (the back-end service where the computer system is located), the client will send the newly generated conversation data to the server in a certain format. After receiving this data, the server will pre-process it, such as data cleaning, format conversion, etc., to ensure the accuracy and consistency of the data.

[0090] In terms of storage, the computer system can use a database management system (DBMS) to store the first training examples. Database types include relational databases (such as MySQL, Oracle) and non-relational databases (such as MongoDB, Redis). Taking a relational database as an example, the computer system can create a table named "training_examples" containing fields such as "consultation_text", "feedback_text" and "prior_mark". When a new first training example is received, the computer system inserts the relevant data into this table for storage for subsequent model training and optimization.

[0091] After a certain number of first training examples have been accumulated, the computer system analyzes and counts these data to better understand the distribution and characteristics of the data and provide a basis for subsequent model optimization. Step S501 is the step of completing this analysis and statistics task.

[0092] The computer system traverses all the first training examples stored in the database, and classifies and counts the dialogue feedback text of each example. For example, for consultation on insomnia, there may be many different types of feedback text, such as lifestyle adjustment ("drink hot milk before bed"), psychological adjustment ("do relaxing meditation activities"), medical advice ("consider consulting a doctor and prescribe some sleep aids"), etc. The computer system counts the number of these different types of dialogue feedback texts, as well as the number of examples of the first training examples corresponding to each type.

[0093] The computer system can classify the dialogue feedback text using a text classification algorithm, such as a word vector-based classification algorithm, a naive Bayes classification algorithm, etc. These algorithms can classify the text into different categories based on its semantic features. Then, the number of each dialogue feedback text type and the corresponding number of examples are calculated using counting statistics.

[0094] For example, suppose the computer system stores a total of 1,000 first training examples. After classification and statistics, it is found that there are 300 dialogue feedback texts in the lifestyle adjustment category, corresponding to 400 first training examples; there are 200 dialogue feedback texts in the psychological adjustment category, corresponding to 300 examples; there are 100 dialogue feedback texts in the medical advice category, corresponding to 200 examples. Through such statistical analysis, the computer system can understand the distribution of different types of dialogue feedback texts in the data set, providing valuable information for subsequent model optimization.

[0095] Step S51 is to trigger the optimization process of the component parameters of the initial multi-layer perceptron component according to specific conditions based on the data statistical analysis to further improve the performance of the model.

[0096] The iteration condition is a pre-set rule used to determine whether the current data situation is suitable for optimizing the model parameters. For example, the iteration condition is set to be that the number of dialogue feedback text types is not less than 5, and the number of examples corresponding to each dialogue feedback text is not less than 100. When the number of dialogue feedback text types and the number of examples corresponding to each type obtained by the computer system in step S501 meet this condition, the optimization process of the component parameters of the initial multi-layer perceptron component will be triggered.

[0097] During the optimization process, the computer system adjusts the component parameters according to the first training error and the second training error corresponding to each first training example. The first training error and the second training error are calculated in the previous step by comparing the confidence of the model prediction with the prior label, and they reflect the prediction accuracy of the model at different stages.

[0098] The specific optimization method can adopt a gradient-based optimization algorithm, such as stochastic gradient descent (SGD), Adagrad, Adadelta, Adam, etc. Taking the Adam algorithm as an example, its basic idea is to adaptively adjust the learning rate according to historical gradient information, so as to more effectively update the component parameters. The update formula of the Adam algorithm refers to the above introduction.

[0099] Through such an optimization process, the computer system can dynamically adjust the component parameters of the initial multi-layer perceptron components according to the actual situation of the data, so that it better meets the needs of semantic processing of smart health care consultation dialogues, improves the accuracy and generalization ability of the model, and thus provides better consulting services for the elderly.

[0100] In one implementation, in step S200, obtaining a target dialogue semantic processing network according to the first dialogue semantic processing network includes:

[0101] Step S210: obtaining a second text sample library of a second dialogue context, the second text sample library including a plurality of second training examples carrying a priori labels, each second training example including a dialogue feedback text corresponding to the second dialogue context and a dialogue consultation text corresponding to the dialogue feedback text;

[0102] Step S220: looping through a second calibration process for the first dialogue semantic processing network according to the second text sample library until the second convergence requirement is met, thereby obtaining a target dialogue semantic processing network, wherein the first dialogue semantic processing network includes a first multi-layer perceptron component and an inference component obtained according to the first calibration process.

[0103] The second adjustment process includes:

[0104] Step S101: loading each second training example into the first multi-layer perceptron component to obtain a third text semantic feature of each second training example;

[0105] Step S102: inputting each second training example and the third text semantic feature of each second training example into the reasoning component, obtaining the second reasoning fit confidence of each second training example, and determining the third training error corresponding to each second training example according to the second reasoning fit confidence and the priori mark of each second training example;

[0106] Step S103: optimizing the first text semantic feature of each second training example according to the third training error corresponding to each second training example, to obtain the fourth text semantic feature corresponding to each second training example;

[0107] Step S104: determining a fourth training error corresponding to each second training example according to the fourth text semantic feature and the priori mark corresponding to each second training example;

[0108] Step S105: optimizing the component parameters of the first multilayer perceptron component according to the third training error and the fourth training error corresponding to each second training example.

[0109] In the process of semantic processing of smart health consultation dialogue, after completing the first stage of model training and obtaining the first dialogue semantic processing network, the computer system needs to further obtain new data to optimize and improve the model to adapt to a wider range of dialogue situations and improve the generalization ability of the model. Step S210 is an operation for obtaining a second text sample library in the context of a second dialogue.

[0110] The context of the second dialogue may be different from that of the first dialogue. For example, in the field of smart health care, the context of the first dialogue may focus on general consultations on common diseases of the elderly, such as daily precautions for diseases such as hypertension and diabetes; while the context of the second dialogue may focus more on rehabilitation suggestions for specific diseases, such as rehabilitation training methods after stroke. This change in context reflects the consultation dialogues at different stages and with different needs in actual application scenarios.

[0111] The computer system obtains the second text sample library in a similar way to the first text sample library. Data can be collected through multiple channels, such as continuing to record new conversation data between the elderly and health care service personnel on the smart health care platform. For example, when an elderly person asks "How to perform hand function rehabilitation training after a stroke?", the health care service personnel give corresponding feedback "You can do grip strength training, starting with holding a soft ball, gradually increase the grip strength, and practice multiple times a day", and the computer system receives this pair of questions and answers as a second training example.

[0112] To ensure the quality and consistency of the data, the computer system will also pre-process the collected data. This includes data cleaning, removing noise data, duplicate data, and incomplete data; format conversion, converting data from different sources into a format suitable for model processing; and annotation, adding a priori tags to each second training example to indicate the actual fit confidence of the dialogue feedback text corresponding to the dialogue consultation text. For example, for the above-mentioned stroke rehabilitation training example, based on professional knowledge and experience, the manual annotation of its prior tag is 0.85, indicating that the feedback text has a high degree of match with the consultation text.

[0113] The computer system stores the pre-processed second training examples in a new database or data file to form a second text sample library. This sample library will serve as an important data basis for subsequent model adjustment, providing more learning information for the model so that it can better adapt to different dialogue contexts.

[0114] In step S220, after obtaining the second text sample library, the computer system further optimizes and adjusts the first dialogue semantic processing network using the new data to obtain a more accurate and generalized target dialogue semantic processing network. This process is achieved by repeatedly executing the second adjustment process until the model meets the second convergence requirement.

[0115] The first dialogue semantic processing network is obtained in the first calibration process, and includes the first multi-layer perceptron component and the reasoning component obtained according to the first calibration process. In the second calibration process, the computer system inputs the data in the second text sample library into the first dialogue semantic processing network, and continuously adjusts the parameters of the network so that the model can better adapt to the new data distribution and semantic features.

[0116] The specific operation of the second calibration process is similar to the first calibration process, but some adjustments are made according to the new data characteristics and optimization goals. For example, in each cycle, the computer system performs the following operations:

[0117] First, each second training example is loaded into the first multi-layer perceptron component to obtain the third text semantic features of each second training example. This step is similar to step S10 in the first calibration process. The computer system inputs the text data of the second training example (such as the dialogue consultation text and the dialogue feedback text) into the first multi-layer perceptron component, and extracts the feature vector that can reflect the text semantic information through the calculation and conversion of multiple layers of neurons. For example, for a second training example about "how to conduct language function rehabilitation training after stroke", after being processed by the first multi-layer perceptron component, a third text semantic feature vector [0.2, 0.3, 0.1, …, 0.4] with a length of 100 may be obtained.

[0118] Then, each second training example and the third text semantic feature of each second training example are input into the reasoning component to obtain the second reasoning fit confidence of each second training example, and determine the third training error corresponding to each second training example based on the second reasoning fit confidence and the prior mark of each second training example. The reasoning component predicts the fit confidence of the dialogue feedback text and the dialogue consultation text based on the input text semantic features and training example information. For example, for the above-mentioned example of stroke language rehabilitation training, the reasoning component may output a second reasoning fit confidence of 0.8, while its prior mark is 0.85. According to the mean square error formula, the third training error of this example is calculated to be (0.85 - 0.8) 2 =0.0025.

[0119] Next, the first text semantic features of each second training example are optimized according to the third training error corresponding to each second training example, so as to obtain the fourth text semantic features corresponding to each second training example. This step is similar to step S30 in the first calibration process. The computer system uses a gradient-based optimization method, such as a gradient descent algorithm, to adjust and optimize the third text semantic features according to the information of the third training error to reduce the training error. For example, by calculating the gradient of the third training error relative to the third text semantic feature, the feature is updated in the opposite direction of the gradient to obtain a more accurate fourth text semantic feature.

[0120] Then, based on the fourth text semantic features and prior labels corresponding to each second training example, determine the fourth training error corresponding to each second training example. This step is similar to determining the third training error. The computer system inputs the optimized fourth text semantic features into the reasoning component to obtain a new reasoning fit confidence, and then compares it with the prior label to calculate the fourth training error. For example, after optimization, after the fourth text semantic features of the above stroke language rehabilitation training example are input into the reasoning component, the new reasoning fit confidence is 0.83, then the fourth training error is (0.85 - 0.83) 2 =0.0004.

[0121] Finally, according to the third training error and the fourth training error corresponding to each second training example, the component parameters of the first multilayer perceptron component are optimized. This step is similar to step S50 in the first calibration process. The computer system comprehensively considers the third training error and the fourth training error, and fuses the two by assigning different weights. Then, according to the fused error information, an optimization algorithm (such as the Adam algorithm) is used to update the component parameters of the first multilayer perceptron component.

[0122] The computer system continuously loops through the second calibration process until the model meets the second convergence requirement. The second convergence requirement is, for example, to measure the difference between the model's prediction result and the true label by defining a loss function. When the value of the loss function is less than a preset threshold, the model is considered to have converged. For example, the loss function is set to the average training error of all second training examples. When the average training error is less than 0.001, the model is considered to meet the second convergence requirement, and the network obtained at this time is the target dialogue semantic processing network.

[0123] Through this process, the computer system can use the new data in the second text sample library to further optimize and adjust the first dialogue semantic processing network, and obtain a more accurate and generalized target dialogue semantic processing network, so as to better meet the actual needs of smart health care consultation dialogue semantic processing and provide better quality and more personalized consulting services for the elderly.

[0124] In one implementation, the second calibration process further includes:

[0125] Step S106: Based on the norm between the first component parameter and the transition component parameter, obtain the context migration parameter restriction corresponding to the second dialogue context, the context migration parameter restriction is used to limit the norm between the transition component parameter and the first component parameter, the transition component parameter is the component parameter of the transition dialogue semantic processing network obtained in the previous second calibration process, and the first component parameter is the component parameter of the first dialogue semantic processing network.

[0126] Step S105, optimizing the component parameters of the first multilayer perceptron component according to the third training error and the fourth training error corresponding to each second training example, including:

[0127] Step S1051: optimizing component parameters of the first multilayer perceptron component according to the context transfer parameter restriction corresponding to the second dialogue context and the third training error and the fourth training error corresponding to each second training example.

[0128] In the second tuning process, when the computer system transitions from the first dialogue context to the second dialogue context for model optimization, it is necessary to consider how to maintain the knowledge and capabilities learned by the model in the original context while using new data to improve model performance. This requires the introduction of context migration parameter restrictions to control the range of model parameter changes and avoid overfitting new data, which may lead to performance degradation in the original context.

[0129] The first component parameter is the component parameter of the first dialogue semantic processing network, which is obtained through training in the first calibration process and represents the knowledge and features learned by the model in the first dialogue context. The transition component parameter is the component parameter of the transition dialogue semantic processing network obtained in the previous second calibration process, which reflects the parameter state of the model in the process of gradually adapting to the second dialogue context.

[0130] Norm is a measure of the size of a vector or matrix. Norms include L1 norm and L2 norm. L1 norm is the sum of the absolute values ​​of each element in the vector. , and its L1 norm calculation formula is: ; The L2 norm is the square root of the sum of the squares of each element in the vector, and the calculation formula is The computer system can quantify the degree of difference between the first component parameter and the transition component parameter by calculating the norm between the two sets of parameter.

[0131] For example, suppose the first component parameter vector is , the transition component parameter vector is . Calculate the L2 norm between them: ;

[0132] The computer system determines the context transfer parameter limit corresponding to the second dialogue context based on the calculated norm. The role of this limit is to constrain the range of changes in the model component parameters in the second calibration process, ensuring that the model does not deviate too far from the knowledge learned in the first context while adapting to the new context. For example, the context transfer parameter limit is set to C. When the calculated norm exceeds C, the computer system takes corresponding measures, such as adjusting the learning rate or correcting the parameter update, to ensure the stability and generalization ability of the model.

[0133] In the second tuning process, the computer system not only needs to consider the training error of the model in the new context, but also needs to optimize the component parameters of the first multi-layer perceptron component in combination with the context migration parameter restrictions to achieve balance and optimization of the model in different contexts.

[0134] The third training error and the fourth training error are calculated at different stages of the second calibration process, and they reflect the prediction accuracy of the model when processing the second training example. The third training error is calculated based on the predicted fit confidence and prior labeling after the second training example and the third text semantic feature are input into the reasoning component; the fourth training error is calculated again through the reasoning component after the third text semantic feature is optimized to obtain the fourth text semantic feature.

[0135] When optimizing component parameters, the computer system needs to comprehensively consider the three factors of context transfer parameter limitation, third training error and fourth training error. One implementation method is to assign corresponding weights to each factor and then merge them to obtain a comprehensive optimization target.

[0136] For example, let the weight corresponding to the context transfer parameter restriction be , the weight corresponding to the third training error is , the weight corresponding to the fourth training error is For a certain component parameter w of the first multi-layer perceptron component, its update can be achieved in the following way:

[0137] First, calculate the comprehensive optimization target L: ;

[0138] Then, calculate the gradient of L with respect to w This can be done with automatic differentiation tools or based on the back-propagation algorithm.

[0139] Finally, the component parameter w is updated according to the gradient descent algorithm:

[0140] ;

[0141] in, is the learning rate, which controls the step size of each update.

[0142] In this way, the computer system can optimize the component parameters of the first multi-layer perceptron component by making full use of the information provided by the third training error and the fourth training error while considering context transfer. This helps the model to better learn and adapt to new data in the context of the second dialogue while maintaining its performance in the context of the first dialogue, thereby improving the overall performance and generalization ability of the model in the semantic processing of smart health consultation dialogues.

[0143] In practical applications, the computer system can determine the appropriate weights and learning rates through multiple experiments and adjustments to achieve the best optimization effect. At the same time, some regularization techniques, such as L1 regularization and L2 regularization, can also be used to prevent model overfitting and further improve the stability and generalization ability of the model. In short, by rationally and comprehensively considering the context transfer parameter restrictions, the third training error, and the fourth training error, the computer system can more effectively optimize the model parameters and improve the quality and effect of the semantic processing of smart health consultation dialogues.

[0144] In one implementation, step S1051, optimizing component parameters of the first multilayer perceptron component according to the context transfer parameter restriction corresponding to the second dialogue context and the third training error and the fourth training error corresponding to each second training example, includes:

[0145] Step S10511: for each second training example, obtaining a third influencing factor corresponding to the third training error, a fourth influencing factor corresponding to the fourth training error, and a fifth influencing factor corresponding to the context transfer parameter restriction;

[0146] Step S10512: fusing the third training error, the fourth training error and the context transfer parameter restriction according to the third influencing factor, the fourth influencing factor and the fifth influencing factor respectively to obtain a second merged training error corresponding to the second training example;

[0147] Step S10513: Optimizing component parameters of the first multi-layer perceptron component according to the second combined training errors corresponding to each second training example.

[0148] In step S10511, the computer system determines three important influencing factors for each second training example, and these influencing factors will be used for subsequent weighted fusion of different factors to achieve optimization of component parameters.

[0149] The third training error is the error calculated based on the predicted fit confidence and the prior label after the second training example and the third text semantic feature are input into the inference component in the second calibration process. The third impact factor is a weight coefficient used to measure the importance of the third training error in the optimization process.

[0150] The fourth training error is an error calculated again by the reasoning component after optimizing the third text semantic feature to obtain the fourth text semantic feature. The fourth influencing factor is a weight coefficient corresponding to the fourth training error, which is used to indicate the importance of the fourth training error in the optimization process.

[0151] The context migration parameter restriction is obtained based on the norm between the first component parameter and the transition component parameter, and is used to limit the range of changes in the component parameter when the model transitions from the first dialogue context to the second dialogue context. The fifth impact factor is the weight coefficient corresponding to the context migration parameter restriction, which is used to measure the role of the context migration parameter restriction in the optimization process.

[0152] The computer system can determine the values ​​of these influencing factors by analyzing historical data, conducting experimental verification, or based on the experience of domain experts. Different application scenarios and data characteristics may result in different values ​​of the influencing factors.

[0153] After obtaining each influencing factor, the computer system fuses the third training error, the fourth training error and the context transfer parameter limit according to the corresponding influencing factors to obtain a second combined training error that comprehensively considers multiple factors. The fusion process can be implemented by weighted summation.

[0154] After obtaining the second combined training errors corresponding to each second training example, the computer system will optimize the component parameters of the first multi-layer perceptron component based on the error information to improve the performance of the model in the second dialogue context.

[0155] The optimization method is based on the gradient descent algorithm. The core idea of ​​the gradient descent algorithm is to calculate the gradient of the objective function (here is the second merged training error) with respect to the component parameters, and then update the component parameters in the opposite direction of the gradient so that the value of the objective function gradually decreases.

[0156] The computer system performs such an update operation on all component parameters in the first multi-layer perceptron component. By continuously iterating this process, that is, calculating the second merged training error multiple times and updating the component parameters based on it, the model will gradually adjust its own parameters to adapt to the data characteristics in the context of the second dialogue, improve the processing ability of the second training example, and thus improve the performance and generalization ability of the entire model in the semantic processing of smart health consultation dialogues.

[0157] In practical applications, the computer system may recalculate the second combined training error after each update of the component parameter, and determine whether the stop condition is met. The stop condition may be that the second combined training error is less than a preset threshold, or that the maximum number of iterations has been reached. When the stop condition is met, the computer system believes that the model has achieved a good optimization effect under the current data and stops updating the component parameter.

[0158] In one implementation, step S106, obtaining the context transfer parameter restriction corresponding to the second dialogue context according to the norm between the first component parameter and the transition component parameter, includes:

[0159] Step S106A: determining a first penalty factor corresponding to the second dialogue context according to the norm between the first component parameter and the transition component parameter, and using the first penalty factor as a context transfer parameter restriction corresponding to the second dialogue context;

[0160] or;

[0161] Step S106B: Based on the transition dialogue semantic processing network, determine the inference training error of each first training example in the first text sample library corresponding to the transition component parameter; determine the influence factor corresponding to the first component parameter according to the inference training error corresponding to each first training example; obtain the context transfer parameter restriction corresponding to the second dialogue context according to the influence factor corresponding to the first component parameter and the norm between the first component parameter and the transition component parameter.

[0162] In the process of model calibration for semantic processing of smart health consultation dialogue, the computer system pays attention to the changes in component parameters when the model transitions from the first dialogue context to the second dialogue context, so as to avoid the model over-adapting to the new context and losing the effective information learned in the original context. Step S106A is aimed at this requirement and determines the context migration parameter limit by calculating the norm between the first component parameter and the transition component parameter.

[0163] The first component parameter is the component parameter of the first dialogue semantic processing network, which represents the knowledge and features learned by the model in the context of the first dialogue. The transition component parameter is the component parameter of the transition dialogue semantic processing network obtained in the previous second calibration process, which reflects the parameter state of the model in the process of gradually adapting to the context of the second dialogue.

[0164] Norm is a measure used to measure the size of a vector or matrix. In this case, the computer system uses, for example, the L1 norm or the L2 norm to calculate the difference between the first component parameter and the transition component parameter. This will not be described in detail here.

[0165] The computer system determines the first penalty factor corresponding to the context of the second dialogue based on this norm. The role of the first penalty factor is to constrain the change of model parameters to ensure that the model does not deviate too much from the original context knowledge when adapting to the new context. One way is to directly use the calculated norm as the first penalty factor.

[0166] In the actual implementation process, the computer system can use numerical computing libraries to efficiently calculate the norm of vectors. These libraries provide ready-made functions to perform calculations such as L1 norm and L2 norm. In this way, the computer system can quickly and accurately determine the first penalty factor and use it as the context migration parameter limit corresponding to the second dialogue context. This limit will play a role in the subsequent model optimization process to ensure the smooth transition of the model between different dialogue contexts, so that it can learn the information of the new context while retaining the performance in the original context.

[0167] Step S106B provides a more targeted method for determining context transfer parameter limits. It not only considers the difference between the first component parameter and the transition component parameter, but also combines the inference training error of the model on the first text sample library to determine the influencing factor of the first component parameter, thereby obtaining the context transfer parameter limits.

[0168] First, the computer system determines the inference training error of each first training example in the first text sample library corresponding to the transition component parameter based on the transition dialogue semantic processing network. The transition dialogue semantic processing network is an intermediate model gradually formed in the second calibration process, and its component parameters (i.e., transition component parameters) are in the process of constantly adjusting to adapt to the context of the second dialogue. For each first training example in the first text sample library, the computer system inputs it into the transition dialogue semantic processing network, performs inference through the inference component, and obtains the predicted fit confidence. Then, this predicted value is compared with the prior label of the training example, and the inference training error is calculated according to the loss function. For example, for a training example in the first text sample library, its dialogue consultation text is "My blood pressure is not stable recently, what should I pay attention to?", and the dialogue feedback text is "Pay attention to a light diet and measure blood pressure regularly", and the prior label is 0.9. The fit confidence obtained by inference through the transition dialogue semantic processing network is 0.85. If the mean square error loss function is used, the inference training error of the training example is (0.9 - 0.85) 2 =0.0025.

[0169] Next, the computer system determines the impact factor corresponding to the first component parameter variable based on the inference training error corresponding to each first training example. This step is intended to analyze the relationship between the inference training error and the first component parameter variable to determine the importance of the first component parameter variable in the model adjustment process. One method is to determine the impact factor by calculating the rate of change of the inference training error with respect to the first component parameter variable. For example, suppose that through a series of calculations and analyses, it is found that when a parameter of the first component parameter variable Minor changes When , the change of inference training error is , then the impact factor It can be calculated by the following approximate formula: This impact factor reflects the sensitivity of the change of the first component parameter to the inference training error, thus reflecting its importance in the model.

[0170] Finally, the computer system obtains the context migration parameter restriction corresponding to the second dialogue context based on the influence factor corresponding to the first component parameter and the norm between the first component parameter and the transition component parameter. The specific calculation method can be to multiply the influence factor by the norm. Let the norm between the first component parameter and the transition component parameter be N, and the influence factor corresponding to the first component parameter be , then the context transfer parameter limits For example, assuming the calculated norm N=0.1, the impact factor =0.5, then the context transfer parameter limit C=0.5×0.1=0.05.

[0171] In actual operation, the computer system can use automatic differentiation tools to calculate the rate of change of the inference training error for the first component parameter, so as to more accurately determine the influencing factors. At the same time, the norm is efficiently calculated through the numerical calculation library. In this way, the computer system can comprehensively consider the performance of the model in different aspects and obtain a more reasonable context migration parameter restriction that better reflects the actual needs of the model. This restriction can better guide the model to adjust parameters in the second calibration process, so that the model can maintain its understanding and processing capabilities of the first dialogue context while adapting to the second dialogue context, thereby improving the overall performance and stability of the model in the semantic processing of smart health care consultation dialogues.

[0172] In summary, steps S106A and S106B provide methods for determining the context transfer parameter limits corresponding to the second dialogue context from different approaches. Step S106A determines the limits based on the norms between the parameters in a simple and direct way; while step S106B more deeply combines the model's reasoning error on the original sample library and comprehensively considers multiple factors to determine the limits. Both methods help computer systems better balance the relationship between different dialogue contexts during model calibration, optimize model performance, and provide more accurate and reliable semantic processing support for smart health care consultation dialogues.

[0173] In one implementation, in step S106B, determining the influence factor corresponding to the first component parameter variable according to the inference training error corresponding to each first training example includes:

[0174] Step S106B1: obtaining a dialogue context combined training error of the first dialogue context according to the inference training errors corresponding to each first training example;

[0175] Step S106B2: Obtain the change rate of the dialogue context combined training error of the first dialogue context with respect to the first component parameter, and obtain the impact factor corresponding to the first component parameter according to the change rate of the dialogue context combined training error with respect to the first component parameter.

[0176] In step S106B1, the computer system comprehensively considers the inference training errors corresponding to all first training examples in the first text sample library to obtain a dialogue context combined training error that can reflect the model training effect in the entire first dialogue context.

[0177] For each first training example in the first text sample library, the computer system has calculated its corresponding inference training error based on the transition dialogue semantic processing network in the previous step. The inference training error is obtained by comparing the model's prediction result for the training example (such as the predicted fit confidence) with the prior label of the example (the actual fit confidence), such as the mean square error (MSE) loss function.

[0178] Assume that there are n first training examples in the first text sample library, and the inference training error of the i-th first training example is , then calculate the dialogue context combined training error of the first dialogue context One way to do this is to sum or average the inference training errors over all training examples.

[0179] The computer system can loop through all the first training examples in the first text sample library, calculate the inference training error of each example in turn, and accumulate it into a variable, and finally obtain the dialogue context merged training error according to the selected calculation method (sum or average). This calculation method can comprehensively consider the information of all training examples and provide a basis for subsequently determining the influencing factor corresponding to the first component parameter variable.

[0180] In step S106B2, after obtaining the dialogue context-merged training error of the first dialogue context, the computer system further analyzes the rate of change of the error with respect to the first component parameter, thereby determining the influencing factor corresponding to the first component parameter.

[0181] The rate of change reflects how fast one variable changes relative to another variable. Here, the rate of change of the dialogue context merge training error with respect to the first component parameter indicates the corresponding change of the dialogue context merge training error when the first component parameter changes slightly.

[0182] One implementation of calculating the rate of change is to use derivatives or partial derivatives. In the case of a multivariate function, since the first component parameter is, for example, a vector containing multiple parameters, partial derivatives need to be calculated. Assume that the first component parameter vector is , the dialogue context combined training error is , then the dialogue context merge training error for the jth first component parameter The partial derivative of Indicates that when other component parameters remain unchanged, The rate of change.

[0183] For example, suppose the first component parameter vector is , dialogue context merge training error The relationship between the first component parameter can be expressed as a function In order to calculate right The partial derivative of , you can Considered as a constant, about Derivative.

[0184] Assumptions .

[0185] After obtaining the partial derivatives of the dialogue context merged training error for each first component parameter, the computer system can determine the impact factor corresponding to the first component parameter based on these partial derivatives. The role of the impact factor is to measure the degree of influence of each first component parameter on the dialogue context merged training error. One way is to directly use the absolute value of the partial derivative as the impact factor, that is, the jth first component parameter Corresponding impact factor .

[0186] For example, in the above example, if ,but ,So Corresponding impact factor .

[0187] In actual calculations, the computer system can use numerical calculation methods or automatic differentiation tools to calculate partial derivatives. For example, the numerical calculation method is to approximate the partial derivatives by making a small perturbation to the first component parameter and observing the changes in the dialogue context combined training error; the automatic differentiation tool can automatically calculate the partial derivatives according to the expression of the function, which is more efficient and accurate. In this way, the computer system can accurately obtain the influence factor corresponding to the first component parameter based on the inference training error corresponding to the first training example. This influence factor will be used in subsequent steps to determine the context transfer parameter limit corresponding to the second dialogue context, so as to better control the transition of the model between different dialogue contexts and improve the performance and adaptability of the model in the semantic processing of smart health care consultation dialogues.

[0188] In one implementation, the method further includes:

[0189] Step S201: Determine whether the context of the first dialogue and the context of the second dialogue are consistent;

[0190] Step S202: if the first dialogue context is inconsistent with the second dialogue context, the second calibration process is cyclically completed on the first dialogue semantic processing network according to the second text sample library until the second convergence requirement is met, thereby obtaining a target dialogue semantic processing network;

[0191] Step S203: If the first dialogue context is consistent with the second dialogue context, the second text sample library is determined as a new first text sample library, and the first dialogue semantic processing network is looped to complete the first adjustment process according to the second text sample library until the third dialogue semantic processing network is obtained by meeting the third convergence requirement.

[0192] In step S201, in the field of smart health care, the dialogue context may vary due to various factors, such as the type of consulting question, the health field involved, the characteristics of the dialogue partner, etc. The computer system accurately determines whether the first dialogue context and the second dialogue context are consistent, so as to select an appropriate model calibration strategy.

[0193] In order to determine whether the contexts of two dialogues are consistent, the computer system can adopt multiple implementation methods. One method is to perform semantic analysis and feature extraction on the dialogue text. For example, the computer system can convert the words in the dialogue text into vector representations through a word vector model, and then calculate the word vector similarity of the texts in the two contexts. Suppose a typical consultation text in the context of the first dialogue is "My blood pressure is a little high recently, what should I do?", and a consultation text in the context of the second dialogue is "My blood pressure is unstable, do you have any good suggestions?". The computer system first converts the words in the two texts into word vectors, and then can use the cosine similarity formula to calculate the similarity of the two texts:

[0194] ;

[0195] in, They are the word vector representations of the two texts, represents the dot product of vectors, Represents vectors If the calculated similarity is higher than a preset threshold (e.g., 0.8), the two dialogue contexts are considered to be semantically similar, that is, the context of the first dialogue is consistent with the context of the second dialogue; otherwise, the two dialogue contexts are considered to be inconsistent.

[0196] Another method is to analyze the keywords and topics in the conversation text. The computer system can extract the keywords in the two conversation contexts through natural language processing technology, and then compare the overlap of the keywords. For example, the keywords in the first conversation context are "hypertension" and "treatment methods", and the keywords in the second conversation context are "hypertension" and "preventive measures". Since the keywords have a high overlap, it can be preliminarily judged that the two conversation contexts are consistent.

[0197] In step S202, when the computer system determines that the first dialogue context and the second dialogue context are inconsistent, it means that the model needs to adapt to the new dialogue context, so the first dialogue semantic processing network needs to be further adjusted to obtain a target dialogue semantic processing network that is more suitable for the second dialogue context.

[0198] The second tuning process is an iterative process that aims to continuously adjust the parameters of the model to optimize its performance in the context of the second dialogue. In each cycle, the computer system performs a series of operations, including loading the second training example into the first multi-layer perceptron component to obtain the third text semantic feature, calculating the second inference fit confidence through the inference component and determining the third training error, optimizing the third text semantic feature according to the third training error to obtain the fourth text semantic feature, and then determining the fourth training error, and finally optimizing the component parameters of the first multi-layer perceptron component according to the third training error and the fourth training error.

[0199] For example, suppose the first dialogue context is mainly general consultation on common diseases of the elderly, such as "Dietary considerations for diabetes", while the second dialogue context is consultation on rehabilitation training for specific diseases, such as "Rehabilitation training methods after stroke". Since the two contexts are inconsistent, the computer system performs a second calibration process on the first dialogue semantic processing network based on a second text sample library containing a large number of examples of dialogues related to stroke rehabilitation training.

[0200] In each cycle, the computer system inputs a second training example in the second text sample library, such as "How to conduct rehabilitation training for hand function after stroke?" and its corresponding feedback text into the first multi-layer perceptron component to obtain the third text semantic features. Then this information is input into the reasoning component to obtain the second reasoning fit confidence, which is assumed to be 0.7, and the prior label of the example is 0.9. The third training error is calculated according to the mean square error formula as (0.9-0.7) 2 =0.04. Then, the computer system optimizes the third text semantic feature according to the third training error to obtain the fourth text semantic feature, and then calculates the fourth training error. Assume that after optimization, the fourth training error is 0.01. Finally, the computer system optimizes the component parameter of the first multi-layer perceptron component according to the third training error and the fourth training error, for example, using a gradient descent algorithm to adjust the parameter value according to the gradient information of the error to the component parameter.

[0201] The computer system repeats this cycle until the performance of the model meets the second convergence requirement. The second convergence requirement is measured by defining a loss function, such as the average training error is less than a preset threshold (such as 0.005). When the second convergence requirement is met, the network obtained by the computer system is the target dialogue semantic processing network, which can better adapt to the context of the second dialogue and provide more accurate and more demand-oriented consultation responses for the elderly.

[0202] In step S203, when the computer system determines that the first dialogue context and the second dialogue context are consistent, it means that the newly acquired second text sample library is semantically similar to the original first text sample library. At this time, the second text sample library can be merged into the original sample library as a new first text sample library, and then the first dialogue semantic processing network is further optimized to obtain a more complete third dialogue semantic processing network.

[0203] The first calibration process is similar to the previously mentioned process, and is also an iterative process, including loading the training examples into the initial multi-layer perceptron component to obtain the first text semantic feature, calculating the first inference fit confidence and the first training error, optimizing the first text semantic feature to obtain the second text semantic feature and calculating the second training error, and finally optimizing the component parameters of the initial multi-layer perceptron component based on the first training error and the second training error.

[0204] For example, suppose that both the first dialogue context and the second dialogue context are about mental health consultation for the elderly, and the first text sample library contains some examples of mental health consultation, such as "I have been suffering from insomnia recently and feel very anxious, what should I do?", and the second text sample library contains some new similar consultation examples, such as "I feel very irritable recently and easily lose my temper, how should I adjust?". Since the two contexts are consistent, the computer system determines the second text sample library as the new first text sample library.

[0205] In each cycle of the first calibration process, the computer system selects a training example from the new first text sample library and inputs it into the initial multi-layer perceptron component of the first dialogue semantic processing network to obtain the first text semantic feature. Assume that for a new training example "I always feel lonely recently, is there any good solution?", the first text semantic feature vector obtained is [0.2, 0.3, 0.1,…, 0.4]. Then the training example and the first text semantic feature are input into the reasoning component to obtain the first reasoning fit confidence, which is assumed to be 0.8, and the prior label of the example is 0.9, and the first training error is calculated to be (0.9 - 0.8) 2 =0.01. Then, the computer system optimizes the first text semantic feature according to the first training error to obtain the second text semantic feature, and then calculates the second training error. Assume that the optimized second training error is 0.005. Finally, the component parameters of the initial multi-layer perceptron component are optimized according to the first training error and the second training error.

[0206] The computer system continues this cycle until the performance of the model meets the third convergence requirement. The third convergence requirement can also be measured by defining a loss function, for example, the average training error is less than a preset threshold (such as 0.003). When the third convergence requirement is met, the network obtained by the computer system is the third dialogue semantic processing network, which can provide more accurate and higher-quality consulting services after training and optimization with more data in the same dialogue context.

[0207] In summary, steps S201 to S203 are important steps for the computer system to select different model calibration strategies according to the consistency of the dialogue context in the semantic processing of smart health care consultation dialogues. By accurately judging the consistency of the dialogue context and adopting the corresponding calibration process, the computer system can continuously optimize the model, improve the accuracy and adaptability of dialogue semantic processing, and provide better consulting services for the elderly.

[0208] In one implementation, step S30, optimizing the first text semantic features of each first training example according to the first training error of each first training example to obtain the second text semantic features of each first training example, includes:

[0209] Step S31: for each first training example, obtaining a change rate of a first training error corresponding to the first training example to a first text semantic feature;

[0210] Step S32: Determine the optimization range corresponding to the first text semantic feature of the first training example based on the tuning parameters corresponding to the inference component and the change rate corresponding to the first training example, and optimize the first text semantic feature of the first training example to the second text semantic feature based on the optimization range.

[0211] In step S31, the computer system analyzes the relationship between the first training error and the first text semantic feature, so as to understand how the first training error will change accordingly when the first text semantic feature changes. The quantitative representation of this relationship is the rate of change, which can provide an important basis for determining the optimization direction and magnitude in the future.

[0212] The rate of change can be calculated mathematically through derivatives or partial derivatives. For the first text semantic feature vector , the first training error E is, for example, a function of x, denoted as Since x is a vector, we need to calculate partial derivatives to represent the rate of change in each dimension.

[0213] Specifically, for the i-th dimension x of the first text semantic feature vector i , the first training error E versus x i The partial derivative of It means that E increases with x while other dimensions remain unchanged. i The calculation formula can use the definition of partial derivative:

[0214] ;

[0215] In actual calculations, the computer system may not directly use the above definition formula for calculation, but may use numerical calculation methods or automatic differentiation tools. One feasible way of numerical calculation method is finite difference method, such as central difference method, and its calculation formula is:

[0216] ;

[0217] Among them, h is a small positive number, and a suitable value is selected according to the specific situation.

[0218] For a better understanding, let's take a simple example. Assume that the semantic feature vector of the first text is , the relationship between the first training error E and x is Now we need to calculate E versus x 1 The partial derivative of .

[0219] According to the calculation rules of partial derivatives, E with respect to x 1 Taking partial derivatives we get:

[0220] ;

[0221] x 1 =2,x 2 =3Substitute into the above formula, we get:

[0222] ;

[0223] This means that when x 1 When a small change occurs, the first training error E will change by about 10 times. The same method can be used to calculate E versus x 2 The partial derivative of .

[0224] In this way, the computer system can obtain the rate of change of the first training error with respect to the first text semantic feature for each first training example, thereby understanding the degree of influence of the semantic feature in each dimension on the training error.

[0225] In step S32, after obtaining the change rate of the first training error to the first text semantic feature, the computer system determines the optimization range of the first text semantic feature based on this information, and then optimizes it to the second text semantic feature. The determination of the optimization range involves the tuning parameter corresponding to the inference component, that is, the learning rate.

[0226] The learning rate is a very important hyperparameter in the model training process, which determines the step size of each parameter update. A suitable learning rate can make the model converge quickly during the training process and avoid oscillation or falling into the local optimal solution. Suppose the learning rate is , for the i-th dimension x of the first text semantic feature vector x i , the optimization range It can be calculated by the following formula:

[0227] ;

[0228] Among them, the negative sign indicates that the optimization direction is to reduce the training error, that is, update in the opposite direction of the gradient.

[0229] For example, suppose that for a first training example, the first text semantic feature vector is , the first training error E versus x 1 The partial derivative of , learning rate =0.1. Then x 1 The optimization range is: ; This means that x_1 needs to be reduced by 1 based on its current value. Similarly, x can be calculated 2 The optimization range .

[0230] After obtaining the optimization range, the computer system can optimize the first text semantic feature to the second text semantic feature according to the optimization range. The specific update formula is:

[0231] ;

[0232] in, represents the value of the i-th dimension of the updated second text semantic feature, Represents the value of the i-th dimension of the original first text semantic feature.

[0233] Continuing with the above example, The updated semantic feature value of the second text is:

[0234] ;

[0235] In this way, the computer system can determine the optimization range for each dimension of the first text semantic feature of each first training example according to the learning rate and the change rate, and update it to the second text semantic feature. Such an optimization process enables the model to gradually adjust the first text semantic feature during the training process to make it more in line with the needs of dialogue semantic processing, thereby improving the performance of the model.

[0236] In practical applications, computer systems can use optimizers provided by deep learning frameworks to implement this process. Optimizers such as stochastic gradient descent (SGD), Adagrad, Adadelta, Adam, etc. can automatically update the parameters of the model according to the set learning rate and the calculated rate of change.

[0237] In one implementation, step S50, optimizing the component parameters of the initial multilayer perceptron component according to the first training error and the second training error corresponding to each first training example, includes:

[0238] Step S50A: for each first training example, respectively, based on a first influencing factor corresponding to the first training error and a second influencing factor corresponding to the second training error, the first training error and the second training error are fused to obtain a first merged training error corresponding to the first training example;

[0239] Step S50B: Optimizing component parameters of the initial multi-layer perceptron component according to the first combined training errors corresponding to the first training examples.

[0240] In step S50A, the computer system comprehensively considers the first training error and the second training error, and fuses the two errors by introducing corresponding influencing factors to obtain a first combined training error that can better reflect the overall training status of the model.

[0241] The first impact factor and the second impact factor are weight coefficients used to measure the relative importance of the first training error and the second training error in the fusion process. Their values ​​can be adjusted according to specific application scenarios, data characteristics, and model requirements. For example, these impact factors are determined through experiments, experience, or domain knowledge.

[0242] Assume that for the i-th first training example, its first training error is , the corresponding first impact factor is ; The second training error is , the corresponding second impact factor is Then, the fusion process obtains the first combined training error The formula can be expressed as:

[0243] ;

[0244] This formula reflects the process of weighted summing of the first training error and the second training error according to the two influencing factors. The obtained first combined training error comprehensively considers the training error information of the two stages.

[0245] Through this fusion processing method, the computer system can reasonably combine different training errors according to their importance to obtain a more representative training error indicator, providing a more accurate basis for subsequent component parameter optimization.

[0246] In practical applications, the computer system can determine the first influencing factor and the second influencing factor in a variety of ways. One method is to analyze based on the distribution and characteristics of the training data. For example, if the first training error mainly reflects the basic fitting of the model to the data in the initial stage, and the second training error focuses more on reflecting the model's ability to capture data details after certain optimization, then the size of the two influencing factors can be adjusted according to the complexity of the data and the needs of the model. If the data is more complex and more attention needs to be paid to the model's learning of details, the value of the second influencing factor can be appropriately increased; conversely, if the data is relatively simple and the accuracy of the initial fitting is more important, the value of the first influencing factor can be increased.

[0247] In step S50B, after obtaining the first combined training errors corresponding to each first training example, the computer system will optimize the component parameters of the initial multi-layer perceptron component according to the error information to improve the performance and accuracy of the model.

[0248] The goal of optimization is to minimize the first merged training error, and the optimization method is based on the gradient descent algorithm. The basic idea of ​​the gradient descent algorithm is to update the parameters along the negative gradient direction of the objective function (here is the first merged training error), because the value of the objective function decreases fastest in this direction.

[0249] For a component parameter of the initial multilayer perceptron component (j represents the index of the parameter variable), calculate the first merge training error right Gradient . This gradient shows that when other parameters remain unchanged, Follow The rate of change.

[0250] There are many ways to calculate gradients, either using automatic differentiation tools or based on the back-propagation algorithm. The back-propagation algorithm is an efficient way to calculate gradients. It propagates the error from the output layer to the input layer through the chain rule, calculating the gradient of each layer in turn.

[0251] Assume that the first merged training error is calculated For component parameters The gradient of , the learning rate is (The learning rate is a hyperparameter that controls the step size of each parameter update). According to the gradient descent algorithm, the component parameters The update formula is:

[0252] ;

[0253] in, Represents the updated component parameter value, Represents the current component parameter value.

[0254] The computer system performs such an update operation on all component parameters in the initial multi-layer perceptron component. After each update, the first merged training error is recalculated and it is determined whether the stopping condition is met. The stopping condition may be that the first merged training error is less than a preset threshold, or that the maximum number of iterations is reached. If the stopping condition is not met, the next round of optimization is continued until the stopping condition is met.

[0255] In one implementation, the first calibration process further includes:

[0256] Step S60: Optimizing component parameters of the inference component in the neural network to be trained according to the second training errors corresponding to the first training examples.

[0257] The second calibration process also includes:

[0258] Step S107: Optimizing component parameters of the reasoning component in the first dialogue semantic processing network according to the context transfer parameter restriction corresponding to the second dialogue context and the fourth training error corresponding to each second training example.

[0259] The first calibration process aims to make the model better adapt to the consultation dialogue in the first dialogue context by gradually optimizing the initial multi-layer perceptron component and the reasoning component. The computer system first loads the first training example into the initial multi-layer perceptron component to obtain the first text semantic feature. For example, in the scenario of dietary health consultation for the elderly, for the training example "I have diabetes, what fruits can I eat?" and its corresponding feedback text, the multi-layer perceptron component processes to obtain the first text semantic feature vector such as [0.2, 0.3, 0.1,…, 0.4]. Then the example and feature are input into the reasoning component to obtain the first reasoning fit confidence and calculate the first training error. Then, the first text semantic feature is optimized to the second text semantic feature based on the first training error, and the second training error is input into the reasoning component again to obtain the second training error. Finally, the component parameter of the initial multi-layer perceptron component is optimized by combining the first and second training errors. The optimization implementation method is based on the gradient descent algorithm, and the gradient of the error to the component parameter is calculated, and the parameter is updated in the opposite direction of the gradient.

[0260] Step S60 requires the computer system to optimize the component parameters of the reasoning component based on the second training errors corresponding to each first training example. This is because the reasoning component is responsible for predicting the fit between the dialogue feedback text and the dialogue consultation text in the entire model, and its accuracy directly affects the model performance. For example, when processing training examples about sports rehabilitation consultation, if the second training error indicates that the reasoning component prediction is inaccurate, the computer system calculates the gradient of the second training error to the parameter of the reasoning component, and uses a method similar to gradient descent to adjust the parameter so that the reasoning component can more accurately judge the fit based on the semantic features of the text.

[0261] The second calibration process is to further optimize the first dialogue semantic processing network to adapt to the new context after obtaining the second text sample library of the second dialogue context. In this process, step S107 requires the optimization of the component parameters of the reasoning component in the first dialogue semantic processing network according to the context migration parameter restrictions corresponding to the second dialogue context and the fourth training errors corresponding to each second training example. For example, when transitioning from a general health consultation context to a specific disease rehabilitation consultation context, the computer system calculates the context migration parameter restrictions. Assume that the limit value obtained by calculating the norm between the first component parameter and the transition component parameter is 0.1. For the second training example of "How to perform limb rehabilitation training after a stroke", after obtaining the fourth training error, the gradient of the comprehensive error to the reasoning component parameter is calculated in combination with the context migration parameter restrictions, and the gradient is calculated in a similar manner. ( is the learning rate, is the context transfer parameter restriction weight, C is the context transfer parameter restriction, is the fourth training error weight, The formula for the fourth training error adjusts the inference component parameters to make the model more accurate in reasoning in the new context and improve the overall performance.

[0262] These processes and steps work together to continuously optimize the parameters of the multi-layer perceptron components and reasoning components, so that the model can accurately understand the consultation text in different dialogue contexts, provide appropriate feedback text, and improve the quality of smart health care consultation dialogue services.

[0263] The present application embodiment provides a computer system, such as Figure 3 As shown, the computer system 100 includes: a processor 101 and a memory 103. The processor 101 and the memory 103 are connected, such as through a bus 102. Optionally, the computer system 100 may also include a transceiver 104. It should be noted that in actual applications, the transceiver 104 is not limited to one, and the structure of the computer system 100 does not constitute a limitation on the embodiments of the present application.

[0264] Processor 101 may be a CPU, a general-purpose processor, a GPU, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 101 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0265] The bus 102 may include a path to transmit information between the above components. The bus 102 may be a PCI bus or an EISA bus, etc. The bus 102 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0266] The memory 103 may be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an EEPROM, a CD-ROM or other optical disk storage, an optical disk storage (including a compressed optical disk, a laser disk, an optical disk, a digital versatile disk, a Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0267] The memory 103 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 101. The processor 101 is used to execute the application code stored in the memory 103 to implement the content shown in any of the above method embodiments.

[0268] An embodiment of the present application provides a computer system. The computer system in the embodiment of the present application includes: one or more processors; a memory; one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors. When the one or more programs are executed by the processor, the above-mentioned consultation dialogue semantic processing method applied to smart health care is implemented.

[0269] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program runs on a processor, the processor can execute the corresponding content in the aforementioned method embodiment.

[0270] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0271] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for processing the semantics of consultation dialogues applied to smart health care, characterized in that: The method comprises: Obtaining a first text sample library of a first dialogue context and a neural network to be trained, wherein the first text sample library includes a plurality of first training examples carrying a priori labels, each first training example includes a dialogue feedback text corresponding to the first dialogue context and a dialogue consultation text corresponding to the dialogue feedback text, the neural network to be trained includes an initial multi-layer perceptron component and a pre-trained reasoning component, and the a priori label of the first training example is used to indicate an actual fit confidence that the dialogue feedback text in the first training example corresponds to the dialogue consultation text in the first training example; A first calibration process is completed for the neural network to be trained according to the first text sample library until a first convergence requirement is met to obtain a first dialogue semantic processing network, and a target dialogue semantic processing network is obtained according to the first dialogue semantic processing network, so as to select dialogue feedback text according to the target dialogue semantic processing network; Wherein, the first adjustment process includes: Loading each of the first training examples into the initial multi-layer perceptron component to obtain a first text semantic feature of each of the first training examples; Inputting each of the first training examples and the first text semantic features of each of the first training examples into the reasoning component, obtaining a first reasoning fit confidence of each of the first training examples, and determining a first training error corresponding to each of the first training examples based on the first reasoning fit confidence and the priori label of each of the first training examples; Optimizing the first text semantic features of each of the first training examples according to the first training errors of each of the first training examples to obtain the second text semantic features of each of the first training examples; Determining a second training error corresponding to each of the first training examples according to the second text semantic feature and the priori label of each of the first training examples; Optimizing component parameters of the initial multilayer perceptron component according to first training errors and second training errors corresponding to each of the first training examples.

2. The method according to claim 1, characterized in that: The step of obtaining a first text sample library in a first dialogue context includes: Continuously receiving and storing the first training example; The method further comprises: Determine the number of types of dialogue feedback texts corresponding to the stored first training examples, and the number of examples of the first training examples corresponding to each type of dialogue feedback text; The optimizing the component parameters of the initial multi-layer perceptron component according to the first training errors and the second training errors corresponding to the first training examples includes: When the number of dialogue feedback text types and the number of examples corresponding to each dialogue feedback text meet an iteration condition, the component parameters of the initial multilayer perceptron component are optimized according to the first training errors and the second training errors corresponding to the first training examples.

3. The method according to claim 1, characterized in that The step of obtaining a target dialogue semantic processing network according to the first dialogue semantic processing network includes: Acquire a second text sample library of a second dialogue context, wherein the second text sample library includes a plurality of second training examples carrying a priori labels, and each second training example includes a dialogue feedback text corresponding to the second dialogue context and a dialogue consultation text corresponding to the dialogue feedback text; According to the second text sample library, the first dialogue semantic processing network is looped to complete a second calibration process until a second convergence requirement is met, thereby obtaining the target dialogue semantic processing network, wherein the first dialogue semantic processing network includes a first multi-layer perceptron component and a reasoning component obtained according to the first calibration process; Wherein, the second adjustment process includes: Loading each of the second training examples into the first multi-layer perceptron component to obtain a third text semantic feature of each of the second training examples; Inputting each of the second training examples and the third text semantic features of each of the second training examples into the reasoning component, obtaining a second reasoning fit confidence of each of the second training examples, and determining a third training error corresponding to each of the second training examples based on the second reasoning fit confidence and the priori label of each of the second training examples; Optimizing the first text semantic feature of each of the second training examples according to the third training error corresponding to each of the second training examples to obtain a fourth text semantic feature corresponding to each of the second training examples; Determine a fourth training error corresponding to each of the second training examples according to a fourth text semantic feature and a priori label corresponding to each of the second training examples; Optimizing component parameters of the first multilayer perceptron component according to the third training error and the fourth training error corresponding to each of the second training examples.

4. The method according to claim 3, characterized in that The second adjustment process further includes: According to the norm between the first component parameter and the transition component parameter, a context migration parameter restriction corresponding to the second dialogue context is obtained, wherein the context migration parameter restriction is used to limit the norm between the transition component parameter and the first component parameter, wherein the transition component parameter is a component parameter of the transition dialogue semantic processing network obtained by the previous second calibration process, and the first component parameter is a component parameter of the first dialogue semantic processing network; The optimizing the component parameters of the first multilayer perceptron component according to the third training error and the fourth training error corresponding to each of the second training examples includes: Optimize component parameters of the first multilayer perceptron component according to the context transfer parameter restriction corresponding to the second dialogue context and the third training error and the fourth training error corresponding to each of the second training examples.

5. The method according to claim 4, characterized in that The obtaining, based on the norm between the first component parameter and the transition component parameter, the context migration parameter restriction corresponding to the second dialogue context includes: Determining a first penalty factor corresponding to the second dialog context according to a norm between the first component parameter and the transition component parameter, and using the first penalty factor as a context migration parameter restriction corresponding to the second dialog context; or; Based on the transitional dialogue semantic processing network, determining the inference training error of each of the first training examples in the first text sample library corresponding to the transitional component parameter; determining the influence factor corresponding to the first component parameter according to the inference training error corresponding to each of the first training examples; obtaining the context migration parameter restriction corresponding to the second dialogue context according to the influence factor corresponding to the first component parameter and the norm between the first component parameter and the transitional component parameter; The step of determining the influencing factor corresponding to the first component parameter variable according to the inference training error corresponding to each of the first training examples includes: Obtaining a dialogue context combined training error of the first dialogue context according to the inference training errors corresponding to each of the first training examples; Obtain a change rate of the dialogue context combined training error of the first dialogue context with respect to the first component parameter, and obtain an impact factor corresponding to the first component parameter according to the change rate of the dialogue context combined training error with respect to the first component parameter.

6. The method according to any one of claims 1 to 5, characterized in that The step of optimizing the first text semantic features of each of the first training examples according to the first training errors of each of the first training examples to obtain the second text semantic features of each of the first training examples includes: For each of the first training examples, obtaining a rate of change of a first training error corresponding to the first training example to the first text semantic feature; Determining an optimization amplitude corresponding to a first text semantic feature of the first training example according to a tuning parameter corresponding to the reasoning component and a change rate corresponding to the first training example, and optimizing the first text semantic feature of the first training example to a second text semantic feature according to the optimization amplitude; The optimizing the component parameters of the initial multi-layer perceptron component according to the first training errors and the second training errors corresponding to the first training examples includes: For each first training example, respectively, according to a first influencing factor corresponding to the first training error and a second influencing factor corresponding to the second training error, the first training error and the second training error are fused to obtain a first merged training error corresponding to the first training example; Optimizing component parameters of the initial multilayer perceptron component according to the first combined training errors corresponding to the first training examples.

7. The method according to any one of claims 3 to 5, characterized in that: The optimizing the component parameters of the first multilayer perceptron component according to the context transfer parameter restriction corresponding to the second dialogue context and the third training error and the fourth training error corresponding to each of the second training examples includes: For each second training example, obtaining a third influencing factor corresponding to the third training error, a fourth influencing factor corresponding to the fourth training error, and a fifth influencing factor corresponding to the context transfer parameter restriction; According to the third influencing factor, the fourth influencing factor and the fifth influencing factor, the third training error, the fourth training error and the context transfer parameter restriction are respectively merged to obtain a second merged training error corresponding to the second training example; Optimizing component parameters of the first multilayer perceptron component according to the second combined training errors corresponding to the second training examples.

8. The method according to any one of claims 3 to 5, characterized in that: The first adjustment process also includes: Optimizing component parameters of the reasoning component in the neural network to be trained according to the second training errors corresponding to each of the first training examples; The second adjustment process also includes: According to the context transfer parameter restriction corresponding to the second dialogue context and the fourth training error corresponding to each of the second training examples, the component parameter variables of the reasoning component in the first dialogue semantic processing network are optimized.

9. The method according to any one of claims 3 to 5, characterized in that: The method further comprises: Determining whether the first dialogue context and the second dialogue context are consistent; If the first dialogue context is inconsistent with the second dialogue context, the first dialogue semantic processing network is cyclically calibrated according to the second text sample library until the second convergence requirement is met to obtain the target dialogue semantic processing network; If the first dialogue context is consistent with the second dialogue context, the second text sample library is determined as a new first text sample library, and the first dialogue semantic processing network is looped to complete the first adjustment process according to the second text sample library until the third convergence requirement is met to obtain the third dialogue semantic processing network.

10. A computer system, characterized in that: include: one or more processors; Memory; one or more computer programs; The one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and when the one or more computer programs are executed by the processors, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Neural network training method and device and electronic equipment

    CN111930992A

  • Model training method and related device

    CN116739071A