Input text processing methods, model training methods, devices, equipment and media
By performing label prediction and department prediction processing on the input text, the problem of low efficiency of questionnaire templates is solved, and fast and accurate department guidance is achieved.
Patent Information
- Application Number
- CN202211350424.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-10-31
AI Technical Summary
In existing technologies, obtaining physiological symptoms by having patients fill out questionnaire templates is inefficient and makes it difficult to quickly determine the appropriate medical treatment department.
By performing label prediction processing on the input text, character and sentence labels are obtained. Department guidance labels are determined by combining the confidence probability. When the confidence probability is lower than the threshold, department prediction processing and updates are performed.
It improves the accuracy and efficiency of departmental guidance labels, avoids filling out questionnaire templates, and enables rapid identification of the medical treatment department.
Smart Images

Figure CN117010365B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to an input text processing method, model training method, apparatus, device and medium. Background Technology
[0002] In daily life, medical institutions have complex organizational structures, usually with multiple departments, and patients need to go to the corresponding department according to their abnormal physiological condition.
[0003] In this technology, a questionnaire template corresponding to the patient's chief complaints and physiological symptoms is used to further describe the patient's abnormal physiological state. Based on the questionnaire results, the information desk staff guides the relevant medical departments in determining the appropriate treatment for the abnormal physiological state.
[0004] However, obtaining multiple physiological symptoms through a questionnaire template requires users to fill in all the questions in the template one by one, which is inefficient; how to quickly determine the medical treatment department is an urgent problem to be solved. Summary of the Invention
[0005] This application provides an input text processing method, a model training method, an apparatus, a device, and a medium, the technical solutions of which are as follows: According to one aspect of this application, an input text processing method is provided, the method comprising: The input text is obtained, which is used to indicate the abnormal physiological state of the input object, and the input text includes at least two input characters; The input text is subjected to label prediction processing to obtain character label groups and statement labels of the input text. The character label group includes at least two character labels, which indicate the entity category to which the corresponding at least two input characters belong. The statement labels are used to indicate the overall statement category of the input text. Based on at least one of the input characters, at least one of the character tags, and the statement tag, determine the department guidance tag and confidence probability of the input object, wherein the department guidance tag is used to indicate the medical treatment department for the abnormal physiological state; If the confidence probability is lower than the confidence threshold, the department label of the input text obtained by the department prediction processing is used to update the department guidance label. The department label is predicted based on the semantic information contained in the input text.
[0006] According to another aspect of this application, a model training method is provided, the method comprising: Obtain sample input text, and sample character tag group, sample sentence tag and sample department tag of the sample input text. The sample input text is used to indicate the abnormal physiological state of the sample object. The sample input text includes at least two input characters. The sample department tag is used to indicate the medical treatment department of the abnormal physiological state. The label prediction network is invoked to perform label prediction processing on the sample input text to obtain the predicted character label group and predicted sentence label of the input text. The predicted character label group includes at least two predicted character labels, and the at least two predicted character labels indicate the entity category to which the corresponding at least two input characters belong. The sentence label is used to indicate the overall sentence category of the sample input text. The first loss function is obtained by distinguishing between the sample character label group, the sample sentence label, the predicted character label group, and the predicted sentence label; The department prediction network is invoked to perform department prediction processing on the sample input text to obtain the predicted department label of the input text; The second loss function is obtained by comparing the sample department labels with the predicted department labels; Based on the first loss function, the label prediction network is trained by backpropagation to obtain the trained label prediction network; and based on the second loss function, the department prediction network is trained by backpropagation to obtain the trained department prediction network.
[0007] According to another aspect of this application, an input text processing apparatus is provided, the apparatus comprising: The acquisition module is used to acquire the input text, which is used to indicate the abnormal physiological state of the input object, and the input text includes at least two input characters; The prediction module is used to perform label prediction processing on the input text to obtain character label groups and sentence labels of the input text. The character label group includes at least two character labels, and the at least two character labels indicate the entity category to which the corresponding at least two input characters belong. The sentence labels are used to indicate the overall sentence category of the input text. The determination module is used to determine the department guidance label and confidence probability of the input object based on at least one of the input characters, at least one of the character labels and the statement label, wherein the department guidance label is used to indicate the medical treatment department for the abnormal physiological state; The prediction module is further configured to update the department guidance label based on the department label of the input text obtained by the department prediction processing of the input text when the confidence probability is lower than the confidence threshold. The department label is predicted based on the semantic information contained in the input text.
[0008] In an optional design of this application, the character tag group and the statement tag are predicted by a tag prediction network, which includes a first encoding subnetwork and a first prediction subnetwork. The prediction module is also used for: The first encoding subnetwork of the label prediction network is invoked to encode the input text to obtain the character feature representation of the input text, wherein the character feature representation includes the hidden layer feature vectors of at least two input characters in the input text; The first prediction subnetwork of the label prediction network is invoked to perform label prediction processing on the character feature representation to obtain the character label group and sentence label of the input text.
[0009] In an optional design of this application, the label prediction network further includes a second coding subnetwork; the first prediction subnetwork includes a first prediction layer and a second prediction layer; The prediction module is also used for: The second encoding subnetwork of the label prediction network is invoked to encode the input text to obtain the word feature representation of the input text. The word feature representation includes the hidden layer feature vector of the word group composed of the at least two input characters in the input text. The first prediction layer is invoked to perform label prediction processing on the character feature representation to obtain the character label group of the input text; The second prediction layer is invoked to perform label prediction processing on the character feature representation and the phrase feature representation to obtain the sentence label of the input text.
[0010] In an optional design of this application, the determining module is further configured to: Based on the statement tag, an associated character tag that is related to the statement tag is determined in the character tag group, and the associated character tag includes at least one of the character tags; By comparing the similarity between at least one input character corresponding to the associated character label and at least one standard character corresponding to the associated character label, an associated standard character is determined from the at least one standard character; Based on the department mapping relationship corresponding to the associated standard characters, the department guidance label and the confidence probability are determined.
[0011] In an optional design of this application, the determining module is further configured to: Based on the department mapping relationship corresponding to the associated standard characters, determine the information missing type of the input text; Based on the type of missing information, a supplementary guidance statement is determined, and the supplementary guidance statement is displayed to the input object. The supplementary guidance statement is used to guide the supplementation of the physiological abnormality state of the input object.
[0012] In an optional design of this application, the information missing type includes at least one of the following: Missing physiological abnormality sites, missing accompanying physiological abnormality states, missing age information of the input object, missing gender information of the input object, and missing pregnancy and childbirth information of the input object.
[0013] In an optional design of this application, the department label is predicted by a department prediction network, which includes a third encoding subnetwork and a second prediction subnetwork. The prediction module is also used for: When the confidence probability is lower than the confidence threshold, the third encoding subnetwork of the department prediction network is invoked to encode the input text to obtain the semantic feature representation of the input text. The semantic feature representation is the hidden layer feature vector of the semantic information contained in the input text. The second prediction subnetwork of the department prediction network is invoked to perform department prediction processing on the semantic feature representation to obtain the department label of the input text, and the department label is updated using the department label.
[0014] In an optional design of this application, the determining module is further configured to: Obtain the organizational structure information of the first medical institution, wherein the organizational structure information includes at least one department; Construct departmental association information between the organizational departments and the standard departments in the standard library; The department label corresponds to at least one organizational department.
[0015] In an optional design of this application, the prediction module is further configured to: If the confidence probability is lower than the confidence threshold, a department prediction process is performed based on the input text to obtain a predicted standard department, which belongs to the standard library. Based on the department association information, the label of the organization department corresponding to the predicted standard department is determined as the department label, and the department guidance label is updated.
[0016] According to another aspect of this application, a model training apparatus is provided, the apparatus comprising: The acquisition module is used to acquire sample input text, and sample character tag group, sample sentence tag and sample department tag of the sample input text. The sample input text is used to indicate the physiological abnormality state of the sample object. The sample input text includes at least two input characters. The sample department tag is used to indicate the medical treatment department of the physiological abnormality state. The prediction module is used to call the label prediction network to perform label prediction processing on the sample input text to obtain the predicted character label group and predicted sentence label of the input text. The predicted character label group includes at least two predicted character labels, and the at least two predicted character labels indicate the entity category to which the corresponding at least two input characters belong. The sentence label is used to indicate the overall sentence category of the sample input text. The calculation module is used to obtain a first loss function by the difference between the sample character label group, the sample sentence label, the predicted character label group, and the predicted sentence label; The prediction module is also used to call the department prediction network to perform department prediction processing on the sample input text to obtain the predicted department label of the input text; The calculation module is also used to obtain a second loss function based on the difference between the sample department label and the predicted department label; The training module is used to perform backpropagation training on the label prediction network based on the first loss function to obtain the trained label prediction network, and to perform backpropagation training on the department prediction network based on the second loss function to obtain the trained department prediction network.
[0017] In an optional design of this application, the computing module is further configured to: Calculate the negative log-likelihood loss function between the sample character label group and the predicted character label group; Calculate the cross-entropy loss function between the sample statement label and the predicted statement label; The first loss function is obtained by summing the negative log-likelihood loss function and the cross-entropy loss function.
[0018] According to another aspect of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the input text processing method and / or model training method as described above.
[0019] According to another aspect of this application, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the input text processing method and / or model training method as described above.
[0020] According to another aspect of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium, wherein a processor reads from the computer-readable storage medium and executes the computer instructions to implement the input text processing method and / or model training method described above.
[0021] The beneficial effects of the technical solution provided in this application include at least the following: By performing label prediction and department prediction processing on the input text one after another, department guidance labels can be obtained based on the input text. Label prediction processing and department prediction processing provide different processing methods for the input text. The two prediction processes improve the prediction accuracy of department guidance labels, avoid filling in questionnaire templates, and improve the prediction efficiency of department guidance labels. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic diagram of a computer system provided in an exemplary embodiment of this application; Figure 2 This is a schematic diagram of an input text processing method provided in an exemplary embodiment of this application; Figure 3 This is a flowchart of an input text processing method provided in an exemplary embodiment of this application; Figure 4 This is a flowchart of an input text processing method provided in an exemplary embodiment of this application; Figure 5 This is a flowchart of an input text processing method provided in an exemplary embodiment of this application; Figure 6 This is a schematic diagram of a label prediction network provided in an exemplary embodiment of this application; Figure 7This is a flowchart of an input text processing method provided in an exemplary embodiment of this application; Figure 8 This is a flowchart of an input text processing method provided in an exemplary embodiment of this application; Figure 9 This is a flowchart of an input text processing method provided in an exemplary embodiment of this application; Figure 10 This is a schematic diagram of a department prediction network provided in an exemplary embodiment of this application; Figure 11 This is a schematic diagram of an input text processing interface provided in an exemplary embodiment of this application; Figure 12 This is a flowchart of an input text processing method provided in an exemplary embodiment of this application; Figure 13 This is a schematic diagram illustrating the construction of departmental association information provided in an exemplary embodiment of this application; Figure 14 This is a schematic diagram of input text processing provided in an exemplary embodiment of this application; Figure 15 This is a flowchart of a model training method provided in an exemplary embodiment of this application; Figure 16 This is a schematic diagram of input text processing provided in an exemplary embodiment of this application; Figure 17 This is a structural block diagram of an input text processing apparatus provided in an exemplary embodiment of this application; Figure 18 This is a structural block diagram of a model training apparatus provided in an exemplary embodiment of this application; Figure 19 This is a structural block diagram of a server provided in an exemplary embodiment of this application.
[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0027] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0028] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the input text and other information involved in this application were obtained with full authorization.
[0029] It should be understood that although the terms first, second, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, a first parameter may also be referred to as a second parameter without departing from the scope of this disclosure, and similarly, a second parameter may also be referred to as a first parameter. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0030] Figure 1A schematic diagram of a computer system provided in one embodiment of this application is shown. This computer system can implement a system architecture for an input text processing method and / or a model training method. The computer system may include a terminal 100 and a server 200. The terminal 100 may be an electronic device such as a mobile phone, tablet computer, vehicle-mounted terminal (vehicle system), wearable device, or PC (Personal Computer). A client application for a target application may be installed and run on the terminal 100. This target application may be an application for an input text processing method and / or a model training method, or other applications providing input text processing and / or model training functions; this application does not limit the specific application. Furthermore, this application does not limit the form of the target application, including but not limited to Apps (Applications), applets, etc., installed on the terminal 100, and may also be in web page form. The server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The server 200 may be a backend server for the aforementioned target application, used to provide backend services to the client of the target application.
[0031] The input text processing method and / or model training method provided in this application embodiment can be executed by a computer device, which refers to an electronic device with data computing, processing, and storage capabilities. Figure 1 Taking the implementation environment of the scheme shown as an example, the input text processing method and / or model training method can be executed by the terminal 100 (such as the input text processing method and / or model training method executed by the client of the target application installed and running in the terminal 100), or the input text processing method and / or model training method can be executed by the server 200, or the terminal 100 and the server 200 can interact and cooperate to execute it. This application does not limit this.
[0032] Furthermore, the technical solution of this application can be combined with blockchain technology. For example, some data involved in the input text processing method and / or model training method disclosed in this application (input physiological images, sample physiological images, etc.) can be stored on the blockchain. The terminal 100 and the server 200 can communicate through a network, such as a wired or wireless network.
[0033] Next, the input text method in this application will be described. In one example, the input text method is implemented by calling a label prediction network and a department prediction network: Figure 2 A schematic diagram of an input text processing method provided in one embodiment of this application is shown.
[0034] In this embodiment, the input text 300 is processed by calling the label prediction network 310 and the department prediction network 320.
[0035] The label prediction network 310 includes a first coding subnetwork 312, a second coding subnetwork 314, and a first prediction subnetwork 316.
[0036] Input text 300 is used to indicate the abnormal physiological state of the input object. Input text 300 includes at least two input characters. Understandably, input text 300 can directly describe the abnormal physiological state of the input object, such as: "I have a headache today." Input text 300 can also indirectly indicate the abnormal physiological state by describing the medical department, such as: "I'm not feeling well today, I'm making an appointment with the dental department."
[0037] The first encoding subnetwork 312 of the label prediction network 310 is invoked to encode the input text 300, resulting in a character feature representation 302 of the input text 300. The character feature representation 302 includes the hidden layer feature vectors of at least two input characters in the input text 300. For example, if the input text 300 is "I have a headache today", the character feature representation 302 includes the hidden layer feature vectors of at least six input characters in the input text 300.
[0038] The second encoding subnetwork 314 of the label prediction network 310 is invoked to encode the input text 300, resulting in a phrase feature representation 304 of the input text 300. The phrase feature representation 302 includes the hidden layer feature vectors of phrases consisting of at least two input characters in the input text 300. For example, if the input text 300 is "I have a headache today", the phrase feature representation 304 includes the hidden layer feature vectors of the three phrases "today", "some" and "headache" in the input text 300.
[0039] The first prediction subnetwork 316 includes a first prediction layer 316a and a second prediction layer 316b.
[0040] The first prediction layer 316a is invoked to perform label prediction processing on the character feature representation 302, resulting in a character label group 306 for the input text 300. For example, if the input text 300 is "I have a headache today", the character label group 306 includes six character labels: the first character label 306a, and the second to sixth character labels 306b to 306f. The character labels indicate the entity category to which the corresponding input character belongs. Entity categories include, but are not limited to, at least one of the following: symptoms, diseases, departments, time, body parts, and doctor's name.
[0041] The second prediction layer 316b is invoked to perform label prediction processing on the character feature representation 302 and the phrase feature representation 304, resulting in the sentence label 308 of the input text 300. The sentence label 308 is used to indicate the overall sentence category of the input text; the overall sentence category includes, but is not limited to, at least one of: department registration, doctor registration, and symptom inquiry.
[0042] Based on statement tag 308, an associated character tag that is related to statement tag 308 is determined in character tag group 306; in this embodiment, the associated character tag is the second character tag 306b. Each associated character label corresponds to at least one input character, which is some or all of the characters in the input text 300. By comparing the similarity between the at least one input character corresponding to the associated character label and the at least one standard character corresponding to the associated character label, an associated standard character is determined from the at least one standard character; based on the department mapping relationship corresponding to the associated standard character, a department guidance label 309 and a confidence probability 309a are determined.
[0043] Taking symptom labels as an example, the input characters corresponding to these labels include: "Something in my throat I can't swallow." The standard characters corresponding to these symptom labels include: "Diarrhea," "Fever," and "Foreign body in the throat." "Foreign body in the throat" is selected as the standard character for association.
[0044] Based on the departmental mapping relationship associated with the standard character "pharyngeal foreign body", the departmental guidance label 309 and confidence probability 309a are determined. For example, if the departmental guidance label is "otolaryngology", the confidence probability is 85%.
[0045] If the confidence probability 309a is lower than the confidence threshold, the department prediction network 320 is invoked to perform department prediction processing on the input text 300. The department prediction network 320 includes a third encoding subnetwork 322 and a second prediction subnetwork 324.
[0046] Specifically, when the confidence probability 309a is lower than the confidence threshold, the third encoding subnetwork 322 of the department prediction network 320 is called to encode the input text 300, and the semantic feature representation 305 of the input text 300 is obtained. The semantic feature representation 305 is the hidden layer feature vector of the semantic information contained in the input text. The second prediction subnetwork 324 of the department prediction network 320 is invoked to perform department prediction processing on the semantic feature representation 305, resulting in the department label 300a of the input text. The department label 300a is then used to update the department guidance label 309. The department label 300a is predicted based on the semantic information contained in the input text 300.
[0047] Figure 3A flowchart illustrating an exemplary embodiment of this application shows an input text processing method. This method can be executed by a computer device. The method includes: Step 510: Obtain the input text; For example, the input text is used to indicate the abnormal physiological state of the input object; the input text can directly describe the abnormal physiological state of the input object through its abnormal physiological symptoms, or it can indirectly indicate the abnormal physiological state by describing at least one of the following: the medical treatment department, the doctor's label of the medical treatment department, or the label of the abnormal physiological disease. The input text includes at least two input characters.
[0048] In one implementation, a computer device provided by a medical institution acquires the input text. This computer device also displays prompts to guide the user to enter the text. Those skilled in the art will understand that in one implementation of this application, the acquisition of the input text is done with the separate consent of the authorized party and complies with relevant laws, regulations, and standards of the relevant countries and regions. For example, for acquiring input text information, the user is explicitly prompted through at least one method such as a user privacy agreement or pop-up prompts, and the information is acquired only after the user's full authorization. In another implementation, the user is prompted each time the above information is acquired, obtaining the user's separate consent.
[0049] Those skilled in the art will understand that the input text is used solely for predicting departmental guidance labels with the user's separate consent; in one implementation, when requesting the aforementioned information from the user, the intended use of the information is shown to the user. The information obtained will not be used for purposes exceeding the scope of the user's consent, and will not be uploaded, stored, or disclosed without the user's full authorization.
[0050] Step 520: Perform label prediction processing on the input text to obtain the character label groups and sentence labels of the input text; For example, a character label group includes at least two character labels, and the character labels in the character label group correspond one-to-one with the input characters in the input text; the at least two character labels indicate the entity category to which the corresponding at least two input characters belong. For example, the entity category is a semantic category in natural language. The character labels in the character label group are label information at the granularity of the corresponding input characters, used to indicate the entity category of the input characters.
[0051] For example, statement tags are used to indicate the overall statement category of the input text; in one implementation, the overall statement category is used to indicate the intent category of the input statement; the intent category is used to indicate the linguistic purpose information of the input text, and the overall statement category includes, but is not limited to, at least one of: department registration, doctor registration, and symptom inquiry. Statement tags are tagging information at the input text level, used to indicate the overall statement category of the input text.
[0052] It is understandable that label prediction processing can be performed based on statistical calculations or by calling artificial neural network models. This embodiment does not impose any restrictions on the method of label prediction processing.
[0053] Step 530: Based on at least one input character, at least one character label, and a statement label, determine the department guidance label and confidence probability of the input object; For example, at least one input character can be part or all of the input text. At least one character label can be indicated by a statement label or a preset label determined by filtering within a group of character labels.
[0054] For example, the department guidance label is used to indicate the medical treatment department for abnormal physiological states; it is understood that the medical treatment department in this embodiment only indicates the department that can treat the abnormal physiological state of the input object, and does not include the determination of the disease corresponding to the abnormal physiological state. The confidence probability is used to indicate the reliability of the department guidance label.
[0055] Step 540: If the confidence probability is lower than the confidence threshold, update the department guidance label based on the department label of the input text obtained by department prediction processing; For example, the confidence threshold can be preset or determined during model training, and this embodiment does not limit it in this way.
[0056] For example, the department label is predicted based on the semantic information contained in the input text; the department label can be obtained by directly performing department prediction processing on the input text, or it can be obtained indirectly by performing department prediction processing on other information generated based on the input text. It should be noted that the semantic information contained in the input text in this embodiment can be obtained at the granularity of one or more characters in the input text, or it can be obtained at the granularity of the entire input text.
[0057] In summary, the method provided in this embodiment achieves the prediction of department guidance labels based on input text by performing label prediction processing and department prediction processing on the input text one after another. Label prediction processing and department prediction processing provide different processing methods for input text. The two prediction processing improves the prediction accuracy of department guidance labels, avoids filling in questionnaire templates, and improves the prediction efficiency of department guidance labels.
[0058] Figure 4 A flowchart illustrating an exemplary embodiment of the input text processing method provided in this application is shown. This method can be executed by a computer device. That is, in Figure 3 In the illustrated embodiment, step 520 can be implemented as steps 522 and 524: Step 522: Call the first encoding subnetwork of the label prediction network to encode the input text and obtain the character feature representation of the input text; In this embodiment, character tag groups and sentence tags are predicted by a tag prediction network, which includes a first encoding subnetwork and a first prediction subnetwork; that is, in this embodiment, the input text is processed by calling the tag prediction network to predict tags.
[0059] For example, the character feature representation includes the hidden layer feature vectors of at least two input characters in the input text; the character feature representation is obtained by encoding at the granularity of the input characters. In one implementation, the character feature representation corresponds one-to-one with the input characters in the input text. The encoding process is used to extract the hidden layer vector features of the input characters in the input text, and the character feature representation is the feature representation of the input characters in the hidden layer space. In this embodiment, the first encoding sub-network can encode each input character individually, or it can combine the input characters and their neighboring characters for encoding; this embodiment does not impose any limitations on this.
[0060] Step 524: Call the first prediction subnetwork of the label prediction network to perform label prediction processing on the character feature representation to obtain the character label group and sentence label of the input text; For example, the first prediction sub-network predicts the character label combination sentence label of the input text based on the hidden layer vector features indicated by the character feature representation. For example, the model parameters in the first prediction sub-network are determined during the training process of the label prediction network.
[0061] In summary, the method provided in this embodiment achieves the prediction of department guidance labels based on the input text by successively performing label prediction processing and department prediction processing on the input text; it provides a specific method for label prediction processing by calling the label prediction network, which makes full use of the hidden features in the input text; the label prediction processing and department prediction processing provide different processing methods for the input text, and the two prediction processing improves the prediction accuracy of department guidance labels, avoids filling in questionnaire templates, and improves the prediction efficiency of department guidance labels.
[0062] Figure 5 A flowchart illustrating an exemplary embodiment of the input text processing method provided in this application is shown. This method can be executed by a computer device. That is, in Figure 4 Based on the illustrated embodiment, step 523 is also included, and step 524 can be implemented as steps 524a and 524b: Step 523: Call the second encoding subnetwork of the label prediction network to encode the input text and obtain the word feature representation of the input text; In this embodiment, the label prediction network further includes a second encoding sub-network; the first prediction sub-network in the label prediction network includes a first prediction layer and a second prediction layer.
[0063] For example, the phrase feature representation includes the hidden feature vector of phrases consisting of at least two input characters in the input text; the phrase feature representation is obtained by encoding at the granularity of phrases composed of input characters. In one implementation, there is a one-to-one correspondence between the phrase feature representation and the phrases composed of input characters. The encoding process is used to extract the hidden feature vector of the phrases.
[0064] Step 524a: Call the first prediction layer to perform label prediction processing on the character feature representation to obtain the character label group of the input text; For example, character label groups are used to represent the entity category to which the input character belongs. Prediction is performed using the feature representation of the input character in the hidden layer space, as indicated by the character feature representation, to obtain the character label group. It is understood that the first and second prediction layers perform prediction processing in different ways, but this does not mean that the first and second prediction layers are independent of each other. The first and second prediction layers can have the same network model structure and / or use the same network model parameters.
[0065] Step 524b: Call the second prediction layer to perform label prediction processing on the character feature representation and phrase feature representation to obtain the sentence labels of the input text; For example, statement labels are used to indicate the overall statement category of the input text. Character feature representation describes the latent space features of the input statement from a fine-grained perspective, i.e., from the perspective of each input character. Phrase feature representation describes the latent space features of the input statement from a coarse-grained perspective, i.e., from the perspective of multiple input characters forming a phrase. The receptive field corresponding to the phrase feature representation is larger than that corresponding to the character feature representation; using phrase feature representation improves the accuracy of predicting statement labels.
[0066] Those skilled in the art will understand that the first prediction layer and the second prediction layer in this embodiment are not limited to a cascaded relationship; step 524a can be executed before, after, or simultaneously with step 524b. The first prediction layer and the second prediction layer are distinguished only from the perspective of the prediction processing method, and do not limit the structure of the first prediction sub-network.
[0067] In summary, the method provided in this embodiment achieves the prediction of department guidance labels based on the input text by successively performing label prediction processing and department prediction processing on the input text; it calls the label prediction network to perform label prediction processing, and obtains the word feature representation of the input text through the second encoding sub-network, further mining the hidden features contained in the input text from different granularities of characters and words; the label prediction processing and department prediction processing provide different processing methods for the input text, and the two prediction processing improves the prediction accuracy of department guidance labels, avoids filling in questionnaire templates, and improves the prediction efficiency of department guidance labels.
[0068] Figure 6 A schematic diagram of a label prediction network provided in an exemplary embodiment of this application is shown.
[0069] In this embodiment, the tag prediction network 410 includes a first encoding sub-network 412 and a second encoding sub-network 414; the tag prediction network 410 also includes a first prediction sub-network, which includes a first prediction layer 416a and a second prediction layer 416b.
[0070] In this embodiment, the input text 400 is "I have a headache today"; the first encoding sub-network 412 encodes the character feature representation 400a at the character level; the character feature representation 400a is represented as... ;in, This represents the hidden feature vectors corresponding to the six input characters in the input text 400.
[0071] The second encoding subnetwork 414 encodes character feature representations 400b at the granularity of word groups; the word group feature representation 400b is represented as... ;in, This represents the hidden feature vectors corresponding to three word groups in the input text 400. For example, the first encoding sub-network 412 and the second encoding sub-network 414 include a Transformer Encoder model.
[0072] The first prediction layer 416a uses a Conditional Random Fields (CRF) model to label the text. Accordingly, the category labels are BIO (Beginning, Inside, Outside) labels, including Bt, It, and O labels. A character labeled Bt indicates that the target word belongs to entity category t, and that the character is at the beginning of the target word. A character labeled It indicates that the target word belongs to entity category t, and that the character is not at the beginning of the target word. A character labeled O indicates that the character does not belong to any entity category. For example, the first prediction layer 416a predicts the following character label group 432 for the input text 400 "I have a headache today": B-time, I-time, O, O, B-symptoms, I-symptoms.
[0073] In this embodiment of the application, character tag group 432 is represented as , Character tags that each represent a single character.
[0074] In this embodiment, an example is taken where a character with a preset positional difference from a given character is a character that precedes the given character and has a positional difference from it. Accordingly, through the first prediction layer 416a, for any character in the input text 400, based on the latent vector of the given character and the preset category label of the character with the preset positional difference from it, a degree parameter is determined as to whether the character is labeled with multiple preset category labels. For example:
[0075] Where h represents the hidden feature vector of the character. This indicates the category label for the first character of the two characters. This indicates the default category label for the second character of the two characters. Indicates from preset category labels To preset category labels The conversion parameters, and Indicates the corresponding category label The weight vector and bias, This indicates that the latent vector of the current character is h, and the preset category label of the previous character is h. In this case, the character is labeled with a preset category tag. The appropriateness of the category label. When any character is the first character in the text, the pre-defined category label of its preceding character is a fixed, easily calculated starting category label. .
[0076]
[0077] in, Represents candidate label sequence The probability, The parameter represents the degree to which the i-th character in the text is labeled with a certain preset category label.
[0078] The second prediction layer 416b processes the latent vector matrix H output by the Transformer Encoder model using a multi-head attention mechanism to obtain the attention vector. Specifically, the second prediction layer 416b predicts the sentence labels 434 of the input text, for example:
[0079] in, This represents the sigmoid function. and This represents the parameters of the second prediction layer. Represents the attention vector. The statement label represents the probability of having multiple intent categories.
[0080] Next, the training process of the label prediction network will be introduced.
[0081] In one example, the negative log-likelihood function is used as the loss function for training the second prediction layer. Specifically:
[0082] in, Let x represent the first loss function, and let x represent a training sample. This represents the true label sequence of the training sample x. This represents the hidden vector sequence of words in the training sample x.
[0083] In one example, the cross-entropy loss function is used as the model training loss function for the second prediction layer. For instance, the binary cross-entropy function is used as the model training loss function. Specifically:
[0084] in, Let x represent a training sample and y represent an intent category. This is used to indicate whether a training sample x belongs to the intent category y; if it does, then... ,otherwise , This represents the element that corresponds to the intent category y of the training sample x.
[0085] In one example, the two loss functions mentioned above are weighted and summed; for example:
[0086] in, This represents the third loss function. This represents the first loss value. This represents the second loss value. The weights represent the first loss value. This represents the weight of the second loss value. It is a hyperparameter used to adjust the importance level.
[0087] In summary, the method provided in this embodiment achieves the prediction of department guidance labels based on the input text by successively performing label prediction processing and department prediction processing on the input text; it calls the label prediction network to perform label prediction processing, and obtains the word feature representation of the input text through the second encoding sub-network, further mining the hidden features contained in the input text from different granularities of characters and words; the label prediction processing and department prediction processing provide different processing methods for the input text, and the two prediction processing improves the prediction accuracy of department guidance labels, avoids filling in questionnaire templates, and improves the prediction efficiency of department guidance labels.
[0088] Figure 7 A flowchart illustrating an exemplary embodiment of the input text processing method provided in this application is shown. This method can be executed by a computer device. That is, in Figure 3 In the illustrated embodiment, step 530 can be implemented as steps 532, 534, and 536: Step 532: Based on the statement tag, determine the associated character tag that is related to the statement tag in the character tag group. The associated character tag includes at least one character tag. For example, associated character labels are determined based on statement labels, and are typically a subset of labels within a character label group. In one example, associated character labels are the labels corresponding to characters in the input text that express the intent category. For a specific statement label, there are one or more associated character labels. For instance, in the case of an intent category of "department registration," the doctor's name in the character label group would be identified as the associated character label. For example, associated character labels are obtained by filtering the character label group based on the intent category indicated by the statement label.
[0089] Step 534: By comparing the similarity between at least one input character corresponding to the associated character label and at least one standard character corresponding to the associated character label, determine the associated standard character among at least one standard character; For example, at least one input character corresponding to the associated character label is an explicit expression of the intent category in the input text. The predicted input text corresponding to the associated character label is the character actually entered by the input object. The standard character corresponding to the associated character label is the corresponding standard character in the standard corpus, usually expressed as a phrase. Taking the associated character label as symptom as an example, in the medical standard corpus, the standard characters corresponding to the symptom label include, but are not limited to, at least one of the following: diarrhea, fever, foreign body in the throat, etc. The standard character is a specific instance of the associated character label. By comparing the similarity between the input character corresponding to the associated character label and the standard character, the input character is transformed into an expression instance in the standard corpus. It can be understood that at least one input character can form one or more phrases, and the associated standard characters obtained by comparing similarity can also be one or more.
[0090] Step 536: Determine the department guidance label and confidence probability based on the department mapping relationship corresponding to the associated standard characters; For example, department mapping relationships are used to describe the correlation between associated standard characters and department guidance labels. Associated standard characters can be one or more; for instance, a department mapping relationship indicates the correlation between the two associated standard characters "fever" and "diarrhea," and department guidance labels such as "fever clinic," "infectious disease clinic," and "endocrinology." Depending on the departmental setup of the medical institution, the department mapping relationship indicates the correlation between more or fewer medical treatment departments and associated standard characters.
[0091] In summary, the method provided in this embodiment achieves the prediction of department guidance labels based on input text by successively performing label prediction processing and department prediction processing on the input text. Label prediction processing and department prediction processing provide different processing methods for input text. By determining the department guidance labels and confidence probabilities by associating standard characters with corresponding department mapping relationships, the accuracy of prediction results is guaranteed, questionnaire templates are avoided, and the prediction efficiency of department guidance labels is improved.
[0092] Figure 8 A flowchart illustrating an exemplary embodiment of the input text processing method provided in this application is shown. This method can be executed by a computer device. That is, in Figure 3 Based on the illustrated embodiment, steps 538 and 539 are also included: Step 538: Determine the type of missing information in the input text based on the department mapping relationship corresponding to the associated standard characters; For example, department mapping relationships directly or indirectly indicate the type of missing information in the input text. In one implementation, the type of missing information in the input text is determined by comparing department mapping relationships of multiple first standard characters, including associated standard characters. The impact of other standard characters (excluding associated standard characters) in the first standard characters on the department guidance label and confidence probability is compared to determine the type of missing information in the input text.
[0093] In one implementation, the types of missing information include, but are not limited to, at least one of the following: Missing physiological abnormality site; used to indicate the specific location of the physiological abnormality. The location of the physiological abnormality is important for determining the medical department to handle it. For example, if someone says "I have a red rash on my body that is very itchy," it is necessary to ask about the specific location before making a judgment.
[0094] Missing accompanying physiological abnormalities; used to indicate the physiological abnormalities that occur simultaneously with the supplementary physiological abnormality. When a physiological abnormality includes a single physiological abnormality symptom, it may correspond to multiple diseases and further to multiple medical treatment departments, requiring supplementation of the accompanying physiological abnormality and follow-up questioning of accompanying symptoms. For example, sources of accompanying symptoms include, but are not limited to, at least one of the following: Custom questionnaires: multiple rounds of follow-up questioning based on decision trees for common symptoms; High-frequency symptom-accompanying symptoms: mining co-occurrence relationships between symptoms from sample physiological abnormality data to obtain symptoms with high co-occurrence for follow-up questioning; High-frequency symptoms of medical treatment departments: selecting high-frequency accompanying symptoms from each of multiple medical treatment departments for follow-up questioning.
[0095] The age information of the input object is missing; the age information of the input object plays an important role in determining the medical treatment department, for example, guiding the patient to the pediatric department or geriatric department based on the age information.
[0096] The gender information of the input object is missing; the gender information of the input object plays an important role in identifying the medical treatment department.
[0097] The input object's pregnancy and childbirth information is missing; pregnancy time and delivery time are important for gynecology and obstetrics to distinguish between pregnancy and postpartum status. The input text identifies the pregnancy or postpartum status, but the time is not specified. Follow up with the pregnancy time and / or delivery time.
[0098] Step 539: Determine the supplementary guidance statement based on the type of missing information, and display the supplementary guidance statement to the input object; For example, the missing information type corresponds to a supplementary guidance statement. By displaying the supplementary guidance statement, the input object is prompted to supplement the abnormal physiological state; that is, the supplementary guidance statement is used to guide the input object to supplement the abnormal physiological state.
[0099] Understandably, supplementary guidance statements can be in the form of questions, guiding the input subject to supplement the abnormal physiological state by asking them a question. Supplementary guidance statements can also include questions and answer options, guiding the input subject to choose from multiple answer options provided by the supplementary guidance statement to supplement the abnormal physiological state.
[0100] In summary, the method provided in this embodiment achieves the prediction of department guidance labels based on input text by successively performing label prediction processing and department prediction processing on the input text. Label prediction processing and department prediction processing provide different processing methods for the input text. By supplementing the guidance statements, the input object is guided to supplement the description of abnormal physiological state, which provides more basis for the prediction of medical treatment departments, avoids filling in questionnaire templates, and improves the prediction efficiency of department guidance labels.
[0101] Figure 9 A flowchart illustrating an exemplary embodiment of the input text processing method provided in this application is shown. This method can be executed by a computer device. That is, in Figure 3 In the illustrated embodiment, step 540 can be implemented as steps 542 and 544: Step 542: When the confidence probability is lower than the confidence threshold, the third encoding subnetwork of the department prediction network is invoked to encode the input text and obtain the semantic feature representation of the input text; In this embodiment, the department label is predicted by the department prediction network, which includes a third encoding subnetwork and a second prediction subnetwork; that is, in this embodiment, the label prediction network is invoked to perform label prediction processing on the input text.
[0102] For example, semantic features are represented as hidden feature vectors containing semantic information in the input text. In one implementation, the semantic feature representation includes at least two hidden vectors, with each input character in the input text corresponding to one hidden vector. It should be noted that the hidden vector corresponding to an input character may indicate only the semantic information of that input character, or it may indicate the semantic information in the context of that input character.
[0103] In one example, the third encoding subnetwork includes a Bidirectional Encoder Representation from Transformers (BERT). A special classification embedding [CLS] is inserted before the first input character of the input text, and a special delimiter [SEP] is inserted after the first input character. The semantic feature representation includes feature vectors for the special classification embedding [CLS] and the special delimiter [SEP]. The feature vector for the special classification embedding [CLS] is used to represent the overall semantic information of the input text.
[0104] Step 544: Call the second prediction subnetwork of the department prediction network to perform department prediction processing on the semantic feature representation to obtain the department label of the input text, and use the department label to update the department guidance label; For example, the second prediction sub-network predicts the department label of the input text based on the semantic information indicated by the semantic feature representation. For example, the model parameters in the second prediction sub-network are determined during the training process of the department prediction network.
[0105] In summary, the method provided in this embodiment achieves the prediction of department guidance labels based on the input text by successively performing label prediction processing and department prediction processing on the input text; it provides a specific method for department prediction processing by calling the department prediction network, which makes full use of the semantic features in the input text; the label prediction processing and department prediction processing provide different processing methods for the input text, and the two prediction processing improves the prediction accuracy of department guidance labels, avoids filling in questionnaire templates, and improves the prediction efficiency of department guidance labels.
[0106] Figure 10 A schematic diagram of a department prediction network provided in an exemplary embodiment of this application is shown.
[0107] In this embodiment, the department prediction network 420 includes a second coding subnetwork 422 and a second prediction subnetwork 424.
[0108] In this embodiment, the input text 400 is "I have a headache today"; a special category embedding character [CLS] is added to the beginning of the input text, and a special delimiter [SEP] is added to the end. Each input character in the input text 400 corresponds to a serialization result. The second encoding sub-network 422 is invoked to encode the special classification embedding [CLS], the special delimiter [SEP], and the input text 400, resulting in the semantic feature representation 400c of the input text 400. ;in, This represents the overall semantic features of the input text 400. These represent the semantic features of each input character in the input text 400.
[0109] In one implementation, the second prediction sub-network 424 is invoked to predict the overall semantic features of the input text 400, thereby obtaining the department label of the input text 400. Specifically:
[0110] Among them, Let p be a sigmoid function, and W and b be the network parameters in the department prediction network. Each element in p corresponds to a predicted probability value for a department label.
[0111] One implementation describes the training process of the department prediction network 420.
[0112] In one example, the cross-entropy loss function is used as the model training loss function for the department prediction network. For instance, the binary cross-entropy function is used as the model training loss function. Specifically:
[0113] Where L represents the second loss function, x represents a training sample, and y represents an intent category. This is used to indicate whether a training sample x belongs to the department label y. If it does, then... ,otherwise , This represents the element representing the department label y corresponding to the training sample x.
[0114] In one example, the second encoding subnetwork 422 is pre-trained using a large-scale medical corpus. The pre-training method employs Masked Language Modeling (MLM), which randomly transforms some words in the original input into masks. The output of the pre-trained model corresponding to the mask is then fed into a multi-classification layer. By predicting the words corresponding to the masks, the semantic representation of the text is learned.
[0115] In summary, the method provided in this embodiment achieves the prediction of department guidance labels based on the input text by successively performing label prediction processing and department prediction processing on the input text; it provides a specific method for department prediction processing by calling the department prediction network, which makes full use of the semantic features in the input text; the label prediction processing and department prediction processing provide different processing methods for the input text, and the two prediction processing improves the prediction accuracy of department guidance labels, avoids filling in questionnaire templates, and improves the prediction efficiency of department guidance labels.
[0116] Figure 11 A schematic diagram of an input text processing interface provided by an exemplary embodiment of this application is shown.
[0117] For example, the triage service interface 710 is used to provide an input interface for input text and to display department guidance labels obtained by processing the input text.
[0118] In this embodiment, the first area 720 is an information display area, used to display the input text of the input object, supplementary guidance statements, and department guidance labels. Based on the input text: "What should I do if my hands keep shaking?", "Female, 27 years old", and "No other symptoms", the department guidance label obtained is the neurology outpatient clinic; it also displays the registration status of doctors in the medical treatment department. The second area 730 provides an input text entry point, where the input object can input text using text input and / or voice information.
[0119] In one implementation, the input text processing method provided in this application has achieved good processing results. Table 1 shows the consistency and accuracy of the department guidance labels for major departments.
[0120] Table 1
[0121] Figure 12 A flowchart illustrating an exemplary embodiment of the input text processing method provided in this application is shown. This method can be executed by a computer device. That is, in Figure 3 Based on the illustrated embodiment, steps 502 and 504 are also included: Step 502: Obtain the organizational structure information of the first medical institution; For example, the first medical institution is the institution that performs medical treatment on the input object. The organizational structure information of the first medical institution includes at least one organizational department, which is the department that performs the medical treatment.
[0122] Step 504: Construct departmental association information between organizational departments and standard departments in the standard library; For example, the organizational departments are the actual medical treatment departments set up by the primary medical institution, while the standard departments in the standard library are the recommended medical treatment departments used during the construction process of the medical institution. It is understood that the organizational departments of the primary medical institution may differ from the standard departments. For example, the primary medical institution may differentiate between different hospital campuses, resulting in different organizational departments and standard departments; or the primary medical institution may split a standard department into multiple organizational departments to refine the management of organizational departments. This embodiment does not impose restrictive provisions on the reasons for the differences between organizational departments and standard departments.
[0123] For example, in this embodiment, the predicted department label corresponds to at least one organizational department. That is, the department label obtained from the department prediction process is the medical treatment department actually set up by the first medical institution.
[0124] In this embodiment, the department association information can be obtained through statistical processing or predicted through a network model. This embodiment does not impose any restrictions on this.
[0125] In an alternative implementation, step 540 in this embodiment can be implemented as follows: When the confidence probability is lower than the confidence threshold, the department prediction process is performed based on the input text to obtain the predicted standard department, which belongs to the standard library. Based on departmental association information, the labels of the organizational departments corresponding to the predicted standard departments are determined as departmental labels, and the departmental guidance labels are updated.
[0126] For example, predictive processing can be used to obtain the predicted standard departments belonging to the standard library. By using the department association information between the organizational departments and the standard departments, the organizational departments corresponding to the predicted standard departments can be obtained, and the labels of the organizational departments can be used as department labels.
[0127] In summary, the method provided in this embodiment, by obtaining the organizational departments of the first medical institution and establishing a valid association between these departments and standard departments, ensures that the department guidance labels obtained by the input object are the actual departments set up in the first medical institution. This improves the applicability of the input text processing method across different medical institutions. The label prediction processing and department prediction processing provide different processing methods for the input text; these two prediction processes improve the accuracy of department guidance label prediction, avoid the need to fill out questionnaire templates, and improve the prediction efficiency of department guidance labels.
[0128] Figure 13 This illustration shows a schematic diagram of the construction of department association information provided by an exemplary embodiment of this application.
[0129] In this embodiment, the relationship building model is invoked to construct the department association information.
[0130] First, the judgment network 512 in the relationship construction model 510 is invoked to determine whether the organizational department 500 in the organizational structure information of the first medical institution matches the cached department. The cached department is the standard department in the standard library.
[0131] If a cached department is found, the mapping network 516 is invoked to filter the cached departments, resulting in output department 500a. Output department 500a is a standard department in the standard library. The mapping network 516 is used to perform a secondary filter on the obtained cached departments to improve the accuracy of department association information.
[0132] If the cached department is not hit, the classification network 514 is invoked to predict the department 500, resulting in a predicted department that belongs to the standard departments in the standard library. In an alternative implementation, the classification network 514 and the department prediction network mentioned above have the same network structure.
[0133] The mapping network 516 is invoked to filter the predicted departments, resulting in output department 500a. The mapping network is used to perform a secondary filter on the obtained predicted departments to improve the accuracy of department association information.
[0134] The department association information is used to indicate that there is an association between the organization department 500 and the output department 500a obtained from the relationship building model 510.
[0135] In one example, the mapping network includes, but is not limited to, at least one of: gender-age mapping, general department mapping, and pediatric department mapping.
[0136] The gender and age mapping is used to map based on the gender and age characteristics of the 500 organizational departments. The general department mapping is used to obtain fine-grained department labels. For example, because general departments have a broader treatment scope, fine-grained departments are added to the corresponding standard departments. For instance, if the standard department is "Orthopedics," fine-grained departments such as "Sports Medicine" and "Orthopedic Surgery" are added. The pediatric department mapping is used to add the corresponding pediatric departments to the standard departments when the primary medical institution is a pediatric specialty institution.
[0137] In one example, Table 2 shows the constructed department association information, demonstrating the correspondence between the organizing departments and the output departments. In this embodiment, the doctor's job title or support can also be used as a way to express the organizing department.
[0138] Table 2
[0139] Figure 14A schematic diagram of input text processing provided by an exemplary embodiment of this application is shown.
[0140] For input text 731: "Age 42, Male, Which department should I consult for diabetes?", after predictive processing, the predicted standard departments 732 are: Endocrinology and Diabetes Clinic. Endocrinology is a common department, while Diabetes Clinic is a specialized department, with specialized departments having higher priority than common departments. The organizational departments set up by the primary medical institution include: Endocrinology, Obesity and Metabolic Clinic, Thyroid Clinic, Diabetes Clinic, Geriatric Diabetes Clinic, Gestational Diabetes Clinic, and Diabetic Retinopathy Clinic. Based on departmental association information, the label for the organizational department corresponding to predicted standard department 732 is determined as department label 734, and the department guidance label is updated. Department label 734 includes: Endocrinology and Diabetes Clinic.
[0141] Figure 15 A flowchart illustrating a model training method provided in an exemplary embodiment of this application is shown. This method can be executed by a computer device. The method includes: Step 610: Obtain the sample input text, and the sample character tag group, sample sentence tag, and sample department tag of the sample input text; For example, the sample input text is used to indicate the abnormal physiological state of the sample object, and the sample input text includes at least two input characters. The sample department label is used to indicate the medical department for the treatment of the abnormal physiological state. For example, the sample character label group includes at least two sample character labels, and the character labels in the character label group correspond one-to-one with the input characters in the input text. The sample character labels in the sample character label group are label information with the corresponding sample input characters as the granularity, used to indicate the entity category of the input characters.
[0142] Step 620: Call the label prediction network to perform label prediction processing on the sample input text to obtain the predicted character label group and predicted sentence label of the input text; For example, the predicted character label group includes at least two predicted character labels, which indicate the entity category to which the corresponding at least two input characters belong, and the statement label is used to indicate the overall statement category of the sample input text; Step 630: Obtain the first loss function by identifying the differences between the sample character label group, the sample sentence label, the predicted character label group, and the predicted sentence label; The first loss function is used to indicate the differences between the sample character label group, the sample statement label, the predicted character label group, and the predicted statement label.
[0143] In one alternative implementation, this step can be implemented as: calculating the negative log-likelihood loss function between the sample character label group and the predicted character label group; Calculate the cross-entropy loss function between the sample statement labels and the predicted statement labels; The first loss function is obtained by summing the negative log-likelihood loss function and the cross-entropy loss function.
[0144] The negative log-likelihood loss function and cross-entropy loss function in this embodiment can be referred to above. Figure 6 The loss function shown in the illustrated embodiment will not be described again in this embodiment.
[0145] Step 640: Call the department prediction network to perform department prediction processing on the sample input text to obtain the predicted department label of the input text; For example, the predicted department label is predicted based on the semantic information contained in the sample input text; the department label can be obtained by directly performing department prediction processing on the sample input text, or it can be obtained by indirectly performing department prediction processing on other information generated based on the sample input text.
[0146] Step 650: Obtain the second loss function by analyzing the difference between the sample department labels and the predicted department labels; The second loss function is used to indicate the difference between the sample department label and the predicted department label. The second loss function in this embodiment can be referred to above. Figure 10 The loss function shown in the illustrated embodiment will not be described again in this embodiment.
[0147] Step 660: Based on the first loss function, perform backpropagation training on the label prediction network to obtain the trained label prediction network, and based on the second loss function, perform backpropagation training on the department prediction network to obtain the trained department prediction network.
[0148] For example, by training through backpropagation, the parameters in the label prediction network and the department prediction network are adjusted to reduce the first loss and the second loss.
[0149] In summary, the method provided in this embodiment ensures the accuracy of obtaining department guidance labels from the input text by training the label prediction network and the department prediction network. The label prediction processing and the department prediction processing provide different processing methods for the input text. The two prediction processes improve the prediction accuracy of the department guidance labels, avoid filling in questionnaire templates, and improve the prediction efficiency of department guidance labels.
[0150] Figure 16 A schematic diagram of input text processing provided by an exemplary embodiment of this application is shown.
[0151] The input object enters input text 750, which is a piece of natural language text including gender and age. The query understanding network 760 processes the input text 750, determining its intent category, entity category, and standardized symptoms. Next, direct mapping processing 762 is performed. If the input text 750 matches a real department, standard department, or doctor's label, it undergoes department sorting processing 768 to obtain a department guidance label 750a. If further supplementation is needed for the input text 750, supplementary guidance statements 764 are obtained. Supplementary guidance statements 764 follow up on at least one of the following: missing gender / age, missing location, missing symptom details, or missing gestational / partum time. To further identify the specific department, supplementary guidance statements 764 also follow up on accompanying symptoms of the input object's abnormal physiological state. If direct mapping processing 762 does not reach a confidence threshold, the department prediction network 766 is invoked to classify standard departments, obtaining the corresponding standard departments. Real departments within medical institutions are then sorted using department sorting processing 768 to obtain department guidance labels 750a. Furthermore, doctors are sorted according to their areas of expertise, and real doctor labels are output, providing an entry point for the user to register for an appointment.
[0152] Those skilled in the art will understand that the above embodiments can be implemented independently, or the above embodiments can be freely combined to create new embodiments to implement the input text processing method and / or model training method of this application.
[0153] Figure 17 A block diagram of an input text processing apparatus provided in an exemplary embodiment of this application is shown. The apparatus includes: The acquisition module 810 is used to acquire the input text, which is used to indicate the abnormal physiological state of the input object, and the input text includes at least two input characters; The prediction module 820 is used to perform label prediction processing on the input text to obtain character label groups and sentence labels of the input text. The character label group includes at least two character labels, and the at least two character labels indicate the entity category to which the corresponding at least two input characters belong. The sentence labels are used to indicate the overall sentence category of the input text. The determination module 830 is used to determine the department guidance label and confidence probability of the input object based on at least one of the input characters, at least one of the character labels and the statement label, wherein the department guidance label is used to indicate the medical treatment department for the abnormal physiological state; The prediction module 820 is further configured to update the department guidance label based on the department label of the input text obtained by the department prediction processing of the input text when the confidence probability is lower than the confidence threshold. The department label is predicted based on the semantic information contained in the input text.
[0154] In an optional design of this application, the character tag group and the statement tag are predicted by a tag prediction network, which includes a first encoding subnetwork and a first prediction subnetwork. The prediction module 820 is further configured to: call the first encoding subnetwork of the label prediction network to encode the input text to obtain a character feature representation of the input text, wherein the character feature representation includes the hidden layer feature vectors of at least two input characters in the input text; The first prediction subnetwork of the label prediction network is invoked to perform label prediction processing on the character feature representation to obtain the character label group and sentence label of the input text.
[0155] In an optional design of this application, the label prediction network further includes a second coding subnetwork; the first prediction subnetwork includes a first prediction layer and a second prediction layer; The prediction module 820 is also used for: The second encoding subnetwork of the label prediction network is invoked to encode the input text to obtain the word feature representation of the input text. The word feature representation includes the hidden layer feature vector of the word group composed of the at least two input characters in the input text. The first prediction layer is invoked to perform label prediction processing on the character feature representation to obtain the character label group of the input text; The second prediction layer is invoked to perform label prediction processing on the character feature representation and the phrase feature representation to obtain the sentence label of the input text.
[0156] In an optional design of this application, the determining module 830 is further configured to: Based on the statement tag, an associated character tag that is related to the statement tag is determined in the character tag group, and the associated character tag includes at least one of the character tags; By comparing the similarity between at least one input character corresponding to the associated character label and at least one standard character corresponding to the associated character label, an associated standard character is determined from the at least one standard character; Based on the department mapping relationship corresponding to the associated standard characters, the department guidance label and the confidence probability are determined.
[0157] In an optional design of this application, the determining module 830 is further configured to: Based on the department mapping relationship corresponding to the associated standard characters, determine the information missing type of the input text; Based on the type of missing information, a supplementary guidance statement is determined, and the supplementary guidance statement is displayed to the input object. The supplementary guidance statement is used to guide the supplementation of the physiological abnormality state of the input object.
[0158] In an optional design of this application, the information missing type includes at least one of the following: Missing physiological abnormality sites, missing accompanying physiological abnormality states, missing age information of the input object, missing gender information of the input object, and missing pregnancy and childbirth information of the input object.
[0159] In an optional design of this application, the department label is predicted by a department prediction network, which includes a third encoding subnetwork and a second prediction subnetwork. The prediction module 820 is further configured to: when the confidence probability is lower than the confidence threshold, call the third encoding sub-network of the department prediction network to encode the input text to obtain the semantic feature representation of the input text, wherein the semantic feature representation is a hidden layer feature vector of the semantic information contained in the input text; The second prediction subnetwork of the department prediction network is invoked to perform department prediction processing on the semantic feature representation to obtain the department label of the input text, and the department label is updated using the department label.
[0160] In an optional design of this application, the determining module 830 is further configured to: Obtain the organizational structure information of the first medical institution, wherein the organizational structure information includes at least one department; Construct departmental association information between the organizational departments and the standard departments in the standard library; The department label corresponds to at least one organizational department.
[0161] In an optional design of this application, the prediction module 820 is further configured to: If the confidence probability is lower than the confidence threshold, a department prediction process is performed based on the input text to obtain a predicted standard department, which belongs to the standard library. Based on the department association information, the label of the organization department corresponding to the predicted standard department is determined as the department label, and the department guidance label is updated.
[0162] Figure 18A block diagram of a model training apparatus provided in an exemplary embodiment of this application is shown. The apparatus includes: The acquisition module 840 is used to acquire sample input text, and sample character tag group, sample sentence tag and sample department tag of the sample input text. The sample input text is used to indicate the physiological abnormality of the sample object. The sample input text includes at least two input characters. The sample department tag is used to indicate the medical treatment department of the physiological abnormality. The prediction module 850 is used to call the label prediction network to perform label prediction processing on the sample input text to obtain the predicted character label group and predicted sentence label of the input text. The predicted character label group includes at least two predicted character labels, and the at least two predicted character labels indicate the entity category to which the corresponding at least two input characters belong. The sentence label is used to indicate the overall sentence category of the sample input text. The calculation module 860 is used to obtain a first loss function by the difference between the sample character label group, the sample sentence label, the predicted character label group and the predicted sentence label; The prediction module 850 is also used to call the department prediction network to perform department prediction processing on the sample input text to obtain the predicted department label of the input text; The calculation module 860 is also used to obtain a second loss function by the difference between the sample department label and the predicted department label; The training module 870 is used to perform backpropagation training on the label prediction network based on the first loss function to obtain the trained label prediction network, and to perform backpropagation training on the department prediction network based on the second loss function to obtain the trained department prediction network.
[0163] In an optional design of this application, the computing module 860 is further configured to: Calculate the negative log-likelihood loss function between the sample character label group and the predicted character label group; Calculate the cross-entropy loss function between the sample statement label and the predicted statement label; The first loss function is obtained by summing the negative log-likelihood loss function and the cross-entropy loss function.
[0164] It should be noted that the device provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0165] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments of the relevant method; the technical effects achieved by each module performing its operation are the same as the technical effects in the embodiments of the relevant method, and will not be elaborated here.
[0166] This application also provides a computer device, which includes: a processor and a memory, wherein the memory stores a computer program; the processor is used to execute the computer program in the memory to implement the input text processing method and / or model training method provided in the above method embodiments.
[0167] Alternatively, the computer device is a server. For example, Figure 19 This is a structural block diagram of a server provided in an exemplary embodiment of this application. Typically, the server 2300 includes a processor 2301 and a memory 2302.
[0168] Processor 2301 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 2301 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Processor 2301 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 2301 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 2301 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0169] The memory 2302 may include one or more computer-readable storage media, which may be non-transitory. The memory 2302 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 2302 is used to store at least one instruction, which is executed by the processor 2301 to implement the input text processing method and / or model training method provided in the method embodiments of this application.
[0170] In some embodiments, the server 2300 may optionally include an input interface 2303 and an output interface 2304. The processor 2301, memory 2302, and input interfaces 2303 and 2304 can be connected via a bus or signal lines. Various peripheral devices can be connected to the input interfaces 2303 and 2304 via a bus, signal lines, or a circuit board. The input interfaces 2303 and 2304 can be used to connect at least one input / output (I / O) related peripheral device to the processor 2301 and memory 2302. In some embodiments, the processor 2301, memory 2302, and input interfaces 2303 and 2304 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 2301, memory 2302, and input interfaces 2303 and 2304 can be implemented on separate chips or circuit boards, and this application does not limit this.
[0171] Those skilled in the art will understand that the structure shown above does not constitute a limitation on server 2300, and may include more or fewer components than shown, or combine certain components, or employ different component arrangements.
[0172] In an exemplary embodiment, a chip is also provided, the chip including programmable logic circuitry and / or program instructions, which, when the chip is run on a computer device, are used to implement the input text processing method and / or model training method described above.
[0173] In an exemplary embodiment, a computer program product is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to implement the input text processing method and / or model training method provided in the above-described method embodiments.
[0174] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores a computer program that is loaded and executed by a processor to implement the input text processing method and / or model training method provided in the above-described method embodiments.
[0175] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0176] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0177] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. An input text processing method, characterized by, The method includes: The input text is obtained, which is used to indicate the abnormal physiological state of the input object, and the input text includes at least two input characters; The input text is subjected to label prediction processing to obtain character label groups and statement labels of the input text. The character label group includes at least two character labels, which indicate the entity category to which the corresponding at least two input characters belong. The statement labels are used to indicate the overall statement category of the input text. Based on the statement tag, an associated character tag that is related to the statement tag is determined in the character tag group, and the associated character tag includes at least one of the character tags; By comparing the similarity between at least one input character corresponding to the associated character label and at least one standard character corresponding to the associated character label, an associated standard character is determined from the at least one standard character; Based on the department mapping relationship corresponding to the associated standard characters, the department guidance label and confidence probability are determined; the department guidance label is used to indicate the medical treatment department for the abnormal physiological state; When the confidence probability is lower than the confidence threshold, a predicted standard department is obtained by performing department prediction processing based on the input text. The predicted standard department belongs to the standard library. Based on the department association information, the label of the organization department corresponding to the predicted standard department is determined as the department label of the input text, and the department guidance label is updated. The department association information refers to the relationship between the organization's departments and the standard departments in the standard library.
2. The method of claim 1, wherein, The character tag group and the statement tag are predicted by a tag prediction network, which includes a first encoding subnetwork and a first prediction subnetwork. The step of performing label prediction processing on the input text to obtain character label groups and sentence labels for the input text includes: The first encoding subnetwork of the label prediction network is invoked to encode the input text to obtain the character feature representation of the input text, wherein the character feature representation includes the hidden layer feature vectors of at least two input characters in the input text; The first prediction subnetwork of the label prediction network is invoked to perform label prediction processing on the character feature representation to obtain the character label group and sentence label of the input text.
3. The method of claim 2, wherein, The label prediction network further includes a second encoding sub-network; the first prediction sub-network includes a first prediction layer and a second prediction layer. The method further includes: The second encoding subnetwork of the label prediction network is invoked to encode the input text to obtain the word feature representation of the input text. The word feature representation includes the hidden layer feature vector of the word group composed of the at least two input characters in the input text. The first prediction subnetwork of the label prediction network is invoked to perform label prediction processing on the character feature representation to obtain the character label groups and sentence labels of the input text, including: The first prediction layer is invoked to perform label prediction processing on the character feature representation to obtain the character label group of the input text; The second prediction layer is invoked to perform label prediction processing on the character feature representation and the phrase feature representation to obtain the sentence label of the input text.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Based on the department mapping relationship corresponding to the associated standard characters, determine the information missing type of the input text; Based on the type of missing information, a supplementary guidance statement is determined, and the supplementary guidance statement is displayed to the input object. The supplementary guidance statement is used to guide the supplementation of the physiological abnormality state of the input object.
5. The method according to any one of claims 1 to 3, characterized in that, The department label is predicted by a department prediction network, which includes a third coding subnetwork and a second prediction subnetwork. When the confidence probability is lower than the confidence threshold, the third encoding subnetwork of the department prediction network is invoked to encode the input text to obtain the semantic feature representation of the input text. The semantic feature representation is the hidden layer feature vector of the semantic information contained in the input text. The second prediction subnetwork of the department prediction network is invoked to perform department prediction processing on the semantic feature representation to obtain the department label of the input text, and the department label is updated using the department label.
6. A model training method, comprising: The method includes: Obtain sample input text and sample character tag groups, sample sentence tags, and sample department tags of the sample input text. The sample input text is used to indicate the abnormal physiological state of the sample object. The sample input text includes at least two input characters. The sample department tags are used to indicate the medical treatment department for the abnormal physiological state. The label prediction network is invoked to perform label prediction processing on the sample input text to obtain the predicted character label group and predicted sentence label of the sample input text. The predicted character label group includes at least two predicted character labels, and the at least two predicted character labels indicate the entity category to which the corresponding at least two input characters belong. The sentence label is used to indicate the overall sentence category of the sample input text. The first loss function is obtained by distinguishing between the sample character label group, the sample sentence label, the predicted character label group, and the predicted sentence label; The department prediction network is invoked to perform department prediction processing on the sample input text to obtain the predicted standard department of the input text, which belongs to the standard library; based on the department association information, the label of the organization department corresponding to the predicted standard department is determined as the predicted department label; The second loss function is obtained by comparing the sample department labels with the predicted department labels; Based on the first loss function, the label prediction network is trained by backpropagation to obtain the trained label prediction network; and based on the second loss function, the department prediction network is trained by backpropagation to obtain the trained department prediction network. The department association information refers to the relationship between the organization's departments and the standard departments in the standard library.
7. The method of claim 6, wherein, The step of obtaining the first loss function by identifying the differences between the sample character label group, the sample sentence label, the predicted character label group, and the predicted sentence label includes: Calculate the negative log-likelihood loss function between the sample character label group and the predicted character label group; Calculate the cross-entropy loss function between the sample statement label and the predicted statement label; The first loss function is obtained by summing the negative log-likelihood loss function and the cross-entropy loss function.
8. An input text processing apparatus characterized by comprising: The device includes: The acquisition module is used to acquire the input text, which is used to indicate the abnormal physiological state of the input object, and the input text includes at least two input characters; The prediction module is used to perform label prediction processing on the input text to obtain character label groups and sentence labels of the input text. The character label group includes at least two character labels, and the at least two character labels indicate the entity category to which the corresponding at least two input characters belong. The sentence labels are used to indicate the overall sentence category of the input text. A determining module is configured to determine, based on the statement tag, an associated character tag in the character tag group that is associated with the statement tag, wherein the associated character tag includes at least one of the character tags; By comparing the similarity between at least one input character corresponding to the associated character label and at least one standard character corresponding to the associated character label, an associated standard character is determined from the at least one standard character; Based on the department mapping relationship corresponding to the associated standard characters, the department guidance label and confidence probability are determined; the department guidance label is used to indicate the medical treatment department for the abnormal physiological state; The prediction module is further configured to, when the confidence probability is lower than the confidence threshold, perform department prediction processing based on the input text to obtain a predicted standard department, wherein the predicted standard department belongs to the standard library; and, based on the department association information, determine the label of the organization department corresponding to the predicted standard department as the department label of the input text, and update the department guidance label; The department association information refers to the relationship between the organization's departments and the standard departments in the standard library.
9. A model training apparatus, comprising: The device includes: The acquisition module is used to acquire sample input text and sample character tag groups, sample sentence tags and sample department tags of the sample input text. The sample input text is used to indicate the physiological abnormality of the sample object. The sample input text includes at least two input characters. The sample department tags are used to indicate the medical treatment department of the physiological abnormality. The prediction module is used to call the label prediction network to perform label prediction processing on the sample input text to obtain the predicted character label group and predicted sentence label of the sample input text. The predicted character label group includes at least two predicted character labels, and the at least two predicted character labels indicate the entity category to which the corresponding at least two input characters belong. The sentence label is used to indicate the overall sentence category of the sample input text. The calculation module is used to obtain a first loss function by the difference between the sample character label group, the sample sentence label, the predicted character label group, and the predicted sentence label; The prediction module is also used to call the department prediction network to perform department prediction processing on the sample input text to obtain the prediction standard department of the input text, wherein the prediction standard department belongs to the standard library; based on the department association information, the label of the organization department corresponding to the prediction standard department is determined as the prediction department label; The calculation module is also used to obtain a second loss function based on the difference between the sample department label and the predicted department label; The training module is used to perform backpropagation training on the label prediction network based on the first loss function to obtain the trained label prediction network, and to perform backpropagation training on the department prediction network based on the second loss function to obtain the trained department prediction network. The department association information refers to the relationship between the organization's departments and the standard departments in the standard library.
10. A computer device, comprising: The computer device includes: a processor and a memory, wherein the memory stores at least one program; the processor is configured to execute the at least one program in the memory to implement the input text processing method as described in any one of claims 1 to 5, and / or the model training method as described in claim 6 or 7.
11. A computer readable storage medium, characterized in that, The readable storage medium stores executable instructions, which are loaded and executed by a processor to implement the input text processing method as described in any one of claims 1 to 5, and / or the model training method as described in claim 6 or 7.
12. A computer program product, characterised in that, The computer program product includes computer instructions stored in a computer-readable storage medium, which a processor reads from and executes to implement the input text processing method as described in any one of claims 1 to 5, and / or the model training method as described in claim 6 or 7.
Citation Information
Patent Citations
Method, device and equipment for pushing department information and storage medium
CN113282761A
Intelligent hospital guide processing method and device, electronic equipment and storage medium
CN113488157A
Triage method and apparatus, and computer readable storage medium
WO2022206599A1
