Intelligent maternal and infant knowledge service method
By constructing information extraction models and knowledge graphs, the problems of systematic and humanized presentation of maternal and infant data have been solved, improving the question-and-answer efficiency and information integration effect of the maternal and infant consultation system.
Patent Information
- Application Number
- CN202511755777.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-03-20
AI Technical Summary
Maternal and infant health data is scattered across the internet and lacks a systematic and user-friendly presentation, making it difficult to utilize effectively.
By constructing an information extraction model and a knowledge graph, using the Word2Vec tool to generate a word embedding matrix, building a self-attention mechanism model, performing entity disambiguation and integrating entity knowledge, a maternal and infant consultation system based on a knowledge graph is realized.
It improves the question-and-answer efficiency of the maternal and infant consultation system, ensures the accuracy of model predictions and reduces complexity, and achieves efficient and rational integration of information.
Smart Images

Figure CN121706768A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of maternal and infant health care, and particularly relates to an intelligent maternal and infant knowledge service method. BACKGROUND
[0002] With the rapid development of the Internet, computer technology has facilitated people's life in various industries. The medical field is no exception. There are a large amount of maternal and infant professional data hidden on the network. These information is like gold scattered in the sand for solving maternal and infant health care problems. Although it is very useful, it is not systematic, complete, lacks flexible and intelligent organization and humanized presentation, and finally cannot play a good role. SUMMARY
[0003] The present application aims to provide an intelligent maternal and infant knowledge service method to solve the technical problems proposed in the background art.
[0004] To achieve the above-mentioned purpose, the specific technical scheme of the present application is as follows: an intelligent maternal and infant knowledge service method, comprising the following steps:
[0005] S1, data set preprocessing, data set collection includes structured and unstructured;
[0006] S2, constructing a word embedding model, first counting the word frequency, selecting the top 10000 words with the highest frequency to join the dictionary, generating a word embedding matrix through the Word2Vec tool, and encoding the words;
[0007] S3, building an information extraction model, summarizing the keywords and structure into various templates, and marking such data, first dividing the input sentence according to the punctuation marks, matching the keywords for the marked data, further segmenting the sentence according to the matched keywords, then introducing the trained word vector, and the model also introduces a self-attention mechanism;
[0008] S4, model training, a total of 100 pieces of text data are obtained, the text data are processed according to the rules, and the maximum sequence length is set to 20, then 18692 sequence samples are generated, 10000 samples are randomly selected for processing, and the 10000 pieces of data are divided into a training set and a test set according to a ratio of 4:1;
[0009] S5, building a knowledge graph, performing entity disambiguation on the recognized entities, and fusing entity knowledge to obtain two types of triplets, which are saved as a json file, and a knowledge graph can be built according to the extracted information through neo4j;
[0010] S6, acquire the natural question sentence sent by the user, and perform question sentence preprocessing on the natural question sentence, find the corresponding information in the knowledge graph according to the query request;
[0011] S7, feed back the corresponding result found to the user.
[0012] Preferably, the structured data set in step S1 is obtained through the network, and part of the unstructured data set is provided by the laboratory and the other part is obtained by crawling the network.
[0013] Preferably, the model training step in step S4 is as follows:
[0014] 1), initialize the network model, create the network structure, and initialize the network layer parameters;
[0015] 2), read each type of labeled data for training;
[0016] 3), perform gradient calculation, back propagation, and update the network parameters through the optimizer;
[0017] 4), save the latest network parameters and generate a model structure file;
[0018] 5), repeat steps 1) to 4) until the loss function value tends to be stable or reaches a predetermined number of training times;
[0019] 6), output the training result, including the validation set accuracy, the number of iterations, and the loss function value.
[0020] Preferably, in the model training process, Adam is selected as the optimizer, and the initial learning rate is set to 0.001.
[0021] Preferably, the specific use steps of entity resolution in step S5 are as follows:
[0022] 1), data preprocessing, read the recognized entity into an excel file;
[0023] 2), read the pre-trained word vector through dedupe;
[0024] 3), set the dedupe comparison degree threshold to 0.8, that is, after calculation, the entities with a similarity of 0.8 or more are considered as the same entity;
[0025] 4), overall clustering.
[0026] Preferably, the two types of triplets in step S5 are entity, entity relationship, entity, and entity, attribute, and entity.
[0027] Preferably, the question preprocessing in the step S6 first divides the natural question into long and short sentences according to punctuation or space, and matches Chinese characters by setting a Unicode Chinese encoding segment and matches English characters by setting an English encoding segment, so as to filter non-Chinese and English symbols.
[0028] Preferably, the question preprocessing in the step S6 analyzes the natural question, including a question word segmentation module and a question classification module.
[0029] The intelligent mother and baby knowledge service method has the following advantages:
[0030] 1. The information extraction model designed in the present application can fully utilize context information, reduce model complexity while ensuring prediction accuracy, and integrate similar information through knowledge fusion to ensure the rationality and efficiency of the data structure in the knowledge graph, thereby improving the question and answer efficiency of the entire consultation system.
[0031] 2. The present application realizes a mother and baby knowledge consultation system based on a knowledge graph, realizes a rule-based question analysis module, inputs the analyzed information into the knowledge graph for query matching, and feeds back the generated answer to the user after packaging. BRIEF DESCRIPTION OF DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation to the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0033] Figure 1 A flow chart for building a knowledge graph in the present application;
[0034] Figure 2 A question and answer framework based on a knowledge graph in the present application;
[0035] Figure 3 A question analysis flow chart in the present application;
[0036] Figure 4 A keyword extraction flow chart in the present application;
[0037] Figure 5 A structure diagram of question classification in the present application. DETAILED DESCRIPTION
[0038] In the following, only certain exemplary embodiments are simply described. As those skilled in the art can recognize, the described embodiments can be modified in various different ways without departing from the spirit or scope of the embodiments of the present application. Therefore, the drawings and the description are considered to be exemplary in nature rather than limiting.
[0039] In the description of the embodiments of the present application, it needs to be understood that the terms "length", "vertical", "horizontal", "top", "bottom" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, which are only for the purpose of facilitating the description of the embodiments of the present application and simplifying the description, and do not indicate or imply that the indicated device or element must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0040] In addition, the terms "first", "second" are only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise explicitly specified and limited.
[0041] In the embodiments of the present application, unless otherwise explicitly specified and limited, the terms "mounting", "connecting", "connecting", "fixing" and the like should be understood in a broad sense, for example, it can be fixedly connected, or it can be detachably connected, or it can be integrated; it can be mechanically connected, or it can be electrically connected, or it can be communicated; it can be directly connected, or it can be indirectly connected through an intermediate medium; it can be the communication or interaction relationship between two elements. For those skilled in the art, the specific meaning of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0042] The following disclosure provides many different embodiments or examples for implementing different structures of the embodiments of the present application. In order to simplify the disclosure of the embodiments of the present application, the components and arrangements of specific examples are described in the following. Of course, they are only examples, and the purpose is not to limit the embodiments of the present application. In addition, the embodiments of the present application can refer to the same reference numerals and / or reference letters in different examples, and such repetition is for the purpose of simplification and clarity, and does not indicate the relationship between the various embodiments and / or arrangements discussed.
[0043] In order to better understand the purpose, structure and function of the present application, the following will further describe an intelligent mother and baby knowledge service method of the present application in combination with the drawings.
[0044] As Figures 1-5 shown, an intelligent mother and baby knowledge service method of the present application comprises the following steps:
[0045] S1, data set preprocessing, the collection of data set includes structured and unstructured;
[0046] S2, construct a word embedding model, first count the word frequency, select the top 10000 words with the highest frequency to join the dictionary, generate a word embedding matrix through the Word2Vec tool, and encode the words;
[0047] S3, build an information extraction model, summarize the keywords and structure into various templates, and mark such data. The input sentence is first divided according to the punctuation marks. The marked data is matched with the keywords, and the sentence is further segmented according to the matched keywords. The trained word vector is introduced, and the model also introduces a self-attention mechanism. Since the length of the segmented sentence is different, the number of neural units in the BiLSTM layer is limited, and the amount of information contained in different sentences is different. The introduction of the attention mechanism helps the network to identify important information and use information about words that are farther apart, improving the recognition accuracy.
[0048] S4, model training, a total of 100 pieces of text data are obtained, the text data are processed according to the rules, and the maximum sequence length is set to 20. Then 18692 sequence samples are generated, and 10000 samples are randomly selected for processing. The 10000 data are divided into training set and test set according to the ratio of 4:1.
[0049] S5, build a knowledge graph, disambiguate the recognized entities, and integrate entity knowledge to obtain two types of triplets, which are saved as json files. The knowledge graph can be built according to the extracted information through neo4j.
[0050] S6, obtain the natural question sent by the user, and preprocess the natural question. The query request is searched in the knowledge graph to find the corresponding information.
[0051] S7, feed back the corresponding result found to the user.
[0052] The structured data set in step S1 is obtained through the network, and the unstructured data set is partly provided by the laboratory and partly obtained by network crawling.
[0053] The model training step in step S4 is as follows:
[0054] 6) Initialize the network model, create the network structure, and initialize the parameters of each layer of the network;
[0055] 7) Read the annotated data of each type for training;
[0056] 8) Gradient calculation, back propagation, update network parameters through optimizer;
[0057] 9) Save the latest network parameters and generate model structure file;
[0058] 10) Repeat steps 1-4 until the loss function value tends to be stable or reaches the predetermined number of training times;
[0059] 6) Output the training results, including the accuracy of the validation set, the number of iterations, and the loss function value.
[0060] During the model training process, Adam is selected as the optimizer, and the initial learning rate is set to 0.001.
[0061] The specific use steps of entity disambiguation in step S5 are as follows:
[0062] 4) Data preprocessing, read the recognized entities into an excel file;
[0063] 5) Read the pre-trained word vector through dedupe;
[0064] 6) Set the dedupe comparison degree threshold to 0.8, that is, after calculation, entities with a similarity of 0.8 or more are considered the same entity;
[0065] 4) Overall clustering.
[0066] The two types of triplets in step S5 are entity, entity relationship, entity, and entity, attribute, entity.
[0067] In step S6, the natural question is first divided into long and short sentences according to punctuation or space, and Chinese characters are matched through setting Unicode Chinese encoding segments, and English characters are matched through setting English encoding segments, to filter non-Chinese and English symbols.
[0068] In step S6, the natural question is parsed, including a question segmentation module and a question classification module. All possible entities involved in the question are found through question segmentation, and the entity relationship of the natural question mapped to the knowledge graph is found through question classification.
[0069] jieba supports loading a custom lexicon, which can be added to the lexicon by some manual means to improve the accuracy of the model in recognizing obscure words, while jieba supports four kinds of segmentation mode, creating a prefix dictionary tree, scanning each word in the sentence through the prefix dictionary tree, initializing all possible cases of characters in the sentence, generating a directed acyclic graph, finding the maximum probability path based on the dynamic programming method, dividing the sentence according to the word frequency in the sample, and introducing the paddle framework to speed up the segmentation speed, while supporting the keyword extraction function, which is convenient for subsequent filtering entities.
[0070] The keyword extraction process is as shown in Figure 4 First, the part-of-speech of the segmented word based on jieba is labeled, and a part-of-speech blacklist is set to filter the part-of-speech in the blacklist. Secondly, the TF-IDF value of the filtered word is calculated to identify the keyword, the TF value represents the frequency of the word appearing in this document, the DF value represents the frequency of the word appearing in the library, and the IDF is the inverse of the value, called inverse document frequency. The TF*IDF gets the TF-IDF value, which means that the word appears frequently in this document but rarely in other documents, so the word has good class distinction ability, and the word is considered as a keyword. The invention uses the words contained in the built-in corpus of jieba as the library, and adds the recognized keywords to the library for DF value calculation, and extracts the top 3 words as keywords.
[0071] Another key module in question analysis is question classification, which defines feature words, feature word paths, dictionaries, question interrogative words, question relationship words and other member variables in the question classification module. The feature words not only include entity words in the maternal and infant field, but also include negative words. When extracting the entity relationship in the question, the relevant characters filtered by segmentation are matched with the question interrogative words, negative words and feature words, and the matched words will enter the query statement conversion module. This process takes about 10s in the test. For a real-time question and answer consulting system, this time delay is unacceptable, so the invention introduces an AC automaton to speed up this process.
[0072] The KPM pattern matching algorithm and the dictionary tree are the key to realize the AC automatic machine. The KPM algorithm is a single pattern matching algorithm based on dynamic programming. The AC automatic machine is a multi-pattern string matching algorithm based on KPM. The following steps are needed to create the AC automatic machine: (1) define a prefix dictionary tree as the data structure of the search of the AC automatic machine; (2) define a tail pointer. If a character does not match, the AC automatic machine can automatically jump to the character of the longest common prefix and suffix to continue matching. This is consistent with the KMP algorithm. When a character does not match, the AC automatic machine also needs a tail pointer to jump. The tail pointer needs to point to the longest suffix before the failure of the pattern string matching. The number of matching characters after the jump is certainly less than the number of characters before the failure of the matching. Therefore, the breadth-first search can be used to locate the tail pointer on the dictionary tree; (3) scan the main string to match, and finally obtain the entity or the entity relationship.
[0073] It can be understood that the present application is described by some embodiments, and those skilled in the art know that various changes or equivalent replacements can be made to these features and embodiments without departing from the spirit and scope of the present application. In addition, under the guidance of the present application, these features and embodiments can be modified to adapt to specific conditions and materials without departing from the spirit and scope of the present application. Therefore, the present application is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of the present application are within the scope of the present application.
Claims
1. A method for providing intelligent maternal and infant knowledge services, characterized in that: Includes the following steps: S1. Dataset preprocessing: Dataset collection includes both structured and unstructured datasets. S2. Construct a word embedding model. First, count the word frequencies, select the top 10,000 most frequent words and add them to the dictionary. Then, use the Word2Vec tool to generate a word embedding matrix and encode the words. S3. Build an information extraction model, summarize keywords and structures into various templates, and label this type of data. First, divide the input sentence according to punctuation marks. Then, perform keyword matching on the labeled data, further segment the sentence based on the matched keywords, and then introduce the trained word vectors. At the same time, the model also introduces a self-attention mechanism. S4. Model training: A total of 100 text data were obtained. After processing the text data according to rules and setting the maximum sequence length to 20, 18,692 sequence samples were generated. 10,000 of these samples were randomly selected for processing. The 10,000 data were divided into training set and test set in a 4:1 ratio. S5. Build a knowledge graph, disambiguate the identified entities, and merge entity knowledge to obtain two types of triples. Save them as JSON files, and then use Neo4j to build the knowledge graph based on the extracted information. S6. Obtain the natural language questions sent by the user, perform question preprocessing on the natural language questions, and search for corresponding information in the knowledge graph for the query request; S7. Return the corresponding search results to the user.
2. The intelligent maternal and infant knowledge service method according to claim 1, characterized in that: In step S1, the structured dataset is obtained through the network, while the unstructured dataset is partly provided by the laboratory and partly obtained through web crawling.
3. The intelligent maternal and infant knowledge service method according to claim 1, characterized in that: The model training steps in step S4 are as follows: 1) Initialize the network model, create the network structure, and initialize the parameters of each layer of the network; 2) Read labeled data of various types for training; 3) Perform gradient calculation, backpropagation, and update network parameters through the optimizer; 4) Save the latest network parameters and generate the model structure file; 5) Repeat training steps 1)-4) until the loss function value tends to stabilize or the predetermined number of training iterations is reached; 6) Output the training results, including validation set accuracy, number of iterations, and loss function value.
4. The intelligent maternal and infant knowledge service method according to claim 3, characterized in that: During the model training process, Adam was selected as the optimizer, and the initial learning rate was set to 0.
001.
5. The intelligent maternal and infant knowledge service method according to claim 1, characterized in that: The specific steps for entity disambiguation in step S5 are as follows: 1) Perform data preprocessing, reading the identified entities into an Excel file; 2) Read the pre-trained word vectors using dededupe; 3) Set the DedePUE comparison threshold to 0.8, meaning that after calculation, entities with a similarity of 0.8 or higher are considered the same entity; 4) Perform overall clustering.
6. The intelligent maternal and infant knowledge service method according to claim 1, characterized in that: The two types of triples in step S5 are entity, entity relation, entity, and entity, attribute, entity.
7. The intelligent maternal and infant knowledge service method according to claim 1, characterized in that: In step S6, the question preprocessing first divides the natural question into sentences of varying lengths according to punctuation or spaces, and then uses Unicode Chinese encoding segments to match Chinese characters and English encoding segments to match English characters, thereby filtering out non-Chinese and non-English symbols.
8. The intelligent maternal and infant knowledge service method according to claim 1, characterized in that: In step S6, the question preprocessing will parse natural questions, including a question segmentation module and a question classification module.