Question answering method based on knowledge base and question answering method based on architectural knowledge base
By optimizing the regional division scheme of entity information in the knowledge base and combining similarity data fusion, the problem of insufficient understanding of the correlation characteristics of knowledge information in the knowledge base is solved, and accurate and complete answers are provided in complex information environments.
Patent Information
- Application Number
- CN202510046264.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-01-13
AI Technical Summary
In the prior art, the lack of understanding of the correlation characteristics between knowledge information in the knowledge base makes it difficult to provide accurate and complete answers in complex and diverse information environments.
By optimizing the regional division scheme of entity information in the knowledge base, the entity correlation characteristics between entity information are strengthened by factor contribution, and combined with entity similarity data and corpus similarity data to search and answer generation of target text data.
Effectively extracting entity correlation characteristics between entity information improves the accuracy and completeness of answers, and can provide high-quality question-and-answer services in complex information environments.
Smart Images

Figure CN119474324B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of natural language processing, and in particular to a question-answering method based on a knowledge base and a question-answering method based on a knowledge base in the field of architecture. Background Art
[0002] Knowledge base question-answering systems have become one of the important ways of information exchange in various industries. In various industries, knowledge base question-answering systems can help employees quickly obtain information related to construction projects in their daily work, thereby improving work efficiency and quality. As the amount of project information and documents increases, the amount of information in the knowledge base also increases, becoming more and more complex and diverse, and the ability to understand the correlation characteristics between knowledge information in the knowledge base in related technologies still needs to be further improved. Summary of the invention
[0003] The present application provides a question-answering method based on a knowledge base and a question-answering method based on a knowledge base in the architectural field. By optimizing the regional division scheme of entity information in the knowledge base, the entity association features between entity information are strengthened, and the entity association features between entity information are effectively extracted, thereby providing accurate and complete answer text data. Technical effect.
[0004] In order to achieve the above objectives, the main technical solutions adopted in this application include:
[0005] In a first aspect, an embodiment of the present application provides a question-answering method based on a knowledge base, wherein the knowledge base stores industry text data, entity information, entity corpora corresponding to the entity information, and factor contribution of the entity information in a target partition to which it belongs, and the entity information and the entity corpora are determined based on the industry text data, and the target partition to which it belongs is determined based on the factor contribution; the method comprises:
[0006] Acquire question text data, and segment the question text data to obtain question corpus blocks;
[0007] Perform information extraction and embedding processing based on the question corpus to obtain question entity data;
[0008] Performing similarity calculation based on the question entity data, the entity information and the factor contribution to obtain entity similarity data, performing similarity calculation based on the question corpus and the entity corpus to obtain corpus similarity data, and determining a fusion result of the entity similarity data and the corpus similarity data;
[0009] The fusion result is used to retrieve target text data from the industry text data in the knowledge base, and answer text data of the question text data is generated based on the target text data.
[0010] The question-answering method based on the knowledge base proposed in the embodiment of the present application optimizes the regional division scheme of entity information through the factor contribution of different partitions and constructs the corresponding knowledge base, thereby strengthening the entity association characteristics between entity information and improving the contextual relevance of entity information. In the question-answering process, the question text data is used to calculate the entity similarity data and the corpus similarity data in the above-mentioned knowledge base; wherein the entity similarity data characterizes the correlation between the question text data and the entity information, and the corpus similarity data characterizes the correlation between the question text data and the industry text data; by combining the entity similarity data and the corpus similarity data, the entity association characteristics between the entity information can be effectively extracted, thereby providing accurate and complete answer text data for the question text data.
[0011] Optionally, the knowledge base is constructed by the following method:
[0012] Partitioning is performed based on the entity information and the event information corresponding to the entity information to obtain a plurality of initial partitions; wherein any entity information corresponds to an initial partition in the plurality of initial partitions;
[0013] For the initial partition corresponding to any entity information, calculate the factor contribution of the entity information in the initial partition according to the optimal number of factors of the initial partition;
[0014] If it is determined according to the factor contribution that the initial partition does not meet the factor contribution condition, the multiple initial partitions are partition optimized until the optimized initial partitions all meet the factor contribution condition; wherein any entity information corresponds to a target partition in the optimized initial partition; the factor contribution condition is that there is entity information in the initial partition whose factor contribution reaches a preset threshold;
[0015] According to the entity association features of the target partition to which the any entity information belongs, vector embedding is performed on the any entity information to obtain a graph embedding representation to construct the knowledge base.
[0016] Optionally, the optimal number of factors is obtained by the following method:
[0017] According to the entity information and event information in any initial partition, a partition adjacency matrix of any initial partition is constructed; wherein the elements in the partition adjacency matrix are used to represent the association relationship between the entity information in any initial partition;
[0018] Performing non-negative matrix decomposition on the partition adjacency matrix, and determining the optimal number of factors according to an error between a non-negative matrix decomposition result and the partition adjacency matrix.
[0019] Optionally, partitioning based on the entity information and event information corresponding to the entity information to obtain multiple initial partitions includes:
[0020] According to the entity information and the event information, a weighted adjacency matrix about the entity information is constructed; wherein the elements in the weighted adjacency matrix are used to represent the association relationship between the entity information;
[0021] The entity information is partitioned using the weighted adjacency matrix through the Leiden algorithm to obtain the multiple initial partitions.
[0022] Optionally, the performing partition optimization on the multiple initial partitions until all the optimized initial partitions satisfy the factor contribution condition includes:
[0023] The resolution parameter in the Leiden algorithm is adjusted, and repartitioning is performed according to the adjusted resolution parameter to obtain a plurality of optimized initial partitions, until the plurality of optimized initial partitions all meet the factor contribution condition.
[0024] Optionally, the entity association feature of the target partition corresponding to any entity information is obtained in the following manner:
[0025] By means of a random walk algorithm, random walk is performed in the target partition corresponding to any entity information according to the weighted adjacency matrix to obtain entity association features between entity information in the target partition.
[0026] Optionally, the entity similarity data is in the following form:
[0027]
[0028] in, Representing the entity similarity data; The entity data of the problem; The entity information; Entity data for the problem and the entity information similarity; For the entity information In the target partition The corresponding factor contribution in ; is the set of all the target partitions.
[0029] In a second aspect, an embodiment of the present application provides a question-answering system based on a knowledge base, wherein the knowledge base stores industry text data, entity information, entity corpora corresponding to the entity information, and factor contribution of the entity information in a target partition to which it belongs, and the entity information and the entity corpora are determined based on the industry text data, and the target partition to which it belongs is determined based on the factor contribution; the system comprises:
[0030] A text segmentation module is used to obtain question text data and segment the question text data to obtain question corpus blocks;
[0031] An information processing module, used for performing information extraction and embedding processing based on the question corpus to obtain question entity data;
[0032] A similarity calculation module, configured to perform similarity calculation based on the question entity data, the entity information and the factor contribution to obtain entity similarity data, perform similarity calculation based on the question corpus and the entity corpus to obtain corpus similarity data, and determine a fusion result of the entity similarity data and the corpus similarity data;
[0033] The retrieval and answering module is used to retrieve target text data in the industry text data of the knowledge base using the fusion result, and generate answer text data for the question text data based on the target text data.
[0034] In a third aspect, an embodiment of the present application provides a question-answering method based on a construction domain knowledge base, wherein the construction domain knowledge base is used for concrete quality supervision and traceability analysis; the construction domain knowledge base stores concrete quality information, concrete quality entity information, a concrete quality corpus corresponding to the concrete quality entity information, and a factor contribution of the concrete quality entity information in a target partition to which it belongs, and the concrete quality entity information and the concrete quality corpus are determined based on the concrete quality information, and the target partition to which it belongs is determined based on the factor contribution; the method comprises:
[0035] Acquire source tracing question data, and segment the source tracing question data to obtain source tracing question corpus blocks;
[0036] Performing information extraction and embedding processing based on the source-tracing question corpus to obtain source-tracing question entity information;
[0037] Performing similarity calculation based on the tracing question entity information, the concrete quality entity information and the factor contribution to obtain tracing entity similarity data, performing similarity calculation based on the tracing question corpus and the concrete quality corpus to obtain tracing corpus similarity data, and determining a fusion result of the tracing entity similarity data and the tracing corpus similarity data;
[0038] The fusion result is used to retrieve target traceability information from the concrete quality information in the construction field knowledge base, and concrete traceability answer data corresponding to the traceability question data is generated based on the target traceability information to perform quality supervision and traceability analysis on concrete.
[0039] In a fourth aspect, an embodiment of the present application provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method described in any one of the above embodiments by executing the computer instructions.
[0040] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute any one of the methods in the above embodiments.
[0041] In a sixth aspect, an embodiment of the present application provides a computer program product, including computer instructions, wherein the computer instructions are used to enable a computer to execute any one of the methods described in the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 A step diagram of a question-answering method based on a knowledge base in the field of architecture provided in an embodiment of the present application;
[0044] Figure 2 A step diagram of a question-answering method based on a knowledge base provided in an embodiment of the present application;
[0045] Figure 3 A diagram showing the steps for constructing a knowledge base in an embodiment of the present application;
[0046] Figure 4 A diagram showing the steps for determining the optimal number of factors in an embodiment of the present application;
[0047] Figure 5 A diagram showing the steps for obtaining the initial partition in an embodiment of the present application;
[0048] Figure 6 A module diagram of a question-answering system based on a knowledge base provided in an embodiment of the present application;
[0049] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0051] The knowledge base question and answer system has become one of the important ways of information exchange in various industries. In specific industries, the knowledge base question and answer system can help employees quickly obtain relevant information about construction projects in their daily work, thereby improving work efficiency and quality. When using it, employees input question text data into the knowledge base question and answer system, and the knowledge base question and answer system analyzes the question text data and searches in the corresponding knowledge base to give the corresponding answer.
[0052] As the number of project information and documents increases, the amount of information in the knowledge base also increases, becoming more and more complex and diverse. Traditional knowledge base retrieval methods, such as keyword-based search, often cannot effectively handle these complex queries, especially when facing ambiguous, ambiguous or context-related queries. In related technologies, it is difficult for a single large language model to quickly locate and retrieve relevant information in a huge amount of document information. At the same time, due to the lack of an explicit mechanism to connect scattered information points to form a whole, it is difficult for the model to effectively integrate this information. Building a high-quality knowledge graph knowledge base requires a lot of annotation work and expertise. At the same time, the current entity recognition and relationship extraction technologies in the field of natural language processing (NLP) lack sufficiently deep semantic understanding capabilities and cannot provide accurate answers based on contextual information.
[0053] Based on the above problems, the present application provides a question-answering method based on a knowledge base and a question-answering method based on a knowledge base in the construction field, wherein the knowledge base stores industry text data, entity information, entity corpus blocks corresponding to the entity information, and factor contribution of the entity information in the target partition to which it belongs, and the entity information and entity corpus blocks are determined based on the industry text data, and the target partition to which it belongs is determined based on the factor contribution.
[0054] The method provided by the present application includes: obtaining a question corpus and question entity data according to question text data; performing similarity calculation according to the question entity data, entity information and factor contribution to obtain entity similarity data; performing similarity calculation according to the question corpus and the entity corpus to obtain corpus similarity data; retrieving target text data in the industry text data of the knowledge base according to the fusion result of the entity similarity data and the corpus similarity data, and generating answer text data for the question text data based on the target text data.
[0055] The knowledge base-based question-answering method proposed in the embodiment of the present application strengthens the entity association features between entity information by optimizing the regional division scheme of entity information in the knowledge base, thereby achieving the technical effect of effectively extracting the entity association features between entity information, thereby providing accurate and complete answer text data.
[0056] The question-answering method based on the knowledge base provided in this specification can be applied to integrate document materials in different industry fields to build relevant knowledge bases, such as the field of construction engineering. Accordingly, the method provided in this specification is also used to search the constructed knowledge base, and answer the questions according to the contextual relevance between the entity information in the knowledge base by inputting the question text data. It is understandable that the method provided in this specification needs to be adaptively modified when applied in different fields to suit the characteristics of the corresponding fields.
[0057] In the embodiment of the present application, based on the above method and according to its application in the construction field, a question-answering method based on a construction field knowledge base is provided. In this method, the construction field knowledge base is used for concrete quality supervision and traceability analysis; the construction field knowledge base stores concrete quality information, concrete quality entity information, concrete quality corpus corresponding to the concrete quality entity information, and the factor contribution of the concrete quality entity information in the target partition to which it belongs, and the concrete quality entity information and the concrete quality corpus are determined based on the concrete quality information, and the target partition to which it belongs is determined based on the factor contribution. Figure 1 As shown, the method includes:
[0058] S102. Obtain source tracing question data, and segment the source tracing question data to obtain source tracing question corpus blocks.
[0059] S104. Perform information extraction and embedding processing based on the source-tracing question corpus to obtain source-tracing question entity information.
[0060] S106. Perform similarity calculation based on the traceability question entity information, concrete quality entity information and factor contribution to obtain traceability entity similarity data, perform similarity calculation based on the traceability question corpus and the concrete quality corpus to obtain traceability corpus similarity data, and determine the fusion result of the traceability entity similarity data and the traceability corpus similarity data.
[0061] S108. Utilize the fusion result to retrieve the target traceability information from the concrete quality information in the construction field knowledge base, and generate concrete traceability answer data corresponding to the traceability question data based on the target traceability information, so as to conduct quality supervision and traceability analysis on the concrete.
[0062] Specifically, the construction domain knowledge base can be constructed based on the construction industry text data in the construction field, and is used to aggregate the construction industry text data, and organize and summarize it for users to query and ask questions. When the construction domain knowledge base is used for concrete quality supervision and traceability analysis, the construction industry text data stored in the construction domain knowledge base can be concrete quality information, and the concrete quality information can be the quality information collected by professional equipment at various stages of the concrete application process. In actual scenarios, concrete quality information can be stored in the concrete supervision platform in the form of concrete quality supervision documents.
[0063] It should be noted that the concrete quality information obtained through collection can be in one of the formats such as text format, picture format or PDF format. For concrete quality information other than text format, it needs to be identified and preprocessed. For example, the identification and preprocessing can be OCR (Optical Character Recognition), which extracts the text information in the picture by performing OCR recognition on the concrete quality information in picture format to generate the corresponding concrete quality information in text format. The identification and preprocessing can also be to extract features of the concrete quality information in picture format through traditional deep learning models or multimodal large models, and generate relevant description information based on the extracted picture features as the concrete quality information in text format.
[0064] It is understandable that after obtaining the concrete quality information in text format, the concrete quality information needs to be preprocessed to improve the information quality of the concrete quality information, wherein the text preprocessing includes at least one of text cleaning, word segmentation, and stop word removal.
[0065] To illustrate concrete quality information by way of example, the concrete application process includes stages such as raw material testing, production, transportation, witness sampling, pouring and mechanism testing. In each stage, the quality information of concrete is collected by professional equipment, and the concrete quality information in text format is generated after preprocessing. Concrete quality information includes at least one of the following information: material information, mix ratio information, transportation information, witness sampling information, curing room environment and test results. The above information corresponds to different stages in the concrete application process. For example, in the raw material testing stage, the concrete quality information may be the material information and mix ratio information used in the concrete, etc., to indicate whether the raw materials used in the concrete meet the corresponding preset quality requirements; in the transportation stage, the concrete quality information may be the transportation information of the concrete, including the transportation time, transportation temperature and the speed of the mixer truck used to transport the concrete, etc., to indicate whether the transportation process of the concrete meets the corresponding preset quality requirements.
[0066] Specifically, the concrete quality corpus can be a sub-corpus obtained by segmenting the concrete quality information, and the concrete quality entity information can be obtained by extracting entities from the concrete quality corpus using the large language model in the construction field, indicating a specific object in the concrete application process. Exemplarily, the concrete quality entity information can be mineral powder, which refers to the product of grinding ore or other materials into fine powder, indicating the type of raw materials used in concrete; the concrete quality entity information can also be the chip code of the concrete, through which the production batch, raw materials and production date of the concrete can be determined.
[0067] Furthermore, the construction domain knowledge base is constructed based on concrete quality information, concrete quality entity information and concrete quality corpus corresponding to the concrete quality entity information, wherein the concrete quality entity information and the concrete quality corpus are determined based on the concrete quality information. Any concrete quality entity information has a target partition, and the target partition is determined based on the factor contribution of the concrete quality entity information in the target partition.
[0068] Specifically, the traceability question data may be text information used by the user when querying the concrete quality information using the knowledge base in the construction field. The traceability question corpus may be a sub-corpus obtained by segmenting the traceability question data, and the traceability question entity information may be obtained by entity extraction of the traceability question corpus using the large language model in the construction field, indicating the specific content of the concrete quality information that the user wants to know. Exemplarily, the traceability question data may be "What is the mix ratio of mineral powder in the first batch of concrete?" At this time, the traceability question corpus obtained by segmentation includes "first batch", "concrete", "mineral powder" and "mix ratio", and the traceability question entity information obtained includes "concrete" and "mineral powder".
[0069] Specifically, the target traceability information may be concrete quality information determined based on the fusion result of the traceability entity similarity data and the traceability corpus block similarity data after obtaining the traceability entity similarity data and the traceability corpus block similarity data, and the number may be one or more. It should be noted that if the target traceability information only contains one concrete quality information, the concrete quality information is used as the concrete traceability answer data; if the target traceability information contains multiple concrete quality information, then according to the contextual correlation between the multiple concrete quality information, the concrete traceability answer data corresponding to the traceability question data is generated through the large language model in the construction field. Exemplarily, if the traceability question data is "What is the mix ratio of mineral powder in the first batch of concrete?", the target traceability information may include "The raw materials of the first batch of concrete include cement, and its mix ratio is Akg / m 3 ” and “the weight of mineral powder in the first batch of concrete accounts for B% of the weight of cement”. Based on the above target traceability information, the big language model in the construction field can generate the concrete traceability answer data as “the mix ratio of mineral powder in the first batch of concrete is A×Bkg / m 3 ”.
[0070] It should be noted that when the user asks questions based on the traceability question data and the constructed construction field knowledge base, the method calculates similarity based on the traceability question entity information, concrete quality entity information and factor contribution to obtain traceability entity similarity data; it also calculates similarity based on the traceability question corpus and the concrete quality corpus to obtain traceability corpus similarity data. It can be understood that the concrete quality entity information with higher factor contribution has more prominent features in the initial partition to which it belongs, that is, it is more important in the initial partition to which it belongs. By adding factor contribution in the similarity calculation process, the range of target traceability information that can be searched in the question-answering process is increased, thereby improving the accuracy of the obtained concrete traceability answer data.
[0071] It is understandable that after using the knowledge base in the construction field to obtain the concrete traceability answer data, users can understand the quality information of concrete at each stage of the application process. When any batch of concrete has quality problems, users can use the concrete traceability answer data to determine the stage at which the concrete quality problem occurred, so as to determine the cause of the quality problem and take corresponding measures, thereby achieving quality supervision and traceability analysis of concrete and reducing the impact of concrete quality problems on construction projects.
[0072] According to an embodiment of the present application, an embodiment of a question-answering method based on a knowledge base is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0073] In this embodiment, a question-answering method based on a knowledge base is provided, which can be used in the above-mentioned different industry fields. The knowledge base stores industry text data, entity information, entity corpus blocks corresponding to the entity information, and factor contribution of the entity information in the target partition to which it belongs. The entity information and the entity corpus blocks are determined based on the industry text data, and the target partition to which they belong is determined based on the factor contribution. Figure 2 The step diagram of the question-answering method based on the knowledge base provided in the embodiment of the present application, as shown in the figure, the method includes:
[0074] S100. Obtain question text data, and segment the question text data to obtain question corpus blocks.
[0075] S200. Perform information extraction and embedding processing based on the question corpus to obtain question entity data.
[0076] S300. Perform similarity calculation based on the question entity data, entity information and factor contribution to obtain entity similarity data, perform similarity calculation based on the question corpus and the entity corpus to obtain corpus similarity data, and determine the fusion result of the entity similarity data and the corpus similarity data.
[0077] S400. Retrieve target text data from the industry text data in the knowledge base using the fusion result, and generate answer text data for the question text data based on the target text data.
[0078] Specifically, the knowledge base can be constructed based on the industry text data in the target industry field, and is used to aggregate the industry text data, and to organize and summarize it for users to query and ask questions. In some embodiments, the industry text data can be event records about the target industry field. For example, in the construction industry field, for a project, the daily progress of the project can be recorded and organized to obtain a knowledge base about the progress of the project, so that users can query the events that occurred during the project at any time to grasp the overall progress of the project.
[0079] In some other embodiments, the industry text data may also be a feature database about the target industry field. For example, in the construction industry, the industry text data may be a description of the characteristics and attributes of engineering entities. Through these industry text data, a feature database about engineering entities can be obtained, so that users can understand the characteristics of different engineering entities by querying the knowledge base, thereby being able to quickly formulate engineering plans and improve the accuracy of engineering polarization design.
[0080] Furthermore, the question text data may be text data used by users to ask questions to the knowledge base, and the question corpus is obtained by segmenting the question text data. After obtaining the question corpus, the question corpus is extracted through a large language model to obtain the question entity content representing the relevant field in the question corpus. The question entity content may be a commonly used noun in the relevant field. It is understandable that there is a certain relationship between the question entity content, which includes name, type and description information, and the relationship between the question entity content includes source entity, target entity and description information.
[0081] Furthermore, by using a large language model, the question corpus is vector-embedded according to the extracted question entities to obtain an embedding vector about the question entity content, and the question entity information is obtained according to the embedding vector of the question entity content.
[0082] Furthermore, the entity similarity data is obtained based on the similarity between the question entity data and the entity information in the knowledge base. By adding the factor contribution of the corresponding entity information in the target partition to which it belongs, the entity similarity data of the entity information with a higher factor contribution in each target partition to which it belongs is made more prominent and can be more easily searched. It is understandable that when calculating the entity similarity data, the data with more prominent entity similarity data can be entity information with the same content as the question entity data, or it can be entity information with different content, but with a higher corresponding factor contribution. By adding the factor contribution in the calculation process of the entity similarity data, the range of target text data that can be searched in the question-answering process is increased, thereby improving the accuracy of the answer text data corresponding to the question text data.
[0083] Furthermore, the form of the corpus similarity data is as follows:
[0084]
[0085] in, Represents corpus chunk similarity data; is the embedding vector of the question corpus; is the embedding vector of the entity corpus chunk.
[0086] In some embodiments, a weighted calculation is performed on the entity similarity data and the corpus similarity data to obtain a fusion result of the two. The fusion result of the entity similarity data and the corpus similarity data is in the following form:
[0087]
[0088] in, represents the fusion result; Represents entity similarity data; Represents corpus chunk similarity data; is the weight coefficient, The fusion result includes entity similarity data and corpus similarity data. The entity similarity data is used to match the question text data with keywords that contain contextual relevance, thereby improving the accuracy of the answer. The corpus similarity data is also used to perform semantic matching, thereby obtaining multiple target text data with the same keywords and high similarity.
[0089] Furthermore, there is a certain degree of contextual correlation between the multiple target text data obtained. The above-mentioned multiple target text data and corresponding entity information are summarized and analyzed through a large language model, so that by combining the target text data and the entity information, answer text data for the question text data is obtained, thereby answering the user's question.
[0090] The question-answering method based on the knowledge base provided in this embodiment optimizes the regional division scheme of entity information through the factor contribution of different partitions and constructs the corresponding knowledge base, thereby strengthening the entity association characteristics between entity information and improving the contextual relevance of entity information. In the question-answering process, the entity similarity data and the corpus similarity data are calculated in the above-mentioned knowledge base using the question text data; wherein the entity similarity data characterizes the correlation between the question text data and the entity information, and the corpus similarity data characterizes the correlation between the question text data and the industry text data; by combining the entity similarity data and the corpus similarity data, the entity association characteristics between the entity information can be effectively extracted, thereby providing accurate and complete answer text data for the question text data.
[0091] Reference Figure 3 As shown, as an embodiment of the present application, a knowledge base is constructed by the following method:
[0092] S500. Partitioning is performed based on entity information and event information corresponding to the entity information to obtain multiple initial partitions; wherein any entity information corresponds to an initial partition in the multiple initial partitions.
[0093] S600. For the initial partition corresponding to any entity information, calculate the factor contribution of any entity information in the initial partition according to the optimal number of factors of the initial partition.
[0094] S700. If it is determined based on the factor contribution that the initial partition does not satisfy the factor contribution condition, multiple initial partitions are optimized until the optimized initial partitions all satisfy the factor contribution condition; wherein any entity information corresponds to a target partition in the optimized initial partition; the factor contribution condition is that there is entity information in the initial partition whose factor contribution reaches a preset threshold.
[0095] S800. Perform vector embedding on any entity information according to entity association features of the target partition to which the entity information belongs, and obtain a graph embedding representation to construct a knowledge base.
[0096] Specifically, the industry text data may be basic text data for constructing a knowledge base. Before obtaining the entity corpus, the method may further include a process of preprocessing the industry text data, wherein the preprocessing process includes at least one of operations such as text cleaning, word segmentation, and stop word removal. By preprocessing the industry text data, the accuracy of the industry text data is improved, and the probability of erroneous or modified information being mixed into the knowledge base is reduced.
[0097] Furthermore, by segmenting the industry text data, multiple sub-corpora can be obtained based on the segmented words, and the sub-corpora include entity corpora and event corpora. The sub-corpora are extracted through a large language model to obtain entity content or event content representing the relevant field in the sub-corpora; wherein the entity content can be a commonly used noun in the relevant field, and the event content can be attributes and features related to the entity content. It can be understood that there is a certain relationship between entity content, and the entity content includes name, type and description information, while the relationship includes source entity, target entity and description information, and the event content includes at least one of the initiator of the event, the reporter of the event, the event type, the event status, the start date of the event, the end date of the event, the description of the event and the source of the event.
[0098] Exemplarily, when the knowledge base is used to record event progress, the entity content may be the execution object of the action contained in the event, and accordingly, the event content may be the event and location where the action performed on the entity content occurs; when the knowledge base is used to record entity characteristics, the entity content may be the object that needs to be recorded, and accordingly, the event content may be the characteristics of the entity content.
[0099] Furthermore, a large language model is used to embed the entity corpus blocks according to the extracted entity content and event content, and an embedding vector about the entity content and event content, that is, entity information and event information, is obtained to form a vectorized corpus. At this time, the entity information is compared with a list of feature candidate entities in the relevant field, wherein the list of feature candidate entities includes commonly used entities in the relevant field. By comparison, a similarity score between the entity information and the commonly used entities is obtained, and entity information with a low similarity score is screened out according to the similarity score. It can be understood that entity information with a low similarity score may be entity information that is not related to the relevant field, or the name of the entity information is wrong, etc.
[0100] Specifically, the entity information is partitioned to obtain multiple initial partitions, and each entity information corresponds to an initial partition. For any initial partition, the entity information contained therein has similar characteristics, which are determined by the contribution of multiple factors in the corresponding initial partition. According to the optimal number of factors in the initial partition, the contribution of each factor to any entity information is calculated by contribution calculation. The contribution of all factors to the same entity information is summed to obtain the factor contribution of the entity information, and the partition quality can be evaluated by the factor contribution.
[0101] In some embodiments, a partition adjacency matrix can be obtained for any entity information in the initial partition, and a feature matrix and a weight matrix as decomposition results can be obtained by performing non-negative matrix decomposition on the partition adjacency matrix, thereby determining the factor contribution of any entity information. Exemplarily, the factor contribution is in the following form:
[0102]
[0103] in, Indicates The factor contribution of each entity information; is the optimal number of factors; and are the weight matrix and feature matrix.
[0104] Furthermore, for any initial partition, the corresponding factor contribution sequence can be obtained according to the entity information therein, which includes the factor contribution of each entity information. If there is any entity information with a higher factor contribution in the factor contribution sequence, it means that the entity information has outstanding characteristics, and the partitioning scheme for the initial partition can be considered reasonable. The factor contribution condition is set as the entity information with a factor contribution reaching a preset threshold in the initial partition. If there is any initial partition that does not meet the factor contribution condition among all the initial partitions, the current overall partitioning scheme is considered unreasonable, and the overall partitioning scheme needs to be modified and adjusted, so as to optimize the partitioning of multiple initial partitions until the optimized initial partitions meet the factor contribution condition. It can be understood that when all the initial partitions meet the factor contribution condition, the current overall partitioning scheme is considered reasonable, and the optimized initial partition obtained at this time is used as the target partition, and any entity information corresponds to the target partition in the target partition.
[0105] Furthermore, for any entity information and its corresponding target partition, by learning the target partition, the entity association features between the entity information in the target partition can be obtained, wherein the entity association features represent the association between the entity information and are used to characterize the features of the target partition. Exemplarily, the entity association features can be expressed as the presence of the same or similar event information between the entity information, and can also be expressed as the presence of the same or similar type or description information between the entity information, that is, it is related to the relationship between the entity information. It can be understood that in the graph embedding representation obtained according to the entity association features, the embedding vector representing any entity information contains the features of the entity information and the entity association features between the entity information and other entity information, and the contextual association between different entity information can be obtained through the entity association features.
[0106] Reference Figure 4 As shown, as an embodiment of the present application, the optimal number of factors is obtained by the following method:
[0107] S610. Construct a partition adjacency matrix of any initial partition based on the entity information and event information in any initial partition; wherein the elements in the partition adjacency matrix are used to represent the association relationship between the entity information in any initial partition.
[0108] S620. Perform non-negative matrix decomposition on the partition adjacency matrix, and determine the optimal number of factors based on the error between the non-negative matrix decomposition result and the partition adjacency matrix.
[0109] Specifically, the non-negative matrix decomposition result includes a weight matrix and a feature matrix. The partition adjacency matrix can be approximately reconstructed through the weight matrix and the feature matrix. Therefore, there is a reconstruction error between the weight matrix and the feature matrix and the partition adjacency matrix.
[0110] Furthermore, the optimal number of factors can be the number of factors taken during the non-negative matrix decomposition when the reconstruction error is minimized. At this time, the number of columns of the weight matrix and the number of rows of the feature matrix obtained are the same as the optimal number of factors. According to the optimal number of factors, the contribution of each factor to the partition adjacency matrix can be obtained.
[0111] Furthermore, before performing non-negative matrix decomposition on the partition adjacency matrix, it is also necessary to perform Z-score normalization on the partition adjacency matrix. The form of Z-score normalization is as follows:
[0112]
[0113] in, Represents the partition adjacency matrix after Z-score standardization; is the partition adjacency matrix; For any initial partition The average value of the embedding vectors of all entity information in ; For any initial partition The standard deviation of the embedding vectors of all entity information in .
[0114] The partition adjacency matrix after Z-score normalization is used as the original matrix, and the original matrix is subjected to non-negative matrix decomposition, which is in the following form:
[0115]
[0116] in, is the weight matrix, and is a non-negative matrix; is the feature matrix, and is a non-negative matrix. The weight matrix and the feature matrix are the results of non-negative matrix decomposition of the original matrix. According to the non-negative matrix decomposition result, the reconstruction error of the original matrix can be obtained, that is, the error between the non-negative matrix decomposition result and the partition adjacency matrix, which is in the following form:
[0117]
[0118] in, is the rank of the non-negative matrix decomposition.
[0119] According to the above error, take the error The rank number when the value is the minimum is used as the initial partition The optimal number of factors is as follows:
[0120]
[0121] in, represents the optimal number of factors.
[0122] Reference Figure 5 As shown, as an embodiment of the present application, partitioning is performed based on entity information and event information corresponding to the entity information to obtain multiple initial partitions, including:
[0123] S510. Construct a weighted adjacency matrix about the entity information based on the entity information and the event information; wherein the elements in the weighted adjacency matrix are used to characterize the association relationship between the entity information.
[0124] S520. Partition the entity information using the Leiden algorithm and the weighted adjacency matrix to obtain multiple initial partitions.
[0125] Specifically, the elements in the weighted adjacency matrix are as follows:
[0126]
[0127] in, Represents the weighted adjacency matrix Middle Line The elements of the column represent Entity information and The relationship between entity information; is event information data; It is the relationship information data between entity information; and are weight parameters, .
[0128] Further, the Leiden algorithm is an algorithm for detecting communities in large networks that divides nodes into disjoint communities in order to maximize the modularity score of each community; modularity quantifies the quality of assigning nodes to communities, that is, how densely connected the nodes are in a community compared to how connected the nodes are in a random network. The form of modularity in the Leiden algorithm is as follows:
[0129]
[0130] in, represents modularity; Based on The obtained The weighted degree of entity information; Based on The obtained The weighted degree of entity information; For all The sum of is the resolution parameter; is the Kronecker function, when Entity information and When the entity information is in the same initial partition, ,otherwise .
[0131] As an embodiment of the present application, partition optimization is performed on multiple initial partitions until the optimized initial partitions all meet the factor contribution conditions, including:
[0132] S710. Adjust the resolution parameter in the Leiden algorithm, and repartition according to the adjusted resolution parameter to obtain multiple optimized initial partitions, until the multiple optimized initial partitions all meet the factor contribution conditions.
[0133] Specifically, the resolution parameter is used to control the size of the partition. The larger the resolution parameter, the more entity information is contained in the resulting initial partition, and the weaker the entity association features between the entity information are. The smaller the resolution parameter, the less entity information is contained in the resulting initial partition, and the stronger the entity association features between the entity information are. However, a too small resolution parameter will result in too many initial partitions, and different initial partitions may have similar features, reducing the rationality of the partitioning scheme.
[0134] In some embodiments, the weights of the elements in the weighted adjacency matrix may also be adjusted, and the entity association features between the entity information may be adjusted to optimize the partitions of the multiple initial partitions.
[0135] As an embodiment of the present application, the entity association feature of the target partition corresponding to any entity information is obtained in the following manner:
[0136] S810. Perform random walks in the target partition corresponding to any entity information according to the weighted adjacency matrix through a random walk algorithm to obtain entity association features between entity information in the target partition.
[0137] Specifically, by adding the weights in the weighted adjacency matrix to the random walk algorithm, the random walk nodes can be transferred according to the correlation between entity information. Through multiple transfers, the entity association features between entity information are learned and the contextual correlation between entity information is determined.
[0138] In some embodiments, the random walk algorithm is of the form:
[0139]
[0140] in, is the random walk process The entity information sequence number of the step; and is the transition probability; is a normalization constant so that the sum of all transition probabilities is 1; For the The target partition to which the entity information belongs.
[0141] As an embodiment of the present application, the entity similarity data is in the following form:
[0142]
[0143] in, Represents entity similarity data; The entity data of the problem; For entity information; For the problem entity data and entity information similarity; Entity Information In the target partition The corresponding factor contribution in ; The set of all target partitions.
[0144] Specifically, for any entity information, if its factor contribution in the target partition is higher, it may have more obvious characteristics; and for question text data, the knowledge contained in the entity data with higher factor contribution may be more accurate. By adding factor contribution to the calculation process of entity similarity data, the range of target text data that can be searched in the question-answering process is increased, thereby improving the accuracy of answer text data corresponding to question text data.
[0145] Accordingly, please refer to Figure 6 The embodiment of the present application provides a question-answering system based on a knowledge base, wherein the knowledge base stores industry text data, entity information, entity corpus blocks corresponding to the entity information, and factor contribution of the entity information in the target partition to which it belongs, and the entity information and entity corpus blocks are determined based on the industry text data, and the target partition to which it belongs is determined based on the factor contribution. The system includes:
[0146] The text segmentation module 100 is used to obtain question text data and segment the question text data to obtain question corpus blocks.
[0147] The information processing module 200 is used to perform information extraction and embedding processing based on the question corpus to obtain question entity data.
[0148] The similarity calculation module 300 is used to perform similarity calculation based on the question entity data, entity information and factor contribution to obtain entity similarity data, perform similarity calculation based on the question corpus and the entity corpus to obtain corpus similarity data, and determine the fusion result of the entity similarity data and the corpus similarity data.
[0149] The retrieval and answering module 400 is used to retrieve target text data in the industry text data of the knowledge base using the fusion result, and generate answer text data for the question text data based on the target text data.
[0150] In some optional embodiments, the system further comprises:
[0151] The preliminary partitioning module is used to partition based on entity information and event information corresponding to the entity information to obtain multiple initial partitions; wherein any entity information corresponds to an initial partition in the multiple initial partitions.
[0152] The factor contribution calculation module is used to calculate the factor contribution of any entity information in the initial partition corresponding to any entity information according to the optimal number of factors of the initial partition.
[0153] The partition optimization module is used to perform partition optimization. If the initial partition is determined not to meet the factor contribution condition based on the factor contribution, multiple initial partitions are partition optimized until the optimized initial partitions all meet the factor contribution condition; wherein any entity information corresponds to a target partition in the optimized initial partition; the factor contribution condition is that there is entity information in the initial partition whose factor contribution reaches a preset threshold.
[0154] The knowledge base construction module is used to perform vector embedding on any entity information according to the entity association features of the target partition to which the entity information belongs, and obtain a graph embedding representation to construct a knowledge base.
[0155] In some optional implementations, the factor contribution calculation module includes:
[0156] The partition adjacency matrix construction unit is used to construct a partition adjacency matrix of any initial partition according to the entity information and event information in any initial partition; wherein the elements in the partition adjacency matrix are used to represent the association relationship between the entity information in any initial partition.
[0157] The optimal factor number determination unit is used to perform non-negative matrix decomposition on the partition adjacency matrix and determine the optimal factor number according to the error between the non-negative matrix decomposition result and the partition adjacency matrix.
[0158] In some optional implementations, the preliminary partitioning module includes:
[0159] A weighted adjacency matrix construction unit is used to construct a weighted adjacency matrix about entity information according to entity information and event information; wherein the elements in the weighted adjacency matrix are used to represent the association relationship between entity information;
[0160] The initial partitioning unit is used to partition the entity information by using the Leiden algorithm and the weighted adjacency matrix to obtain multiple initial partitions.
[0161] In some optional implementations, the partition optimization module includes:
[0162] The resolution parameter adjustment unit is used to adjust the resolution parameter in the Leiden algorithm, and repartition according to the adjusted resolution parameter to obtain multiple optimized initial partitions until the multiple optimized initial partitions all meet the factor contribution conditions.
[0163] In some optional implementations, the knowledge base building module includes:
[0164] The random walk unit is used to perform random walk in the target partition corresponding to any entity information according to the weighted adjacency matrix through a random walk algorithm to obtain entity association features between entity information in the target partition.
[0165] In some optional implementations, the entity similarity data in the similarity calculation module 300 is in the following form:
[0166]
[0167] in, Represents entity similarity data; The entity data of the problem; For entity information; For the problem entity data and entity information similarity; Entity Information In the target partition The corresponding factor contribution in ; The set of all target partitions.
[0168] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0169] The knowledge base-based question-answering system in this embodiment is presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0170] See also Figure 7 , Figure 7It is a structural diagram of a computer device provided by an embodiment of the present application. As shown in the figure, the computer device includes: one or more processors 10, a memory 20, and an interface for connecting various components, including a high-speed interface and a low-speed interface. Each component uses different buses to communicate with each other, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.
[0171] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0172] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0173] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0174] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0175] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0176] The embodiment of the present application also provides a computer-readable storage medium. The above method according to the embodiment of the present application can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0177] The embodiment of the present application provides a computer program product, which includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of any embodiment of the present application.
[0178] Although the embodiments of the present application are described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations are all within the scope defined by the appended claims.
[0179] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0180] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0181] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0182] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0183] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0184] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0185] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0186] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0187] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
[0188] Although the embodiments of the present application have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A question-answering method based on a knowledge base, characterized in that: The knowledge base stores industry text data, entity information, entity corpus corresponding to the entity information, and factor contribution of the entity information in the target partition to which it belongs, and the entity information and the entity corpus are determined based on the industry text data, and the target partition to which it belongs is determined based on the factor contribution; the method comprises: Acquire question text data, and segment the question text data to obtain question corpus blocks; Perform information extraction and embedding processing based on the question corpus to obtain question entity data; Performing similarity calculation based on the question entity data, the entity information and the factor contribution to obtain entity similarity data, performing similarity calculation based on the question corpus and the entity corpus to obtain corpus similarity data, and determining a fusion result of the entity similarity data and the corpus similarity data; Retrieving target text data from the industry text data in the knowledge base using the fusion result, and generating answer text data for the question text data based on the target text data; The knowledge base is constructed by the following method: partitioning is performed based on the entity information and the event information corresponding to the entity information to obtain multiple initial partitions; wherein any entity information corresponds to an initial partition in the multiple initial partitions; for the initial partition corresponding to any entity information, the factor contribution of any entity information in the initial partition is calculated according to the optimal number of factors of the initial partition; wherein the factor contribution is obtained by summing the contribution of each factor to any entity information by calculating the contribution, and is used to evaluate the partition quality; if it is determined that the initial partition does not meet the factor contribution condition according to the factor contribution, the multiple initial partitions are partitioned and optimized until the optimized initial partitions all meet the factor contribution condition; wherein any entity information corresponds to a target partition in the optimized initial partition; the factor contribution condition is that there is entity information whose factor contribution reaches a preset threshold in the initial partition; according to the entity association feature of the target partition corresponding to any entity information, vector embedding is performed on any entity information to obtain a graph embedding representation to construct the knowledge base.
2. The method according to claim 1, characterized in that The optimal number of factors is obtained by the following method: According to the entity information and event information in any initial partition, a partition adjacency matrix of any initial partition is constructed; wherein the elements in the partition adjacency matrix are used to represent the association relationship between the entity information in any initial partition; Performing non-negative matrix decomposition on the partition adjacency matrix, and determining the optimal number of factors according to an error between a non-negative matrix decomposition result and the partition adjacency matrix.
3. The method according to claim 1, characterized in that The partitioning based on the entity information and the event information corresponding to the entity information to obtain a plurality of initial partitions includes: According to the entity information and the event information, a weighted adjacency matrix about the entity information is constructed; wherein the elements in the weighted adjacency matrix are used to represent the association relationship between the entity information; The entity information is partitioned using the weighted adjacency matrix through the Leiden algorithm to obtain the multiple initial partitions.
4. The method according to claim 3, characterized in that The performing partition optimization on the multiple initial partitions until all the optimized initial partitions satisfy the factor contribution conditions includes: The resolution parameter in the Leiden algorithm is adjusted, and repartitioning is performed according to the adjusted resolution parameter to obtain a plurality of optimized initial partitions, until the plurality of optimized initial partitions all meet the factor contribution condition.
5. The method according to claim 3, characterized in that: The entity association feature of the target partition corresponding to any entity information is obtained in the following manner: By means of a random walk algorithm, random walk is performed in the target partition corresponding to any entity information according to the weighted adjacency matrix to obtain entity association features between entity information in the target partition.
6. The method according to claim 1, characterized in that The entity similarity data is in the following form: in, Representing the entity similarity data; The entity data of the problem; The entity information; Entity data for the problem and the entity information similarity; For the entity information In the target partition The corresponding factor contribution in ; is the set of all the target partitions.
7. A question-answering system based on a knowledge base, characterized in that: The knowledge base stores industry text data, entity information, entity corpus corresponding to the entity information, and factor contribution of the entity information in the target partition to which it belongs, and the entity information and the entity corpus are determined based on the industry text data, and the target partition to which it belongs is determined based on the factor contribution; the system includes: A text segmentation module is used to obtain question text data and segment the question text data to obtain question corpus blocks; An information processing module, used for performing information extraction and embedding processing based on the question corpus to obtain question entity data; A similarity calculation module, configured to perform similarity calculation based on the question entity data, the entity information and the factor contribution to obtain entity similarity data, perform similarity calculation based on the question corpus and the entity corpus to obtain corpus similarity data, and determine a fusion result of the entity similarity data and the corpus similarity data; A retrieval and answering module, used to retrieve target text data from the industry text data in the knowledge base using the fusion result, and generate answer text data for the question text data based on the target text data; The system further includes: a preliminary partitioning module, which is used to partition based on entity information and event information corresponding to the entity information to obtain multiple initial partitions; wherein any entity information corresponds to an initial partition in the multiple initial partitions; a factor contribution calculation module, which is used to calculate the factor contribution of any entity information in the initial partition according to the optimal number of factors of the initial partition; wherein the factor contribution is obtained by summing the contribution of each factor to any entity information through contribution calculation, and is used to evaluate the partition quality; a partition optimization module, which is used to perform partition optimization, and if it is determined that the initial partition does not meet the factor contribution condition according to the factor contribution, multiple initial partitions are partition optimized until the optimized initial partitions all meet the factor contribution condition; wherein any entity information corresponds to a target partition in the optimized initial partition; the factor contribution condition is that there is entity information whose factor contribution reaches a preset threshold in the initial partition; a knowledge base construction module, which is used to perform vector embedding on any entity information according to the entity association features of the target partition corresponding to any entity information, and obtain a graph embedding representation to construct a knowledge base.
8. A question-answering method based on a knowledge base in the field of architecture, characterized in that: The construction domain knowledge base is used for concrete quality supervision and traceability analysis; the construction domain knowledge base stores concrete quality information, concrete quality entity information, concrete quality corpus corresponding to the concrete quality entity information, and factor contribution of the concrete quality entity information in the target partition to which it belongs, and the concrete quality entity information and the concrete quality corpus are determined based on the concrete quality information, and the target partition to which it belongs is determined based on the factor contribution; the method comprises: Acquire source tracing question data, and segment the source tracing question data to obtain source tracing question corpus blocks; Performing information extraction and embedding processing based on the source-tracing question corpus to obtain source-tracing question entity information; Performing similarity calculation based on the tracing question entity information, the concrete quality entity information and the factor contribution to obtain tracing entity similarity data, performing similarity calculation based on the tracing question corpus and the concrete quality corpus to obtain tracing corpus similarity data, and determining a fusion result of the tracing entity similarity data and the tracing corpus similarity data; Retrieving target traceability information from the concrete quality information in the construction field knowledge base using the fusion result, and generating concrete traceability answer data corresponding to the traceability question data based on the target traceability information, so as to perform quality supervision and traceability analysis on concrete; The construction method of the architectural field knowledge base adopts the knowledge base construction method of different fields, and constructs the knowledge base by the following method: partitioning is performed based on entity information and event information corresponding to the entity information to obtain multiple initial partitions; wherein any entity information corresponds to an initial partition in the multiple initial partitions; for the initial partition corresponding to any entity information, the factor contribution of any entity information in the initial partition is calculated according to the optimal number of factors of the initial partition; wherein the factor contribution is obtained by summing the contribution of each factor to any entity information through contribution calculation, and is used to evaluate the partition quality; if it is determined that the initial partition does not meet the factor contribution condition according to the factor contribution, the multiple initial partitions are partitioned and optimized until the optimized initial partitions all meet the factor contribution condition; wherein any entity information corresponds to a target partition in the optimized initial partition; the factor contribution condition is that there is entity information whose factor contribution reaches a preset threshold in the initial partition; according to the entity association feature of the target partition corresponding to any entity information, the vector embedding of any entity information is performed to obtain a graph embedding representation to construct the knowledge base.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 6 by executing the computer instructions.
Citation Information
Patent Citations
A data fusion method and device for a knowledge graph
CN109739939A
Question and answer method and device, electronic equipment and storage medium
CN117473056A