A digital human system for pregnant and lying-in women accompanied by an anthropomorphic large model and its accompanying method
By constructing anthropomorphic large-scale model of maternal companion digital human system, the defects of the existing technology in maternal management consultation and emotional comfort are solved, and multifunctional maternal health services and data analysis are realized, which improves the medical experience and anxiety relief of pregnant women.
Patent Information
- Application Number
- CN202411732371.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2044-11-29
AI Technical Summary
The existing health and medical model lacks personalized service capabilities in handling management consultation and emotional comfort of pregnant women, and cannot provide emotional care and detailed guidance for pregnant women in multiple environments and situations.
The anthropomorphic large model of maternal companion digital human system is adopted. Through data collection, processing, training and optimization modules, a maternal companion anthropomorphic model is constructed, including the data collection module for desensitization, deduplication and usability assessment, the data processing module for relationship extraction and entity recognition, the training module uses CHATGLM intelligent model and performs LORA fine-tuning, and the optimization module uses reinforcement learning and prompt word templates of human feedback for optimization.
It has realized multi-modal questions, maternal health service assistant, data collection and analysis platform, and has real-time Q&A, pregnancy health advice, health knowledge popularization and health data visual management functions, alleviating pregnant women's anxiety and improving the medical experience of pregnant women.
Smart Images

Figure CN119227724B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of health care and artificial intelligence, and in particular to an anthropomorphic large model maternal companion digital human system and its companion method. Background Art
[0002] Digital human technology is a virtual image technology based on artificial intelligence technology, which can simulate the appearance, voice and behavior of humans. Its technology is based on powerful computer graphics rendering and motion capture technology, and comprehensively uses big data technology and artificial intelligence technology to achieve anthropomorphic interaction with real humans.
[0003] On the one hand, with the help of machine learning algorithms and deep learning technology, AI can efficiently process and analyze massive amounts of data, extract the characteristics and laws of human behavior, enable the digital human to simulate the human thinking process, and make corresponding decisions and behaviors. At the same time, the integration of AI technologies such as speech recognition, natural language processing and computer vision endows the digital human with more natural and fluent interaction capabilities, enabling it to have in-depth conversations with users and understand complex instructions.
[0004] On the other hand, with the rapid development of big data technology, artificial intelligence technology and the continuous improvement of data infrastructure, in the field of health care, digital humans can deeply mine and analyze diversified data such as user health and behavior, and then realize a series of functions such as providing problem answers, health service assistants, data processing and analysis for service objects, meeting the high-capability requirements of users for personalized services of digital humans.
[0005] Currently, with the rapid development of artificial intelligence technology and the great improvement of computing power, various health care Q&A systems are emerging in an endless stream, and the service scope almost covers all aspects of the entire medical treatment process from pre-consultation, patient triage to drug indication instructions. However, existing various technical systems, whether it is a pure Q&A large model or an existing digital human, have certain defects in dealing with the management consultation and emotional comfort guarantee of pregnant women.
[0006] Currently, the mainstream health care large models in the market include iFlytek's iFlytek Spark Medical Large Model, Baidu's Lingyi Large Model, Tencent's Hunyuan Medical Large Model, SenseTime's Big Medical Model, etc. These large models generally appear in the form of a Q&A box or a web system, and their main tasks are to complete the generation of structured medical records, the auxiliary diagnosis of various images and medical test reports, the health management consultation services for healthy and sub-healthy people, and the digital and intelligent management services of hospitals. These large models can all handle non-emotional business interaction services and simple Q&A consultation services well, but basically do not have the function of maternal emotional care and detailed guidance in multiple environments and situations.
[0007] In terms of digital humans, the relatively successful one at present is the "Anzhen'er", a digital health human jointly developed by the Zhejiang Provincial Health Commission and Ant Group. It has simple voice dialogue functions and can provide process functions such as intelligent medical guidance, online appointment, queuing call, report query, and medical insurance payment. However, it cannot realize the functions required by pregnant and lying-in women such as pregnancy and childbirth care, answering questions, and does not have the personalized service ability for pregnant and lying-in women.
[0008] To sum up, there is currently no digital human that combines multiple functions such as advice, service, education, and management specifically for pregnant and lying-in women. Although the technical bases of existing digital human-related products are the same, they lack personalized training for the conditions and environments of pregnant and lying-in women.
[0009] To address the above technical problems, the present invention proposes an anthropomorphic model pregnant and lying-in women companion digital human system and its companion method. Summary of the Invention
[0010] The purpose of the present invention is to provide an anthropomorphic model pregnant and lying-in women companion digital human system and its companion method in view of the deficiencies of the existing technology.
[0011] To achieve the above objectives, the present invention adopts the following technical solutions:
[0012] An anthropomorphic model pregnant and lying-in women companion digital human system, comprising:
[0013] A data collection module, configured to obtain data information corresponding to the companionship of pregnant and lying-in women, and perform desensitization, duplicate removal, and usability evaluation processing on the obtained data information to obtain processed text data;
[0014] A data processing module, configured to perform relationship extraction, entity recognition, and text classification processing on the processed text data to obtain structured processed text data;
[0015] A training module, configured to input the structured processed text data into the CHATGLM intelligent model and perform fine-tuning training using the LORA method to obtain a fine-tuned CHATGLM intelligent model;
[0016] An optimization module, configured to optimize the fine-tuned CHATGLM intelligent model using human feedback-based reinforcement learning and prompt templates to obtain an anthropomorphic model for pregnant and lying-in women companionship.
[0017] Further, the data collection module includes:
[0018] A text processing module, configured to obtain the text data in the data information;
[0019] A desensitization processing module, configured to delete the sensitive data in the text data to obtain desensitized text data;
[0020] An availability evaluation module for evaluating the availability of keywords corresponding to the desensitized text data based on the bag-of-words model;
[0021] A duplicate removal processing module for checking for duplicates among the evaluated keywords, deleting the duplicate keywords, and obtaining the text data after duplicate removal.
[0022] Further, the evaluation of the availability of the desensitized keywords in the availability evaluation module is specifically as follows: determining whether the keywords corresponding to the text block are normal, and excluding the text blocks where the keyword anomalies exceed the preset threshold range, expressed as:
[0023] ;
[0024] where, K represents the keyword anomaly value of each piece of data; W represents the number of keywords; w represents the keyword serial number; Un w represents the cosine distance of the w-th keyword in the n-th data; T represents the preset threshold range; represents the number of keywords not within the preset threshold range.
[0025] Further, the duplicate removal processing module checks for duplicates among the evaluated keywords and deletes the duplicate keywords, expressed as:
[0026] ;
[0027] where, Un represents the n-th data; Un w =Un - 1 w means that the n-th data is exactly the same as the (n - 1)-th data, then the n-th data is deleted.
[0028] Further, the data processing module specifically includes:
[0029] A relationship extraction module for using an extraction model to extract relationships from the text data and complete the task of data relationship extraction;
[0030] An entity recognition module for using a vector model to identify the semantic information of the text data after completing the data relationship extraction;
[0031] A text classification module for storing the recognized text data into a relational database, a graph database, and a vector database respectively according to the text category and data format.
[0032] Further, the CHATGLM intelligent model in the training module is the ChatGLM3 - 7B intelligent model.
[0033] Further, the optimization of the fine-tuned CHATGLM intelligent model by reinforcement learning based on human feedback in the optimization module is specifically as follows:
[0034] Optimize the decision-making process of the fine-tuned CHATGLM intelligent model through reinforcement learning from human feedback (RLHF) so that the fine-tuned CHATGLM intelligent model can self-iteratively learn according to the feedback.
[0035] Furthermore, the specific optimization process of the fine-tuned CHATGLM intelligent model based on the prompt template in the optimization module is as follows: Set a reply template for the fine-tuned CHATGLM intelligent model through preset rules and constraints.
[0036] Furthermore, it also includes a generation module, which is used to generate pregnant women portraits and visual management of maternal health data after obtaining the structured processed text data.
[0037] Correspondingly, a companion method for the anthropomorphic large model maternal companion digital human system is also provided, which is used to be realized through an anthropomorphic large model maternal companion digital human system. The companion method includes:
[0038] S1. The maternal companion anthropomorphic model obtains the questions proposed by the user and performs text parsing on the obtained questions to obtain keywords corresponding to the text.
[0039] S2. The maternal companion anthropomorphic model determines whether the obtained keywords are compliant. If not, it reminds the user and ends the conversation without recording relevant information. If so, it determines whether there is relevant knowledge corresponding to the keyword retrieval keyword in the keyword retrieval database. If so, it executes step S3;
[0040] S3. The maternal companion anthropomorphic model forms specific answer content according to the prompt template.
[0041] S4. The maternal companion anthropomorphic model recommends relevant popular science content according to the answer content and records the conversation text.
[0042] Compared with the prior art, after completing the construction of the base layer, the medical middle platform model, and the maternal companion anthropomorphic large model, the present invention has four major capability modules: a multimodal question-solving system, a maternal health service assistant, a data collection and analysis platform, and a user data cockpit. Through the four major capability modules, six major functions of real-time answering for pregnant women, pregnancy health advice, pregnancy health knowledge popularization, cross-departmental joint processing of maternal medical data, generation of maternal health portraits, and visual management of maternal health data are realized. The specific effects are summarized as follows:
[0043] 1. The present invention realizes the comprehensive processing and analysis of maternal data by constructing a three - level large - model joint disposal system of base - middle platform - front - end, and enables the system to have the ability to conduct real - time multi - round and multi - modal anthropomorphic Q&A with pregnant women through deep learning methods. By interacting with pregnant women in the form of digital humans, it effectively solves various questions of pregnant women and alleviates their mental anxiety.
[0044] 2. Through the methods of reinforcement learning and knowledge graph, after the system obtains the current health data of pregnant women and conducts multi - round conversations with them, it can provide pregnant women with pregnancy health advice in an anthropomorphic way (including but not limited to functions such as recommending the total daily calorie intake, recommended food ingredients, and reminders of important nutrients). And it conducts publicity and popularization of relevant pregnancy and childbirth health knowledge according to the questions raised by pregnant women and the relevant health care texts or images uploaded.
[0045] 3. The system, through a powerful medical middle - platform model, breaks through information barriers, obtains the medical treatment data, examination and inspection data of pregnant women in each department, and conducts joint processing of relevant health care data through a data relationship extraction model. With the help of knowledge graph technology, it describes the current state of pregnant women in text form and conducts prenatal profiling of pregnant women through relevant health care data, which is convenient for pregnant women to understand their specific situations and helps pregnant women make choices suitable for themselves and their fetuses in aspects such as seeking medical treatment, nutritional arrangements, and rest time arrangements.
[0046] 4. Through the collection and analysis of data, the system constructs a user data cockpit, which is convenient for relevant medical staff, pregnant women and their families to have an accurate and clear understanding of the whole - process historical data since pregnancy. On the one hand, it reduces the work intensity of the pregnant woman's attending doctor, quickly collects and analyzes the relevant data of pregnant women, and assists them in making better medical decisions. On the other hand, it helps pregnant women and their families understand the whole process of pregnancy and childbirth, helps them avoid risks and relieve anxiety. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a structural diagram of a digital human system for accompanying pregnant women with an anthropomorphic large - model provided in Embodiment 1;
[0048] Figure 2 is a structural diagram of an anthropomorphic model for accompanying pregnant women provided in Embodiment 1;
[0049] Figure 3 is a schematic diagram of structuring text data provided in Embodiment 1;
[0050] Figure 4 is a flow chart of a method for accompanying a digital human system for accompanying pregnant women with an anthropomorphic large - model provided in Embodiment 2;
[0051] Figure 5It is a schematic diagram of the pregnant woman portrait generation and the visualization management of maternal health data provided by Embodiment 6. Detailed implementation manners
[0052] The following uses specific specific examples to illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0053] The object of the present invention is to provide a digital human system for accompanying pregnant and lying-in women based on an anthropomorphic large model and its accompanying method in view of the defects of the prior art.
[0054] Embodiment 1
[0055] This embodiment provides a digital human system for accompanying pregnant and lying-in women based on an anthropomorphic large model, as Figure 1 shown, including:
[0056] A data collection module 11, configured to obtain data information corresponding to the accompaniment of pregnant and lying-in women, and perform desensitization, duplicate removal, and usability evaluation processing on the obtained data information to obtain processed text data;
[0057] A data processing module 12, configured to perform relationship extraction, entity recognition, and text classification processing on the processed text data to obtain structured processed text data;
[0058] A training module 13, configured to input the structured processed text data into the CHATGLM intelligent model, and perform fine-tuning training using the LORA method to obtain a fine-tuned CHATGLM intelligent model;
[0059] An optimization module 14, configured to optimize the fine-tuned CHATGLM intelligent model by using reinforcement learning with human feedback and prompt templates to obtain an anthropomorphic model for accompanying pregnant and lying-in women.
[0060] This system mainly consists of three levels: the technical foundation layer, the middle platform task adjustment layer, and the front-end dialogue application layer. With the support of the technical foundation layer and the middle platform task adjustment layer, the front-end application dialogue layer realizes the construction of a knowledge graph for pregnancy and maternal-related issues, the construction of a vector database, and various entity extraction problems, as well as the joint analysis of data from various departments in the hospital by combining and applying technologies such as the ChatGLM3-7B base large model, the GPLinker model, the word2vec model, the bge-large-zh-v1.5 model, and the approximate nearest neighbor HNSW (Hierarchical Navigable Small Word) graph algorithm. Furthermore, it achieves accurate answers to real-time questions, precise display of user portraits, and detailed and reliable data cockpits, ensuring smooth and effective communication between pregnant women and the system and effectively alleviating anxiety.
[0061] As Figure 2 shown, the technical foundation layer of this embodiment consists of a data foundation and an intelligent model foundation. The million-level obstetrics and gynecology health care data and the CHATGLM large model together constitute the algorithm and data basis for training the pregnant woman companion digital human (anthropomorphic large model). Furthermore, after the medical middle platform model completes data induction work such as health care data entity recognition, relationship extraction, and text classification for different tasks, they jointly support the medical dialogue large model to complete multi-round dialogue interaction tasks and align with the requirements of human communication feedback.
[0062] In the data collection module 11, data information corresponding to pregnant woman companions is obtained, and the obtained data information is subjected to desensitization, deduplication, and usability evaluation processing to obtain processed text data.
[0063] The data foundation of the system has million-level high-quality training data, including: user basic information, user medical treatment process information (appointment registration, online follow-up visit, consultation session, evaluation information, etc.), medical intervention data (prescription writing, laboratory tests, home care, chronic disease management, etc.), academic research clinical data, pathological analysis report data, drug instruction data, pregnant woman popular science literature data, obstetrics and gynecology and pediatrics Q&A data. All training sets combined exceed 1,000,000 data samples, covering various modal data of different age groups in obstetrics and gynecology and other related departments in the past five years, including text data such as diagnostic texts and test reports, as well as image data such as CT and B-ultrasound examinations.
[0064] The data collection module 11 specifically includes: a text processing module, a desensitization processing module, a usability evaluation module, and a deduplication processing module.
[0065] The text processing module is used to obtain the text data in the data information. In text data processing, in this embodiment, technologies such as OCR and document parsers are first used to obtain the text data in different file formats (txt / csv / png, etc.) of the source dataset, and the text types (disease data, drug data, report data, etc.) are labeled. Then, the long documents are segmented according to text length, punctuation marks, titles, etc. and converted into shorter text blocks. After that, the system performs desensitization, deduplication, and usability evaluation on the text data, and retains high-quality data for model training.
[0066] The desensitization processing module is used to delete the sensitive data in the text data to obtain the desensitized text data. Regarding the privacy protection issue, after obtaining the relevant text data, the system automatically deletes the key privacy fields such as the name, ID number, and hospital HIS system number of the relevant data, and uses digital codes to complete the encoding of the relevant text data, eliminating the potential risk of privacy leakage for subsequent processing.
[0067] In this embodiment, the source dataset contains patient privacy data, and the data in each field of the dataset is stored in text mode. However, each piece of data has a corresponding patient identity identification information, that is, the HIS code or ID number. Therefore, these privacy-related numbers need to be replaced with simple numerical numbers for model training.
[0068] The usability evaluation module is used to evaluate the usability of the corresponding keywords of the desensitized text data based on the bag-of-words model, determine whether the keywords corresponding to each piece of data are normal, and eliminate the data with keywords abnormal exceeding the preset threshold range to obtain the evaluated keywords. In terms of usability evaluation, since the relevant text data needs to be used in the field of health care, the accuracy requirements for the data are very high, and a series of factors such as consistency, accuracy, and integrity need to be considered for the text data. Therefore, this embodiment proposes a method for determining the data quality of the 30-dimensional element word vectors of each keyword in the dataset based on the bag-of-words model to evaluate the usability of the text data. The specific method is as follows:
[0069] In the maternal online follow-up consultation dataset, by recording the text records of the conversations between pregnant and lying-in women and doctors, the documents are obtained through a document parser and long text segmentation is completed to obtain multiple pieces of text data, and a series of keywords for each piece of text data are obtained. Then, based on the word2vec model, vector representation is performed on all keywords, and each keyword is represented as a 30-dimensional vector Vw = [V1, V2, ..., V 30 , where V i (i = 1, 2, ..., 30) represents the i-th dimension of Vw, and w is the keyword serial number in this dataset, that is, it represents the w-th keyword in this dataset.
[0070] For each keyword, calculate the geometric mean word vector G of the 30-dimensional vector of each keyword M , G M can be expressed as:
[0071] G M = (V1⨀ V2 ⨀... ⨀ V 30 ) (1 / 30) ;
[0072] where, ⨀ represents element-wise multiplication of vectors (Hadamard product), and 1 / 30 represents taking the 30th root of the vector (element-wise).
[0073] After completing the calculation of the geometric mean word vector G of the dataset, it is necessary to calculate the deviation between the vector Vw and the geometric mean word vector G M . At this time, it is necessary to introduce the special situation vector θ of pregnant women. The value of θ is determined by the special situation of pregnant women. The values of the special situation vector θ obtained for different special situations of pregnant women are different. Therefore, different θ values need to be multiplied when calculating the cosine distance. M The calculation method of θ is as follows:
[0074] First, calculate the geometric mean vector G0 of the dataset of 1000 pregnant women aged 25 to 30 without physical abnormalities
[0075] , and then select the pregnant woman with the largest deviation from the average value to calculate the cosine distance threshold T, which is expressed as: M T = d cos(Vw, G0
[0076] ) = 1 - (Vw · G0 M / (|Vw| · |G0 M) |); M where, ⋅ represents the dot product of vectors, and ∣Vw∣ and ∣G0
[0077] ∣ respectively represent the norms of the vectors. M After completing the calculation of the cosine threshold T, further set the special situation vector θ of pregnant women according to different special situations of pregnant women. According to the data of twin mothers, diabetic mothers, etc. in the hospital historical data, obtain the geometric mean vector GS
[0078] of the existing abnormal pregnant woman dataset, where S is the abnormal situation number. For example, G1 M is for twin mothers, G2 M is for diabetic mothers, G3 M is for elderly pregnant women, etc. According to different abnormal situations, calculate their cosine distance values QS respectively, and then the special situation vector θS of pregnant women can be calculated through the ratio of Q to T: M
[0079] θS = QS / T;
[0080] Where θS is the vector number for different special situations of pregnant and lying-in women. For example, θ1 is the vector for twin mothers, and θ2 is the vector for diabetic mothers. QS is the current cosine distance value for the special situation, and T is the cosine distance threshold.
[0081] After calculating the geometric mean word vector G M and the vector θS for special situations of pregnant and lying-in women, the quality of each piece of data in the dataset can be checked. After the system obtains the data, it calculates the geometric mean word vector of each keyword vector Vw for each piece of data, and then calculates the cosine distance of the vector by adding the vector θS for special situations of pregnant and lying-in women according to the labels of special situations of pregnant and lying-in women:
[0082] Un w = θS · d cos(Vw, G0 M ) = θS · [1 - (Vw · G0 M ) / (|Vw| · |G0 M |)];
[0083] Finally, count the keyword outliers for each piece of data, expressed as:
[0084] ;
[0085] Where K represents the keyword outliers for each piece of data; W represents the number of keywords; w represents the keyword serial number; Un w represents the vector cosine distance of the w-th keyword in the n-th data; T represents the preset threshold range; Un w > T represents judging whether the cosine distance falls within the threshold range; represents the number of keywords not within the preset threshold range, which proves that there may be problems with this piece of data. When K is greater than 1 / 3, it is determined that there are problems with this piece of data, and it is removed from the training dataset and does not participate in subsequent model training.
[0086] The deduplication processing module is used to check for duplicate keywords in the evaluated keywords, delete the duplicate keywords, and obtain the deduplicated text data. After completing the usability evaluation of the text data, perform duplicate checking and sorting on the data. If there are two entries with exactly the same keyword vector cosine distance, the entry with a later data serial number and being duplicate needs to be deleted. That is, it satisfies the formula:
[0087] ;
[0088] Where Un represents the n-th data; Un w = Un-1 wIf it is indicated that the nth data is exactly the same as the (n - 1)th data, then the nth data is deleted. After the text data desensitization, text data availability check, and text data duplicate check are completed, the processing of the text data part ends.
[0089] In this embodiment, it also includes the processing of image data such as CT and B-ultrasound examinations. The image processing improves the image quality through means such as contrast adjustment, sharpening, and geometric correction to ensure the accuracy of subsequent model training. Among them, contrast adjustment is used to improve the overall and local contrast of the image, making the image clearer and facilitating the capture of key information and the calculation of feature vectors. Sharpening makes the edge details of the image more prominent, preventing the omission of key edge information in various examination images during model training. Geometric correction ensures that the images input for training are at a relatively regular angle, ensuring the accuracy of recognition in the initial stage of model training. Since the production cost of various medical examination image data is relatively high and the possibility of errors is very low, in the image data processing stage, it mainly focuses on image correction and enhancement, without deleting, modifying, or compressing the image database.
[0090] In the data processing module 12, the processed text data is subjected to relation extraction, entity recognition, and text classification processing to obtain the structured text data.
[0091] As Figure 3 shown, to improve the training accuracy and operation efficiency of the anthropomorphic dialogue large model, a medical data middle platform model is added between the original data layer and the model application layer in this embodiment to complete tasks such as entity recognition, relation extraction, and text classification for various health care data facing different tasks.
[0092] The relation extraction module is used to perform relation extraction on text data using an extraction model to complete the task of data relation extraction.
[0093] After the data base completes desensitization, duplicate removal, and availability evaluation, the extraction model GPLinker is used to perform relation extraction on the text data of long texts. By accurately annotating the health care text data, and then in the case of supervised fine-tuning, the GPLinker model regards relation extraction as the recognition problem of a five-tuple, that is, the start position of the subject, the end position of the subject, the relation between the predicate subject and the object, the start position of the object, and the end position of the object. The five-tuple is recognized and matched through five steps: preliminary recognition, entity position determination, relation matching, multi-stage condition judgment, and global optimization to complete the task of data relation extraction.
[0094] The entity recognition module is used to recognize the semantic information of the text data that has completed data relationship extraction using a vector model.
[0095] After extracting the relationships of each phrase entity in the text, it is necessary to use the vector model bge-large-zh-v1.5 to obtain the vector representation of each data corresponding text block. By inputting the text block that has completed relationship extraction into the model, the model calculates a high-dimensional vector regarding the characteristics of the text block through vector operations based on triples, realizing the representation of the text block in the vector space. Furthermore, the capture of the semantic information of the text block is completed.
[0096] The text classification module is used to store the recognized text data into a relational database, a graph database, and a vector database respectively according to the text category and data format.
[0097] After completing entity relationship extraction - five-tuple construction and high-dimensional vector calculation, the data processed in these links is stored into a relational database (tabular data), a graph database (triple data), and a vector database (vector data) respectively according to the text category and data format. And through the approximate nearest neighbor HNSW (Hierarchical Navigable Small Word) graph algorithm, the data in the relational database, graph database, and vector database are linked with shorter paths. Then, according to different data types, different databases are called to provide fast retrieval support for the subsequent anthropomorphic medical dialogue large model training and real-time question answering for pregnant and lying-in women. That is, the relational database, graph database, and vector database jointly form a keyword retrieval database. Among them, the relational database stores the associated information data of a certain patient code (A - 45 years old - native place); the graph database stores triple data, that is, stores (A - school - student); the vector database stores the feature vectors obtained after recognizing and calculating the text block.
[0098] In training module 13, the structured text data is input into the CHATGLM intelligent model, and the LORA method is used for fine-tuning training to obtain the fine-tuned CHATGLM intelligent model.
[0099] In this embodiment, the ChatGLM3-7B large model released by Zhipu AI is used as the model base for supervised fine-tuning. ChatGLM3-7B has powerful multi-modal understanding capabilities, can easily handle various types of information processing requirements such as text and images, and also integrates AgentTuning technology to achieve the functions of code generation and execution, bringing new intelligent support to the fields of programming and software development. In addition, based on the latest efficient dynamic inference and video memory optimization technology, this model achieves faster inference speed and lower inference cost under the same hardware and model conditions, greatly improving application efficiency and cost performance. At the same time, the ChatGLM3-7B large model natively supports complex scenarios such as tool calls, database operations, knowledge graph search and inference, and operating systems, and has good multi-platform applicability, making it suitable as the anthropomorphic model base for maternal and child companionship.
[0100] On the original model base of ChatGLM3-7B, the CHATGLM intelligent model is fine-tuned by the LORA method. The fine-tuning of the CHATGLM intelligent model by the LORA method specifically includes two parts: the first part is to obtain the labeled data set for fine-tuning training; the second part is to select a suitable low-rank matrix. After completing these two parts of work, select CHATGLM as the pre-loaded model, set the selected low-rank matrix parameters and the maternal and child dialogue data set for training, and the large model can be made competent for new tasks with the addition of fewer parameters, effectively saving computing power costs and improving training efficiency.
[0101] 1. Obtain the labeled data set for fine-tuning training: This is solved by the GlobalPointer technology combined with the collected various clinical dialogue source data. After obtaining a large amount of source data of clinical maternal and child and medical staff conversations, the GlobalPointer technology is used to clean and sort the dialogue source data. The input text is first converted into a token sequence by the tokenizer (a Token sequence refers to splitting the original text into individual independent units (tokens), which can be words, subwords, or characters), and then converted into a vector representation through the embedding layer, and then the feature vectors of relevant keywords and various emotional terms are extracted to generate corresponding emotional labels and a complete label matrix. After the generation is completed, a maternal and child dialogue data set with emotional labels is generated to achieve the digital processing of the long text generated in the conversations between maternal and children and medical staff; specifically refer to the processing methods of the data collection module 11 and the data processing module 12.
[0102] 2. Select an appropriate low-rank matrix: The selection of the low-rank matrix R is related to the training accuracy of the CHATGLM intelligent model. The larger the rank R of the matrix, the higher the training accuracy of the CHATGLM intelligent model, but the higher the requirement for computing power; the smaller the rank R of the matrix, the lower the training accuracy of the CHATGLM intelligent model, but the lower the requirement for computing power. In this embodiment, in order to improve the training accuracy of the fine-tuned model as much as possible, a strategy of increasing the value of the low-rank matrix numerically is adopted under the condition that the computing power permits. The selected value of the low-rank matrix starts from 8 and increases according to the rule of 8 * 2 n That is, the size of each matrix value is twice that of the previous training. After multiple rounds of testing, this embodiment selects the rank value of the low-rank matrix to be 16 to improve the accuracy of the answer as much as possible under the condition that the computing power can be satisfied.
[0103] After completing the construction of the maternal dialogue dataset and the selection of the low-rank matrix, after loading the relevant LORA module and training with the dataset, further output optimization is performed in the post-processing part of the model. Through multiple tests, emotional correction is performed on the relevant output content (to ensure that the generated content is positive and warm in emotion), and natural language processing tools are used to check the grammar and spelling errors of the generated content. For some content involving medical knowledge, manual supplementation or correction is made according to the content generated by the model to make the model more accurate. After completing the above work, the fine-tuning of the CHATGLM model for the specific task of pregnant and lying-in women is completed.
[0104] For example, the beneficial effects of the fine-tuned CHATGLM intelligent model compared with before fine-tuning are as follows:
[0105] Before fine-tuning:
[0106] Question #What to do about morning sickness#
[0107] Answer #Morning sickness is a common phenomenon in the early stages of pregnancy. Approximately 75% of pregnant women will experience varying degrees of nausea and vomiting within the first three months of pregnancy. In most cases, this symptom will naturally ease or disappear around the fourth month of pregnancy. For morning sickness, the following methods can be tried to relieve it:
[0108] ① Maintain a good eating habit: Eat small meals frequently and avoid fasting. Choose light and easily digestible foods, and avoid greasy, spicy and other strongly stimulating foods. Avoid eating foods with strong odors, as certain odors may trigger nausea. ② Get proper rest: Ensure sufficient sleep and reduce fatigue. Take a short nap during the day, but don't stay in bed for a long time, as it may aggravate the nausea. ③ Supplement vitamin B6: Vitamin B6 is considered helpful in relieving the symptoms of morning sickness. But before using any supplements, please consult a doctor's advice.
[0109] If morning sickness is very severe, resulting in inability to eat, dehydration, or significant weight loss, this may be hyperemesis gravidarum and requires immediate medical attention. The doctor may prescribe medication or other medical interventions. In short, when facing morning sickness, the most important thing is to communicate with the doctor to ensure that the methods adopted are both safe and effective. #Answer ends.
[0110] Fine-tuned:
[0111] Question #What to do about morning sickness#
[0112] Answer #Dear expectant mother, during this special period, you may encounter some small challenges, such as uncomfortable morning sickness. Remember, you're not alone in this battle. Many moms have gone through this stage, and it will pass soon. Here are some suggestions that hope to help you and make you feel better:
[0113] Treat your body gently: Try to eat small, frequent meals and choose light, easily digestible foods. Avoid foods that may make you feel uncomfortable. Remember, every bite of food is for a better tomorrow for you and your baby.
[0114] Give yourself enough rest: When your body tells you it needs rest, don't hesitate. Lie down comfortably, close your eyes, and enjoy this moment of tranquility. Adequate rest can not only help you regain strength but also make you feel happier.
[0115] Little vitamin B6: Sometimes, a little help can make a big difference. You can consider taking an appropriate amount of vitamin B6, which is helpful for relieving morning sickness. However, remember to ask your doctor first to ensure it's safe for you.
[0116] Let fresh air embrace you: Open the window and let the fresh air in! Take a few deep breaths and feel the power of nature. Maybe it can help you relieve that uncomfortable feeling.
[0117] Keep a peaceful mind: Try to relax yourself and do something you like, such as listening to music, reading, or taking a walk. Sometimes, the state of mind directly affects how our body feels.
[0118] Dear friend, if you think your morning sickness is really severe, don't push yourself. It's very important to seek medical help in time. Remember, your health and your baby's health are always the top priority. Although this process is a bit tough, it's also one of the most wonderful journeys in life. Believe in yourself, and you will surely get through this period and welcome a healthy baby! #Answer ends
[0119] According to the above content, it can be seen that through different answers, the fine-tuned CHATGLM model can put forward more suggestions and use an anthropomorphic tone when dealing with relevant questions, so as to give more encouraging and warm suggestions, indicating that the fine-tuning effect is significant.
[0120] In this embodiment, instruction fine-tuning means are adopted to improve the reply accuracy of the model. Since the ChatGLM3-7B base large model uses a large amount of unlabeled text during pre-training, and the text accuracy is not high, and the text content is not focused enough on the health care direction, it can only achieve some simple tasks such as text completion, and it is not applicable to the tasks of answering questions from pregnant and lying-in women with very high precision and popularizing knowledge about pregnancy and childbirth. Therefore, it is necessary to use instruction fine-tuning means to enable the model to have the above capabilities. This embodiment uses the LLaMA Factory architecture combined with a large amount of text data, image data, corresponding labeled maternal and child healthcare data, prescription open data, and inspection and examination data completed in the data collection module 11 and the data processing module 12 to achieve personalized instruction fine-tuning of the ChatGLM3-7B base large model for pregnant and lying-in women, that is, let ChatGLM3-7B generate answers by itself, and tell ChatGLM3-7B to regenerate and train after manually judging right or wrong until ChatGLM3-7B's answers are always correct. Through instruction fine-tuning, the model can better understand and follow the instructions and commands given by humans, so that during the process of communicating with pregnant and lying-in women and during the process of popularizing knowledge about pregnancy and childbirth to pregnant and lying-in women and their families, the replies and pushes are more accurate.
[0121] The ChatGLM3-7B of this embodiment can also be connected to the existing knowledge graph or the existing Internet of Things data.
[0122] In the optimization module 14, the fine-tuned CHATGLM intelligent model is optimized using reinforcement learning based on human feedback and prompt templates to obtain a maternal and child companion anthropomorphic model.
[0123] In this embodiment, reinforcement learning from human feedback (RLHF) is used to optimize the decision-making process of the fine-tuned CHATGLM intelligent model, so that the fine-tuned CHATGLM intelligent model can self-iteratively learn according to the feedback.
[0124] RLHF, or reinforcement learning with human feedback, is a technical approach that combines reinforcement learning with human feedback. This embodiment combines the RLHF framework with an intelligent platform. Using the pre-trained ChatGLM3-7B model framework, the model is trained to make decisions based on the current state of maternal questions and the available educational content. Humans evaluate the model's decisions, providing feedback on the accuracy of responses and the appropriateness of educational recommendations. The information is obtained by analyzing the questioner's keywords and then directly accessing them online or searching existing databases for keywords. Using the RLHF architecture, the model converts feedback into a digital reward signal and uses proximal policy optimization (PPO). Based on the human feedback from the first round, the model automatically generates questions and answers for the second round, summarizes the accuracy and evaluation of the responses in the second round, and uses this feedback to further update the model. This enables continuous self-learning. Through continuous iteration and optimization, the model can gradually improve the accuracy of answers to pregnant women's questions and obtain appropriate educational promotion content based on the analysis of text interaction content with pregnant women, effectively enhancing the sense of gain in interaction between pregnant women and the large anthropomorphic model of pregnant women's companions.
[0125] This embodiment uses the prompt word template for optimization, specifically: setting a reply template for the fine-tuned CHATGLM intelligent model through preset rules and constraints.
[0126] Because pregnant women face enormous mental challenges during pregnancy and childbirth, it is necessary to set prompt word templates to achieve gentler and more personalized responses and avoid various ethical and legal risks that may arise in the responses. This embodiment optimizes the model's anthropomorphism level and avoids the emergence of ethical and legal issues by setting model prompt word rules and constraints. The specific prompt word format used in this embodiment is as follows:
[0127] ## Background Information
[0128] You are a maternity management assistant in the hospital. Now, please help answer the maternity-related {{user}} questions based on the content of {{knowledge}} and output them in json format.
[0129] ## Specific requirements
[0130] Please provide information in the following format:
[0131] export interface pregnany {
[0132] answer: string / / response content
[0133] similarity : string[] / / Similar questions
[0134] }
[0135] answer: Please answer questions related to pregnant women
[0136] similarity : Please output 3 similar questions and return them in array format
[0137] ## Please follow the following constraints:
[0138] - The output content should be as warm as possible.
[0139] - Do not repeat the question.
[0140] - Pay attention to empathy and answer in a caring tone.
[0141] - When it comes to medications, be sure to state "Please take the medication after consulting a doctor."
[0142] - Please abide by national conditions, laws and regulations, such as not answering questions about surrogacy, etc.
[0143] - If the returned format is not in JSON format, optimize it into JSON format and remove unnecessary spaces, etc.
[0144] ## Questions clearly prohibited by laws and regulations:
[0145] - Surrogacy is not allowed
[0146] - Fetal gender prediction is not supported
[0147] ## Example
[0148] Input: What should I pay attention to when getting vaccinated
[0149] {
[0150] "answer": "Points for attention",[[ID=null]]
[0151] "similarity":
[0152] "What should I pay attention to when getting vaccinated during pregnancy?",
[0153] "What should I pay attention to when getting vaccinated during pregnancy?",
[0154] "What problems should a pregnant woman pay attention to when getting vaccinated?"
[0156] }
[0157] The above prompt words are a set of prompt words for questions during pregnancy. In the actual setting of this embodiment, according to the different stages of pregnant and lying-in women, different prompt words are set for the pregnancy period, the lying-in period, and the baby-care period respectively to ensure that the model can accurately output the answers to relevant questions in an anthropomorphic tone.
[0158] After completing the construction of the above three sections of instruction fine-tuning, reinforcement learning based on human feedback (RLHF), and prompt word template setting, the personalized training of the anthropomorphic model for pregnant and lying-in women companionship (that is, the digital human) is realized. The system can analyze and answer the questions raised by users, store data and give relevant publicity and popular science content.
[0159] In this embodiment, the input health care data is structurally processed and input into the large model for special training by means of vector form, table form, triple form, etc. Through supervised instruction fine-tuning of the single-round and multi-round Q&A that has been annotated, knowledge of obstetrics and gynecology is injected into the model, and then accurate Q&A in the professional field of obstetrics and gynecology is realized. By correcting the prompt words of the large model, the system can be competent in answering anthropomorphic questions and providing publicity and popular science in a multi-round dialogue environment, and can still effectively complete tasks, answer accurately and effectively, and avoid ethical risks in the case of special situations such as elderly pregnant women, multiple-birth pregnant women, and pregnant women with abnormal medical examinations. This system realizes pregnancy services and scientific management through the organic combination of obstetrics and gynecology medical knowledge and artificial intelligence technology, and helps with better pregnancy and child-rearing.
[0160] Embodiment 2
[0161] This embodiment provides a companionship method for an anthropomorphic model digital human system for pregnant and lying-in women companionship, as Figure 4 shown, which is implemented through an anthropomorphic model digital human system for pregnant and lying-in women companionship in Embodiment 1. The companionship method includes:
[0162] S1. The anthropomorphic model for pregnant and lying-in women companionship obtains the questions raised by the user, and performs text parsing on the obtained questions to obtain keywords corresponding to the text;
[0163] The user asks a question related to pregnant and lying-in women to the anthropomorphic model digital human system for pregnant and lying-in women companionship. The anthropomorphic model for pregnant and lying-in women companionship performs text parsing on the received question based on technologies such as a document parser and OCR, and extracts the keywords in the text.
[0164] S2. The anthropomorphic model for pregnant and lying-in women companionship judges whether the obtained keywords are compliant. If not, it reminds the user and ends the conversation without recording relevant information; if so, it judges whether there is relevant knowledge corresponding to the keywords in the keyword retrieval database. If so, it executes step S3;
[0165] The anthropomorphic model of pregnant women accompanying their children determines whether the extracted keywords are compliant. If not, it will send a prompt to the user indicating that there are illegal phrases in the question and provide education on the illegal parts.
[0166] If it is compliant, the keyword will be input into the keyword retrieval database and knowledge graph, and it will be determined whether there is knowledge corresponding to the keyword in the keyword retrieval database and knowledge graph. If not, a prompt message that cannot be accurately answered will be sent to the user, and the most similar answer will be given. The conversation content will then be settled as a vector and stored in the vector database, and the vector database will be updated regularly to supplement the data.
[0167] S3. The pregnant woman's companion personified model forms specific responses based on the prompt template;
[0168] If there is knowledge corresponding to the keyword in the keyword retrieval database and knowledge graph, the maternal and infant companion anthropomorphic model will generate answers based on the user's questions.
[0169] S4. The anthropomorphic model accompanying pregnant women recommends relevant popular science content based on the answers and records the conversation text.
[0170] The maternal and infant companion anthropomorphic model also recommends relevant popular science knowledge, videos, etc. based on the generated answer content, and can store the text data corresponding to the current dialogue round. Finally, it ends this round of dialogue and asks whether there are other needs. If so, it continues to return to step S1. If not, it continues the dialogue.
[0171] Compared to existing technologies, this embodiment, after completing the construction of the foundation layer, the medical middle platform model, and the maternal companion anthropomorphic model, features four major modules: a multimodal question-answering system, a maternal health service assistant, a data collection and analysis platform, and a user data cockpit. These modules enable six key functions: real-time maternal Q&A, pregnancy health advice, maternal health knowledge dissemination, cross-department maternal medical data processing, maternal health profile generation, and maternal health data visualization management.
[0172] Example 3
[0173] The accompanying method of the large-scale anthropomorphic model pregnant woman digital human system provided in this embodiment is different from that in the second embodiment in that this embodiment is implemented through specific examples:
[0174] A pregnant woman asks the system the question #When will morning sickness end#. After receiving the question text, the system parses the text. The keywords <morning sickness><when><end> are extracted and this group of keywords is judged to be compliant. After judgment, it is found that this group of keywords does not contain illegal words such as <surrogacy><gender identification>, so the process can continue and a database search is performed. The database search finds that the relevant keywords <morning sickness><when><end> can be found in the database and knowledge graph. Subsequently, the anthropomorphic model of the pregnant woman accompanying the mother organizes the answer based on the relevant information of the prompt template, first considering the relevant constraints of the prompt template: ## Please follow the following constraints: - The output content should be as warm as possible. - Do not repeat the question. - Pay attention to empathy and answer in a caring tone. - When it comes to medication, be sure to state "Please take the medication after following the doctor's orders." Then, a specific answer is formed based on the content of the question and the constraints of the prompt template:
[0175] Start of answer #Dear, I understand your discomfort very well. Morning sickness, this little naughty thing, will usually quietly put away its jokes and gradually fade out of your life around the 12th to 14th week of your pregnancy journey. However, the situation of each expectant mother is unique. Just like everyone's physique and personality are different, the duration of morning sickness also varies. Some pregnant women may say goodbye to this uncomfortable time very quickly, while others may need a longer time, until the middle and late stages of pregnancy, or even the entire pregnancy, before morning sickness is willing to let go. Of course, hormone fluctuations, mood swings, medication use, and daily eating habits may all be important factors affecting the time when this little naughty thing leaves. But don't worry, no matter how naughty morning sickness is, as long as we maintain good living habits, actively adjust our mentality, and seek help from a doctor when necessary, we can successfully get through this special time. Remember, you are not fighting alone, your body is preparing for the arrival of a new life in its own unique way. #End of answer
[0176] After the answer is complete, the system recommends popular science videos and articles related to morning sickness and how to alleviate it, such as "Three Tips to Alleviate Morning Sickness" and "How to Minimize the Negative Effects of Morning Sickness." The system also records the text of the user's question and the system's answer. If the user continues to ask questions, the process ends. If the user continues to ask questions like #I'm in my 20th week of pregnancy and still have morning sickness, what should I do#, the system will perform a compliance check, combine the previous conversation text, the user's question, and the knowledge base data, and provide another answer:
[0177] Start of answer #Dear expectant mother, if morning sickness, this "long-lasting little friend", is still with you in the 20th week of your pregnancy, don't worry too much, it may just be reluctant to leave you. Although most mothers will say goodbye to it in the early stages of pregnancy, every expectant mother's pregnancy experience is unique, just like every flower has its own time to bloom. Try to treat yourself gently and give yourself more patience and care. Keep a relaxed mood, because a good mood is the best regulator for the body. At the same time, you can also refer to the popular science videos recommended to you before, adjust your diet, and let every bite of food become a sweet source of nourishment for you and your baby. If morning sickness really makes you feel uncomfortable, you might as well find time to talk to your doctor and see if there is any good way to make this "little friend" exit early and make your pregnancy easier and more enjoyable. Remember, you are going through a wonderful journey, and every step deserves to be treated gently. #End of answer
[0178] After the answer is completed, all operations are the same as after the first round of dialogue. If there is a subsequent dialogue, the process is the same as above. If there is no subsequent dialogue, the process ends.
[0179] Example 4
[0180] The accompanying method of the large-scale anthropomorphic model pregnant woman digital human system provided in this embodiment is different from that in the second embodiment in that this embodiment is implemented through specific examples:
[0181] If a user asks #I want to find a surrogate, how much will it cost#, the system will parse the text after receiving it. It will extract the keywords <surrogate><how much will it cost>. After checking, it finds that this keyword combination contains the illegal word <surrogate>. The system determines that the user's question contains an illegal phrase and stops the process. Instead, it reminds the user:
[0182] Start answering #Sorry, there are some illegal words in your question, please try again #End answering
[0183] After answering the questions, the system does not record the text information of the relevant questions and answers, and will carry out education on illegal content and push relevant warning education films.
[0184] Example 5
[0185] The accompanying method of the large-scale anthropomorphic model pregnant woman digital human system provided in this embodiment is different from that in the second embodiment in that this embodiment is implemented through specific examples:
[0186] If the user's question is #How to give birth to a Hobbit who can emit lasers#, after receiving the question text, the system analyzes the text. The keywords <How><give birth to><emit lasers><Hobbit> are extracted, and a compliance determination is made on this set of keywords. After determination, it is found that this set of keywords does not contain illegal words such as <surrogacy><gender identification>, so the process can continue. Database retrieval is performed. Through database retrieval, it is found that no relevant content can be searched for the relevant keywords in the knowledge base, but similar content <Hobbit> can be found. At this time, the system will prompt the user that it cannot give an accurate answer and reply with the relevant content of the Hobbit:
[0187] Answer starts #Sorry, my ability is temporarily unable to help you solve this problem, but hope the following data can be helpful to you: The Hobbit is......# Answer ends.
[0188] After the reply, the content of the question text block is resolved into a vector and stored in the vector database. In subsequent regular updates, relevant supplements are made to the database as needed.
[0189] Example Six
[0190] The difference between the companionship method of the anthropomorphic large model maternal and child companionship digital human system provided in this example and Example Two is that this example will also process data processing modules such as pregnant woman portrait generation and visualization management of maternal and child health data according to data information.
[0191] When user A needs to call the pregnant woman's health portrait and initiate maternal and child needs, the system first retrieves the relevant health care data of each department under user A's ID399670 (maternal and child health record data, outpatient data, various inspection and examination data, etc.), and then uses the maternal and child companionship anthropomorphic model to analyze the multi-modal data related to user A, and obtains the relevant information of this pregnant woman <pregnancy duration 16 weeks><pregnancy age 29><jurisdictional health center: Baiyang Street Health Center><whether hospitalized: no> and special logical variable information <twin mother: no><elderly mother: no><diabetic mother: no>. After determining the basic information, various test reports and data from the portable data detection platform are extracted and analyzed to obtain <heart rate data: 67 / min><blood pressure data: 130 / 76><weight data: 62KG><average sleep: 7.2h><blood oxygen saturation: 100%><average daily activity duration: 63min><average daily stress index: 37>, and other disease data <respiratory system diseases: none><gastrointestinal system diseases: none><gynecological diseases: none><other unclassified diseases: none> are obtained by integrating the diagnosis and treatment data of each department.
[0192] After completing the data acquisition and analysis, a comprehensive portrait of the pregnant woman bound to User A's account is created. A virtual human is generated based on computer graphics design and rendering techniques, and details such as body shape and expression are configured according to the relevant health conditions. The current relevant basic health data and some dietary and lifestyle suggestions for ensuring the health of the pregnant woman in the future are displayed on the interaction page. The work of creating a portrait of the pregnant woman to show her current physical health status is completed here.
[0193] After viewing the digital portrait of the pregnant woman, User A accessed the health data cockpit for pregnant women. When User A accessed the health data cockpit for pregnant women, the system collected the historical medical examination data and data from portable devices of the pregnant woman bound to this ID, and concentrated on displaying images of the historical state changes of the pregnant woman <pregnancy duration 0 - 16 weeks>, the weight of the fetus <0 - 110 grams>, and the development situation <gradually taking on the appearance of a baby> for estimation, ensuring that visitors can clearly see all the state data of the pregnant woman in all historical stages in one picture, achieving the effect of the data cockpit. The relevant operation flow chart is as Figure 5 shown.
[0194] Note that the above is only the preferred embodiment of the present invention and the applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described here. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, it can also include more other equivalent embodiments, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A large-scale anthropomorphic model of a pregnant woman accompanying a digital human system, characterized by: include: The data collection module is used to obtain data information corresponding to the maternal companionship, and perform desensitization, deduplication, and usability evaluation on the obtained data information to obtain processed text data; The acquired data information includes text data and image data; including: A text processing module is used to obtain text data in data information; A desensitization processing module is used to delete sensitive data in text data to obtain desensitized text data; The usability evaluation module is used to evaluate the usability of keywords corresponding to the desensitized text data based on the bag-of-words model, determine whether the keywords corresponding to each data item are normal, and remove data where the keyword abnormality exceeds the preset threshold range to obtain the evaluated keywords; Calculate the geometric mean word vector G of each keyword 30-dimensional vector M , G M It can be expressed as: G M =(V1⊙V2⊙...⊙V 30 ) (1 / 30) Among them, ⊙ represents the element-by-element multiplication of the vector, 1 / 30 represents the 30th root operation of the vector; V1, V2, ..., V 30 A 30-dimensional vector represents each keyword; the pregnant woman with the largest deviation from the mean value is selected to calculate the cosine distance threshold T, which is expressed as: T=dcos(Vw,G0 M )=1-(Vw G0 M) / (|Vw| · |G0 M |) where · represents the dot product of the vectors, |Vw| and |G0 M ∣ represents the modulus of the vector; G0 M Represents the geometric mean vector of the data set of pregnant women without physical abnormalities; Vw=[V1,V2,...,V 30 ], representing a 30-dimensional vector for each keyword; Calculate the special case vector θS for pregnant women, expressed as: θS=QS / T Among them, θS represents the vector number of different maternal special cases; QS represents the cosine distance value of the current special case, and T represents the cosine distance threshold; According to the maternal special case label, add the maternal special case vector θS to calculate the vector cosine distance: About w =θS·dcos(Vw,G0 M )=θS·[1-(Vw·G0 M ) / (|Vw|·|G0 M |)] Count the keyword outliers for each piece of data, expressed as: Among them, K represents the keyword outlier value of each data; W represents the number of keywords; w represents the keyword sequence number; Un w represents the vector cosine distance of the wth keyword in the nth data; T represents the preset threshold interval; Indicates the number of keywords that are not within the preset threshold range; The deduplication processing module is used to check the duplicate keywords after evaluation, delete the duplicate keywords, and obtain the deduplicated text data; it is expressed as: Among them, Un represents the nth data; Un w =Un-1 w If the nth data and the n-1th data are exactly the same, the nth data will be deleted; The data processing module is used to perform relationship extraction, entity recognition, and text classification on the processed text data to obtain structured text data. Specifically, it includes: The relation extraction module is used to extract relations from text data using the extraction model to complete the task of extracting data relations; The entity recognition module is used to use a vector model to identify semantic information in text data after data relationship extraction; The text classification module is used to store the recognized text data into relational databases, graph databases, and vector databases according to text categories and data formats; The training module is used to input the structured text data into the CHATGLM intelligent model and use the LORA method to perform fine-tuning training to obtain the fine-tuned CHATGLM intelligent model; The optimization module is used to optimize the fine-tuned CHATGLM intelligent model using reinforcement learning with human feedback and prompt word templates to obtain an anthropomorphic model of pregnant and postpartum companions. Specifically: The decision-making process of the fine-tuned CHATGLM intelligent model is optimized through reinforcement learning (RLHF) based on human feedback, so that the fine-tuned CHATGLM intelligent model can self-iterate and learn based on feedback; and a response template is set for the fine-tuned CHATGLM intelligent model through preset rules and constraints.
2. The large-scale anthropomorphic model digital human system for accompanying pregnant women according to claim 1 is characterized in that: The CHATGLM intelligent model in the training module is the ChatGLM3-7B intelligent model.
3. The large-scale anthropomorphic model digital human system for accompanying pregnant women according to claim 1 is characterized in that: It also includes a generation module for generating pregnant woman portraits and maternal health data visualization management based on the obtained structured text data.
4. A method for accompanying a pregnant woman using a large anthropomorphic model digital human system, characterized in that: The method is implemented by using the large-scale anthropomorphic model of a pregnant woman accompanying digital human system according to any one of claims 1 to 3, wherein the accompanying method comprises: S1. The maternal companion anthropomorphic model obtains questions raised by users and performs text parsing on the questions to obtain keywords corresponding to the text; S2. The maternal companion anthropomorphic model determines whether the obtained keywords are compliant. If not, it reminds the user and ends the conversation without recording relevant information. If so, it determines whether there is relevant knowledge corresponding to the keyword search keyword in the keyword search database. If so, it executes step S3; S3. The pregnant woman's companion personified model forms specific responses based on the prompt template; S4. The anthropomorphic model accompanying pregnant women recommends relevant popular science content based on the answers and records the conversation text.
Citation Information
Patent Citations
Large language model training method and device
CN118349852A