Artificial intelligence-based knowledge graph construction method and system for plate products
By using artificial intelligence-based methods in the construction of plate product knowledge graphs, the problem of inaccurate identification of entity association information in traditional methods is solved, and a more accurate knowledge graph construction is achieved.
Patent Information
- Application Number
- CN202411734583.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-11-29
AI Technical Summary
When building knowledge graphs of sheet products, traditional methods find it difficult to accurately identify and represent the associated information between entities, especially when dealing with complex and diverse knowledge texts, the lack of effective constraint mechanisms leads to incorrect entity relationships or omitting important relationships.
Using an artificial intelligence-based method, by determining the fusion text window in the knowledge text of the sheet product, digging out text structure representation information and text semantic representation information, and using probability distribution to match these information to improve the recognition accuracy of entity-related information.
By limiting the randomness of entity-related information and improving the accuracy of entity-relationship recognition, a more accurate knowledge graph is built, which can better reflect the internal logic of the knowledge system of the sheet product.
Smart Images

Figure CN119226532B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing, and in particular, to a method and system for constructing a knowledge graph of plate products based on artificial intelligence. Background Art
[0002] With the increasing number of sheet metal products, the increasing application scenarios and the continuous development of related technologies, a large amount of sheet metal product knowledge information needs to be effectively organized and managed. As an effective form of knowledge organization and representation, knowledge graph plays an important role in knowledge management in various fields. However, there are many technical difficulties in constructing sheet metal product knowledge graphs. Traditional knowledge graph construction methods often find it difficult to accurately identify and represent the association information between entities. In the field of sheet metal product knowledge, the relationships between entities are complex and diverse, such as the relationship between the material and performance of the sheet metal, the relationship between the use of the sheet metal and the applicable environment, etc. These relationships not only depend on the definition of the entity itself, but are also affected by many factors such as the structure and semantics of the knowledge text. Due to the complexity and diversity of the knowledge text, the association information between entities is highly random. Traditional methods lack an effective constraint mechanism when dealing with this randomness and cannot accurately measure the possibility of association information between different entities. This makes it easy to introduce erroneous entity relationships or omit important relationships when constructing the knowledge graph, thereby affecting the accurate reflection of the knowledge graph on the sheet metal product knowledge system. Summary of the invention
[0003] The purpose of the present invention is to provide a method and system for constructing a knowledge graph of plate products based on artificial intelligence. The present invention is implemented as follows:
[0004] In the first aspect, the present invention provides a method for constructing a knowledge graph of a plate product based on artificial intelligence, comprising: determining a fused text window including multiple entities in a plate product knowledge text; mining the text structure representation information of the fused text window, and mapping the text structure representation information into multiple text structure representation information probability distributions associated one-to-one with multiple entity relationship prior tags; mining the text semantic representation information of each of the entity relationship prior tags, and mapping the text semantic representation information into a text semantic representation information probability distribution corresponding to the entity relationship prior tags; determining, among the multiple text semantic representation information probability distributions associated one-to-one with the multiple entity relationship prior tags, a text semantic representation information probability distribution corresponding to the text structure representation information probability distribution; using the entity association information corresponding to the entity relationship prior tag corresponding to the corresponding text semantic representation information probability distribution as the entity association information between the multiple entities; constructing a knowledge graph of a plate product based on the multiple entities and the corresponding entity association information;
[0005] In a second aspect, the present invention provides a computer system comprising: one or more processors; a memory; one or more computer programs; wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and when the one or more computer programs are executed by the processors, the method as described above is implemented.
[0006] Beneficial effects of the present invention: The scheme of the present invention is based on constructing text structure representation information that satisfies the probability distribution and text semantic representation information of entity relationship prior markings that satisfies the probability distribution, and limits the randomness of entity association information between entities in the knowledge text to the probability distribution, so as to measure the matching of entity association information between text structure representation information and text semantic representation information. In this way, the accuracy of entity association information recognition can be improved according to the matching results, and a more accurate knowledge graph can be obtained based on this construction. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 It is a flow chart of a method for constructing a knowledge graph of plate products based on artificial intelligence provided by an embodiment of the present invention;
[0008] Figure 2 It is a schematic diagram of the composition of a computer system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0009] The execution subject of the method for constructing a knowledge graph of plate products based on artificial intelligence in the embodiment of the present invention is a computer system, including but not limited to a server, a personal computer, a laptop, a tablet computer, a smart phone, etc. Figure 1 As shown, the method comprises the following steps:
[0010] Step S100: determining a fused text window including multiple entities in a sheet material product knowledge text.
[0011] In an embodiment of the present invention, the board product knowledge text refers to text content containing various types of information related to the board product, such as text descriptions of the material, specifications, uses, production processes, etc. of the board. Entity refers to an object or concept that has independent meaning in these knowledge texts. For example, in the board product knowledge text, "plywood", "environmental protection grade E1", "interior decoration", etc. can all be entities. The text window is the text area where the entity is located, which defines the specific text range related to a certain entity. The fused text window is the result of a fusion operation on the text areas where multiple entities are located. This fusion can be an intersection or union operation.
[0012] The computer system analyzes the knowledge text of the board product and identifies the entities that may exist therein, such as rule-based entity recognition algorithms and machine learning-based entity recognition algorithms (such as support vector machines, neural networks, etc.). Taking the rule-based entity recognition algorithm as an example, suppose some rules are set. For example, for the text describing the material of the board, if specific words such as "solid wood" and "artificial board" appear, they will be recognized as entities representing the material of the board. After identifying each entity, the computer system determines the text window where these entities are located. For each entity, the determination of its text window may be related to factors such as the grammatical structure and semantic information of the text. For example, from the perspective of grammatical structure, an entity may be located in the subject position in a sentence, then this sentence may constitute part of the text window of this entity; from the perspective of semantic information, if an entity is semantically closely related to certain surrounding words, then the area where these related words are located may also be included in the text window of this entity.
[0013] After determining the text windows of each entity, the computer system will merge the text windows of multiple entities located in the same text sentence or adjacent text sentences to obtain a merged text window. The same text sentence or adjacent text sentences here are judged based on the structure and semantic coherence of the text. For example, if "plywood" and "interior decoration" are mentioned in a sentence at the same time, then the text windows of these two entities can be merged to form a merged text window; or if two sentences are closely related in semantics and contain the two entities "environmental protection grade E1" and "plywood" respectively, then the text windows of these two entities can also be merged.
[0014] This fusion operation, when building a knowledge graph of board products, the relationship between multiple entities often needs to be mined and analyzed within a relatively concentrated text range. The fused text window provides a suitable text context for the subsequent mining of the relationship between entities, which helps to more accurately identify the associated information between entities. For example, if you want to analyze the relationship between "plywood" and "interior decoration", after merging the text windows where they are located, the computer system can comprehensively consider various information in the text within this fused text range, such as information describing the applicability and usage of plywood in interior decoration, so as to more accurately determine the relationship between them.
[0015] At the same time, in the process of determining the fusion text window, the computer system also considers how to deal with noise and ambiguity in the text. For example, there may be some modifiers in the text that are not closely related to the entity or words with multiple meanings. This requires the computer system to filter out the noise through certain algorithms and determine the accurate meaning of the words according to the context. For example, in the sentence "This plywood has beautiful colors and is suitable for interior decoration", "the color is beautiful" may be relatively minor information for the relationship between "plywood" and "interior decoration". When determining the fusion text window, the computer system needs to be able to recognize this and focus on the part of the text that is more closely related to the entity. In addition, when determining the fusion text window, factors such as the format and encoding of the text can also be considered. Different text formats (such as plain text, HTML format, etc.) and encoding methods (such as UTF-8, GBK, etc.) affect the recognition of the entity and the determination of the text window. The computer system uniformly processes texts of different formats and encodings in order to accurately determine the fusion text window. For example, if the plate product knowledge text is in HTML format, the computer system first parses the HTML tags, extracts the text content, and then performs entity recognition and text window confirmation operations.
[0016] Step S200: mining the text structure representation information of the fused text window, and mapping the text structure representation information into a plurality of text structure representation information probability distributions associated one by one with a plurality of entity relationship prior tags.
[0017] As mentioned above, the fused text window is a text range obtained by performing a fusion operation (such as intersection or union) on the text areas where multiple entities are located in the sheet product knowledge text. This range contains information related to multiple entities and is the basis for subsequent mining work.
[0018] Text structure representation information is a quantitative representation of the structural features of the text contained in the fused text window. The computer system mines text structure representation information in order to understand the connection between text content and entity relationships from a structural level. For example, for a fused text window containing entities such as "plywood" and "interior decoration", the structural features of the text may include the length of the sentence, the order of the components in the sentence (such as subject, predicate, object, etc.), the distribution of words of different parts of speech, etc.
[0019] In order to mine text structure representation information, computer systems can use a variety of technical means. One feasible method is to use word vector technology. Word vector is a representation method that maps words in a text to a low-dimensional vector space, which can capture the semantic and grammatical relationship between words. For example, the two words "plywood" and "artificial board" may be close in the word vector space because they are semantically similar. The computer system can vectorize the words in the fused text window through pre-trained word vector models (such as Word2Vec, GloVe, etc.).
[0020] After obtaining the word vectors of the vocabulary, the computer system processes these word vectors to obtain text structure representation information. This may involve statistical analysis of the word vectors, such as calculating the mean, variance, covariance and other statistics of the word vectors. These statistics can reflect some structural characteristics of the text. For example, the mean of the word vector can represent the central position of the text in the vector space, and the variance can reflect the degree of dispersion of the vocabulary in the vector space.
[0021] After mining the text structure representation information, the computer system maps it into multiple text structure representation information probability distributions that are associated with multiple entity relationship prior tags. The entity relationship prior tags here are pre-defined tags that correspond to the possible relationships between entities. For example, for the knowledge graph of sheet products, there may be entity relationship prior tags such as "used for", "made of...", and "having..." attributes. Probability distribution is a mathematical concept that describes the probability law of random variable values. In this context, the probability distribution of text structure representation information refers to the probability distribution of text structure representation information under different entity relationship prior tags. The computer system maps the text structure representation information into a probability distribution in order to describe the connection between the text structure and the entity relationship in a probabilistic way. In order to achieve this mapping, the computer system can use some technical means based on probability models. For example, it can be assumed that the text structure representation information obeys a certain probability distribution (such as Gaussian distribution), and then the distribution parameters are determined by methods such as maximum likelihood estimation. Assume that the text structure representation information vector is X, and assume that it obeys Gaussian distribution ,in, is the mean vector, is the covariance matrix. For a given entity relationship prior tag k, we need to find the parameter that maximizes P(X|k) and , where P(X|k) is the probability distribution of the text structure representation information X under the entity relationship prior tag k.
[0022] This mapping can provide a probability-based measurement method for the subsequent determination of the relationship between entities. For example, if the probability distribution of the text structure representation information has a higher probability value in a certain area for the entity relationship prior marker "used for", it means that in this fused text window, there is a high probability that the relationship "used for" exists between entities. By mapping the text structure representation information into multiple probability distributions related to the entity relationship prior markers, the computer system can more comprehensively and accurately analyze the connection between the text structure and the entity relationship, thereby providing a more reliable basis for constructing the knowledge graph of plate products.
[0023] At the same time, in this process, the computer system also considers how to deal with complex structures and uncertainties in the text. For example, the sentences in the fused text window may have complex nested structures, or there may be some ambiguous expressions. The computer system handles these situations through appropriate algorithms to ensure that the mined text structure representation information and the mapped probability distribution can accurately reflect the entity relationship. For example, a hierarchical processing method can be used to first analyze the basic structure of the sentence, and then gradually process the nested structure; for ambiguous expressions, semantic disambiguation can be performed in combination with contextual information, and then word vector processing and probability distribution mapping can be performed.
[0024] In addition, different entity relationship prior markers may have different requirements and preferences for text structure. For example, a relationship such as "made of..." may focus more on the relative position and relationship of the words representing materials and products in the text, while a relationship such as "having the attributes of..." may focus more on the connection between the words representing the attributes and the entities. The computer system adjusts the way of mining text structure representation information and mapping probability distribution according to the characteristics of different entity relationship prior markers. For example, for a relationship such as "made of...", the probability distribution of the sentence structure in which the words representing materials are in the subject position and the words representing products are in the object position can be analyzed in detail; for a relationship such as "having the attributes of...", the probability distribution of the modification relationship between the words representing the attributes and the entity in the text structure can be analyzed in detail.
[0025] Step S300: mining the text semantic representation information of each entity relationship prior mark, and mapping the text semantic representation information into the probability distribution of the text semantic representation information of the corresponding entity relationship prior mark.
[0026] In an embodiment of the present invention, the entity relationship prior tag is a pre-set tag used to identify the type of relationship that may exist between entities. For example, in the construction of the knowledge graph of sheet products, a relationship such as "sheet metal is made of a certain material" can be represented by a specific entity relationship prior tag; "sheet metal is suitable for a certain scene" will also have a corresponding tag. These tags provide a classification basis for computer systems to analyze relationships between entities. Text semantic representation information aims to quantitatively describe entity relationship prior tags from a semantic perspective. For computer systems, understanding the semantics of text is a complex task. Semantics includes the meaning of words and the overall meaning they convey when combined. Taking the sheet metal product knowledge text as an example, if the entity relationship prior tag is "sheet metal has certain characteristics", then the text semantic representation information related to this tag may involve words that describe this characteristic, semantic connections between words related to sheet metal, etc.
[0027] In order to mine the text semantic representation information of entity relationship prior markers, computer systems can use a variety of technical means. One feasible method is based on a semantic knowledge base. The semantic knowledge base contains a large amount of semantic information of words, such as WordNet, which classifies words and defines the semantic relationships between words (such as synonyms, antonyms, hypernyms, hyponyms, etc.). The computer system can query the semantic knowledge base to obtain the semantic information of words related to the entity relationship prior markers, and combine this information to construct text semantic representation information.
[0028] Another technical approach is to use a semantic vector model. Similar to a word vector model, a semantic vector model maps semantic information to a vector space. The difference is that a semantic vector model focuses more on the semantic representation of vocabulary combinations. For example, a semantic vector model obtained by pre-training a large amount of text can convert the statement "board is suitable for interior decoration" into a semantic vector that can represent the semantic features of the prior labeling of this entity relationship.
[0029] After mining the text semantic representation information of each entity relationship prior tag, the computer system maps it into the probability distribution of the text semantic representation information corresponding to the entity relationship prior tag. Probability distribution is used here to describe the connection between text semantic representation information and entity relationship in the form of probability. From a mathematical point of view, if the text semantic representation information is Y, for a certain entity relationship prior tag k, we hope to find the probability distribution P(Y|k) of Y under this entity relationship prior tag. One possible method is to assume that Y obeys a certain distribution, such as a multivariate Gaussian distribution. ,in is the mean vector, is the covariance matrix.
[0030] The computer system can determine the parameters of this probability distribution through statistical analysis. For example, by collecting a large number of text semantic representation information samples related to the entity relationship prior tag k, calculating the mean and covariance of these samples, and estimating and . Assume there are n samples , then the mean vector , the covariance matrix .
[0031] This mapping of text semantic representation information into probability distribution provides a probability-based measure for determining whether a specific relationship exists between entities. For example, if the entity relationship is a priori labeled "a board is made of wood", when analyzing a fused text window, the probability distribution of the text semantic representation information obtained by the computer system has a higher probability value in a certain area, which indicates that there is a high probability that such a relationship exists between entities in this text.
[0032] Throughout the process, a word may have different semantics in different contexts. For example, the word "board" may refer to board in the knowledge of board products, but it may have different meanings in other contexts. The computer system accurately determines the semantics of the word according to the context, such as using context-sensitive semantic analysis technology, such as a model based on the attention mechanism, which can dynamically adjust the degree of attention to different words according to the context, so as to more accurately mine the text semantic representation information. Secondly, the combination of semantics is also a difficulty. The semantics of different words combined together is not a simple addition of lexical semantics. For example, the semantics of "environmentally friendly board" is not a simple combination of the semantics of "environmental protection" and "board", but also contains the deeper semantics that this board has environmentally friendly attributes. The computer system uses a suitable semantic combination model, such as recursive neural network (RNN) or its variants (such as LSTM, GRU) to deal with the problem of semantic combination, so as to accurately mine the text semantic representation information of the entity relationship prior label and map it into a reasonable probability distribution.
[0033] Step S400: Determine, among a plurality of text semantic representation information probability distributions associated one by one with a plurality of entity relationship prior tags, a text semantic representation information probability distribution corresponding to the text structure representation information probability distribution.
[0034] In an embodiment of the present invention, entity relationship prior markers are predefined markers corresponding to possible relationships between entities, which have been determined in the previous steps and are associated with the probability distribution of text semantic representation information. The probability distribution of text semantic representation information is the result obtained by the computer system after processing the text semantic representation information of each entity relationship prior marker, which describes the connection between the text semantic representation information and the entity relationship in the form of probability. Similarly, the probability distribution of text structure representation information is the result obtained by mapping the text structure representation information of the fused text window, reflecting the probabilistic connection between the text structure and the entity relationship. The computer system executes step S400 to establish a connection between the text structure representation information and the text semantic representation information so as to more accurately determine the relationship between entities. Because when constructing the knowledge graph of plate products, the structure and semantics of the text have an important influence on the judgment of entity relationships, and the probability distribution of these two representation information is a way to quantitatively describe entity relationships from different angles.
[0035] In order to determine the probability distribution of the text semantic representation information that corresponds to the probability distribution of the text structural representation information, the computer system compares the relationship between the two probability distributions. This is a complex process because the probability distribution is a description of the probability law of the value of a random variable, and comparing different probability distributions requires considering multiple factors.
[0036] For example, in the knowledge text of board products, suppose there are entities "plywood" and "interior decoration", and there is an entity relationship priori marked as "used for". For this mark, the computer system has obtained its text structure representation information probability distribution and text semantic representation information probability distribution. The text structure representation information probability distribution may reflect the probability connection between the sentence structure (such as the structural order of subject-predicate-object, etc.) and the relationship "used for" in the fused text window containing "plywood" and "interior decoration". For example, if in a large number of board product knowledge texts, when "plywood" is the subject and "interior decoration" is the object, and the middle predicate represents the "used for" relationship, this sentence structure appears frequently, then in this text structure representation information probability distribution, the area related to this structure will have a higher probability value. The text semantic representation information probability distribution is described from a semantic perspective. For example, it may take into account the functional characteristic vocabulary of "plywood", the scene-related vocabulary of "interior decoration" and the semantic connection between the relationship vocabulary "used for". If the semantic expression describing that "plywood" is suitable for interior decoration scenarios is more common, then in the probability distribution of the text semantic representation information, the area related to this semantics will have a higher probability value.
[0037] A possible technical means for a computer system to determine the correspondence between the two probability distributions is to calculate the similarity measure between them. For example, the KL divergence (Kullback-Leibler Divergence) can be used to measure the degree of difference between the two probability distributions. Alternatively, the cross-entropy (Cross-Entropy) can be used to measure the degree of difference between the two probability distributions. By calculating the similarity measure between the probability distribution of text semantic representation information corresponding to different entity relationship prior tags and the probability distribution of text structure representation information, the computer system can find the most similar (i.e., the smallest similarity measure) probability distribution of text semantic representation information, which is the probability distribution corresponding to the probability distribution of text structure representation information.
[0038] In addition, the computer system needs to consider the noise and uncertainty of the data when performing this step. In the actual knowledge text of board products, there may be inaccurate expressions, incomplete information or ambiguity. For example, for a statement such as "plywood can be used for interior decoration", some additional modifiers or changes in the way of expression may appear in some texts, which will affect the calculation of the probability distribution. The computer system uses some data preprocessing and cleaning techniques to reduce the impact of noise. For example, the text can be standardized to remove some unnecessary punctuation marks, stop words, etc., and some semantically similar expressions can be normalized.
[0039] At the same time, since the probability distribution is calculated based on sample data, the size and representativeness of the sample data will also affect the accuracy of the probability distribution. If the sample data is too small or not representative, the calculated probability distribution may not accurately reflect the real relationship. To solve this problem, the computer system can use data expansion technology, such as data synthesis, data transformation and other methods to increase the quantity and diversity of sample data. For example, the existing sheet product knowledge text can be subjected to synonym replacement, sentence structure transformation and other operations to generate more sample data, thereby improving the accuracy of probability distribution calculation.
[0040] After determining the probability distribution of text semantic representation information corresponding to the probability distribution of text structural representation information, the computer system can further use this correspondence to more accurately judge the relationship between entities, providing strong support for building an accurate knowledge graph of plate products.
[0041] Step S500: taking the entity association information corresponding to the entity relationship priori mark corresponding to the corresponding text semantic representation information probability distribution as the entity association information between multiple entities.
[0042] In the embodiment of the present invention, entity association information reflects the various connections between entities. In the context of constructing a knowledge graph of board products, these entity association information are crucial for accurately describing the relationships between board product-related entities. For example, in the board product knowledge text, there may be entity association information such as "used for" between the entities "plywood" and "interior decoration"; there may be entity association information such as "compliant" between the entities "artificial board" and "environmental protection standard E1". These entity association information helps to construct a complete knowledge graph of board products, so that the graph can accurately reflect the internal logical relationship of various aspects of board product knowledge.
[0043] The text semantic representation information probability distribution here is the result obtained by processing the text semantic representation information of the entity relationship prior marker in the previous step. Each text semantic representation information probability distribution is associated with a specific entity relationship prior marker. The computer system determines the text semantic representation information probability distribution corresponding to the text structure representation information probability distribution in step S400, and in step S500, the computer system selects the entity association information corresponding to the entity relationship prior marker corresponding to the determined text semantic representation information probability distribution.
[0044] In this process, the computer system can perform rule-based matching and index search. For rule-based matching, the computer system can pre-set some rules that define the mapping relationship between different entity relationship prior tags and entity association information. For example, a rule can be defined as: if the entity relationship prior tag is "used for", then the corresponding entity association information is the relationship between one entity and another entity. In terms of index search, the computer system can build an index table that stores the correspondence between entity relationship prior tags, text semantic representation information probability distribution, and entity association information. After the corresponding text semantic representation information probability distribution is determined, the corresponding entity association information can be quickly obtained by querying this index table.
[0045] The significance of the computer system executing step S500 is to accurately determine the association information between entities, which is the key to building a high-quality knowledge graph of sheet products. Accurate entity association information can enable the knowledge graph to better reflect the various logical relationships in the knowledge system of sheet products, thereby providing a reliable knowledge basis for subsequent applications. For example, in the production management of sheet products, if the knowledge graph can accurately represent the entity association information between different sheets and production processes, then the company can better optimize the production process; in the sales and marketing of sheet products, accurate entity association information can help sales staff better introduce the characteristics and applicable scenarios of sheet products to customers, thereby improving sales efficiency.
[0046] When processing complex board product knowledge text, there may be multiple associations between multiple entities. For example, "multi-layer plywood" can be "used for" "interior decoration" and may also "meet" "specific strength standards". Computer systems can accurately identify and distinguish these different entity association information to avoid confusion. Computer systems can further analyze the semantic and contextual information in the text. For example, semantic role labeling technology can be used to more accurately determine entity association information by analyzing the semantic roles in sentences (such as agent, patient, tool, etc.).
[0047] In addition, as the knowledge of sheet metal products is continuously updated and expanded, new entities and entity association information can continue to appear. The computer system has a certain degree of adaptive ability and can timely update and adjust the determination method of entity association information. For example, incremental learning technology can be used. When new sheet metal product knowledge text is added, the computer system can learn and integrate the new knowledge without retraining the entire model, thereby accurately determining the new entity association information.
[0048] Step S600: Construct a plate product knowledge graph based on multiple entities and corresponding entity association information.
[0049] Entities are the core elements in the knowledge graph. In the construction of the knowledge graph of board products, these entities cover all aspects related to board products, such as the type of board, the properties of the board, the purpose of the board, and the elements related to the production of the board. These entities each represent a specific concept or object and are the cornerstone of building a knowledge graph. Entity association information describes the relationship between entities. For example, for the entities "plywood" and "interior decoration", the association information may be "plywood is used for interior decoration", and this association information clarifies the specific connection between the two. When constructing a knowledge graph, the accuracy and completeness of entity association information are crucial because it determines whether the knowledge graph can accurately reflect the internal logic of the knowledge system of board products.
[0050] When a computer system constructs a knowledge graph of sheet products, it sorts and organizes multiple entities and corresponding entity association information. This may involve the selection and design of data structures. One feasible way is to use a graph structure, in which entities are nodes and entity association information is edges. For example, with "plywood" as one node, "interior decoration" as another node, and "used for" as the entity association information, the edge connecting the two nodes. This graph structure can well represent the complex relationship network between entities. When constructing a graph-structured knowledge graph, in order to ensure uniqueness, data cleaning and standardization techniques can be used. For example, if there are multiple expressions in the knowledge text to represent the same entity, unify them into a standard entity representation. Similar processing is also required for entity association information to ensure that the same relationship has a consistent expression.
[0051] The computer system also considers the expansibility of the knowledge graph. With the deepening of the research on sheet products and the continuous updating of knowledge, new entities and entity association information will continue to appear. Therefore, in the early stage of building the knowledge graph, the computer system must adopt an easily extensible architecture. For example, a hierarchical graph structure can be used to represent different types of entities and relationships in layers, so that when new entities or relationships are added, they can be easily added in the corresponding layer.
[0052] In order to better construct the knowledge graph, we can adopt the knowledge representation learning method. For example, we can map entities and entity association information into a low-dimensional vector space, so that we can use vector operations to represent the relationship between entities. , and the associated information R between them, and map them into vectors through knowledge representation learning technology. , and , there may be some functional relationship , this functional relationship can be used to measure the rationality of entity and association information in the vector space. By minimizing a loss function of this functional relationship (such as the mean square error loss function , where n is the number of samples), the computer system can learn more appropriate vector representations of entities and associated information, thereby optimizing the construction of the knowledge graph.
[0053] In addition, when constructing the knowledge graph of board products, the computer system also needs to consider how to use the existing knowledge graph or knowledge base for integration and supplementation. For example, if there is a general building material knowledge graph that contains some knowledge of board products, the computer system can integrate it with the knowledge graph of board products being constructed. This may involve technologies such as entity alignment and relationship fusion. For entity alignment, the computer system identifies entities that represent the same concept in two knowledge graphs. For example, "wood board" in the general building material knowledge graph and "solid wood board" in the board product knowledge graph may represent the same concept. The computer system determines whether they are the same entity by comparing the attributes and associated information of the entities. For relationship fusion, the computer system integrates different relationship descriptions of the same pair of entities in the two knowledge graphs. For example, one knowledge graph describes "plywood is used for furniture manufacturing" and the other knowledge graph describes "plywood is one of the materials for furniture manufacturing". The computer system reasonably integrates these relationships.
[0054] In the process of constructing the knowledge graph of sheet metal products, the computer system also conducts a quality assessment of the knowledge graph. The indicators of quality assessment may include entity coverage, relationship accuracy, and connectivity of the graph. Entity coverage indicates the coverage of the entities contained in the knowledge graph in the entire knowledge field of sheet metal products, which can be measured by calculating the ratio of the number of entities already included to the number of entities that should be included. Relationship accuracy refers to the accuracy of entity association information in the knowledge graph, which can be verified through manually annotated sample data. For example, some entity pairs and their associated information are randomly selected, and experts judge whether they are correct. The connectivity of the graph reflects the degree to which entities in the knowledge graph are connected to each other through relationships. A knowledge graph with good connectivity can more comprehensively reflect the internal logic of the knowledge system. By monitoring and optimizing these quality assessment indicators, the computer system can construct a high-quality knowledge graph of sheet metal products.
[0055] As an implementation manner, step S100, determining a fused text window including multiple entities in the sheet product knowledge text, may include:
[0056] Step S110: performing named entity recognition on the sheet product knowledge text to obtain a text window of each entity in the sheet product knowledge text;
[0057] Step S120: performing a fusion operation on the text windows of multiple entities located in the same text sentence or adjacent text sentences in the sheet material product knowledge text to obtain a fused text window including multiple entities.
[0058] In step S110, the computer system performs named entity recognition on the sheet product knowledge text to obtain a text window of each entity in the sheet product knowledge text. The computer system can use technical means such as rule-based methods, statistical machine learning methods, or deep learning methods. The rule-based method is to identify named entities by writing a series of rules.
[0059] The statistical machine learning method uses machine learning algorithms to learn entity patterns from a large amount of annotated corpus. For example, Support Vector Machine (SVM) can be used for named entity recognition. The computer system prepares a well-annotated plate product knowledge text corpus, in which each entity is marked as a corresponding category. Then, the features of the text are extracted, such as vocabulary features (whether it contains specific words), part-of-speech features (nouns, verbs, etc.), context features (information about the previous and next words), etc. Suppose there is a training set , where x i is a vector representing text features, is the corresponding entity category label. The goal of the support vector machine is to find a hyperplane , so that the interval between different categories is the largest, where w is the weight vector and b is the bias term. In the testing phase, for new sheet product knowledge text, the computer system extracts its feature vector and then predicts the entity category based on the trained model.
[0060] Deep learning-based methods, such as Bi-LSTM (Bidirectional Long Short-Term Memory) combined with Conditional Random Field (CRF), perform well in named entity recognition. Bi-LSTM can effectively process long sequence data and capture the contextual information of the text. CRF is used to post-process the output of Bi-LSTM to obtain the optimal label sequence. Specifically, Bi-LSTM encodes each word or term of the input sheet product knowledge text to obtain a hidden state representation. Then, CRF uses these hidden states to calculate the probability of each label and selects the most likely label sequence as the result of named entity recognition.
[0061] After identifying each entity, the computer system determines the text window corresponding to each entity. The determination of the text window is related to the position of the entity in the sentence and the scope of semantic relevance. For example, for the entity "solid wood board", if it is in the sentence "this solid wood board has good hardness and stability", then this sentence may constitute part of the text window of the entity "solid wood board". If there are some modifying phrases or clauses in the sentence that are closely related to the semantics of this entity, such as the "from high-quality wood" part in "this solid wood board from high-quality wood", it will also be included in the text window because it helps to more fully understand the relevant information of this entity.
[0062] In step S120, the computer system fuses the text windows of multiple entities in the same text sentence or adjacent text sentences in the board product knowledge text to obtain a fused text window including multiple entities. The judgment basis of the same text sentence or adjacent text sentences is the structure and semantic coherence of the text. From the perspective of text structure, if two entities are in the same sentence, they are closely connected in grammatical structure and are likely to have some relationship. The computer system can simply use this sentence as a fused text window, which contains information about the two entities and their relationship. From the perspective of semantic coherence, there may also be a close semantic connection between adjacent text sentences. For example, the previous sentence mentions that "this board has a high environmental protection level", where "this board" is an entity, and the next sentence says "it can be used to make furniture", where "it" refers to "this board" in the previous sentence. Although these are two sentences, they are semantically coherent, and the text windows of these two entities should also be fused. The computer system can judge this coherence through some semantic analysis techniques. A simple method is to calculate the semantic similarity between sentences. For example, we can use word embedding technology to convert words in a sentence into word embeddings, and then measure the semantic similarity between sentences by calculating the cosine similarity between vectors. If the semantic similarity between two adjacent sentences exceeds a certain threshold, they are considered to be semantically coherent, and the entity text windows in them can be fused.
[0063] When performing a fusion operation, the computer system can use multiple methods. One method is to directly take the union of multiple text windows. For example, if the text window of entity A is , the text window of entity B is , then the merged text window This method is simple and direct, but it can introduce some irrelevant information. Another method is to selectively fuse text windows based on the relationship between entities. For example, if there is a certain relationship between entity A and entity B, such as entity A is an attribute of entity B, then the computer system can focus on fusing the text part related to this relationship.
[0064] As an implementation manner, in step S200, mining text structure representation information of the fused text window may include:
[0065] Step S210: performing a word vector feature extraction operation on the fused text window to obtain an extracted word vector of the text in the fused text window;
[0066] Step S220: Aggregate the extracted word vectors to obtain text structure representation information of the fused text window.
[0067] In step S210, the computer system performs a word vector feature extraction operation on the fused text window to obtain an extracted word vector of the text in the fused text window. A word vector is a representation form that maps words in a text to a low-dimensional vector space, which can capture the semantic and grammatical information of the word.
[0068] When a computer system performs word vector feature extraction operations, it can use a variety of pre-trained word vector models, such as Word2Vec, GloVe, etc. Taking the Word2Vec model as an example, it is based on the principle of the neural network language model and learns the relationship between words through a large amount of text data. Word2Vec has two main architectures: CBOW (Continuous Bag-of-Words) and Skip-gram. In the CBOW architecture, the computer system predicts the target word based on the context words around the target word. Suppose there is a fused text window containing the sentence "Plywood is a commonly used board material used in furniture manufacturing." For the word "plywood", in the CBOW model, the computer system will use the surrounding words (such as "is", "a kind of", "commonly used", "board material", etc.) as input, and calculate the word vector corresponding to the word "plywood" through the neural network model. Specifically, let the input context word vector be , the weight matrix of the neural network is W, and the bias term is b, then the probability of predicting the target word y (here is "plywood") It can be calculated by the Softmax function: , where V is the size of the vocabulary, Representation vector The component corresponding to word y in . Through training with a large amount of text data, the model can learn the weight matrix W and bias term b that maximize this probability, thereby obtaining the word vector for each word.
[0069] The Skip-gram architecture, on the other hand, predicts the surrounding context words based on the target word. Similarly, for the word "plywood" in the above sentence, the Skip-gram model will take "plywood" as input and predict the surrounding words (such as "is", "a kind of", etc.). In this way, the model can also learn the word vector of the word. The GloVe (Global Vectors for Word Representation) model learns word vectors based on global word co-occurrence statistics. It builds a word co-occurrence matrix, where the element X_{ij} represents the number of co-occurrences of word i and word j in the text. Then, the computer system defines a loss function based on this co-occurrence matrix and learns the word vector by minimizing this loss function. Regardless of which word vector model is used, the computer system extracts word vector features for each word in the fused text window, and obtains a series of extracted word vectors. These word vectors contain information about the semantics and grammar of the words. For example, words with similar semantics will be closer in the vector space. For example, the word vectors of two board-related words, "plywood" and "particle board", may be relatively close in the vector space because they both belong to the concept of board.
[0070] In step S220, the computer system aggregates the extracted word vectors to obtain text structure representation information of the fused text window. The aggregation of word vectors is to rise from the word level to the text structure level, thereby obtaining a representation of the overall structural features of the fused text window.
[0071] A computer system can aggregate word vectors in many ways. One feasible way is to find the average vector. For example, suppose there are n words in the fused text window, and their corresponding word vectors are , then the text structure representation information vector V obtained by averaging is: This averaging method is simple and intuitive. It combines the information of each word to obtain a vector that can represent the average semantic and grammatical features of the entire fused text window. For example, in a fused text window about a sheet product, if there are words describing different aspects of the sheet, such as the material, purpose, and performance, the text structure representation information vector obtained by averaging the vector can comprehensively reflect these different aspects of information.
[0072] Another aggregation method is weighted summation. The computer system can assign different weights to words according to their importance in the text, and then sum them up to obtain the text structure representation information vector. For example, for some key words, such as words that represent the core attributes of the board (such as "environmental protection" and "high strength", etc.), higher weights can be assigned. Let the weight of word i be , then the text structure representation information vector V can be expressed as: This method can better highlight the contribution of important words to the representation of text structure information.
[0073] In addition to averaging and weighted summation, computer systems can also use more complex neural network structures for word vector aggregation. For example, a convolutional neural network (CNN) can be used. When processing image data, CNN extracts features by sliding convolution kernels on the image, and it is similar when processing word vector sequences. The computer system can regard the word vector sequence as a one-dimensional "image", extract features of different local areas by defining appropriate convolution kernels, and then aggregate information through pooling operations (such as maximum pooling or average pooling), and finally obtain the text structure representation information of the fused text window.
[0074] As an implementation mode, multiple entity relationship prior tags are associated one-to-one with multiple dense network components; based on this, in step S200, mapping the text structure representation information into multiple text structure representation information probability distributions associated one-to-one with the multiple entity relationship prior tags may include:
[0075] Step S230: For each entity relationship prior label, the following operations are performed: based on the dense network component corresponding to the entity relationship prior label, a linear transformation operation is performed on the text structure representation information to obtain the expectation of the text structure representation information corresponding to the entity relationship prior label and the independent variance vector of the text structure representation information;
[0076] Step S240: Generate a probability distribution of the text structure representation information corresponding to each entity relationship prior tag based on the expectation of the text structure representation information corresponding to each entity relationship prior tag and the independent variance vector of the text structure representation information.
[0077] In step S230, for each entity relationship prior tag, the computer system performs a linear transformation operation on the text structure representation information based on the dense network component (Dense Layer) corresponding to the entity relationship prior tag to obtain the expectation of the text structure representation information corresponding to the entity relationship prior tag, and the independent variance vector of the text structure representation information. Each neuron of the dense network component is connected to all neurons in the previous layer. Assuming that there is a text structure representation information vector X with a dimension of n, for a dense network component corresponding to a certain entity relationship prior tag, let its weight matrix be W (with a dimension of m×n) and the bias vector be b (with a dimension of m), then the result Y after linear transformation is: Y=WX+b. Here, Y is an intermediate result, which will serve as the basis for calculating the expectation and independent variance vector.
[0078] Taking the knowledge graph of sheet metal products as an example, assuming that there is an entity relationship prior tag "used for", the computer system performs the above linear transformation operation on the dense network component corresponding to this tag. If the text structure representation information vector X contains the structural information about the sheet metal and other related entities (such as scenes, processes, etc.) in the fused text window, after the linear transformation of the dense network component corresponding to the "used for" relationship, the result Y reflects to a certain extent the mapping relationship between the text structure representation information and the entity relationship prior tag "used for" under this specific neural network structure.
[0079] When calculating the expectation, for the obtained Y (assuming ),expect (dimension is m) is calculated as: , where s is the number of samples (this can be the number of samples used for calculation during training), is the result of linear transformation of the i-th sample. It represents the average result of linear transformation of text structure representation information under the entity relationship prior label of “used for”. It reflects, to a certain extent, a central trend between text structure representation information and this entity relationship prior label.
[0080] Independent variance vectors (diagonal covariance matrices) are calculated for each element in Y. is the jth element of the ith sample ( ), then the variance of the jth element is for: , independent variance vector , this independent variance vector describes the degree of discreteness of the text structure representation information after linear transformation under the entity relationship prior label of "used for".
[0081] In step S240, a probability distribution of the text structure representation information corresponding to each entity relationship prior tag is generated based on the expectation of the text structure representation information corresponding to each entity relationship prior tag and the independent variance vector of the text structure representation information.
[0082] The computer system may assume that the text structure representation information follows a multivariate Gaussian distribution after linear transformation. For a certain entity relationship prior label, the expectation of the text structure representation information obtained after step S230 is , the independent variance vector is , then the probability distribution P(X) of the text structure representation information corresponding to the entity relationship prior tag is: ; where m is the dimension of the vector, yes This probability distribution describes the distribution of text structure representation information under specific entity relationship prior tags in a probabilistic form.
[0083] Continuing with the knowledge graph of sheet metal products as an example, for the entity relationship prior label "used for", according to the calculated expectation and independent variance vectors The generated probability distribution P(X), if the text structure representation information X in a certain fused text window has a higher probability value under this probability distribution, it means that the text structure in this fused text window has a higher probability correlation with the entity relationship prior tag "used for". Similarly, for other entity relationship prior tags (such as "made of...", "having..." attributes", etc.), the computer system will also generate the corresponding text structure representation information probability distribution through steps S230-S240.
[0084] As an implementation mode, in step S300, mining the textual semantic representation information of each entity relationship prior label may include:
[0085] Step S310: The text loading module based on the text semantic reasoning component embeds each entity relationship priori tag into a one-bit effective code;
[0086] Step S320: Multiply the parameter array of the intermediate network module of the text semantic reasoning component with the one-bit effective code corresponding to each entity relationship prior tag to obtain the text semantic representation information of each entity relationship prior tag.
[0087] In step S310, the computer system embeds each entity relationship prior tag into a one-hot encoding based on the text loading module of the text semantic reasoning component. One-hot encoding is a simple and commonly used encoding method. In this encoding method, for a given plurality of categories (here, entity relationship prior tags), each category is represented as a vector, the length of the vector is equal to the total number of categories, only one element of which is 1, representing the category, and the rest of the elements are 0.
[0088] Taking the knowledge graph of sheet metal products as an example, assume that there are three entity relationship prior tags: "used for", "made of..." and "has the property of...". For the entity relationship prior tag "used for", the computer system embeds it as a one-bit valid code of [1, 0, 0] through the text loading module of the text semantic reasoning component; for "made of...", it is [0,1, 0]; for "has the property of...", it is [0, 0, 1]. The advantage of this encoding method is that it can clearly represent different entity relationship prior tags and is easy for the computer system to process in subsequent calculations. In actual implementation, the computer system can implement this encoding operation through a simple mapping rule, and determine the position of 1 in the encoding vector according to the index position of the entity relationship prior tag in the predefined tag set.
[0089] In step S320, the computer system multiplies the parameter array (for example, a weight matrix) of the intermediate network module of the text semantic reasoning component with the one-bit effective code corresponding to each entity relationship prior tag to obtain the text semantic representation information of each entity relationship prior tag.
[0090] The intermediate network module here is part of the text semantic reasoning component, and its parameter array (weight matrix) contains information related to semantic reasoning. Assuming that the weight matrix of the intermediate network module is W (dimension is m×n, where m and n depend on the design of the network structure), for a single-bit effective encoding e (dimension is n) of a certain entity relationship prior tag, the product result s (i.e., the text semantic representation information of the entity relationship prior tag) is: s=We.
[0091] For example, continuing with the entity relationship prior labeling in the above-mentioned sheet product knowledge graph, assuming that the weight matrix , for the one-bit effective encoding e=[1, 0, 0] of the entity relationship prior tag "used for", the text semantic representation information obtained by taking the product is . This result s actually performs a semantic mapping of the entity relationship prior tag "used for" according to the weight matrix of the intermediate network module. It converts the simple category representation of one-bit effective coding into a vector representation related to the network module. This vector contains the semantic information about the entity relationship prior tag in the entire semantic reasoning framework. For the two entity relationship prior tags "made of..." and "having..." attributes, the computer system will perform the same operation and obtain the corresponding text semantic representation information vectors respectively. The significance of these vectors is that they quantify the entity relationship prior tags from a semantic perspective, and different element values reflect the characteristics of the entity relationship prior tags in different semantic dimensions in the entire semantic reasoning framework. This representation method lays the foundation for the subsequent mapping of text semantic representation information into the probability distribution of text semantic representation information corresponding to the entity relationship prior tags.
[0092] In this process, the weight matrix W of the intermediate network module is obtained through pre-training. The computer system can use a large amount of annotated sheet product knowledge text data for training. For example, for each entity relationship prior tag and its corresponding text semantic information in the sample data, the computer system adjusts the weight matrix W so that the text semantic representation information obtained according to the above calculation can reflect the semantics of the entity relationship prior tag as accurately as possible. The training process may involve defining a loss function and using an optimization algorithm to minimize the loss function. For example, the mean squared error (MSE) can be used as the loss function, and the predicted text semantic representation information is assumed to be , the real text semantic representation information is , then the MSE loss function , where m is the dimension of the vector. By using optimization algorithms such as gradient descent, the weight matrix W is updated according to the loss function, and a suitable weight matrix W is obtained after multiple iterations, so that the text semantic representation information of each entity relationship prior label can be accurately calculated.
[0093] As an implementation manner, in step S300, mapping the text semantic representation information into a probability distribution of the text semantic representation information corresponding to the entity relationship prior label may include:
[0094] Step S330: performing a linear transformation operation on the text semantic representation information of the entity relationship prior labeling to obtain the expectation of the text semantic representation information and the independent variance vector of the text semantic representation information;
[0095] Step S340: Generate a probability distribution of text semantic representation information corresponding to the entity relationship prior labeling based on the expectation and the independent variance vector.
[0096] In step S330, the linear transformation operation in this context is a way to map text semantic representation information from the original vector space to another space, in order to obtain parameters that can describe its probability distribution characteristics. Assuming that the text semantic representation information vector of the entity relationship prior label is S (dimension is n), the computer system performs a linear transformation operation through a weight matrix A (dimension is m×n) and a bias vector b (dimension is m). Then the transformed result Y is: Y=AS+b.
[0097] For example, in the construction of the knowledge graph of sheet products, for the entity relationship prior label "used for", its text semantic representation information vector S may contain various semantic feature representations of the relationship "used for". After the above linear transformation, the obtained Y reflects another representation form related to the original text semantic representation information in the new vector space, which is the basis for calculating the expectation and independent variance vectors.
[0098] Please refer to the above content for the method of calculating the expectation and independent variance vector, which will not be repeated here.
[0099] In step S340, the computer system may assume that the text semantic representation information follows a multivariate Gaussian distribution after linear transformation. For a certain entity relationship prior label, the expectation of the text semantic representation information obtained after step S330 is , the independent variance vector is , then the probability distribution P(S) of the text semantic representation information corresponding to the entity relationship prior tag is: ; where m is the dimension of the vector, yes This probability distribution describes the distribution of text semantic representation information under a specific entity relationship prior label in a probabilistic form.
[0100] Taking the knowledge graph of sheet metal products as an example, for the entity relationship prior label “made of…”, the computer system obtains the expected and independent variance vectors After that, the probability distribution P(S) is generated. If the text semantic representation information S in a certain fused text window has a higher probability value under this probability distribution, it means that the text semantics in this fused text window has a higher probability correlation with the entity relationship prior tag "made of...". Similarly, for other entity relationship prior tags (such as "having the attribute of...", etc.), the computer system will also generate the corresponding text semantic representation information probability distribution through steps S330-S340.
[0101] In this process, the computer system may need to use some technical means to optimize parameters in order to accurately perform linear transformation operations and calculate probability distributions. For example, when calculating the weight matrix A and the bias vector b in the linear transformation, the backpropagation algorithm can be used to adjust these parameters. The backpropagation algorithm is based on the chain rule. It calculates the gradient of the loss function for each parameter and then updates the parameters according to the gradient to minimize the loss function. Assuming the loss function is L, for the elements in the weight matrix A , whose gradient It can be calculated by the back propagation algorithm, and then according to the learning rate To update the parameters: .
[0102] As an implementation manner, in step S400, determining the text semantic representation information probability distribution corresponding to the text structure representation information probability distribution may include:
[0103] Step S410: performing the following operations for each entity relationship priori tag among the multiple entity relationship prior tags: determining a commonality measurement result between a probability distribution of text semantic representation information corresponding to the entity relationship priori tag and a probability distribution of text structural representation information corresponding to the entity relationship priori tag;
[0104] Step S420: Determine the text semantic representation information probability distribution corresponding to the entity relationship priori tag with the largest commonality measurement result as the text semantic representation information probability distribution corresponding to the text structure representation information probability distribution.
[0105] In step S410, for each entity relationship prior marker among the multiple entity relationship prior markers, the computer system determines a commonality measurement result between a probability distribution of text semantic representation information corresponding to the entity relationship prior marker and a probability distribution of text structural representation information corresponding to the entity relationship prior marker.
[0106] The probability distribution of text semantic representation information and the probability distribution of text structure representation information here are the results obtained through a series of complex operations in the previous steps. Taking the construction of the knowledge graph of sheet metal products as an example, assuming that there is an entity relationship prior tag "for", for this tag, the computer system has obtained the probability distribution of its text semantic representation information and the probability distribution of text structure representation information.
[0107] Determining the commonality measure between the two probability distributions is a key operation. The commonality measure is intended to quantify the degree of similarity or correlation between the two different types of probability distributions representing information. Computer systems can use a variety of technical means to achieve this goal.
[0108] One possible technical approach is based on distance measurement. For example, a computer system can calculate a certain distance between two probability distributions as a commonality measurement result. Common distance measurement methods include Euclidean distance. and (Here x represents the value of a random variable), assuming is the probability distribution of the textual semantic representation information of the entity relationship prior tag “for”, is the probability distribution of the text structure representation information, and their Euclidean distance d is calculated as: The smaller the distance value, the greater the commonality between the two probability distributions, that is, they are more similar or related to some extent.
[0109] Another technical approach is based on information theory, such as mutual information. Mutual information measures the mutual dependence between two random variables. Let I(X;Y) represent the mutual information between the probability distribution X of the text semantic representation information and the probability distribution Y of the text structural representation information. Its calculation formula is: , where P(x,y) is the joint probability distribution of X and Y, and P(x) and P(y) are the marginal probability distributions of X and Y, respectively. The larger the value of mutual information, the greater the commonality between the two probability distributions and the closer the association between them.
[0110] For each entity relationship prior tag, the computer system must calculate the commonality measurement result between the probability distribution of text semantic representation information and the probability distribution of text structure representation information through the above or similar technical means. This process helps the computer system find the probability distribution of text semantic representation information that best matches the probability distribution of text structure representation information among many entity relationship prior tags.
[0111] In step S420, the computer system determines the probability distribution of text semantic representation information corresponding to the entity relationship priori tag with the largest commonality measurement result as the probability distribution of text semantic representation information corresponding to the probability distribution of text structure representation information. In the previous step S410, the computer system has calculated the commonality measurement result corresponding to each entity relationship priori tag. Continuing with the knowledge graph of sheet products as an example, if there are entity relationship priori tags "used for", "made of..." and "having..." attributes, the computer system calculates the commonality measurement results between their text semantic representation information probability distribution and text structure representation information probability distribution respectively. Assume that after calculation, the commonality measurement result corresponding to the entity relationship priori tag "used for" is the largest. Then the computer system will determine that the probability distribution of text semantic representation information corresponding to the entity relationship priori tag "used for" is the probability distribution of text semantic representation information corresponding to the probability distribution of text structure representation information. This determination process establishes an association between text structure representation information and text semantic representation information, which is based on their commonality in probability distribution. By finding this association, the computer system can better integrate information from two different angles (structure and semantics), thereby providing a more reliable basis for the subsequent accurate determination of the relationship between entities.
[0112] As an implementation manner, in step S410, determining the commonality measurement result between the probability distribution of the text semantic representation information corresponding to the entity relationship prior mark and the probability distribution of the text structural representation information corresponding to the entity relationship prior mark may include:
[0113] Step S411: performing multiple Monte Carlo sampling on the probability distribution of text semantic representation information to obtain a sampled text semantic representation information set consisting of multiple sampled text semantic representation information;
[0114] Step S412: performing multiple Monte Carlo sampling on the probability distribution of the text structure representation information to obtain a sampled text structure representation information set consisting of multiple sampled text structure representation information;
[0115] Step S413: determining the commonality measurement result between the sampled text semantic representation information set and the sampled text structural representation information set as the commonality measurement result between the text semantic representation information probability distribution and the text structural representation information probability distribution.
[0116] In step S411, the computer system performs multiple Monte Carlo sampling on the probability distribution of the text semantic representation information to obtain a sampled text semantic representation information set consisting of multiple sampled text semantic representation information.
[0117] Monte Carlo sampling is a statistical method based on random simulation. In this scenario, for a given probability distribution of text semantic representation information, the computer system performs random sampling according to this probability distribution. Assume that the probability distribution of text semantic representation information is P(S), where S represents the text semantic representation information vector (this vector contains the quantitative representation of semantic information related to the prior labeling of entity relationships).
[0118] Taking the knowledge graph of sheet metal products as an example, assuming that the prior label of the entity relationship "used for" is a multivariate Gaussian distribution, the probability distribution of its textual semantic representation information P(S) is a multivariate Gaussian distribution. The computer system performs sampling according to the characteristics of this distribution. Specifically, for the multivariate Gaussian distribution (where m is the dimension of vector S, is the mean vector, is the covariance matrix), the computer system can use the random number generation function in some numerical computing libraries (such as NumPy) combined with the parameters of this distribution to generate sampling samples.
[0119] Assume that N samplings are performed, and each sampling results in a vector , these sampled vectors s_i constitute the sampled text semantic representation information set Each element in this set represents a possible semantic representation randomly extracted from the probability distribution of text semantic representation information.
[0120] Step S412 is similar to step S411. For the probability distribution of text structure representation information, the computer system also uses the Monte Carlo sampling method. Assume that the probability distribution of text structure representation information is P(X), where X represents the text structure representation information vector (this vector contains the quantitative representation of the structural information of the fused text window).
[0121] For example, for the entity relationship prior tag "for", if its text structure representation information probability distribution P(X) is also a multivariate Gaussian distribution (assuming that for the sake of simplicity, it is also a multivariate Gaussian distribution, but in actual situations it may be a different distribution form obtained according to specific structural characteristics), the computer system samples according to the parameters of this distribution. Suppose that M samplings are performed, and each sampling obtains a vector , these sampled vectors This constitutes the sampled text structure representation information set Each element in this set represents a possible structural representation randomly extracted from the probability distribution of text structural representation information.
[0122] In step S413, when determining the commonality measurement result, the computer system can use a variety of methods. One method is to calculate the distance measurement between the elements in the two sets. For example, for the sampled text semantic representation information set and sampled text structure representation information set , we can calculate each With each The Euclidean distance between , then the Euclidean distance between them for: .
[0123] These distances can then be statistically analyzed to obtain a measure of commonality. For example, the average distance , this average distance can be used as a measure of the commonality between the two probability distributions. The smaller the average distance, the greater the commonality between the two sets, which means that the greater the commonality between the probability distribution of text semantic representation information and the probability distribution of text structure representation information.
[0124] Another method is based on correlation measurement. The computer system can calculate the correlation coefficient between the sampled text semantic representation information set and the sampled text structural representation information set, such as the Pearson Correlation Coefficient. and elements in the sampled text structure representation information set , let their means be and , then the calculation formula of Pearson correlation coefficient r is: ; The value of the Pearson correlation coefficient r is between -1 and 1. The closer the value of r is to 1, the stronger the positive correlation between the two sets, that is, the greater the commonality between the probability distribution of the text semantic representation information and the probability distribution of the text structure representation information; the closer the value of r is to -1, the stronger the negative correlation; r=0 means there is almost no linear correlation. In practical applications, computer systems can select appropriate commonality measurement methods based on specific needs and data characteristics. For example, if the distribution of data is more in line with the normal distribution and it is hoped to measure the overall distance relationship, the average distance of the Euclidean distance may be a suitable choice; if you pay more attention to the linear relationship between the two sets, the Pearson correlation coefficient may be more appropriate.
[0125] If the numerical ranges of the dimensions of the text semantic representation information vector and the text structure representation information vector are very different, it may have an unreasonable impact on the distance measure or correlation measure. For example, if the numerical range of a dimension of a vector is between 0 and 1, and the numerical range of the corresponding dimension of another vector is between 0 and 1000, then when calculating the Euclidean distance, the dimension with a large numerical range may dominate the distance calculation result. Therefore, before calculating the commonality measure, the computer system may need to normalize the data so that the values of different dimensions are within a relatively uniform range. In addition, when processing complex sheet product knowledge graphs, the probability distribution of text semantic representation information and the probability distribution of text structure representation information corresponding to different entity relationship prior tags may have different characteristics. For example, for the entity relationship prior tag "made of...", its text semantic representation information may focus more on the semantic connection between raw materials and products, while the text structure representation information may be related to the sentence structure describing the manufacturing process; for the entity relationship prior tag "having the attribute of...", its text semantic representation information is more related to the semantic expression of the attribute, and the text structure representation information may be related to structural factors such as the position of the attribute description in the sentence. The computer system reasonably selects and adjusts the calculation method of the commonality measurement based on these different characteristics to ensure that the commonality measurement results between the probability distribution of text semantic representation information and the probability distribution of text structure representation information corresponding to different entity relationship prior tags can be accurately determined.
[0126] As an implementation manner, in step S413, before determining the commonality measurement result between the sampled text semantic representation information set and the sampled text structure representation information set as the commonality measurement result between the text semantic representation information probability distribution and the text structure representation information probability distribution, the method may further include:
[0127] Step S413a: fusing any sampled text semantic representation information in the sampled text semantic representation information set with any sampled text structural representation information in the sampled text structural representation information set to obtain a plurality of sampled representation information tuples;
[0128] Step S413b: determining the feature difference between the sampled text semantic representation information and the sampled text structural representation information in each sampled representation information tuple;
[0129] Step S413c: determining the commonality measurement results of the feature differences and reverse associations with the plurality of sampled representation information tuples, and determining the commonality measurement results between the sampled text semantic representation information set and the sampled text structural representation information set.
[0130] In step S413a, the computer system performs a fusion operation on any sampled text semantic representation information in the sampled text semantic representation information set and any sampled text structural representation information in the sampled text structural representation information set to obtain a plurality of sampled representation information tuples.
[0131] Taking the knowledge graph of sheet metal products as an example, assuming that the information set of sampled text semantic representation is It is obtained by Monte Carlo sampling the probability distribution of the text semantic representation information of the entity relationship prior tag "for", where is a vector representing a sampled text semantic representation information. Similarly, the sampled text structure representation information set It is obtained by sampling the probability distribution of the text structure representation information of the entity relationship prior label. The vector represents the sampled text structure representation information.
[0132] When a computer system performs a fusion operation, it can use a variety of methods. For example, directly connecting two vectors into a new vector, for example, and , the fused vector , here will All elements of are placed in front. All the elements of are placed at the back to form a new longer vector. Through this operation, for each and every By fusion, we can get multiple sampling representation information binary groups ,in Indicated by and The purpose of this fusion operation is to combine the text semantic representation information and the text structure representation information so as to analyze the relationship between them later.
[0133] In step S413b, the computer system determines the feature difference (eg, distance) between the sampled text semantic representation information and the sampled text structural representation information in each sampled representation information binary.
[0134] Continuing with the above example, for each sample representation information tuple , since it is composed of and The computer system can calculate and The distance between them is used to represent the feature difference between them. Here, Euclidean distance can be used for calculation.
[0135] In addition to Euclidean distance, computer systems can also use other distance metrics, such as Manhattan distance. This distance metric calculates the sum of the absolute values of the differences between corresponding elements of a vector, which may be more suitable for describing feature differences in some cases, especially when the features of the data have different importance in different dimensions or are unevenly distributed.
[0136] In step S413c, the computer system determines the commonality measurement results of the feature differences and reverse associations with the plurality of sampled representation information tuples, and determines them as the commonality measurement results between the sampled text semantic representation information set and the sampled text structural representation information set.
[0137] After calculating the feature difference (such as distance) of each sampled information pair ) Then, the computer system calculates the sum of all these feature differences. This sum D reflects the overall feature difference between the semantic representation information of all sampled texts and the structural representation information of the sampled texts. The commonality measurement result is inversely related to the sum D of this feature difference. For example, the commonality measurement result can be defined as ,in is a very small positive number, which is used to avoid the situation where the denominator is zero. In this way, when D is smaller, that is, the overall feature difference between the semantic representation information of the sampled text and the structural representation information of the sampled text is smaller, the commonality measurement result G is larger, indicating that the commonality between the two sets is greater; conversely, when D is larger, the commonality measurement result G is smaller, indicating that the commonality between the two sets is smaller.
[0138] This method of calculating the commonality measurement results has certain rationality. By comprehensively considering the feature differences between the text semantic representation information and the text structural representation information in each sampled representation information tuple, the relationship between the two sets can be more comprehensively reflected. For example, in the knowledge graph of plate products, if the overall feature difference between the sampled text semantic representation information and the sampled text structural representation information is small for the entity relationship prior label "used for", then under this entity relationship, the consistency between the semantics and structure of the text is high, which helps the computer system to determine that in this case, there is a high commonality between the probability distribution of the text semantic representation information and the probability distribution of the text structural representation information.
[0139] As an implementation manner, in step S500, after taking the entity association information corresponding to the entity relationship priori mark corresponding to the corresponding text semantic representation information probability distribution as the entity association information between multiple entities, the method may further include:
[0140] Step S5001: obtaining the number of covered characters of each fused text window in the plate product knowledge text, and arranging each fused text window in descending order according to the number of covered characters to obtain an arrangement sequence;
[0141] Step S5002: Arrange the plurality of fused text windows at the front of the arrangement sequence in descending order according to the commonality measurement result; wherein the commonality measurement result is used to determine entity association information between the plurality of entities in the fused text window;
[0142] Step S5003: Entity association information between multiple entities in the front fused text window is used as attribute information of the plate product knowledge text.
[0143] In step S5001, the computer system obtains the number of covered characters of each fused text window in the plate product knowledge text, and arranges each fused text window in descending order according to the number of covered characters to obtain an arrangement sequence.
[0144] For the knowledge text of board products, the fused text window is a text area that contains multiple entities and their related information. The number of covered characters is the number of characters contained in each fused text window. For example, in a knowledge text about board products, there are the following fused text windows: fused text window A contains "Plywood is a commonly used board with good strength and stability, and is often used in furniture manufacturing and interior decoration." It is calculated that the number of covered characters is 80; fused text window B contains "Particleboard has a low density and is suitable for making some furniture that has weight requirements." The number of covered characters is 45.
[0145] The computer system uses a character counting algorithm to obtain the number of covered characters of each fused text window. After obtaining the number of covered characters of all fused text windows, they are arranged from large to small (in descending order). Assuming that there are other fused text windows C, D, etc., the arrangement sequence obtained after calculation and arrangement may be: fused text window A (80 characters), fused text window C (60 characters), fused text window B (45 characters), fused text window D (30 characters), etc. The significance of this arrangement order is that fused text windows with a larger number of covered characters may contain richer and more comprehensive information about entities and their relationships. Giving them a priority order will help to more accurately mine and determine important information in the knowledge graph of plate products in the future.
[0146] In step S5002, the commonality measurement result is an indicator used in the previous step to measure the relationship between the probability distribution of text semantic representation information and the probability distribution of text structure representation information, which reflects the credibility or rationality of the entity association information in the fused text window. For example, for fused text window A, the commonality measurement result obtained by the previous calculation is 0.8; for fused text window C, the commonality measurement result is 0.7.
[0147] According to these commonality measurement results, the front fused text windows in the arrangement sequence (for example, the first three: fused text window A, fused text window C, fused text window B) are arranged again. After arranging from large to small (in descending order) according to the commonality measurement results, a new sequence may be obtained: fused text window A (commonality measurement result 0.8), fused text window B (commonality measurement result 0.7), fused text window C (commonality measurement result 0.6). This arrangement method further screens and optimizes the order of fused text windows, so that those fused text windows that not only cover more characters but also have higher credibility of entity association information (larger commonality measurement results) are arranged in front.
[0148] In step S5003, the computer system uses the entity association information between the multiple entities in the front fused text window as the attribute information of the plate product knowledge text.
[0149] In the previous step S5002, the fused text window has been sorted twice, and the fused text window in the front is considered to be a more valuable source of information. For example, the entities "plywood" and "furniture manufacturing" are included in the sorted fused text window A, and its entity association information is "plywood is commonly used in furniture manufacturing". The computer system uses this entity association information as the attribute information of the board product knowledge text. Similarly, for the entities "particle board" and "furniture with weight requirements" in the fused text window B, the entity association information "particle board is suitable for making furniture with weight requirements" is also used as attribute information.
[0150] The computer system can use data storage technology to store these attribute information in order to construct a knowledge graph of plate products. For example, these attribute information can be stored in a relational database, with entities as nodes and entity association information as edges, to build the basic framework of the knowledge graph of plate products. During the storage process, for each entity and entity association information, the corresponding table structure and fields can be defined. For example, create a "plate entity table" containing fields such as "plate name" and "plate type"; create an "entity association information table" containing fields such as "associated entity 1", "association relationship", "associated entity 2", etc., and store the attribute information extracted from the fused text window according to this structure.
[0151] In this process, the computer system considers some factors to ensure the accuracy and effectiveness of the operation. In step S5001, when calculating the number of characters covered by the fused text window, it is necessary to accurately handle the possible effects of punctuation, special characters and different encoding methods. For example, if UTF-8 encoding is used, the computer system accurately identifies the number of characters according to the corresponding encoding rules to avoid character number calculation errors caused by encoding problems. In step S5002, the accuracy of the commonality measurement results is crucial to the final determination of the attribute information of the plate product knowledge text. If there is a deviation in the calculation of the commonality measurement results, such as insufficient sample data or inaccurate calculation model, the arrangement order of the fused text window may be wrong. In order to improve the accuracy of the commonality measurement results, the computer system can use more sample data for training and calculation, or optimize the model structure for calculating the commonality measurement results. For example, a more complex deep learning model can be used to improve the measurement accuracy of the relationship between the probability distribution of text semantic representation information and the probability distribution of text structure representation information. In step S5003, when storing entity association information as attribute information, attention should be paid to the consistency and integrity of the data. If there are multiple fused text windows with different descriptions of the same entity relationship, the computer system performs data integration and deduplication operations. For example, if one fused text window says "plywood is suitable for furniture manufacturing" and another says "plywood can be used in furniture production", the computer system recognizes that the two descriptions actually express the same entity association relationship and integrates them into a unified attribute information.
[0152] In addition, as the knowledge of sheet products is continuously updated and new text data is added, the computer system periodically re-executes steps S5001-S5003 to update the attribute information of the sheet product knowledge text to ensure the accuracy and completeness of the knowledge graph. For example, when new research results or market dynamics about sheet products are added to the knowledge text, a new fusion text window will be created, and the computer system will recalculate the number of covered characters, commonality measurement results, etc., and re-determine the attribute information, so that the knowledge graph can reflect the latest sheet product knowledge in a timely manner.
[0153] As an implementation method, the entity association information reasoning component for determining entity association information between multiple entities in the fused text window includes a text structure reasoning component, a text semantic reasoning component, and a sample comparison component. On this basis, in step S100, after determining that the fused text window includes multiple entities in the sheet product knowledge text, the method may also include a training process for the entity association information reasoning component, including:
[0154] Step S1001: Obtain a first learning sample and a second learning sample for calibrating the entity association information reasoning component; wherein the first learning sample includes a fused text window sample and an actual entity relationship prior mark of the fused text window sample, and the second learning sample includes a fused text window sample and an irrelevant entity relationship prior mark of the fused text window sample, and the actual entity relationship prior mark and the irrelevant entity relationship prior mark constitute an entity relationship prior mark set;
[0155] Step S1002: performing a first feedforward calculation on the fused text window sample in the text structure reasoning component, and performing a second feedforward calculation on the actual entity relationship prior marking in the first learning sample in the text semantic reasoning component;
[0156] Step S1003: performing feedforward calculation on the calculated value of the first feedforward calculation and the calculated value of the second feedforward calculation in a sample comparison component to obtain a first commonality measurement result of the fused text window sample and the actual entity relationship priori mark;
[0157] Step S1004: performing a third feedforward calculation on the fused text window sample in the text structure reasoning component, and performing a fourth feedforward calculation on the irrelevant entity relationship prior marking in the second learning sample in the text semantic reasoning component;
[0158] Step S1005: performing feedforward calculation on the calculated value of the third feedforward calculation and the calculated value of the fourth feedforward calculation in the sample comparison component to obtain a second commonality measurement result of the fused text window sample and the unrelated entity relationship priori mark;
[0159] Step S1006: Update the first commonality measurement result and the second commonality measurement result by gradient descent in the entity association information reasoning component to determine the parameter update amount of the entity association information reasoning component when the calibration error value is the lowest, and iterate the parameters of the entity association information reasoning component according to the parameter update amount.
[0160] In step S1001, the first learning example includes a fused text window example and an actual entity relationship prior label of the fused text window example. For example, in the board product knowledge text, there is a fused text window example "This plywood has high strength and is suitable for furniture manufacturing." Here, "plywood" and "furniture manufacturing" are entities, and "suitable for" is the actual entity relationship prior label. This actual entity relationship prior label is based on the annotation of the real relationship between the entities in this fused text window.
[0161] The second learning example includes the fused text window example and the irrelevant entity relationship prior tags of the fused text window example. Still taking the above fused text window as an example, the irrelevant entity relationship prior tag may be "made of...", because in this text, there is no such relationship between plywood and furniture manufacturing. The actual entity relationship prior tags in these two learning examples and the irrelevant entity relationship prior tags constitute an entity relationship prior tag set. The computer system obtains these learning examples through manual annotation or from an existing high-quality annotation data set.
[0162] In step S1002, the computer system performs a first feedforward calculation on the fused text window sample in the text structure reasoning component, and performs a second feedforward calculation on the actual entity relationship prior mark in the first learning sample in the text semantic reasoning component. In the text structure reasoning component, for the fused text window sample, it will analyze and calculate the text structure features therein. Assuming that the text structure reasoning component adopts a neural network structure, it can encode and calculate information such as the word order and sentence structure in the fused text window. For example, for the fused text window "This plywood has high strength and is suitable for furniture manufacturing.", the text structure reasoning component can analyze the subject-predicate-object structure of the sentence, the distance between words and other structural features, and perform feedforward calculation on these features through each layer of the neural network. Assume that the input of the neural network is the structural feature vector x of the fused text window sample, the weight matrix is W1, and the bias term is b1. After the hidden layer calculates h=f(W1x+b1) (where f is the activation function, such as the ReLU function f(z)=max(0,z)), the output y_1 is finally obtained. At the same time, in the text semantic reasoning component, for the actual entity relationship prior tag, it will be calculated based on semantic information. For example, after converting the tag "applicable to" into a semantic vector representation, it is calculated through the neural network in the text semantic reasoning component. Let the input semantic vector be s, the weight matrix be W2, and the bias term be b2. After a similar calculation process h'=g(W2s+b2) (g is the activation function), the output y2 is obtained.
[0163] In step S1003, the computer system performs feedforward calculation on the calculated value of the first feedforward calculation and the calculated value of the second feedforward calculation in the sample comparison component to obtain a first commonality measurement result of the fused text window sample and the actual entity relationship prior label.
[0164] The sample comparison component receives the output results from the text structure reasoning component and the text semantic reasoning component and performs further calculations. Assuming that the sample comparison component is also a neural network layer, it combines the two inputs y1 and y2 for calculation. For example, the weighted sum z=αy1+βy2 (α and β are weight parameters) is calculated, and then the first commonality measurement result is obtained through an activation function h''=k(z) (k is the activation function). This first commonality measurement result represents the degree of association between the text structure and semantic information of the fused text window sample under the actual entity relationship prior labeling.
[0165] In step S1004, the fused text window sample is subjected to a third feedforward calculation in the text structure reasoning component, and the irrelevant entity relationship prior tags in the second learning sample are subjected to a fourth feedforward calculation in the text semantic reasoning component. This step is similar to step S1002, but irrelevant entity relationship prior tags are used. In the text structure reasoning component, the fused text window sample is feedforward calculated again to obtain output y3. In the text semantic reasoning component, irrelevant entity relationship prior tags (such as "made of...") are feedforward calculated to obtain output y4.
[0166] In step S1005, similar to step S1003, the sample comparison component calculates y3 and y4 to obtain a second commonality measurement result. This second commonality measurement result represents the degree of association between the text structure and semantic information of the fused text window sample under the irrelevant entity relationship prior labeling. Unlike the first commonality measurement result, this result should reflect a lower degree of association due to the use of irrelevant entity relationship prior labels. Finally, in step S1006, the computer system updates the first commonality measurement result and the second commonality measurement result in the entity association information reasoning component by gradient descent to determine the parameter update amount of the entity association information reasoning component when the calibration error value is the lowest, and iterates the parameters of the entity association information reasoning component based on the parameter update amount. In this step, the computer system determines a loss function to measure the performance of the model. A feasible loss function is the cross-entropy loss function (Cross-Entropy Loss). Let the first commonality measurement result be p1, and the second commonality measurement result be p2. The goal is to make p1 as large as possible (indicating a high degree of correlation between actual relationships) and p2 as small as possible (indicating a low degree of correlation between irrelevant relationships). For binary classification problems (here distinguishing between relevant and irrelevant relationships), the cross entropy loss function , where y=1 represents the actual relationship (because we hope that p1 corresponds to the actual relationship).
[0167] Then, the computer system calculates the gradient according to the loss function. For each parameter in the entity association information reasoning component (such as the weight matrix and bias term in the text structure reasoning component, text semantic reasoning component, and sample comparison component), the derivative of the loss function with respect to these parameters is calculated. For example, for the element in the weight matrix W ,calculate .
[0168] The parameters are updated according to the calculated gradients through the gradient descent algorithm. Assume that the learning rate is , then the parameter update formula is The computer system repeats this process continuously, adjusting the parameters in each iteration so that the value of the loss function gradually decreases until the calibration error value (i.e., the value of the loss function) reaches the minimum or meets certain convergence conditions.
[0169] In this process, the computer system pays attention to some issues. First, the learning rate The choice is critical. If it is too large, it may cause the parameter update amplitude to be too large, miss the optimal solution, or even cause the loss function to diverge; if If is too small, the parameter update will be very slow, resulting in a long training time. = 0.1, the parameters may be updated too quickly in some cases, while = 0.0001, a large number of iterations may be required for the model to converge.
[0170] Secondly, the quality and quantity of data have a great impact on the training effect. If the number of first learning samples and second learning samples is too small, the model may overfit, that is, it performs well on the training data but poorly on new data. For example, if there are only a small number of fused text window samples and entity relationship prior label pairs, the model can remember the characteristics of these samples but cannot generalize well to other unseen samples. In order to avoid overfitting, data augmentation techniques can be used, such as performing random transformations on existing fused text window samples (such as vocabulary replacement, sentence structure adjustment, etc.) to increase the number of samples. In addition, if the neural network structure of the text structure reasoning component, the text semantic reasoning component, and the sample comparison component is too complex (such as too many layers, too many neurons, etc.), it is also easy to cause overfitting. Some regularization techniques, such as L1 regularization (adding L1 regularization to the loss function) can be used. , is the regularization parameter) or L2 regularization (adding ) to limit the size of parameters and prevent the model from overfitting.
[0171] As an implementation manner, step S1006, updating the first commonality measurement result and the second commonality measurement result by gradient descent in the entity association information reasoning component, may include:
[0172] Step S10061: Determine a first metric value between a calculated value of a first feedforward calculation and a reference probability distribution;
[0173] Step S10062: Determine a second metric value between the calculated value of the second feedforward calculation and the reference probability distribution;
[0174] Step S10063: Determine a calibration error value that has a negative correlation with the first commonality measurement result and a positive correlation with the first measurement value, the second measurement value, and the second commonality measurement result, so as to perform a gradient descent update in the entity association information reasoning component.
[0175] In step S10061, the computer system determines a first metric value (used to measure the difference between the two distributions, such as distance) between the calculated value of the first feedforward calculation and the reference probability distribution. In the previous step, the first feedforward calculation obtained a calculated value, which is related to the calculation of the text structure reasoning component and the text semantic reasoning component in the entity association information reasoning component. The reference probability distribution is a standard probability distribution that is pre-set or obtained in some way and is used as a benchmark for comparison. For example, when processing the sheet product knowledge graph, there may be an ideal reference probability distribution for the entity relationship prior label "used for", which is based on a large amount of accurately annotated sheet product knowledge text.
[0176] The computer system may use a variety of methods to calculate the first metric value, such as calculating the KL divergence.
[0177] Take the entity relationship "plywood is used in furniture manufacturing" in the knowledge graph of board products as an example. Assume the probability distribution P(x) corresponding to the calculated value of this relationship obtained by the first feedforward calculation, and the predetermined reference probability distribution Q(x). If P(x) is significantly different from Q(x) in some areas, such as the probability value of P(x) on the key semantic or structural features representing "plywood is used in furniture manufacturing" is different from Q(x), then the calculated KL divergence will be larger. This may mean that when the current entity association information reasoning component processes this relationship, its calculation results deviate significantly from the ideal situation.
[0178] Another metric that can be used is Euclidean distance, which intuitively measures the spatial distance between two vectors (i.e., two probability distributions). The larger the distance, the greater the difference.
[0179] In step S10062, the computer system determines a second metric between the calculated value of the second feedforward calculation and the reference probability distribution. This step is similar to step S10061, but is for the calculated value of the second feedforward calculation. Taking the board product knowledge graph as an example, assume that the second feedforward calculation is a calculation of a priori tags of irrelevant entity relationships (such as "plywood is made from furniture", which is a tag that does not conform to the actual relationship). The computer system calculates the metric between this calculated value and the reference probability distribution in the same way as step S10061.
[0180] If KL divergence is used, assuming that the probability distribution corresponding to the calculated value of the second feedforward calculation is P'(x), then the second metric value If the Euclidean distance is used, let , then the second metric value .
[0181] The calculation of the metric between the calculated value of the prior labeling of the irrelevant entity relations and the reference probability distribution helps to further evaluate the performance of the entity association information reasoning component. Because ideally, there should be a large difference between the calculated value of the irrelevant relations and the reference probability distribution. For example, if the calculated metric value for the irrelevant relation "plywood is made of furniture" is small, this may indicate that the entity association information reasoning component cannot distinguish between relevant and irrelevant relations well and needs further adjustment.
[0182] In step S10063, the computer system determines a calibration error value that has an inverse correlation with the first commonality measurement result and a positive correlation with the first measurement value, the second measurement value, and the second commonality measurement result, so as to perform a gradient descent update in the entity association information reasoning component.
[0183] The first commonality measurement result reflects the degree of association between the fused text window sample and the actual entity relationship prior mark. Ideally, this value should be large, indicating that the entity association information reasoning component can correctly identify the actual entity relationship. The first metric value and the second metric value respectively measure the differences between the calculated values of the first feedforward calculation and the second feedforward calculation and the reference probability distribution. The larger these differences are, the less ideal the current calculation results may be and more adjustments are needed. The second commonality measurement result reflects the degree of association between the fused text window sample and the irrelevant entity relationship prior mark. This value should be small, indicating that the entity association information reasoning component can correctly identify irrelevant relationships. The method for adjusting the error value can be a function based on the above relationship. For example, suppose the first commonality measurement result is , the first metric is , the second metric is , the second commonality measurement result is , the calibration error value E can be defined as: ; In this formula, the numerator It represents the sum of factors related to the undesirable situation (the first and second metrics represent the difference from the reference distribution, and the second commonality metric represents the degree of incorrect association with irrelevant relationships). Indicates a balance of the first commonality measurement result. The larger the value, the smaller the calibration error value E, which reflects the inverse correlation with the first commonality measurement result; at the same time, when , or When increases, the calibration error value E increases, which reflects the positive correlation with them.
[0184] The computer system performs gradient descent updates based on this calibration error value E. Assume that the parameters in the entity association information reasoning component are (including weight matrix, bias term and other parameters in text structure reasoning component, text semantic reasoning component and sample comparison component), according to the adjustment error value E Finding partial derivatives , and then update the parameters according to the gradient descent algorithm: ,in is the learning rate, which indicates the step size of each update.
[0185] In this process, the learning rate The choice is very important. If it is too large, it may cause the parameter update amplitude to be too large, making the model unstable or even unable to converge. For example, if , in some complex models and data situations, the parameters may skip the optimal solution in one update, causing the model to oscillate during training. Too small, such as =0.0001, parameter updates will be very slow, and a large number of iterations will be required for the model to converge, which will increase the time cost of training. In addition, when determining the function of the calibration error value, it can also be adjusted according to the actual situation. For example, different weights can be assigned to different metric values and commonality metric results to better adapt to specific data sets and task requirements. For example, for those situations where higher requirements are placed on distinguishing related and unrelated relationships, the weight of the second commonality metric result in the calibration error value function can be increased. At the same time, during the entire training process, the distribution of data is considered. If the distribution of training data is uneven, for example, in the knowledge graph of sheet products, there are too many samples of some entity relationships and too few samples of other relationships, which can cause the model to be biased towards relationships with more samples during training, thereby affecting the generalization ability of the model. In order to cope with this situation, data sampling techniques such as oversampling (adding more samples to relationships with fewer samples) or undersampling (reducing the number of samples to relationships with too many samples) can be used to make the data distribution more even and improve the performance of the model.
[0186] An embodiment of the present invention provides a computer system, such as Figure 2 As shown, the computer system 100 includes: a processor 101 and a memory 103. The processor 101 and the memory 103 are connected, such as through a bus 102. Optionally, the computer system 100 may also include a transceiver 104. It should be noted that in actual applications, the transceiver 104 is not limited to one, and the structure of the computer system 100 does not constitute a limitation on the embodiments of the present invention.
[0187] An embodiment of the present invention provides a computer system. The computer system in the embodiment of the present invention includes: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and when the one or more programs are executed by the processor, the above method is implemented.
Claims
1. A method for constructing a knowledge graph of sheet products based on artificial intelligence, characterized in that: include: Determine a fused text window including multiple entities in the sheet product knowledge text; mine the text structure representation information of the fused text window, and map the text structure representation information into multiple text structure representation information probability distributions associated one by one with multiple entity relationship prior tags; mine the text semantic representation information of each of the entity relationship prior tags, and map the text semantic representation information into a text semantic representation information probability distribution corresponding to the entity relationship prior tags; determine the text semantic representation information probability distribution corresponding to the text structure representation information probability distribution among the multiple text semantic representation information probability distributions associated one by one with the multiple entity relationship prior tags; The entity association information corresponding to the entity relationship priori mark corresponding to the probability distribution of the corresponding text semantic representation information is used as the entity association information between the multiple entities; a sheet product knowledge graph is constructed based on the multiple entities and the corresponding entity association information; wherein, the determination of a fused text window including multiple entities in the sheet product knowledge text comprises: performing named entity recognition on the sheet product knowledge text to obtain a text window for each entity in the sheet product knowledge text; fusing the text windows of multiple entities located in the same text sentence or adjacent text sentences in the sheet product knowledge text to obtain a fused text window including the multiple entities; Wherein, the determination of the text semantic representation information probability distribution corresponding to the text structure representation information probability distribution includes: performing the following operations for each entity relationship prior marker among multiple entity relationship prior markers: determining the commonality measurement result between the text semantic representation information probability distribution corresponding to the entity relationship prior marker and the text structure representation information probability distribution corresponding to the entity relationship prior marker; determining the text semantic representation information probability distribution corresponding to the entity relationship prior marker with the largest commonality measurement result as the text semantic representation information probability distribution corresponding to the text structure representation information probability distribution; mining the text structure representation information of the fused text window; Information, including: performing a word vector feature extraction operation on the fused text window to obtain the extracted word vector of the text in the fused text window; aggregating the extracted word vector to obtain the text structure representation information of the fused text window; the mining of the text semantic representation information of each entity relationship prior tag, including: a text loading module based on a text semantic reasoning component embeds each entity relationship prior tag into a one-bit valid code; multiplying the parameter array of the intermediate network module of the text semantic reasoning component with the one-bit valid code corresponding to each entity relationship prior tag to obtain the text semantic representation information of each entity relationship prior tag.
2. The method according to claim 1, characterized in that The plurality of entity relationship prior labels are associated one by one with the plurality of dense network components; The mapping of the text structure representation information into multiple text structure representation information probability distributions associated one by one with multiple entity relationship prior tags includes: performing the following operations for each of the entity relationship prior tags: performing a linear transformation operation on the text structure representation information based on a dense network component corresponding to the entity relationship prior tag to obtain the expectation of the text structure representation information corresponding to the entity relationship prior tag, and the independent variance vector of the text structure representation information; generating a text structure representation information probability distribution corresponding to each of the entity relationship prior tags based on the expectation of the text structure representation information corresponding to each of the entity relationship prior tags, and the independent variance vector of the text structure representation information.
3. The method according to claim 1, characterized in that The mapping of the text semantic representation information into the probability distribution of the text semantic representation information corresponding to the entity relationship prior labeling includes: performing a linear transformation operation on the text semantic representation information of the entity relationship prior labeling to obtain the expectation of the text semantic representation information and the independent variance vector of the text semantic representation information; and generating the probability distribution of the text semantic representation information corresponding to the entity relationship prior labeling based on the expectation and the independent variance vector.
4. The method according to claim 3, characterized in that The method of determining the commonality measurement result between the probability distribution of text semantic representation information corresponding to the entity relationship prior mark and the probability distribution of text structure representation information corresponding to the entity relationship prior mark includes: performing multiple Monte Carlo sampling on the text semantic representation information probability distribution to obtain a sampled text semantic representation information set composed of multiple sampled text semantic representation information; performing multiple Monte Carlo sampling on the text structure representation information probability distribution to obtain a sampled text structure representation information set composed of multiple sampled text structure representation information; and determining the commonality measurement result between the sampled text semantic representation information set and the sampled text structure representation information set as the commonality measurement result between the text semantic representation information probability distribution and the text structure representation information probability distribution.
5. The method according to claim 4, characterized in that Before determining the commonality measurement result between the sampled text semantic representation information set and the sampled text structural representation information set as the commonality measurement result between the text semantic representation information probability distribution and the text structural representation information probability distribution, the method also includes: fusing any sampled text semantic representation information in the sampled text semantic representation information set with any sampled text structural representation information in the sampled text structural representation information set to obtain multiple sampled representation information tuples; determining the feature difference between the sampled text semantic representation information and the sampled text structural representation information in each of the sampled representation information tuples; determining the commonality measurement result that is reversely associated with the feature difference of multiple sampled representation information tuples, and determining it as the commonality measurement result between the sampled text semantic representation information set and the sampled text structural representation information set.
6. The method according to claim 1, characterized in that After taking the entity association information corresponding to the entity relationship prior mark corresponding to the corresponding text semantic representation information probability distribution as the entity association information between the multiple entities, the method also includes: obtaining the number of covered characters of each fused text window in the plate product knowledge text, and arranging each of the fused text windows in descending order according to the number of covered characters to obtain an arrangement sequence; arranging the multiple fused text windows located at the front in the arrangement sequence in descending order according to the commonality measurement result; wherein the commonality measurement result is used to determine the entity association information between the multiple entities in the fused text window; taking the entity association information between the multiple entities in the front fused text window as the attribute information of the plate product knowledge text.
7. The method according to any one of claims 1 to 6, characterized in that: The entity association information reasoning component for determining entity association information between multiple entities in the fused text window includes a text structure reasoning component, a text semantic reasoning component, and a sample comparison component; After determining that a fused text window includes multiple entities in the sheet product knowledge text, the method further includes: obtaining a first learning example and a second learning example for adjusting the entity association information reasoning component; wherein the first learning example includes a fused text window example and an actual entity relationship prior mark of the fused text window example, and the second learning example includes the fused text window example and an irrelevant entity relationship prior mark of the fused text window example, and the actual entity relationship prior mark and the irrelevant entity relationship prior mark constitute an entity relationship prior mark set; performing a first feedforward calculation on the fused text window example in the text structure reasoning component, and performing a second feedforward calculation on the actual entity relationship prior mark in the first learning example in the text semantic reasoning component; performing a feedforward calculation on the calculated value of the first feedforward calculation and the calculated value of the second feedforward calculation in the example comparison component to obtain a first commonality measurement result of the fused text window example and the actual entity relationship prior mark; performing a third feedforward calculation on the fused text window example in the text structure reasoning component, and performing a third feedforward calculation on the irrelevant entity relationship prior mark in the second learning example in the text semantic reasoning component. A fourth feedforward calculation is performed in the text semantic reasoning component; the calculated value of the third feedforward calculation and the calculated value of the fourth feedforward calculation are feedforward calculated in the sample comparison component to obtain a second commonality measurement result of the fused text window sample and the unrelated entity relationship prior label; the first commonality measurement result and the second commonality measurement result are updated by gradient descent in the entity association information reasoning component to determine the parameter update amount of the entity association information reasoning component when the calibration error value is the lowest, and the parameters of the entity association information reasoning component are iterated according to the parameter update amount; wherein the gradient descent updating of the first commonality measurement result and the second commonality measurement result in the entity association information reasoning component includes: determining a first metric value between the calculated value of the first feedforward calculation and a reference probability distribution; determining a second metric value between the calculated value of the second feedforward calculation and the reference probability distribution; determining a calibration error value that has a reverse correlation with the first commonality measurement result and a positive correlation with the first metric value, the second metric value, and the second commonality measurement result, so as to perform a gradient descent update in the entity association information reasoning component.
8. A computer system, characterized in that: include: one or more processors; Memory; One or more computer programs; wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and when the one or more computer programs are executed by the processors, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Data integration method based on knowledge graph
CN118333059A