CN116010586A - Method, device, equipment and storage medium for generating health advice - Google Patents

Method, device, equipment and storage medium for generating health advice Download PDF

Info

Publication number
CN116010586A
CN116010586A CN202310088768.8A CN202310088768A CN116010586A CN 116010586 A CN116010586 A CN 116010586A CN 202310088768 A CN202310088768 A CN 202310088768A CN 116010586 A CN116010586 A CN 116010586A
Authority
CN
China
Prior art keywords
user
vector
fusion
generating
tag
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310088768.8A
Other languages
Chinese (zh)
Inventor
李响
章宇超
张仁杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BY Health Co Ltd
Original Assignee
BY Health Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BY Health Co Ltd filed Critical BY Health Co Ltd
Priority to CN202310088768.8A priority Critical patent/CN116010586A/en
Publication of CN116010586A publication Critical patent/CN116010586A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation

Landscapes

  • Medical Treatment And Welfare Office Work (AREA)

Abstract

The invention discloses a method, a device, equipment and a storage medium for generating health advice. The method comprises the following steps: acquiring a user consultation text, a user portrait tag and a human body function regulation product associated with the user portrait tag, carrying out fusion coding on the user consultation text, the user portrait tag and the human body function regulation product to obtain fusion coding vectors, inputting the fusion coding vectors into a pre-trained multi-decision tree classification model for processing, predicting the disease type of a user, generating health advice aiming at the disease type, and pushing the health advice to the user. The scheme can effectively improve the mechanical query mode of the existing scale, performs pre-diagnosis according to gradual enrichment of user information, combines a classical recursive backtracking algorithm in a multi-decision tree model traversal system, simulates the thought that an expert can review judgment logic in a consultation path, and improves the flexibility and scientificity of health advice.

Description

Method, device, equipment and storage medium for generating health advice
Technical Field
The present invention relates to computer aided consultation technology, and in particular, to a method, apparatus, device and storage medium for generating health advice.
Background
The on-line nutrition consultation scene is to give the user diet health advice and the corresponding reasonable intervention scheme in a mode of manually presetting expert questions.
At present, the business scenario on the market basically takes a preset inquiry flow as a main mode, the specific expression form is usually a fixed scale or a questionnaire, and the related information of the lack of nutrition disease of the user is collected through a series of selection question judgment questions. However, the preset inquiry flow path cannot be reasonably recombined and switched according to the main complaints, the current medical history and the past Shi Dengxiang related information of the user. In the scenario of scientific and nutritional consultation, the consultation scope comprises professional knowledge such as health elements, nutrients, medical common sense and the like, and the immobilized consultation flow lacks the flexibility and scientificity of real consultation.
Disclosure of Invention
The invention provides a method, a device, equipment and a storage medium for generating health advice, which are used for performing pre-diagnosis according to gradual enrichment of user information in a mode of improving the mechanical inquiry of the existing scale, combining a classical recursive backtracking algorithm in a multi-decision tree model traversal system, simulating the thinking that an expert can review judgment logic in an consultation path, and improving the flexibility and scientificity of the health advice.
In a first aspect, the present invention provides a method for generating health advice, including:
acquiring user consultation text, a user portrait tag and a human body function regulating product associated with the user portrait tag;
carrying out fusion coding on the user consultation text, the user portrait tag and the human body function regulating product to obtain a fusion coding vector;
inputting the fusion coding vector into a pre-trained multi-decision tree classification model for processing, and predicting the disease type of the user;
health advice is generated for the disease type and pushed to the user.
The product for regulating human body function comprises food, health product, special medical food, medicine, dietary supplement, nutritional supplement, etc.
Optionally, fusion encoding is performed on the user consultation text, the user portrait tag and the human body function adjusting product to obtain a fusion encoding vector, which includes:
coding the user consultation text by adopting a self-attention mechanism to obtain an attention vector;
generating a conceptualized atlas sequence of the user portrayal tag and the humanbody function regulating product based on the user portrayal tag and the humanbody function regulating product associated with the user portrayal tag;
And fusing the attention vector and the conceptualized map sequence to obtain a fused coding vector.
Optionally, the self-attention mechanism is adopted to encode the user consultation text to obtain an attention vector, which includes:
word embedding processing is carried out on words in the user consultation text to obtain word vectors;
performing position embedding processing on words in the user consultation text to obtain a position vector;
fusing the word vector and the position vector to obtain a fused vector;
and inputting the fusion vector into an encoder of a transducer model to encode so as to obtain the attention vector.
Optionally, generating a conceptual atlas sequence of the user portrait tag and the humanoid product based on the user portrait tag and the humanoid product associated with the user portrait tag, comprising:
when the user inquiry is triggered, acquiring user instruction, user consultation text and customer service product document as candidate input;
identifying all fingers and all entities from the candidate input;
calculating the matching degree between any reference and the entity;
and constructing a conceptualized map sequence of the user portrait tag and the human body function regulating product by taking the reference and the entity as nodes and taking the matching degree as an edge.
Optionally, calculating the matching degree between any reference and the entity includes:
and calculating the editing distance between any reference and the entity as the matching degree, wherein the editing distance calculation formula is as follows:
Figure BDA0004069620700000031
where a is a reference and e is an entity.
Optionally, after generating the user portrait tag and the conceptualized map sequence of the human body function regulating product, the method further comprises:
finding out a concept set corresponding to the core entity from the conceptualized graph sequence;
and carrying out information complementation on the concept set to form a conceptual map sequence with more comprehensive knowledge.
Optionally, inputting the fusion coding vector into a pre-trained multi-decision tree classification model for processing, and predicting the disease type of the user, including:
inputting the fusion coding vector into a diagnosis information discriminator for processing;
if a diagnosis conclusion is obtained, the diagnosis conclusion is used as a predicted disease type;
if the diagnosis conclusion is not obtained, inputting the fusion coding vector into a first decision tree for processing, and traversing all nodes of the first decision tree;
if a diagnosis result is found, the diagnosis result is used as a predicted disease type;
if the diagnosis result is not found, jumping to the next decision tree for processing until the diagnosis conclusion is obtained.
In a second aspect, the present invention also provides a health advice generating apparatus, including:
the data acquisition module is used for acquiring user consultation text, user portrait labels and human body function regulating products associated with the user portrait labels;
the fusion coding module is used for carrying out fusion coding on the user consultation text, the user portrait tag and the human body function regulating product to obtain a fusion coding vector;
the prediction module is used for inputting the fusion coding vector into a pre-trained multi-decision tree classification model for processing and predicting the disease type of the user;
and the health suggestion module is used for generating health suggestions for the disease types and pushing the health suggestions to the user.
In a third aspect, the present invention also provides an electronic device, including:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method of generating a health recommendation as provided by the first aspect of the present invention.
In a fourth aspect, the present invention also provides a computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, are adapted to carry out a method of generating a health recommendation as provided in the first aspect of the present invention.
The method for generating the health advice provided by the invention comprises the following steps: acquiring a user consultation text, a user portrait tag and a human body function regulation product associated with the user portrait tag, carrying out fusion coding on the user consultation text, the user portrait tag and the human body function regulation product to obtain fusion coding vectors, inputting the fusion coding vectors into a pre-trained multi-decision tree classification model for processing, predicting the disease type of a user, generating health advice aiming at the disease type, and pushing the health advice to the user. The scheme can effectively improve the mechanical query mode of the existing scale, performs pre-diagnosis according to gradual enrichment of user information, combines a classical recursive backtracking algorithm in a multi-decision tree model traversal system, simulates the thought that an expert can review judgment logic in a consultation path, and improves the flexibility and scientificity of health advice.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for generating health advice according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a process of a multi-decision tree classification model according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a health advice generating device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Specific embodiments thereof have been shown by way of example in the drawings and will herein be described in more detail. These drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The data acquisition, storage, use, processing and the like in the technical scheme meet the relevant regulations of national laws and regulations.
Fig. 1 is a flowchart of a method for generating a health suggestion provided by an embodiment of the present invention, where the embodiment may be adapted to give a correct health suggestion when a user generates a health suggestion, and the method may be performed by a device for generating a health suggestion provided by an embodiment of the present invention, where the device may be implemented by software and/or hardware, and is typically configured in an electronic device, and as shown in fig. 1, the method for generating a health suggestion specifically includes the following steps:
S101, acquiring user consultation text, a user portrait tag and a human body function regulating product associated with the user portrait tag.
For example, the user consultation text may be obtained in real time when the user initiates the consultation. In some embodiments of the present invention, after the dialogue text is acquired, the user consultation text may be desensitized, and the data desensitization refers to the deformation of data of some sensitive information through the desensitization rule, so as to achieve reliable protection of sensitive privacy data. Under the condition of involving user safety data or some commercial sensitive data, under the condition of not violating system rules, the real data is modified and tested, and personal information such as an identity card number, a mobile phone number, a card number, a client number and the like needs to be subjected to data desensitization.
User portrait labels, namely user information labelling, are characterized by collecting data of each dimension such as social attributes, consumption habits, preference characteristics and the like of users, analyzing and counting the characteristics and mining potential value information, so that the information overall view of the users is abstracted. In the embodiment of the present invention, the user portrait tag may include age groups (for example, children, teenagers, middle-aged people, elderly people, etc.), gender, whether there is a basic disease, etc., which is not limited herein. Human function regulating products associated with user portrait tags, such as, for example, common healthcare type human function regulating products for middle aged and elderly people. Products for regulating human functions include foods, health products, special medical foods, medicines, dietary supplements, nutritional supplements, and the like, and embodiments of the invention are not limited herein.
S102, fusion coding is carried out on the user consultation text, the user portrait label and the human body function regulating product, and fusion coding vectors are obtained.
In the embodiment of the invention, the fusion coding is carried out on the user consultation text, the user portrait tag and the human body function regulating product to obtain the fusion coding vector, so that the fusion coding vector contains the consultation information, the user portrait information and the human body function regulating product information, and the accuracy of health advice is improved.
For example, for user advisory text X1, the words in user advisory text X1 are ordered to form a text word sequence { X1 } 1 ,X1 2 ,…,X1 n }. The text word sequence is then encoded to obtain an attention vector. The text Word sequence is encoded by representing words in the text by codes in a dictionary library and converting the words into a matrix (or vector) with fixed dimensions, and in the embodiment of the invention, word2Vec, one-hot and other coding algorithms can be adopted for the textEncoding is performed, and embodiments of the present invention are not limited in this regard.
Illustratively, in some embodiments of the present invention, the user advisory text is encoded using a self-attention mechanism to obtain an attention vector. The self-attention mechanism weights important information in the consultation text of the user, so that the important information is prevented from being covered by noise, more effective transmission of the important information in the network is ensured, and the accuracy of the health advice is improved.
In some embodiments of the present invention, the process of encoding the user advisory text using a self-attention mechanism is as follows:
1. and carrying out word embedding processing on the words in the consultation text of the user to obtain word vectors.
The input layer of the transducer model performs word Embedding (Token Embedding) processing on words in the user consultation text to obtain a word vector E1. Word embedding refers to the conversion of individual words in the dialog text into word vectors E1 of fixed dimensions, using the coding in the dictionary base.
2. And carrying out position embedding processing on words in the consultation text of the user to obtain a position vector.
The input layer of the transducer model performs a position embedding (Position Embedding) process on the words in the user consultation text to obtain a position vector E2. Position embedding refers to numbering the position of each word in the dialog text and then each number corresponds to a vector. By combining the position vector and the word vector, certain position information is introduced for each word.
3. And fusing the word vector and the position vector to obtain a fused vector.
By fusing the position vector E2 and the word vector E1 to obtain the fused vector E3, certain position information is introduced to each word.
4. The fusion vector is input into an encoder of a transducer model for encoding, and the attention vector is obtained.
Illustratively, the encoder of the transducer model processes the fusion vector E3 based on a multi-headed self-attention mechanism to obtain an attention vector.
The Encoder of the transducer model includes N encoding layers (encodings) stacked in sequence, where N is a positive integer greater than or equal to 2, and illustratively, in this embodiment, n=6, the processing procedure of the Encoder is:
and inputting the fusion vector into the first coding layer for processing, and taking the output of the previous coding layer as the input of the next coding layer until the output of the last coding layer is obtained as the first coding matrix.
Each coding layer processes the input matrix based on a multi-head attention mechanism, and the processing process of each coding layer is as follows:
1) The input is processed based on a multi-head attention mechanism to obtain multi-head attention vectors.
Specifically, the processing procedure of the multi-head attention mechanism is as follows:
firstly, three different linear transformation coefficients are adopted to perform three linear transformations on an input E, and a vector Q, a vector K and a vector V are respectively obtained.
Q=EW i Q
K=EW i K
V=EW i V
Wherein W is i Q The linear transform coefficient of vector Q of the i-th coding layer, W i K The linear transformation coefficient of vector K of the i-th coding layer, W i V The linear transform coefficient of vector V for the i-th coding layer.
Then, the vector Q, the vector K and the vector V are respectively subjected to linear transformation for m times to obtain a vector Q h Vector K h Sum vector V h Wherein h.epsilon.m, m is the attention header number of the coding layer. Illustratively, the processing procedure of the multi-head attention layer is exemplarily described taking m=2 as an example.
Then, calculate vector Q h Vector of AND K h Dot multiplication is carried out to obtain a first sub-vector, and the first sub-vector and a vector K are calculated h A second sub-vector is obtained by a quotient of the square root of the dimension of (c). And then, carrying out normalization processing on the second sub-vector to obtain a third sub-vector. Next, calculateThird sub-vector and vector V i Is multiplied by the point to obtain a fourth sub-vector (i.e., head i ). The calculation head i The mathematical expression of the procedure of (2) is as follows:
Figure BDA0004069620700000101
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure BDA0004069620700000102
is vector Q i Vector of AND K i Is dot by->
Figure BDA0004069620700000103
For K i Is the transposed vector of d 1 Is the vector K i Is the dimension of the normalization process.
Finally, m fourth sub-vectors head i And splicing to obtain a spliced vector, and performing linear transformation on the spliced vector to obtain an attention vector M. The mathematical expression for calculating the attention vector M is as follows:
M=Multihead(Q,K,V)=concat(head 1 ,…,head m )W 0
wherein concat is vector splicing, W 0 Is a linear transformation coefficient for linearly transforming the splice vector.
2) The multi-headed attention vector is fused with the input of the coding layer.
And adding the multi-head attention vector M and the input E of the coding layer to obtain a first fusion vector.
In an embodiment of the present invention, in order to increase the convergence speed of the network, the attention vector M may be normalized (Normalization is replaced by norm in the figure). In order to reduce the over-fitting phenomenon of the network, the normalized vector is input into a discarding (dropout) layer to perform random discarding operation to obtain a vector M 1 . Then, the output of the discarding layer is connected with the input of the multi-head attention layer by residual, namely, the vector M 1 Added to the input E to obtain a first fusion vector M 2
3) And inputting the first fusion vector into a full-connection feedforward layer for processing to obtain a full-connection vector.
Specifically, in the embodiment of the present application, in order to increase the convergence speed of the network, the first fusion vector M may be set in advance 2 Performing layer normalization processing to obtain a vector M 3 . The layer normalization process is as follows:
Figure BDA0004069620700000111
wherein t is i Representing the first fusion vector M 2 Normalized for each row of u L Sum sigma L Respectively representing the mean value and variance of each sample, alpha and beta represent scaling and translation parameter vectors, epsilon is a bias parameter, denominator is avoided to be zero, and vector M is obtained after normalization of each line 3
Then, vector M 3 Inputting into a full-connection feedforward layer for processing to obtain a full-connection vector M 4 . Specifically, the processing procedure of the fully connected feedforward layer is shown in the following formula:
M 4 =FFN(M 3 )=Max(0,M 3 W 1 +b 1 )W 2 +b 2
specifically, the fully-connected feed-forward layer first pairs vectors M 3 A nonlinear transformation is performed, and the transformation parameters are (W 1 ,b 1 ) Obtaining a vector M 3 W 1 +b 1 Then, a nonlinear activation function Max (0, a) is adopted for M 3 W 1 +b 1 Non-linear activation is performed, and then the vector obtained by the non-linear activation is subjected to linear transformation again, and the transformation parameters are (W 2 ,b 2 ) A nonlinear activation function Max (0, a) is used to apply the vector M 3 W 1 +b 1 The negative element of (2) is replaced with 0.
4) And fusing the full connection vector and the first fusion vector to obtain the output of the coding layer.
Specifically, in one embodiment of the present invention, in order to increase the convergence speed and decrease the convergence speed of the networkThe overfitting phenomenon of the fewer networks can be performed on the full connection vector M in advance 4 Performing normalization and random discarding operation, and then performing residual connection on the random discarded output and the input of the full-connection feedforward layer, namely, performing residual connection on the random discarded output and the first fusion vector M 2 And adding to obtain the output of the coding layer.
And so on, taking the output of the previous layer of coding layer as the input of the next layer of coding layer until the output of the last layer of coding layer is obtained as the attention vector.
In some embodiments of the present invention, a conceptual atlas sequence of user portrait tags and humanbody function regulating products is constructed for user portrait tags and humanbody function regulating products associated with the user portrait tags. Specifically, when user query is triggered, user instruction, user consultation text and customer service product document are obtained as candidate inputs, and text recognition is adopted to recognize all the instruction A= { a from the candidate inputs 1 ,a 2 ,a 3 ,...,a i Sum all entities e= { E 1 ,e 2 ,e 3 ,...,e j Each of the designations a i E A, calculate arbitrary reference a i And entity e j Degree of matching between the two. For example, the matching degree may be represented by similarity, distance, and the like, which are not limited in this embodiment of the present invention. The finger and the entity are used as nodes, and the matching degree is used as an edge to construct a user image tag and a conceptual map sequence of the product for adjusting the human body function.
Illustratively, in some embodiments of the present invention, the edit distance between any reference and an entity is calculated as a degree of matching, and the edit distance calculation formula is:
Figure BDA0004069620700000121
where a is a reference and e is an entity.
By calculating the editing distance of every two, the larger editing distance is taken, and secondary entities such as ' product ', ' nutrient ', ' disease ' core entity, taste ', ' efficacy ', ' crowd ' and the like are extracted.
In some embodiments of the present invention, after generating the user portrait tag and the conceptualized atlas sequence of the human performance regulating product, further comprising:
finding out a concept set corresponding to the core entity from the conceptualized map sequence;
and (3) carrying out information complementation on the concept set to form a conceptual map sequence with more comprehensive knowledge.
And (3) finding out a core entity key concept set through the linkage of the map nodes and the edges, and representing the key concept set by using a correlation graph G= (e, c), wherein c is a representation capable of being linked to the entity node e, such as a product-core selling point, a product-suitable crowd, a nutrient-efficacy, a disease-effective nutrient and the like. Through the supplementary contents, a conceptual map sequence with more comprehensive knowledge is formed, and the specific expression form is C= (C) 1 ,c 2 ,…,c m )。
S103, inputting the fusion coding vector into a pre-trained multi-decision tree classification model for processing, and predicting the disease type of the user.
In the embodiment of the invention, the fusion coding vector is input into a pre-trained multi-decision tree classification model for processing, and the disease type of a user is predicted. The characteristic of combining the traversing of the reference tree node DFS and the discrimination backtracking algorithm is that for an actual inquiry problem, the value of the inquiry flow solution can be represented by a spatial tree structure according to the inquiry path. Each node of the tree is a problem state of the queried flow, and the path from the root node to the stop node determines the sequence space of the queried state. The solution state satisfying the diagnostic cross-boundary condition determines the effective inquiry sequence, and the traversal path is a feasible solution.
Fig. 2 is a process flow diagram of a multi-decision tree classification model according to an embodiment of the present invention, as shown in fig. 2, including the following steps:
1. the fusion coding vector is input into a diagnosis information discriminator for processing.
The diagnosis information discriminator is based on an expert system model, carries out rule coding on diagnosis data provided by an expert, and outputs a series of rule groups after coding. And matching the secondary symptoms and the related symptoms according to the matched key symptoms by fuzzy rules. The arbiter prompts the tag when the diagnostic decision satisfies the decision tree condition therein.
Classifying related symptoms by using a fuzzy system theory mode, and judging, for example, 0.7-1.0 of key symptoms A by a subordinate function; the general symptoms of B are 0.4 to 0.6; secondary symptoms of C0.1-0.3. Likewise, other factors such as age, gender, weight (BMI) are given a score to make category distinction.
2. If a diagnosis is found, the diagnosis is taken as the predicted disease type.
If the diagnosis information discriminator gives an explicit diagnosis conclusion, the diagnosis conclusion is taken as the predicted disease type.
3. If the diagnosis conclusion is not obtained, the fusion coding vector is input into a first decision tree to be processed, and all nodes of the first decision tree are traversed.
If the diagnosis information discriminator does not give an explicit diagnosis conclusion, the fusion coding vector is input into the first decision tree for processing, and all nodes of the first decision tree are traversed.
4. If a diagnosis is found, the diagnosis is taken as the predicted disease type.
If the diagnosis result is found after traversing the decision tree, the diagnosis result is used as the predicted disease type.
5. If the diagnosis result is not found, jumping to the next decision tree for processing until the diagnosis conclusion is obtained.
If the diagnosis result is not found after traversing the decision tree, the next decision tree is skipped to be processed, and the process is repeated until a diagnosis conclusion is obtained or all decision trees are traversed.
S104, generating health suggestions for the disease types and pushing the health suggestions to the user.
After determining the disease type, health advice is generated for the disease type and pushed to the user so that the user can obtain accurate health advice, including nutritional products, diet advice, work and rest advice, sports advice, and the like, embodiments of the invention are not limited herein.
The method for generating the health advice provided by the embodiment of the invention comprises the following steps: acquiring a user consultation text, a user portrait tag and a human body function regulation product associated with the user portrait tag, carrying out fusion coding on the user consultation text, the user portrait tag and the human body function regulation product to obtain fusion coding vectors, inputting the fusion coding vectors into a pre-trained multi-decision tree classification model for processing, predicting the disease type of a user, generating health advice aiming at the disease type, and pushing the health advice to the user. The scheme can effectively improve the mechanical query mode of the existing scale, performs pre-diagnosis according to gradual enrichment of user information, combines a classical recursive backtracking algorithm in a multi-decision tree model traversal system, simulates the thought that an expert can review judgment logic in a consultation path, and improves the flexibility and scientificity of health advice.
The embodiment of the invention also provides a health advice generating device, and fig. 3 is a schematic structural diagram of the health advice generating device provided by the embodiment of the invention, where as shown in fig. 3, the health advice generating device includes:
a data acquisition module 201 for acquiring user consultation text, user portrait tags, and human body function regulating products associated with the user portrait tags;
the fusion encoding module 202 is configured to perform fusion encoding on the user consultation text, the user portrait tag, and the human body function adjusting product to obtain a fusion encoding vector;
the prediction module 203 is configured to input the fusion coding vector into a pre-trained multi-decision tree classification model for processing, and predict a disease type of the user;
a health advice module 204 for generating health advice for the disease type and pushing to the user.
In some embodiments of the present invention, fusion encoding module 202 includes:
the attention coding sub-module is used for coding the user consultation text by adopting a self-attention mechanism to obtain an attention vector;
a mapping sub-module for generating a conceptual mapping sequence of the user portrayal tag and the human body function regulating product based on the user portrayal tag and the human body function regulating product associated with the user portrayal tag;
And the fusion sub-module is used for fusing the attention vector and the conceptualized map sequence to obtain a fusion coding vector.
In some embodiments of the invention, the attention encoding submodule includes:
the word embedding unit is used for carrying out word embedding processing on the words in the user consultation text to obtain word vectors;
the position embedding unit is used for carrying out position embedding processing on words in the user consultation text to obtain a position vector;
the fusion unit is used for fusing the word vector and the position vector to obtain a fusion vector;
and the encoding unit is used for inputting the fusion vector into an encoder of the transducer model to encode so as to obtain the attention vector.
In some embodiments of the invention, the mapping submodule includes:
the candidate input acquisition unit is used for acquiring user instruction, user consultation text and customer service product document as candidate input when the user inquiry is triggered;
an identification unit for identifying all fingers and all entities from the candidate inputs;
the matching degree calculating unit is used for calculating the matching degree between any reference and the entity;
and the map construction unit is used for constructing a conceptual map sequence of the user portrait tag and the human body function regulating product by taking the reference and the entity as nodes and the matching degree as an edge.
In some embodiments of the present invention, the matching degree calculation unit is configured to:
and calculating the editing distance between any reference and the entity as the matching degree, wherein the editing distance calculation formula is as follows:
Figure BDA0004069620700000161
where a is a reference and e is an entity.
In some embodiments of the present invention, the health advice generating means further comprises:
the concept set searching module is used for searching a concept set corresponding to a core entity from the concept map sequence after the user portrait tag and the concept map sequence of the human body function regulating product are generated;
and the information complement module is used for carrying out information complement on the concept set to form a conceptual map sequence with more comprehensive knowledge.
In some embodiments of the invention, the prediction module comprises:
the judging sub-module is used for inputting the fusion coding vector into a diagnostic information judging device for processing;
a first type determination submodule for taking a diagnosis conclusion as a predicted disease type if the diagnosis conclusion is obtained;
the node traversing submodule is used for inputting the fusion coding vector into the first decision tree for processing if the diagnosis conclusion is not obtained, and traversing all nodes of the first decision tree;
A second type determination submodule for taking the diagnosis result as a predicted disease type if the diagnosis result is found;
and the rotor jumping module is used for jumping to the next decision tree for processing if the diagnosis result is not found, until a diagnosis conclusion is obtained.
The health advice generating device can execute the health advice generating method provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects of executing the health advice generating method.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the method of generating health advice.
In some embodiments, the method of generating the wellness advice may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the above-described health advice generation method may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the method of generating the health advice in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
Embodiments of the present invention also provide a computer program product comprising a computer program which, when executed by a processor, implements a method of generating health advice as provided by any of the embodiments of the present application.
Computer program product in the implementation, the computer program code for carrying out operations of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method of generating a health recommendation, comprising:
acquiring user consultation text, a user portrait tag and a human body function regulating product associated with the user portrait tag;
carrying out fusion coding on the user consultation text, the user portrait tag and the human body function regulating product to obtain a fusion coding vector;
inputting the fusion coding vector into a pre-trained multi-decision tree classification model for processing, and predicting the disease type of the user;
Health advice is generated for the disease type and pushed to the user.
2. The method of claim 1, wherein fusion encoding the user advisory text, the user portrayal tab, and the human body function adjustment product to obtain a fusion encoded vector comprises:
coding the user consultation text by adopting a self-attention mechanism to obtain an attention vector;
generating a conceptualized atlas sequence of the user portrayal tag and the humanbody function regulating product based on the user portrayal tag and the humanbody function regulating product associated with the user portrayal tag;
and fusing the attention vector and the conceptualized map sequence to obtain a fused coding vector.
3. The method of generating a health advice of claim 2, wherein encoding the user advisory text using a self-attention mechanism to obtain an attention vector comprises:
word embedding processing is carried out on words in the user consultation text to obtain word vectors;
performing position embedding processing on words in the user consultation text to obtain a position vector;
fusing the word vector and the position vector to obtain a fused vector;
And inputting the fusion vector into an encoder of a transducer model to encode so as to obtain the attention vector.
4. The method of generating a health recommendation according to claim 2, wherein generating a conceptualized pattern sequence of the user portrait tag and the adjusted human function product based on the user portrait tag and an adjusted human function product associated with the user portrait tag comprises:
when the user inquiry is triggered, acquiring user instruction, user consultation text and customer service product document as candidate input;
identifying all fingers and all entities from the candidate input;
calculating the matching degree between any reference and the entity;
and constructing a conceptualized map sequence of the user portrait tag and the human body function regulating product by taking the reference and the entity as nodes and taking the matching degree as an edge.
5. The method of claim 4, wherein calculating a degree of match between any reference and an entity comprises:
and calculating the editing distance between any reference and the entity as the matching degree, wherein the editing distance calculation formula is as follows:
Figure FDA0004069620690000021
where a is a reference and e is an entity.
6. The method of claim 2, further comprising, after generating the user representation tag and the conceptualized pattern sequence of the human performance-regulating product:
Finding out a concept set corresponding to the core entity from the conceptualized graph sequence;
and carrying out information complementation on the concept set to form a conceptual map sequence with more comprehensive knowledge.
7. The method of any one of claims 1-6, wherein inputting the fusion encoded vector into a pre-trained multi-decision tree classification model for processing, predicting the disease type of the user, comprises:
inputting the fusion coding vector into a diagnosis information discriminator for processing;
if a diagnosis conclusion is obtained, the diagnosis conclusion is used as a predicted disease type;
if the diagnosis conclusion is not obtained, inputting the fusion coding vector into a first decision tree for processing, and traversing all nodes of the first decision tree;
if a diagnosis result is found, the diagnosis result is used as a predicted disease type;
if the diagnosis result is not found, jumping to the next decision tree for processing until the diagnosis conclusion is obtained.
8. A health advice generation apparatus, comprising:
the data acquisition module is used for acquiring user consultation text, user portrait labels and human body function regulating products associated with the user portrait labels;
The fusion coding module is used for carrying out fusion coding on the user consultation text, the user portrait tag and the human body function regulating product to obtain a fusion coding vector;
the prediction module is used for inputting the fusion coding vector into a pre-trained multi-decision tree classification model for processing and predicting the disease type of the user;
and the health suggestion module is used for generating health suggestions for the disease types and pushing the health suggestions to the user.
9. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of generating health advice of any of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein computer-executable instructions for implementing the method of generating health advice according to any of the claims 1-7 when executed by a processor.
CN202310088768.8A 2023-02-06 2023-02-06 Method, device, equipment and storage medium for generating health advice Pending CN116010586A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310088768.8A CN116010586A (en) 2023-02-06 2023-02-06 Method, device, equipment and storage medium for generating health advice

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310088768.8A CN116010586A (en) 2023-02-06 2023-02-06 Method, device, equipment and storage medium for generating health advice

Publications (1)

Publication Number Publication Date
CN116010586A true CN116010586A (en) 2023-04-25

Family

ID=86024880

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310088768.8A Pending CN116010586A (en) 2023-02-06 2023-02-06 Method, device, equipment and storage medium for generating health advice

Country Status (1)

Country Link
CN (1) CN116010586A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116844717A (en) * 2023-09-01 2023-10-03 中国人民解放军总医院第一医学中心 Medical advice recommendation method, system and equipment based on hierarchical multi-label model
CN116884611A (en) * 2023-07-11 2023-10-13 浙江万航信息科技有限公司 Teenager physical health intervention method and device, storage medium and electronic equipment
CN116913519A (en) * 2023-07-24 2023-10-20 东莞莱姆森科技建材有限公司 Health monitoring method, device, equipment and storage medium based on intelligent mirror

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116884611A (en) * 2023-07-11 2023-10-13 浙江万航信息科技有限公司 Teenager physical health intervention method and device, storage medium and electronic equipment
CN116884611B (en) * 2023-07-11 2024-02-13 浙江万航信息科技有限公司 Teenager physical health intervention method and device, storage medium and electronic equipment
CN116913519A (en) * 2023-07-24 2023-10-20 东莞莱姆森科技建材有限公司 Health monitoring method, device, equipment and storage medium based on intelligent mirror
CN116844717A (en) * 2023-09-01 2023-10-03 中国人民解放军总医院第一医学中心 Medical advice recommendation method, system and equipment based on hierarchical multi-label model
CN116844717B (en) * 2023-09-01 2023-12-22 中国人民解放军总医院第一医学中心 Medical advice recommendation method, system and equipment based on hierarchical multi-label model

Similar Documents

Publication Publication Date Title
CN111680159B (en) Data processing method and device and electronic equipment
CN107644011B (en) System and method for fine-grained medical entity extraction
CN116010586A (en) Method, device, equipment and storage medium for generating health advice
CN111444709A (en) Text classification method, device, storage medium and equipment
CN109326353B (en) Method and device for predicting disease endpoint event and electronic equipment
CN111738001B (en) Training method of synonym recognition model, synonym determination method and equipment
CN114330354B (en) Event extraction method and device based on vocabulary enhancement and storage medium
CN111324738B (en) Method and system for determining text label
CN112183881A (en) Public opinion event prediction method and device based on social network and storage medium
CN112541056A (en) Medical term standardization method, device, electronic equipment and storage medium
CN115114448B (en) Intelligent multi-mode fusion power consumption inspection method, device, system, equipment and medium
CN113705698A (en) Information pushing method and device based on click behavior prediction
CN117557331A (en) Product recommendation method and device, computer equipment and storage medium
CN115329207B (en) Intelligent sales information recommendation method and system
CN116303922B (en) Consultation message response method, consultation message response device, computer equipment, storage medium and product
CN116680401A (en) Document processing method, document processing device, apparatus and storage medium
US11783244B2 (en) Methods and systems for holistic medical student and medical residency matching
CN116719920A (en) Dynamic sampling dialogue generation model training method, device, equipment and medium
CN113806541A (en) Emotion classification method and emotion classification model training method and device
CN114090725A (en) Emotion prediction model training method and device
EP3570188A1 (en) Generating an executable code based on a document
CN113724069B (en) Deep learning-based pricing method, device, electronic equipment and storage medium
Titu et al. Acquiring businesss intelligence through data science: A practical approach
CN116226478B (en) Information processing method, model training method, device, equipment and storage medium
US20240005231A1 (en) Methods and systems for holistic medical student and medical residency matching

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination