Life significance sense detection method and device

By constructing a knowledge graph and a large language model to generate knowledge description text, and combining it with a long short-term memory network training model, the problem of accuracy in detecting the sense of meaning of life in social platform data is solved, and more efficient detection of the sense of meaning of life is achieved.

CN120596640AActive Publication Date: 2025-09-05BEIJING NORMAL UNIVERSITY

Patent Information

Application Number
CN202511094006.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-09-05
Estimated Expiration
2045-08-06

AI Technical Summary

Technical Problem

Current methods for detecting sense of meaning in life have low accuracy in social platform data and lack a systematic interpretation, resulting in inaccurate test results.

Method used

Build a knowledge graph based on multiple scientific documents, use a large language model to generate knowledge description text, and train a sense of life meaning detection model through a long short-term memory network, combined with social text for detection.

Benefits of technology

The accuracy of detecting the sense of meaning in life is improved, and the model's ability to recognize implicit emotional information is enhanced by integrating professional knowledge and social platform data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120596640A_ABST
    Figure CN120596640A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, and discloses a life significance sense detection method and device. The method comprises the following steps: constructing a knowledge graph based on multiple scientific literatures; obtaining text data for training; taking the knowledge graph as background knowledge of a large language model, and generating a knowledge description text corresponding to the text data through the large language model; generating a synthetic text based on the text data and the knowledge description text, and converting the synthetic text into a corresponding fusion vector; training a life significance sense detection model based on the fusion vector; and through the trained life significance sense detection model, detecting a fusion vector generated based on the social text. By adopting the method, the accuracy of life sense sense detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method and device for detecting a sense of meaning in life. Background Art

[0002] There is a close correlation between a sense of meaning in life and mental health and psychological well-being. Testing for a sense of meaning in life can aid in intervention and development of psychological well-being. Studies have shown that a high level of a sense of meaning in life is positively correlated with mental health and psychological well-being, and is strongly associated with greater emotional well-being, motivation, job satisfaction, self-esteem, psychosocial functioning, and physical health. A lack of a sense of meaning in life not only affects the individual's psychological state but also has profound implications for social stability and development.

[0003] Current approaches to detecting a sense of meaning in life rely on analyzing user content posted on social media to detect emotions and intentions related to a sense of meaning in life. However, due to the sheer volume and diversity of content on social platforms and the lack of systematic approaches to interpreting meaning in life, it is difficult to extract implicit emotional information from social platform data, resulting in low accuracy in detecting meaning in life. Therefore, a method is needed to improve the accuracy of detecting meaning in life. Summary of the Invention

[0004] In view of this, the present application aims to propose a method and device for detecting a sense of meaning in life, so as to improve the accuracy of detecting a sense of meaning in life.

[0005] To achieve the above objectives, the technical solutions of this application are as follows: A first aspect of an embodiment of the present application provides a method for detecting a sense of meaning in life, the method comprising: Constructing a knowledge graph based on multiple scientific papers; the knowledge graph includes multiple triples related to the sense of meaning in life; wherein each triple contains two entities and corresponding relationships; Get text data for training; The knowledge graph is used as background knowledge for a large language model, and a knowledge description text corresponding to the text data is generated through the large language model; the knowledge description text includes: enhanced semantic information that reflects the life significance of the text data; generating a synthetic text based on the text data and the knowledge description text, and converting the synthetic text into a corresponding fusion vector; Training a life meaning detection model based on the fusion vector; the life meaning detection model is constructed based on a long short-term memory network; The fusion vector generated based on social text is detected through the trained life meaning detection model.

[0006] Optionally, build a knowledge graph based on multiple scientific papers, including: According to the preset first keyword, a number of scientific papers related to the sense of meaning in life were retrieved; Perform triple extraction on all scientific literature to obtain initial triples; Perform cross-screening on all initial triplets; After cross-screening, the initial triples were deduplicated to obtain multiple triples related to the sense of meaning in life. Based on all triples related to the sense of meaning in life, an entity set and a relationship set are constructed to form a knowledge graph.

[0007] Optionally, after obtaining multiple triplets related to the sense of meaning in life, the method further includes: Detecting whether there is an implicit relationship between any two entities in the knowledge graph whose distance is less than a distance threshold and who have no relationship by using at least two different large language models; Based on the detection results of each large language model, multiple entity pairs with implicit relationships are obtained; Generate supplementary triples based on each entity pair and the corresponding implicit relationship; The supplementary triples are added to the knowledge graph.

[0008] Optionally, perform a cross-screening of all initial triplets, including: Remove triples containing entities with psychology terminology, abstract entities, and entities lacking objects; Remove triplets containing specific object groups; The triples to which entities with the second keyword belong and the triples to which entities without the second keyword belong but are related to the sense of meaning in life are retained.

[0009] Optionally, after constructing entity sets and relationship sets based on all triples related to the sense of meaning in life to form a knowledge graph, the following steps are also included: According to the crawling cycle, popular keywords with a frequency greater than the frequency threshold are crawled from social platforms as new entities; Traversing all entities stored in the knowledge graph to obtain entities associated with the new entity; Generate a new triple based on the new entity and entities associated with the new entity in the knowledge graph; Add the new triple to the knowledge graph.

[0010] Optionally, using the knowledge graph as background knowledge of a large language model and generating a knowledge description text corresponding to the text data through the large language model includes: Dividing the text data into a plurality of text blocks based on the user; Inputting each text block and the knowledge graph into the large language model, and obtaining entities and relationships matching the text block from the knowledge graph through the large language model; wherein the relationships include: relationships between entities, and relationships between entities and sense of meaning in life; The matching entities and relationships of the text block are processed by the large language model to generate text that reflects the life significance of the text block as the knowledge description text corresponding to the text block.

[0011] Optionally, obtaining entities and relationships matching the text block from the knowledge graph using the large language model includes: Traversing the knowledge graph using the large language model to determine whether each entity in the knowledge graph exists in the text block, and whether each entity in the knowledge graph is semantically similar to an entity in the text block; Entities existing in the text block and entities with similar semantics to the entities in the text block are taken as candidate entities; The large language model is used to determine the relationship between candidate entities and the relationship between candidate entities and the sense of meaning of life, and to generate corresponding ternary relationship groups.

[0012] According to a second aspect of an embodiment of the present application, a device for detecting a sense of meaning in life is provided, for implementing the steps of the method provided in the first aspect of the embodiment of the present application, the device comprising: A construction module is configured to construct a knowledge graph based on a plurality of scientific papers; the knowledge graph includes a plurality of triples related to the sense of meaning in life; wherein each triple contains two entities and corresponding relationships; an acquisition module, configured to acquire text data for training; a fusion module configured to use the knowledge graph as background knowledge for a large language model, generate a knowledge description text corresponding to the text data through the large language model, wherein the knowledge description text includes enhanced semantic information reflecting the life significance of the text data; generate a synthetic text based on the text data and the knowledge description text, and convert the synthetic text into a corresponding fusion vector; A training module is configured to train a sense of life meaning detection model based on the fusion vector; the sense of life meaning detection model is constructed based on a long short-term memory network; The detection module is configured to detect the fusion vector generated based on the social text through the trained sense of life detection model.

[0013] According to a third aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the method provided in the first aspect of the embodiment of the present application are implemented.

[0014] According to the fourth aspect of the embodiments of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the computer program is executed by the processor, the steps in the method provided in the first aspect of the embodiments of the present application are implemented.

[0015] The method for detecting the sense of meaning in life provided in this application is adopted to construct a knowledge graph related to the sense of meaning in life based on multiple scientific documents. The knowledge graph is then used as the background knowledge corpus of the large language model. The user text of the social platform is processed by the large language model to generate a knowledge description text corresponding to the sense of meaning in life that can reflect the text data. Since the knowledge graph integrates professional knowledge information from different sources, it organizes and displays complex information and concepts related to the sense of meaning in life in the form of triples, forming systematic and intuitive data. Therefore, the large language model can better generate deep semantic information that reflects the sense of meaning in life in the user text by learning the knowledge graph. On this basis, the knowledge description text is synthesized with the user's original text to obtain a synthetic text with richer semantic information. Using the fusion vector converted from the synthetic text to train the sense of meaning in life detection model can greatly improve the ability of the sense of meaning in life detection model to extract implicit emotional information in the text, thereby improving the performance and accuracy of the detection model. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0017] Figure 1 This is a flow chart of a method for detecting the meaning of life proposed in one embodiment of the present application; Figure 2 is a schematic diagram of generating a fusion vector in one embodiment of the present application; Figure 3 is a schematic diagram of a device for detecting the meaning of life proposed in one embodiment of the present application; Figure 4 FIG. 1 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0018] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0019] It should be understood that references throughout this specification to "one embodiment" or "an embodiment" mean that a particular feature, structure, or characteristic associated with the embodiment is included in at least one embodiment of the present application. Therefore, the appearances of "in one embodiment" or "in an embodiment" throughout this specification do not necessarily refer to the same embodiment. Furthermore, these particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0020] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0021] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with certain aspects as detailed herein.

[0022] It should be noted that, unless there is any conflict, the embodiments and features in the embodiments of this application can be combined with each other.

[0023] Social media platforms, due to their openness and high frequency of information release, have become an important data source for studying individual psychological states. This application pre-constructs a knowledge graph related to the sense of meaning in life and combines this structured knowledge graph with text data from social platforms to improve the ability of the meaning-in-life detection model to identify the sense of meaning in life and enhance the accuracy of the model's detection.

[0024] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments.

[0025] Figure 1 This is a flow chart of a method for detecting the meaning of life proposed in one embodiment of the present application. Figure 1 As shown, the method includes: S1: Construct a knowledge graph based on multiple scientific papers; the knowledge graph includes multiple triples related to the sense of meaning in life; each triple contains two entities and corresponding relationships; S2: Get text data for training; S3: Using the knowledge graph as background knowledge for a large language model, the large language model is used to generate a knowledge description text corresponding to the text data; the knowledge description text includes deep semantic information that reflects the life significance of the text data; S4: generating a synthetic text based on the text data and the knowledge description text, and converting the synthetic text into a corresponding fusion vector; S5: training a life meaning detection model based on the fusion vector; the life meaning detection model is constructed based on a long short-term memory network; S6: Detect the fusion vector generated based on social text through the trained life meaning detection model.

[0026] In this example, a knowledge graph related to the sense of meaning in life was pre-constructed based on multiple scientific papers. This knowledge graph contains multiple triples of entities related to the sense of meaning in life. Each triple consists of two entities and a relationship between them, reflecting the association between the two entities related to the sense of meaning in life.

[0027] In this embodiment, text data for training is obtained from a social platform, and a knowledge description text that can reflect the sense of meaning of life of the original text data is generated by a large language model based on the professional knowledge information provided by the knowledge graph. Specifically, the knowledge graph knowledge corpus background is input into the large language model, and the large language model is used to process each text data to generate a corresponding knowledge description text. The large language model analyzes the entities related to the sense of meaning of life in the text data based on the professional knowledge of the knowledge graph, and then obtains the entities and relationships related to the text data from the knowledge graph, and generates the corresponding knowledge description text based on this. Each text data is synthesized with the corresponding knowledge description text to obtain a synthesized text. The synthesized text comes from the text information of the social platform and the professional knowledge of the knowledge graph. The text on the social platform reflects the subjective experience of the individual, while the variables related to the sense of meaning of life extracted based on scientific literature are objective standards proven by previous studies.

[0028] The synthesized text is converted into a corresponding embedding vector (i.e., a fusion vector). The fusion vector is then used to train a sense of meaning in life detection model. The fusion vector constructs a comprehensive feature space, allowing the original text data to be supplemented with additional information from the knowledge graph, providing the sense of meaning in life detection model with more specialized domain knowledge. Furthermore, using the fusion vector to train the sense of meaning in life detection model can supplement the model with authoritative information sources, improve the model's ability to learn implicit emotional information from text, and enhance model performance and the accuracy of detection results. The trained sense of meaning in life detection model can accurately detect the sense of meaning in life using the fusion vector generated based on the text to be tested. In practical applications, the text to be tested is processed using a large language model to obtain the corresponding knowledge description text. The text to be tested and the corresponding knowledge description text are then synthesized and converted into a fusion vector. The fusion vector is input into the trained sense of meaning in life detection model to obtain the detection result.

[0029] In this embodiment, the fusion vector is used to train a sense of meaning in life detection model. This allows the model to not only detect meaning based on text data from social platforms but also learn from professional knowledge, improving the model's accuracy. Furthermore, the trained sense of meaning in life model can be combined with the knowledge graph to detect input text data, further improving the accuracy of the detection results.

[0030] As an implementation method of this application, a knowledge graph is constructed based on multiple scientific documents, including: According to the preset first keyword, a number of scientific papers related to the sense of meaning in life were retrieved; Perform triple extraction on all scientific literature to obtain initial triples; Perform cross-screening on all initial triplets; After cross-screening, the initial triples were deduplicated to obtain multiple triples related to the sense of meaning in life. Based on all triples related to the sense of meaning in life, an entity set and a relationship set are constructed to form a knowledge graph.

[0031] In one embodiment, a triple related to the sense of meaning in life is first constructed, namely, "head entity-relationship-tail entity". In this embodiment, based on the first keywords "meaning in life" and "meaningful life", a scientific article database is searched to obtain multiple relevant scientific documents. The retrieved scientific documents are sorted from high to low according to their relevance, and a certain number of scientific documents are screened out for extracting triples. In actual applications, the number of scientific documents extracted can be set according to actual needs. The more scientific documents screened out, the larger the number of triplets in the knowledge graph. In this embodiment, 500 scientific documents are finally screened out for triple extraction.

[0032] All selected scientific literature is formatted and triples are extracted. In one embodiment, the extraction is performed using the API (Application Programming Interface) of a large language model. Given that the scientific literature on the meaning of life contains a large amount of English data, a GPT (Generative Pre-trained Transformer) model, which is more suitable for processing English data, is used for triple extraction. The specific steps are as follows: (1) Define entity extraction function: Entities to be set include: "Time", "Place", "Person", "Country / Region", "Organization" and "Concept"; Set the instructions so that GPT can identify possible entities from scientific literature. The output requirements are as follows: 1) The output format is entity name:entity type; 2) Each output result is separated by a fixed symbol; 3) Only extract from the given sentences and do not summarize on your own; 4) The conceptual entity is complete.

[0033] (2) Define the relationship extraction function: 1) Give the entity a specific definition: ① Concepts: refers to concepts related to the meaning of life in the field of psychology, such as the meaning of life, value, health-related qualities, and people; 2) Give a specific definition of the relationship: ① Concept-Relation-Concept; ②Concept-is-concept; 3) Provide specific entity extraction examples.

[0034] For example: Value can be broken down into three main aspects: creativity, experience and attitude.

[0035] Output: Value is related to creation; Value is related to experience; Value is related to attitude; 4) Set instructions so that GPT can complete the relationship extraction task. The output requirements are as follows: The output format is: {head entity h}-{relation r}-{tail entity t}; Each two output results are separated by a fixed symbol; Only extract from the given sentences and do not summarize on your own.

[0036] In this embodiment, the initial triples extracted from the original scientific literature are saved in a txt file and translated into Chinese. An example of the triples is shown in Table 1 below.

[0037] Table 1

[0038] The converted triples need to undergo cross-screening, deduplication and other data cleaning operations before they can be used to build a knowledge graph. After cross-screening and deduplication, the entity set and relationship set are constructed based on the triples that are finally retained, which facilitates the subsequent retrieval of the corresponding embedding vectors. The knowledge graph is constructed based on the triples that are finally retained, the entity set, and the relationship set. In order to facilitate the later training of the sense of life detection model, in this embodiment, all triples are also divided into three parts: training set, test set and validation set, and stored in the knowledge graph for model training.

[0039] In this embodiment, in the knowledge graph finally generated, the division of each data set is specifically shown in Table 2 below.

[0040] Table 2

[0041] In this embodiment, duplicate removal is performed on the triples after cross-screening. Specifically, new triples formed by swapping the positions of the head and tail entities in a triple are removed. The resulting entity set includes 1027 entities, and the relationship set includes 33 types of relationships. The 33 relationships in the relationship set are: related, predict, related, enhance, promote, constitute, regulate, stimulate, associate, involve, influence, provide, improve, enhance, originate from, predict, increase, lead to, strengthen, enhance, pass through, reduce, improve, reduce, alleviate, stimulate, generate, help, limit, depend on, adjust, accelerate, and may destroy.

[0042] In one embodiment, 11,187 triples are extracted according to the above-mentioned extraction method. Furthermore, the extracted triples are further summarized through a large language model to reduce redundant data, save computing resources spent on subsequent entity matching, and improve matching efficiency. Specifically, prompt words are constructed, and these triples are further summarized based on the prompt words through the API service qwen-plus of the Qianwen base model. In actual applications, the number of summarization operations is determined as needed. It is worth noting that as the number of summarization operations increases, the granularity of information in the knowledge graph gradually becomes larger, and detailed information will be lost to a certain extent. Therefore, the number of summarizations can be determined based on the information granularity requirements, data maintenance costs, and entity matching efficiency. Optionally, the number of summarizations in this embodiment is set to 2.

[0043] In this embodiment, the process of an induction operation is as follows: (1) According to semantic similarity, each head entity is classified based on a similarity threshold to obtain multiple triple sets, where the triplets in each triple set share a semantic subject (i.e., the head entity); (2) Semantically classify all tail entities in the same triple set and assign a subcategory name to each type of tail entity; (3) For each type of tail entity, summarize all the triples corresponding to that type of tail entity into a representative triple that is semantically concise and accurately expressed. If there is only one triple corresponding to that type of tail entity, there is no need to summarize it and the original triple is retained directly.

[0044] In this embodiment, the knowledge graph is streamlined by summarizing triples and removing redundant data, and the number of triples in the knowledge graph is ultimately reduced to 2212.

[0045] As an embodiment of the present application, all initial triples are cross-screened, including: Remove triples containing entities with psychology terminology, abstract entities, and entities lacking objects; Remove triplets containing specific object groups; The triples to which entities with the second keyword belong and the triples to which entities without the second keyword belong but are related to the sense of meaning in life are retained.

[0046] In one embodiment, to ensure the accuracy of the knowledge graph, the initial triples converted to Chinese need to be cross-screened to remove some semantically inconsistent, duplicated, or missing data. The cross-screening is performed by two different large language models, and the specific screening rules are as follows: (1) Remove triples containing entities that contain psychological technical terms, are abstract, or lack objects. For example, meaning of life-relevance-mediating effect, meaning of life-relevance-human optimization and development, meaning of life-relevance-compensation, etc. (2) Since the knowledge graph constructed in this application is a general knowledge graph, it is necessary to remove triplets containing specific object groups. For example, meaning of life-related-chronic pain patients, positive emotions-related-elderly people, meaning of life-related-nurse experience, etc. (3) Retain entities that do not contain specific keywords (second keywords) but are related to the sense of meaning in life. For example, triples that do not contain the keyword "meaning of life" but are related to the sense of meaning in life, such as "negative emotions-related-sleep", "positive emotions-related-creativity", and "psychological needs-related-income", need to be retained.

[0047] In this example, the Kappa coefficient was used to measure the consistency of the cross-screening results to ensure the reliability of the triples retained by the cross-screening. Using SPSS analysis, k = 0.79, p < 0.001.

[0048] Optionally, the cross-screening operation can be performed by manual labeling. In one embodiment, the cross-screening is performed by multiple professionals with psychology backgrounds to perform 0 / 1 cross-screening, and the labeling results of all professionals are combined to determine the final screening result.

[0049] As an implementation method of the present application, after constructing entity sets and relationship sets based on all triples related to the sense of meaning in life to form a knowledge graph, the following is also included: According to the crawling cycle, popular keywords with a frequency greater than the frequency threshold are crawled from social platforms as new entities; Traversing all entities stored in the knowledge graph to obtain entities associated with the new entity; Generate a new triple based on the new entity and entities associated with the new entity in the knowledge graph; Add the new triple to the knowledge graph.

[0050] In one embodiment, the knowledge graph is expanded by regularly extracting frequently appearing keywords from social platforms and associating them with entities stored in the knowledge graph to form new triples. Due to the rapid development of the internet, buzzwords or new expressions may appear on social platforms. To improve the life meaning detection model's ability to understand buzzwords and other data on social platforms, frequently appearing popular keywords are captured from social platforms as new entities. These are then added to the knowledge graph through cross-screening, forming new triples with existing entities in the knowledge graph.

[0051] Specifically, according to the crawling cycle, popular keywords with a frequency greater than the frequency threshold are crawled from the social platform as new entities. Based on the new entities and the entities in the knowledge graph, new triples are generated through cross-labeling. The new triples include an entity generated by a popular keyword and an entity in the knowledge graph. The new triples are added to the knowledge graph for training the sense of life meaning detection model. In actual application, the crawling cycle and frequency threshold can be set as needed. In this embodiment, there is no restriction on the specific setting of the frequency threshold.

[0052] As an implementation method of the present application, after obtaining multiple triples related to the sense of meaning in life, the method further includes: Detecting whether there is an implicit relationship between any two entities in the knowledge graph whose distance is less than a distance threshold and who have no relationship by using at least two different large language models; Based on the detection results of each large language model, multiple entity pairs with implicit relationships are obtained; Generate supplementary triples based on each entity pair and the corresponding implicit relationship; The supplementary triples are added to the knowledge graph.

[0053] In one embodiment, the hidden relationships between entities in different triples in the knowledge graph are further mined to expand the knowledge graph, so that the life meaning detection model can learn richer fusion information in the subsequent training process, thereby improving the model's detection performance. Specifically, a first prompt word is constructed, and the massive prior knowledge of the large language model is used to further explore whether there are implicit relationships between entities in different triples in the knowledge graph. The mining process is as follows: (1) For any two entities in the knowledge graph whose distance is less than a distance threshold (for example, a distance threshold of 5) and which have no relationship, different large language models are queried based on the first prompt word to determine whether there is a relationship between the two entities. In this embodiment, the large language models used to mine deep implicit relationships include: ChatGPT-4o model, Llama3.2 model, and ChatGLM model. In actual applications, the distance threshold and the specific large language model used can be specified as needed, and this application does not limit this; (2) For each entity pair mined by the large language model that may have an implicit relationship, it is necessary to further determine whether the implicit relationship exists. In this embodiment, the judgment results of all large language models are summarized, and the entity pairs for which more than half of the large language models output the result of "there is an implicit relationship" are determined to be entity pairs with an implicit relationship; (3) For entity pairs with implicit relationships, new triples are formed and added to the knowledge graph.

[0054] In this embodiment, whether there is an implicit relationship between entities of different triples in the original knowledge graph is further explored. For entity pairs with implicit relationships, new triples are formed to expand the knowledge graph, thereby injecting more professional domain knowledge into the subsequent training and application of the sense of meaning in life detection model, and further improving the accuracy of the model in detecting the sense of meaning in life.

[0055] As an implementation method of the present application, the knowledge graph is used as background knowledge of a large language model, and the knowledge description text corresponding to the text data is generated by the large language model, including: Dividing the text data into a plurality of text blocks based on the user; Inputting each text block and the knowledge graph into the large language model, and obtaining entities and relationships matching the text block from the knowledge graph through the large language model; wherein the relationships include: relationships between entities, and relationships between entities and sense of meaning in life; The matching entities and relationships of the text block are processed by the large language model to generate text that reflects the life significance of the text block as the knowledge description text corresponding to the text block.

[0056] In one embodiment, text data from multiple users is obtained from a social platform and divided into text blocks based on the user. In actual application, the number of characters contained in the text block must be less than the upper limit of the number of characters that can be processed by the large language model to avoid information loss.

[0057] Each user's text block is input into the large language model. Based on the background knowledge provided by the knowledge graph, the large language model analyzes the text block and extracts the entities and relationships that match the text block. Notably, the relationships captured by the large language model include those between entities and between entities and the sense of meaning in life. The large language model then generates a knowledge description text that reflects the sense of meaning in life for the text block based on the entities and relationships that match it.

[0058] The text blocks are then combined with the corresponding knowledge description text to generate synthesized text. The synthesized text is then converted into corresponding embedding vectors (i.e., fusion vectors) to serve as training data for the sense of life detection model.

[0059] As an implementation of the present application, obtaining entities and relationships matching the text block from the knowledge graph using the large language model includes: Traversing the knowledge graph using the large language model to determine whether each entity in the knowledge graph exists in the text block, and whether each entity in the knowledge graph is semantically similar to an entity in the text block; Entities existing in the text block and entities with similar semantics to the entities in the text block are taken as candidate entities; The large language model is used to determine the relationship between candidate entities and the relationship between candidate entities and the sense of meaning of life, and to generate corresponding ternary relationship groups.

[0060] In one embodiment, the COT (Chain of Thought) method is adopted, with the knowledge graph as background knowledge, and a large language model is used to perform three-step reasoning to obtain matching entities. Considering that the triples in the knowledge graph constructed in the embodiment of this application are Chinese text, the large language model adopts the Qwen3 model, which is more suitable for Chinese reasoning. The knowledge graph is pre-inputted into the large language model as background knowledge corpus, which serves as the knowledge basis for analyzing and deducing entities and relationships that match the text data. Then, the matching entities are obtained according to the following steps: The first step is to infer which entities in the knowledge graph match the user's text block. The prompt word and the text block are fed into the large language model. The large language model uses the knowledge graph as a basis and traverses each entity in the graph to identify all entities that match the user's text block as candidate entities, generating an entity set E = {e1, e2, ...en}. The second step is to infer the direct relationship between each candidate entity in the entity set E, as well as the relationship between each candidate entity and the sense of meaning of life, and obtain the relationship set R = {r1, r2, ..rn}; The third step is to combine the entity set E and the relationship set R into triples, resulting in a set of multiple triples T = {(h1, r1, t1), (h2, r2, t2), …, (hn, rn, tn)}, where h represents the head entity in the triple, t represents the tail entity in the triple, and r represents the relationship between the head and tail entities. It is worth noting that during the integration process, multiple triples may be generated based on a single text block, depending on the actual situation.

[0061] In this embodiment, pre-built prompt words are used to guide the large language model to traverse and reason about the knowledge graph based on the information of the knowledge graph. The content of the constructed prompt words is as follows: You are an assistant with a psychology background. Please refer to the following "Sense of Meaning in Life Knowledge Map" to complete the Weibo content analysis task: Knowledge Graph {kg_text}

Task Weibo

[0062] Step 2: Relationship Extraction Based on the entities identified in the previous step, analyze the potential relationships between them, especially the relationship with "sense of meaning in life", and reason based on the relationships in the knowledge graph.

[0063] Step 3: Triple integration Please integrate the above entities and their relationships into structured triple expressions and explain how they are related to the sense of meaning in life.

[0064] Figure 2 FIG. 1 is a schematic diagram of generating a fusion vector in an embodiment of the present application. Figure 2 As shown, each user's text block is input into a large language model that has learned a knowledge graph. The knowledge graph and large language model are then used to infer the entities and relationships that match the text block. After obtaining the entities and relationships that match the text block, the large language model is further used to process these entities and relationships to generate corresponding knowledge description text. Because this knowledge description text is based on the entities and relationships that match the text block, it can well reflect the life significance of the text block. Based on this, the original text block is synthesized with the corresponding knowledge description text to produce a synthesized text. This synthesized text is then converted into a vector using the BERT (Bidirectional Encoder Representations from Transformers) model to produce a fused vector.

[0065] The following uses a Weibo text from the Weibo platform as an example. Consider a user's Weibo text: "I helped a classmate review, and he actually bought me a cup of milk tea. I'm so happy!" According to the method for generating a fusion vector provided in the above embodiment, a fusion vector is generated by following the steps below: (1) Input the microblog text into the large language model SentenceBert with the knowledge graph as the background knowledge base to obtain the entities and relationships that match the microblog text: Entity 1: "Helping classmates review" → The large language model matches the entity "respectful activity" in the knowledge graph; Entity 2: "Bought a cup of milk tea" → The large language model analysis judges that it may imply an "emotional experience of being respected" or "emotional experience of being recognized"; (2) Extract relations from matched entities: The two entities "Respected Activities" and "Recognized Emotional Experience" have a "promotion" relationship, i.e., helping classmates review (respected activities) → promotion → being bought milk tea (recognized emotional experience). Combined with the knowledge graph, "respected activities" can promote "meaningful life," and this recognized experience further enhances the user's sense of meaning in life. (3) Integrate entities and relationships into triples: Triad 1: (helping classmates review, promoting, meaningful life); Triad 2: (buying milk tea, enhanced, sense of meaning in life); (4) Based on the integrated triples, the knowledge is interpreted and summarized as follows: This microblog reflects that the user has gained a positive emotional experience of being recognized by helping others, which may indirectly enhance their sense of meaning in life. Based on this, the large language model generates knowledge description text: By participating in “respectful activities” (helping classmates review), users received positive feedback (buying milk tea), and thus felt the meaning and value of life.

[0066] (5) The original text block is synthesized with the knowledge description text to obtain the synthesized text. The synthesized text is converted into an embedding vector using the BERT model to obtain a fusion vector.

[0067] It is worth noting that if no entities and relationships matching the user's text data are obtained, the corresponding knowledge description text is missing, that is, there is no corresponding second target vector.

[0068] This example utilizes a large language model, using the knowledge graph as background knowledge corpus, to reason about text data, generating knowledge descriptions that embody the text's sense of life. Compared to the traditional approach of segmenting text data and then matching entities based on the segmented words, this example uses a large language model to match entities and relationships across the entire text block. This allows for the complete transfer of relevant entities and relationships from the knowledge graph to the text's semantics, avoiding the omission of entities with similar semantics to the text block, thereby improving the accuracy of the detection model.

[0069] In one embodiment, the sense of life meaning detection model is built based on LSTM (Long Short-Term Memory) networks. LSTM models can effectively handle long-term dependencies in sequences and dynamically adjust stored content based on changes in input data. This makes them ideal for long-term user-posted text updates on social platforms. By continuously adjusting memory and information flow, LSTM models can understand the deeper meaning of input text.

[0070] Before training the model with the fusion vectors, the dataset is partitioned on a per-user basis, dividing the target dataset into a first training set and a first test set. The NumPy matrix G of the fusion vectors for each user is saved as an independent file, named in the format of "user ID number + subscale scores of the three dimensions of the sense of meaning in life + username", e.g., "1345454230+25+20+27+Zhang San.npy". This naming convention provides the true labels for the LSTM model, i.e., the sense of meaning in life questionnaire scores for each user.

[0071] In this embodiment, the fusion vector is a three-dimensional vector. After inputting the fusion vector into the model, the LSTM model treats it as a time series, where the three dimensions are regarded as different time series, time steps, and the feature dimensions at each time step respectively. LSTM updates its internal state by selectively discarding or adding information through a gating mechanism. The gating of LSTM captures important information in the input features through a series of calculations based on the input feature dimensions of the time series, while forgetting unimportant information.

[0072] During the training process, the fusion vector propagates forward through the various layers of the LSTM to calculate the predicted sense of meaning in life value. The model evaluates the difference between the predicted value and the true label by calculating the loss value, and updates the weights using the backpropagation algorithm based on the loss value. The gradient with respect to each parameter is calculated through the chain rule, which indicates the impact of each parameter on the final loss. Based on the calculated gradients, the weights are adjusted through an optimization algorithm. The output performance of the model is improved through iterative training, and the weights of the output layer are adjusted during the training process to minimize the error between the predicted value and the actual label. When the LSTM model has processed all the input sequences, a final hidden state is generated, which reflects the important information in the sequence. Subsequently, this hidden state is passed through a fully connected layer to an activation function, and finally the intensity value of the sense of meaning in life is output.

[0073] The detection result output of the sense of meaning in life detection model is the intensity value of the sense of meaning in life, ranging from [-1, 1]. The intensity value of the sense of meaning in life represents the intensity of the sense of meaning in life. The closer this value is to -1, the lower the sense of meaning in life; the closer it is to 1, the stronger the sense of meaning in life.

[0074] In this embodiment, the sense of meaning in life detection model maps the important features in the fusion vector to the level of the sense of meaning in life, enabling the model to better capture relevant information in the Weibo text and the knowledge graph and output a more accurate sense of meaning in life score.

[0075] Based on the same inventive concept, an embodiment of the present application provides a sense of meaning in life detection device. Refer to Figure 3 , Figure 3 which is a schematic diagram of the sense of meaning in life detection device 100 proposed in an embodiment of the present application. As Figure 3 As shown, the device includes: A construction module 101 is configured to construct a knowledge graph based on a plurality of scientific papers; the knowledge graph includes a plurality of triples related to a sense of meaning in life; each triple contains two entities and corresponding relationships; and convert all entities and relationships in the knowledge graph into embedding vectors; The acquisition module 102 is configured to acquire text data for training; The fusion module 103 is configured to use the knowledge graph as background knowledge for a large language model, generate a knowledge description text corresponding to the text data through the large language model, wherein the knowledge description text includes enhanced semantic information reflecting the life significance of the text data; generate a synthetic text based on the text data and the knowledge description text, and convert the synthetic text into a corresponding fusion vector; A training module 104 is configured to train a life meaning detection model based on the fusion vector; the life meaning detection model is constructed based on a long short-term memory network; The detection module 105 is configured to detect the fusion vector generated based on the social text through the trained life meaning detection model.

[0076] As an embodiment of the present application, the construction module 101 is configured to construct a knowledge graph based on multiple scientific documents, including: According to the preset first keyword, a number of scientific papers related to the sense of meaning in life were retrieved; Perform triple extraction on all scientific literature to obtain initial triples; Perform cross-screening on all initial triplets; After cross-screening, the initial triples were deduplicated to obtain multiple triples related to the sense of meaning in life. Based on all triples related to the sense of meaning in life, an entity set and a relationship set are constructed to form a knowledge graph.

[0077] As an embodiment of the present application, after obtaining a plurality of triples related to the sense of meaning in life, the construction module 101 is further configured to perform the following steps: Detecting whether there is an implicit relationship between any two entities in the knowledge graph whose distance is less than a distance threshold and who have no relationship by using at least two different large language models; Based on the detection results of each large language model, multiple entity pairs with implicit relationships are obtained; Generate supplementary triples based on each entity pair and the corresponding implicit relationship; The supplementary triples are added to the knowledge graph.

[0078] As an embodiment of the present application, the construction module 101 is configured to perform cross-screening on all initial triples, including: Remove triples containing entities with psychology terminology, abstract entities, and entities lacking objects; Remove triplets containing specific object groups; The triples to which entities with the second keyword belong and the triples to which entities without the second keyword belong but are related to the sense of meaning in life are retained.

[0079] As an embodiment of the present application, after constructing an entity set and a relationship set based on all triples related to the sense of meaning in life to form a knowledge graph, the construction module 101 is further configured to perform the following steps: According to the crawling cycle, popular keywords with a frequency greater than the frequency threshold are crawled from social platforms as new entities; Traversing all entities stored in the knowledge graph to obtain entities associated with the new entity; Generate a new triple based on the new entity and entities associated with the new entity in the knowledge graph; Add the new triple to the knowledge graph.

[0080] As an embodiment of the present application, the fusion module 103 is configured to use the knowledge graph as background knowledge of the large language model and generate knowledge description text corresponding to the text data through the large language model, specifically including: Dividing the text data into a plurality of text blocks based on the user; Inputting each text block and the knowledge graph into the large language model, and obtaining entities and relationships matching the text block from the knowledge graph through the large language model; wherein the relationships include: relationships between entities, and relationships between entities and sense of meaning in life; The matching entities and relationships of the text block are processed by the large language model to generate text that reflects the life significance of the text block as the knowledge description text corresponding to the text block.

[0081] As an embodiment of the present application, the fusion module 103 is configured to obtain entities and relationships matching the text block from the knowledge graph using the large language model, specifically including: Traversing the knowledge graph using the large language model to determine whether each entity in the knowledge graph exists in the text block, and whether each entity in the knowledge graph is semantically similar to an entity in the text block; Entities existing in the text block and entities with similar semantics to the entities in the text block are taken as candidate entities; The large language model is used to determine the relationship between candidate entities and the relationship between candidate entities and the sense of meaning of life, and to generate corresponding ternary relationship groups.

[0082] Based on the same inventive concept, an embodiment of the present application provides a computer program product. The computer program product includes a computer program, which, when executed by a processor, implements the steps of the method for detecting the sense of meaning of life as described in any of the above embodiments of the present application.

[0083] Based on the same inventive concept, an embodiment of the present application provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the method for detecting the sense of meaning of life as described in any of the above embodiments of the present application are implemented.

[0084] Based on the same inventive concept, an embodiment of the present application provides an electronic device, referring to Figure 4 , Figure 4 Schematic diagram of an electronic device according to one embodiment of the present application. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When executed by the processor, the computer program implements the steps of the method for detecting the sense of meaning of life as described in any of the above embodiments of the present application.

[0085] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0086] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

[0087] For the sake of simplicity, the method embodiments are described as a series of action combinations. However, those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and components involved are not necessarily required by this application.

[0088] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0089] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0090] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0091] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0092] Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the underlying inventive concepts. Therefore, this application is intended to include the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0093] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.

[0094] The above is a detailed introduction to the method and device for detecting the sense of meaning of life provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for detecting a sense of meaning in life, characterized in that: include: Constructing a knowledge graph based on multiple scientific papers; the knowledge graph includes multiple triples related to the sense of meaning in life; wherein each triple contains two entities and corresponding relationships; Get text data for training; The knowledge graph is used as background knowledge for a large language model, and a knowledge description text corresponding to the text data is generated through the large language model; the knowledge description text includes: deep semantic information that reflects the life meaning of the text data; generating a synthetic text based on the text data and the knowledge description text, and converting the synthetic text into a corresponding fusion vector; Training a life meaning detection model based on the fusion vector; the life meaning detection model is constructed based on a long short-term memory network; The fusion vector generated based on social text is detected through the trained life meaning detection model.

2. The method for detecting the sense of meaning of life according to claim 1, wherein: Build a knowledge graph based on multiple scientific papers, including: According to the preset first keyword, a number of scientific papers related to the sense of meaning in life were retrieved; Perform triple extraction on all scientific literature to obtain initial triples; Perform cross-screening on all initial triplets; After cross-screening, the initial triples were deduplicated to obtain multiple triples related to the sense of meaning in life. Based on all triples related to the sense of meaning in life, an entity set and a relationship set are constructed to form a knowledge graph.

3. The method for detecting the sense of meaning of life according to claim 2, wherein: After obtaining multiple triplets related to the sense of meaning in life, it also includes: Detecting whether there is an implicit relationship between any two entities in the knowledge graph whose distance is less than a distance threshold and who have no relationship by using at least two different large language models; Based on the detection results of each large language model, multiple entity pairs with implicit relationships are obtained; Generate supplementary triples based on each entity pair and the corresponding implicit relationship; The supplementary triples are added to the knowledge graph.

4. The method for detecting the sense of meaning of life according to claim 2, wherein: Perform a cross-screening of all initial triplets, including: Remove triples containing entities with psychology terminology, abstract entities, and entities lacking objects; Remove triplets containing specific object groups; The triples to which entities with the second keyword belong and the triples to which entities without the second keyword belong but are related to the sense of meaning in life are retained.

5. The method for detecting the sense of meaning of life according to claim 2, wherein: After constructing entity sets and relationship sets based on all triples related to the sense of meaning in life to form a knowledge graph, it also includes: According to the crawling cycle, popular keywords with a frequency greater than the frequency threshold are crawled from social platforms as new entities; Traversing all entities stored in the knowledge graph to obtain entities associated with the new entity; Generate a new triple based on the new entity and entities associated with the new entity in the knowledge graph; Add the new triple to the knowledge graph.

6. The method for detecting the sense of meaning of life according to claim 1, wherein: Using the knowledge graph as background knowledge for a large language model, and generating a knowledge description text corresponding to the text data through the large language model includes: Dividing the text data into a plurality of text blocks based on the user; Inputting each text block and the knowledge graph into the large language model, and obtaining entities and relationships matching the text block from the knowledge graph through the large language model; wherein the relationships include: relationships between entities, and relationships between entities and sense of meaning in life; The matching entities and relationships of the text block are processed by the large language model to generate text that reflects the life significance of the text block as the knowledge description text corresponding to the text block.

7. The method for detecting the sense of meaning of life according to claim 6, wherein: Obtaining entities and relationships matching the text block from the knowledge graph using the large language model includes: Traversing the knowledge graph using the large language model to determine whether each entity in the knowledge graph exists in the text block, and whether each entity in the knowledge graph is semantically similar to an entity in the text block; Entities existing in the text block and entities with similar semantics to the entities in the text block are taken as candidate entities; The large language model is used to determine the relationship between candidate entities and the relationship between candidate entities and the sense of meaning of life, and to generate corresponding ternary relationship groups.

8. A device for detecting the meaning of life, characterized in that: Used to perform the method according to any one of claims 1 to 7, comprising: A construction module is configured to construct a knowledge graph based on a plurality of scientific papers; the knowledge graph includes a plurality of triples related to the sense of meaning in life; wherein each triple contains two entities and corresponding relationships; an acquisition module, configured to acquire text data for training; a fusion module configured to use the knowledge graph as background knowledge for a large language model, generate a knowledge description text corresponding to the text data through the large language model, wherein the knowledge description text includes enhanced semantic information reflecting the life significance of the text data; generate a synthetic text based on the text data and the knowledge description text, and convert the synthetic text into a corresponding fusion vector; A training module is configured to train a sense of life meaning detection model based on the fusion vector; the sense of life meaning detection model is constructed based on a long short-term memory network; The detection module is configured to detect the fusion vector generated based on the social text through the trained sense of life detection model.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps in the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Large language model training method based on knowledge graph

    CN120069087A

  • Knowledge graph construction method and device based on large language model, equipment and storage medium

    CN120087461A

  • Knowledge graph-combined brilliance large-scale model culture knowledge generation and retrieval method

    CN120256644A

  • Training method for natural language processing model, and text processing method and apparatus

    US20250190704A1

Cited By

  • Data analysis method, device and equipment

    CN121351977A