Coal industry large model retrieval enhancement generation method and system based on knowledge graph
By constructing a knowledge graph of the coal industry and performing intent recognition and reliability scoring, the problem of poor retrieval results in existing technologies has been solved, and more efficient and accurate retrieval results have been generated.
Patent Information
- Application Number
- CN202510031500.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-01-08
AI Technical Summary
Existing technologies based on search enhancement generation techniques in the coal industry have poor search performance and limitations, affecting search accuracy and efficiency.
A knowledge graph of the coal industry is constructed, the target retrieval scope is determined by intent recognition, the target text is determined from the candidate texts based on reliability scores, and the input is fed into a large language model to generate the response answer.
The retrieval algorithm has been optimized, improving retrieval accuracy and efficiency, and generating more accurate and higher-quality response answers.
Smart Images

Figure CN119988600B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of coal mine intelligent technology, in particular to a coal industry large model retrieval enhancement generation method and system based on a knowledge graph. BACKGROUND
[0002] In the coal industry, in order to improve the degree of coal mine intelligence, retrieval enhancement generation technology is introduced. Retrieval enhancement generation refers to retrieving relevant information from a large document set before generating text or answering questions based on a large model, and then using the retrieved information to guide the generation of text, thereby improving the quality and accuracy of prediction.
[0003] In related technologies, when retrieval is performed based on retrieval enhancement generation technology, there are great limitations and the retrieval effect is not good. SUMMARY
[0004] The present disclosure aims to at least partially solve one of the technical problems in the related art.
[0005] To this end, the purpose of the present disclosure is to propose a coal industry large model retrieval enhancement generation method and system based on a knowledge graph, which can effectively optimize the retrieval algorithm and improve the retrieval accuracy and efficiency.
[0006] To achieve the above-mentioned purpose, the coal industry large model retrieval enhancement generation method based on a knowledge graph according to the first aspect of the present disclosure comprises:
[0007] constructing a coal industry knowledge graph;
[0008] performing intent recognition on a user query statement and determining a target retrieval range from the coal industry knowledge graph according to the intent recognition result, wherein the target retrieval range comprises a plurality of candidate texts;
[0009] performing retrieval based on the user query statement to determine a target text from the plurality of candidate texts;
[0010] determining a reliability score corresponding to each target text;
[0011] inputting the target text into a large language model according to the reliability score to obtain a response answer text corresponding to the user query statement.
[0012] To achieve the above-mentioned purpose, the coal industry large model retrieval enhancement generation system based on a knowledge graph according to the second aspect of the present disclosure comprises:
[0013] a construction module configured to construct a coal industry knowledge graph;
[0014] The first determination module is configured to perform intent recognition on the user query statement, and determine a target retrieval range from the coal industry knowledge graph according to the intent recognition result, wherein the target retrieval range includes a plurality of candidate texts.
[0015] The second determination module is configured to perform retrieval based on the user query statement to determine a target text from the plurality of candidate texts.
[0016] The third determination module is configured to determine a reliability score corresponding to each target text.
[0017] The input module is configured to input the target text into a large language model according to the reliability score to obtain a response answer text corresponding to the user query statement.
[0018] The coal industry large model retrieval enhancement generation method and system based on a knowledge graph provided by the present disclosure can effectively optimize the retrieval algorithm and improve the retrieval accuracy and efficiency.
[0019] Additional aspects and advantages of the present disclosure will be described in part in the description that follows, will become apparent from the description, or will be learned through practice of the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0020] The above and / or additional aspects and advantages of the present disclosure will become apparent and more readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
[0021] Figure 1 is a flowchart of a coal industry large model retrieval enhancement generation method based on a knowledge graph according to an embodiment of the present disclosure;
[0022] Figure 2 is a flowchart of a coal industry large model retrieval enhancement generation method based on a knowledge graph according to another embodiment of the present disclosure;
[0023] Figure 3 is a structural diagram of a coal industry large model retrieval enhancement generation system based on a knowledge graph according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] Embodiments of the present disclosure are described below in detail with reference to the accompanying drawings, examples of which are shown in the drawings, wherein the same or similar notations represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by reference to the drawings are exemplary only, and are for the purpose of explanation only, and are not to be taken as limiting of the present disclosure. On the contrary, the embodiments of the present disclosure include all modifications, variations and equivalents that fall within the spirit and scope of the appended claims.
[0025] Figure 1 FIG. 1 is a flowchart of a method for enhancing and generating a coal industry large model retrieval based on a knowledge graph according to an embodiment of the present disclosure.
[0026] It should be noted that the execution subject of the method for enhancing and generating a coal industry large model retrieval based on a knowledge graph is a system for enhancing and generating a coal industry large model retrieval based on a knowledge graph. The system can be implemented in software and / or hardware, and can be configured in a computer device, which can include, but is not limited to, a terminal, a server, and the like. For example, the terminal can be a mobile phone, a palm computer, and the like.
[0027] As shown in FIG. 1, the method for enhancing and generating a coal industry large model retrieval based on a knowledge graph includes the following steps. Figure 1
[0028] S101: Constructing a coal industry knowledge graph.
[0029] The coal industry knowledge graph refers to a knowledge graph used to indicate information related to the coal industry. The type and quantity of the coal industry knowledge graph are not limited in the embodiments of the present disclosure.
[0030] It can be understood that there is a large amount of related information in the coal industry, and it can be cumbersome to directly retrieve based on this information. Therefore, in the embodiments of the present disclosure, a coal industry knowledge graph can be constructed to realize the structured arrangement of the related text of the coal industry, so as to facilitate subsequent retrieval.
[0031] S102: Intention recognition is performed on a user query statement, and a target retrieval range is determined from the coal industry knowledge graph according to the intention recognition result, wherein the target retrieval range includes a plurality of candidate texts.
[0032] The user query statement refers to the text queried by the user.
[0033] The intention recognition result can be used to indicate the query intention of the user, for example, can include a query object, a query range, and the like, which is not limited.
[0034] The target retrieval range refers to the retrieval range preliminarily determined from the coal industry knowledge graph based on the intention recognition result.
[0035] wherein the candidate text refers to a text related to the coal industry.
[0036] In the embodiment of the present disclosure, the intention of the user query statement is recognized, and the target retrieval range is determined from the coal industry knowledge graph according to the intention recognition result, thereby realizing preliminary retrieval to effectively reduce the calculation cost of the subsequent retrieval process.
[0037] S103: Retrieving based on the user query statement to determine the target text from the plurality of candidate texts.
[0038] wherein the target text refers to a text related to the coal industry.
[0039] That is to say, after the intention of the user query statement is recognized, and the target retrieval range is determined from the coal industry knowledge graph according to the intention recognition result, the target text can be determined from the plurality of candidate texts based on the user query statement, thereby providing reliable data support for obtaining the response answer text corresponding to the user query statement.
[0040] S104: Determining the reliability score corresponding to each target text.
[0041] wherein the reliability score can be used to indicate the reliability of the target text in responding to the user query statement.
[0042] In the embodiment of the present disclosure, when determining the reliability score corresponding to each target text, the target text can be input into a pre-trained machine learning model to obtain the corresponding reliability score, or the reliability score corresponding to each target text can also be determined based on a third-party scoring device, which is not limited.
[0043] S105: Inputting the target text into a large language model according to the reliability score to obtain the response answer text corresponding to the user query statement.
[0044] wherein the response answer text refers to a text used to answer the user query statement.
[0045] In the embodiment of the present disclosure, when inputting the target text into a large language model according to the reliability score to obtain the response answer text corresponding to the user query statement, the target text can be reordered according to the reliability score, and then the reordered target text can be input into the large language model to generate the corresponding response answer text after being sorted by the large language model.
[0046] In this embodiment, a knowledge graph of the coal industry is constructed; the intent of the user query statement is recognized, and the target retrieval range is determined from the knowledge graph of the coal industry according to the intent recognition result, wherein the target retrieval range includes a plurality of candidate texts; retrieval is performed based on the user query statement to determine the target text from the plurality of candidate texts; the reliability score corresponding to each target text is determined; and the target text is input into the large language model according to the reliability score to obtain the response answer text corresponding to the user query statement. Thus, the retrieval algorithm can be effectively optimized, and the retrieval accuracy and efficiency can be improved.
[0047] Figure 2 is a flowchart of a method for enhancing and generating a large model retrieval of the coal industry based on a knowledge graph according to another embodiment of the present disclosure.
[0048] As shown in Figure 2 , the method for enhancing and generating a large model retrieval of the coal industry based on a knowledge graph includes:
[0049] S201: Obtain coal industry related data, wherein the coal industry related data includes a plurality of related texts.
[0050] The coal industry related data refers to data related to the coal industry, which may, for example, include laws and regulations, periodical literature, patents, standards, safety regulations, etc., without limitation.
[0051] The related text refers to the text contained in the coal industry related data.
[0052] In the embodiments of the present disclosure, when the coal industry related data is obtained, reliable data support can be provided for subsequent construction of the knowledge graph of the coal industry.
[0053] S202: Data cleaning and preprocessing are performed on the related texts to obtain reference texts, wherein the candidate texts belong to a plurality of reference texts.
[0054] The reference text refers to the text obtained after data cleaning and preprocessing of the related text.
[0055] It can be understood that the related texts obtained initially may contain duplicate data and irrelevant data, which may affect the subsequent retrieval efficiency and cost. Therefore, in the embodiments of the present disclosure, data cleaning and preprocessing can be performed on the related texts to effectively improve the quality and accuracy of the obtained reference texts.
[0056] S203: Determine the label information corresponding to each reference text.
[0057] The label information can be used to indicate the related features corresponding to the reference text.
[0058] Optionally, in some embodiments, when determining the label information corresponding to each reference text, the industry business type to which the reference text belongs can be determined, and a first-level label can be determined according to the industry business type; the industry application scenario to which the reference text belongs can be determined, and a second-level label can be determined according to the industry application scenario; the data source, constraint type and viewpoint type corresponding to the reference text can be determined, and other dimension labels can be determined according to the data source, constraint type and viewpoint type; the first-level label, the second-level label and the other dimension labels are jointly used as the label information corresponding to the reference text. In this way, the indication effect of the obtained label information can be effectively improved, and the practicality and reliability of the label information can be ensured.
[0059] The industry business type may, for example, include basic, production, safety, management, etc., and no limitation is made thereto. The first-level label can be used to indicate the industry business type to which the reference text belongs.
[0060] The industry application scenario may, for example, include license information, organization, geological and hydrological conditions, mining conditions, disaster conditions, IT infrastructure and others. The second-level label can be used to indicate the industry application scenario to which the reference text belongs.
[0061] The other dimension label can be used to indicate the data source (laws and regulations, standards, patents, papers, etc.), constraint type (mandatory, recommended, etc.), viewpoint type (subjective, objective, etc.) and other characteristics of the reference text.
[0062] In the embodiments of the present disclosure, when the label information corresponding to each reference text is determined, reliable reference information can be provided for subsequent construction of the coal industry knowledge graph.
[0063] S204: Constructing a coal industry knowledge graph based on the label information and the reference text.
[0064] Optionally, in some embodiments, when the coal industry knowledge graph is constructed based on the label information and the reference text, the ontology layer of a knowledge subgraph can be constructed based on the second-level label, wherein the knowledge subgraph is associated with the first-level label; entity recognition is performed on the reference text to determine a plurality of reference entities of the knowledge subgraph and determine the association information between the plurality of reference entities; the similarity between the plurality of reference entities is determined, and the plurality of reference entities are fused according to the similarity; the reference entities are attribute-filled based on the other dimension labels; the data connection between the reference entities and the corresponding reference text is established; and the union of the knowledge subgraphs corresponding to the plurality of first-level labels is taken as the coal industry knowledge graph. In this way, the indication effect of the obtained coal industry knowledge graph can be effectively improved, and the practicality and reliability of the coal industry knowledge graph can be ensured.
[0065] Wherein, the ontology layer refers to a hierarchy in the knowledge graph for defining and describing knowledge of a specific field, including entities, concepts, attributes, relationships, and constraints, etc.
[0066] Wherein, the reference entity refers to an entity determined by performing entity recognition on the reference text.
[0067] Wherein, the knowledge sub-graph refers to a knowledge graph constructed for a primary label.
[0068] That is to say, in the embodiments of the present disclosure, a knowledge graph can be constructed for each primary label respectively, and the collection of the knowledge sub-graphs corresponding to the multiple primary labels is taken as the coal industry knowledge graph, so as to ensure the clear indication of the obtained coal industry knowledge graph.
[0069] That is to say, in the embodiments of the present disclosure, coal industry related data can be obtained, wherein the coal industry related data includes multiple related texts; data cleaning and preprocessing are performed on the related texts to obtain reference texts, wherein the candidate text belongs to multiple reference texts; the label information corresponding to each reference text is determined; and the coal industry knowledge graph is constructed based on the label information and the reference texts. Thus, the reliability and practicality of the obtained coal industry knowledge graph can be effectively improved.
[0070] S205: performing intent recognition on the user query statement, and determining a target retrieval range from the coal industry knowledge graph according to the intent recognition result, wherein the target retrieval range includes multiple candidate texts.
[0071] S206: performing retrieval based on the user query statement to determine a target text from the multiple candidate texts.
[0072] S207: determining a reliability score corresponding to each target text.
[0073] S208: inputting the target text into a large language model according to the reliability score to obtain a response answer text corresponding to the user query statement.
[0074] The description of S205-S208 can be specifically referred to the above embodiments, which will not be repeated here.
[0075] In the embodiments, coal industry related data is obtained, wherein the coal industry related data includes multiple related texts; data cleaning and preprocessing are performed on the related texts to obtain reference texts, wherein the candidate text belongs to multiple reference texts; the label information corresponding to each reference text is determined; and the coal industry knowledge graph is constructed based on the label information and the reference texts. Thus, the reliability and practicality of the obtained coal industry knowledge graph can be effectively improved.
[0076] Optionally, in some embodiments, when the intent of the user query statement is identified, and the target retrieval range is determined from the coal industry knowledge graph according to the intent identification result, the intent of the user query statement can be identified to determine the first-level label and the second-level label related to the user query statement as the intent identification result; the candidate entity is determined from the plurality of reference entities according to the first-level label and the second-level label related to the user query statement; and the reference text connected with the candidate entity is taken as the candidate text, wherein the plurality of candidate texts jointly constitute the target retrieval range. Thus, the target retrieval range can be accurately and quickly determined.
[0077] wherein the candidate entity refers to the entity determined from the plurality of reference entities according to the first-level label and the second-level label related to the user query statement.
[0078] Optionally, in some embodiments, when the target text is determined from the plurality of candidate texts based on the user query statement, the unstructured retrieval can be performed based on the user query statement to determine the first text from the plurality of candidate texts; the structured retrieval can be performed based on the user query statement to determine the second text from the plurality of candidate texts; and the first text and the second text are jointly taken as the target text. Thus, the unstructured retrieval and the structured retrieval can be combined to ensure the retrieval accuracy of the target text.
[0079] Optionally, in some embodiments, when the unstructured retrieval is performed based on the user query statement to determine the first text from the plurality of candidate texts, the user query statement can be optimized and adjusted to obtain a target query statement; the target query statement is converted into a query statement vector, and the candidate text is converted into a candidate text vector; the cosine similarity between the query statement vector and each candidate text vector is determined; and the first text is determined from the plurality of candidate texts according to the cosine similarity. Thus, the accuracy of the determined first text can be ensured by combining the cosine similarity between the query statement vector and each candidate text vector.
[0080] Optionally, in some embodiments, when the structured retrieval is performed based on the user query statement to determine the second text from the plurality of candidate texts, the entity to be queried corresponding to the target query statement can be determined; the matching result between the entity to be queried and each candidate entity is determined; and the second text is determined from the plurality of candidate texts according to the matching result. Thus, the second text can be quickly determined.
[0081] Optionally, in some embodiments, when determining the reliability score corresponding to each target text, the following can be performed: according to the industry application scenario corresponding to the target text, determining the reference score and the weight value corresponding to each other dimension label of the target text; and performing weighted summation based on the reference score and the weight value to obtain the reliability score. In this way, the reference score and the weight value corresponding to each other dimension label of the target text can be determined in combination with the industry application scenario corresponding to the target text, so as to ensure the adaptability of the obtained reliability score to the personalized application scenario.
[0082] In combination with the above embodiments, the present disclosure relates to knowledge graph construction and knowledge retrieval of text data, and the specific implementation steps mainly include the following aspects:
[0083] 1. Constructing a coal industry knowledge graph based on an industry label system
[0084] Step one, data collection. To form a complete vertical field knowledge graph, industry-related knowledge is widely collected. First, the data sources required for the coal industry knowledge graph are sorted out, including but not limited to legal regulations, journal literature, patents, standards, safety regulations, etc. Next, a combination of automatic algorithm and manual review is used to extract data from the above-mentioned multiple sources, form a unified format, and the automatic algorithm can batch capture and transform data, and manual review can ensure the accuracy and relevance of the data. Finally, the collected data is classified according to structured, semi-structured and unstructured to facilitate subsequent processing and analysis. Structured and semi-structured knowledge has an explicit structure and fixed format, and belongs to easily extractable information. Unstructured data is mostly pure text knowledge, with no obvious format, and belongs to relatively difficult to extract knowledge.
[0085] Step two, data cleaning. In order to improve the quality and accuracy of the data, the data needs to be cleaned and preprocessed, mainly including identifying and removing duplicate data and irrelevant data in the data set, filling missing data, data standardization, etc. Related technologies of natural language processing are used for data cleaning to improve data quality and lay a solid foundation for subsequent construction of knowledge graph.
[0086] Step three, data labeling. Based on the established industry label system, use data labeling tools for labeling, including first-level labels, second-level labels, and other dimension labels. First-level labels are divided into four categories: basic, production, safety, and management. Second-level labels further classify data based on industry practical application scenarios, such as the seven categories of basic labels, including license information, organization, geological and hydrological conditions, mining conditions, disaster conditions, IT infrastructure, and others. Other dimension labels are classified by data sources (laws and regulations, standards, patents, papers, etc.), constraint types (mandatory, recommended, etc.), and viewpoint types (subjective, objective, etc.). Early manual labeling is the main method, and when the labeled data accumulates to a certain amount, deep learning models such as BERT and textcnn can be trained for automatic labeling. Subsequently, manual assistance is provided for checking to improve the accuracy and efficiency of labeling.
[0087] Step four, building knowledge graph. Based on the labeled data, use the property graph model as the knowledge representation method, and use the Neo4j graph database to build the knowledge graph. For each first-level label, build a knowledge subgraph, and the union of all first-level label subgraphs forms the coal industry knowledge graph. Taking the production class knowledge subgraph as an example, the detailed process of building the knowledge graph is described:
[0088] ① Ontology layer construction, which defines the concepts and relationships between concepts in the field. Due to the special nature of the coal industry business, automated construction driven by data cannot clearly induce and classify, so manual construction should be used, combined with industry knowledge, to build an ontology layer that conforms to the business logic of the industry. When building the production class subgraph, use the second-level labels of the production class as the ontology layer. Since the data has been labeled in step three, the ontology layer can be quickly constructed, saving effort and conforming to the industry business logic;
[0089] ② Entity recognition and relationship extraction, the entity objects extracted from the knowledge are extracted as nodes of the knowledge graph. In the coal industry, this may involve identifying mine, equipment model, mining technology, and other professional terms. Relationship extraction identifies the semantic connection between entities, such as "the mine uses a certain model of equipment." These steps usually require natural language processing techniques, including named entity recognition (NER) and relationship extraction algorithms.
[0090] ③Knowledge fusion, knowledge fusion of synonyms and similar entities, and solving the conflict and ambiguity problem of different data sources. In the coal industry, the same equipment has different names in different documents, such as "coal mining machine" and "coal cutting machine", which refer to the same equipment. Knowledge fusion needs to unify these synonyms to ensure the consistency of the knowledge graph. Due to the lack of certain background knowledge of the coal industry in the algorithm model, it is difficult to achieve the effect of industry professionalism with the help of traditional knowledge fusion strategy, and it is necessary to combine machine learning algorithm with the synonym list of the coal industry to ensure the accuracy of the fusion result. In addition, knowledge fusion also includes entity linking and knowledge merging to ensure that knowledge from different sources can be integrated together. To achieve this goal, other dimension labels are needed to confirm more authoritative information, for example, when subjective and objective conflict, the objective content should be selected first; when forced and recommended conflict, the forced content should be selected to ensure higher quality of merged knowledge.
[0091] ④Attribute filling, taking other dimension labels as entity attributes and embedding them into the knowledge graph.
[0092] ⑤Connect each entity node to its original document to facilitate data tracking, unstructured retrieval, and context understanding.
[0093] ⑥Store knowledge, finally store the extracted knowledge in the graph database.
[0094] Through the above steps, a structured and rich semantic information coal industry knowledge sub-graph can be constructed, and the same process can be used to construct sub-graphs for other primary labels.
[0095] 2. User query statement (query) intent recognition, narrowing the search scope
[0096] The intent of the user input query statement is identified, and the primary and secondary labels of the query statement are confirmed. Specifically, the identified primary label can narrow the search scope to the sub-graph, and the secondary label can narrow the search scope to the related entities in the sub-graph, thereby improving the subsequent retrieval efficiency. The intent of the query statement can be achieved in three ways: 1. Based on the automatic tagging model trained in advance to identify the intent of the query statement; 2. Query statement intent recognition based on large model, that is, by constructing prompt template to guide the large model to answer the label of the query statement; 3. Vector matching based intent recognition, vectorizing query, label and its description information respectively, and performing similarity matching.
[0097] 3. Unstructured retrieval based on vector, structured retrieval based on knowledge graph
[0098] After confirming the search range, this step combines the advantages of unstructured and structured search to form a hybrid search mechanism to provide comprehensive and accurate search results. First, for the user query statement, optional rewriting / extension can be performed to optimize the expression of the query statement and facilitate more accurate retrieval. Then, a vector-based unstructured search method is introduced. In this method, the system converts the query statement into a high-dimensional vector and calculates the cosine similarity between it and the text vectors in the search range locked in the second step. Through this step, the system can quickly identify the n texts that are most semantically similar to the query statement, reducing large-scale similarity calculation. This search result is used as the unstructured search result. Next, a structured search technique is used to identify entities in the query statement through an entity extraction model. Using the structured information in the knowledge graph, the system can match related entities and attributes within the locked search range and retrieve highly relevant neighborhood information for the user query. This structured search process not only provides accurate search results, but also reveals complex relationships between entities through the links in the knowledge graph. This query result is used as the structured query result.
[0099] 4. Search rearrangement and context generation
[0100] Search rearrangement and context generation are important steps to improve the quality of search results. This step reorders the search results based on the authority score of the attributes in the knowledge graph to ensure that more authoritative information is placed at the front. The authority score can be calculated by weighted average. Different weights are assigned to each label dimension, and within each dimension, a score is assigned based on the authority level, for example, in the constraint type dimension, mandatory label > suggested label; in the opinion type dimension, objective label > subjective label. The authority of the search content is calculated based on the authority score, and the search results are reordered based on the score, with higher-scoring search results placed at the front to generate a comprehensive context for large language models.
[0101] 5. Large language model generates response answer
[0102] A large language model is used to generate a response answer. The text content from the previous step is inserted into a pre-constructed prompt template as input for the large model to guide the large language model to generate an accurate, logical, and professional answer.
[0103] The present application constructs a knowledge graph based on an industry label system to narrow the search range and improve query efficiency. At the same time, it improves the accuracy and authority of the answer through attribute-based search rearrangement. Finally, it uses the rich relationships in the knowledge graph to generate logically coherent and highly relevant text, improving the quality of semantic understanding and text generation.
[0104] Figure 3 is a structural schematic diagram of a coal industry large model retrieval enhancement generation system based on a knowledge graph according to an embodiment of the present disclosure.
[0105] As shown in Figure 3 the coal industry large model retrieval enhancement generation system 30 based on the knowledge graph includes:
[0106] The construction module 301 is configured to construct a coal industry knowledge graph.
[0107] The first determination module 302 is configured to perform intent recognition on a user query statement, and determine a target retrieval range from the coal industry knowledge graph according to the intent recognition result, wherein the target retrieval range includes a plurality of candidate texts.
[0108] The second determination module 303 is configured to perform retrieval based on the user query statement to determine a target text from the plurality of candidate texts.
[0109] The third determination module 304 is configured to determine a reliability score corresponding to each target text.
[0110] The input module 305 is configured to input the target text into a large language model according to the reliability score to obtain a response answer text corresponding to the user query statement.
[0111] It should be noted that the foregoing explanation and description of the coal industry large model retrieval enhancement generation method based on the knowledge graph also applies to the coal industry large model retrieval enhancement generation system based on the knowledge graph of the present embodiment, which will not be described here.
[0112] In the present embodiment, by constructing a coal industry knowledge graph, performing intent recognition on a user query statement, and determining a target retrieval range from the coal industry knowledge graph according to the intent recognition result, wherein the target retrieval range includes a plurality of candidate texts, performing retrieval based on the user query statement to determine a target text from the plurality of candidate texts, determining a reliability score corresponding to each target text, and inputting the target text into a large language model according to the reliability score to obtain a response answer text corresponding to the user query statement. Therefore, the retrieval algorithm can be effectively optimized, and the retrieval accuracy and efficiency can be improved.
[0113] Other embodiments of the present disclosure will be readily apparent to those skilled in the art upon considering the description set forth herein with reference to the accompanying drawings. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles thereof and include those that are within the general purview of the present disclosure but are not disclosed herein. The description and examples are to be regarded as illustrative only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0114] It is to be understood that the present disclosure is not limited to the precise construction that has been described above and shown in the accompanying drawings, and that various modifications and changes can be effected therein by those skilled in the art without departing from the scope of the disclosure. The scope of the disclosure is limited only by the claims appended hereto.
[0115] It should be noted that in the description of the present disclosure, the terms "first", "second", etc. are used only for descriptive purposes and are not to be construed as indicating or implying relative importance. In addition, in the description of the present disclosure, the meaning of "a plurality of" is two or more, unless otherwise specified.
[0116] Any process or method descriptions or any other descriptions herein can be understood as representing embodiments of implementations encompassing one or more steps, operations or functions, and the scope of the preferred embodiments of the present disclosure includes additional implementations that can be performed in an order different from the order shown or discussed, including substantially concurrently or in reverse order, and that additional implementations can include fewer or additional steps, operations or functions.
[0117] It should be understood that various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-described embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and as in another embodiment, it can be implemented by any one or a combination of the following technologies known in the art: discrete logic circuit with logic gates for implementing logical functions on data signals, application specific integrated circuit with suitable combination logic gates, programmable gate array (PGA), field programmable gate array (FPGA) and the like.
[0118] Those skilled in the art of the present technology can understand that all or part of the steps carried out by the above-mentioned embodiments can be completed by programs instructing relevant hardware, and the programs can be stored in a computer readable storage medium, which includes one or a combination of steps of the method embodiments when executed.
[0119] In addition, each functional unit in each embodiment of the present disclosure can be integrated in one processing module, or each unit can exist physically separately, or two or more units can be integrated in one module. The above-mentioned integrated module can be realized in the form of hardware or in the form of software functional module. When the integrated module is realized in the form of software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.
[0120] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0121] In the description of the present disclosure, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present disclosure. In the present disclosure, the illustrative description of the above terms does not necessarily mean the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0122] Although the embodiments of the present disclosure have been shown and described above, it is understood that the above-described embodiments are exemplary and are not to be construed as limiting the present disclosure, and those skilled in the art can make changes, modifications, replacements and variations to the above-described embodiments within the scope of the present disclosure.
Claims
1. A knowledge graph-based method for enhancing the retrieval and generation of large-scale models in the coal industry, characterized in that, include: Obtain relevant data on the coal industry, wherein the relevant data on the coal industry includes multiple related texts; The relevant texts are cleaned and preprocessed to obtain reference texts, wherein the candidate texts belong to multiple reference texts; Determine the industry business type to which the reference text belongs, and determine the primary tags based on the industry business type, including basic, production, security and management; Determine the industry application scenario to which the reference text belongs, and determine the secondary tags based on the industry application scenario; Determine the data source, constraint type, and opinion type corresponding to the reference text, and determine other dimension tags based on the data source, constraint type, and opinion type, wherein the constraint type includes mandatory and advisory, and the opinion type includes subjective and objective; The first-level label, the second-level label, and the other dimension labels are combined to form the label information corresponding to the reference text; Based on the secondary tags, an ontology layer of knowledge subgraphs is constructed, wherein the knowledge subgraphs are associated with the primary tags; Entity recognition is performed on the reference text to identify multiple reference entities in the knowledge subgraph and to determine the association information between the multiple reference entities; Determine the similarity between the plurality of reference entities, and perform a fusion process on the plurality of reference entities based on the similarity; The reference entity is populated with attributes based on the other dimension labels; Establish a data connection between the reference entity and the corresponding reference text; The collection of knowledge subgraphs corresponding to multiple first-level tags is used as the knowledge graph of the coal industry. The intent of the user query is identified, and the target retrieval scope is determined from the coal industry knowledge graph based on the intent identification results, wherein the target retrieval scope includes multiple candidate texts; The search is performed based on the user's query to determine the target text from the plurality of candidate texts; Determining the reliability score for each target text includes: Based on the industry application scenario corresponding to the target text, determine the reference score and weight value corresponding to the target text and each other dimension label; A reliability score is obtained by weighted summation based on reference scores and weight values. The target text is input into a large language model based on the reliability score to obtain the response answer text corresponding to the user's query.
2. The method as described in claim 1, characterized in that, The step of identifying the intent of the user's query and determining the target retrieval scope from the coal industry knowledge graph based on the intent identification result includes: The intent of the user query statement is identified to determine the primary and secondary tags related to the user query statement as the intent identification result. Candidate entities are determined from the plurality of reference entities based on the primary and secondary tags related to the user query statement; The reference text connected to the candidate entity is used as the candidate text, wherein multiple candidate texts are jointly used to form the target retrieval range.
3. The method as described in claim 2, characterized in that, The step of retrieving text based on the user query to determine the target text from the plurality of candidate texts includes: Unstructured retrieval is performed based on the user's query to determine the first text from the plurality of candidate texts; A structured retrieval is performed based on the user's query to determine the second text from the plurality of candidate texts; The first text and the second text are combined as the target text.
4. The method as described in claim 3, characterized in that, The step of performing unstructured retrieval based on the user query to determine the first text from the plurality of candidate texts includes: The user query statement is optimized and adjusted to obtain the target query statement; The target query statement is converted into a query statement vector, and the candidate text is converted into a candidate text vector; Determine the cosine similarity between the query statement vector and each candidate text vector; The first text is determined from the plurality of candidate texts based on the cosine similarity.
5. The method as described in claim 4, characterized in that, The step of performing a structured retrieval based on the user query to determine the second text from the plurality of candidate texts includes: Identify the entity to be queried corresponding to the target query statement; Determine the matching result between the entity to be queried and each of the candidate entities; Based on the matching results, the second text is determined from the plurality of candidate texts.
6. A knowledge graph-based enhanced generation system for large-scale coal industry model retrieval, characterized in that, include: A module for building a knowledge graph for the coal industry; The building module is specifically used for: Obtain relevant data on the coal industry, wherein the relevant data on the coal industry includes multiple related texts; The relevant texts are cleaned and preprocessed to obtain reference texts, wherein the candidate texts belong to multiple reference texts; Determine the industry business type to which the reference text belongs, and determine the primary tags based on the industry business type, including basic, production, security and management; Determine the industry application scenario to which the reference text belongs, and determine the secondary tags based on the industry application scenario; Determine the data source, constraint type, and opinion type corresponding to the reference text, and determine other dimension tags based on the data source, constraint type, and opinion type, wherein the constraint type includes mandatory and advisory, and the opinion type includes subjective and objective; The first-level label, the second-level label, and the other dimension labels are combined to form the label information corresponding to the reference text; Based on the secondary tags, an ontology layer of knowledge subgraphs is constructed, wherein the knowledge subgraphs are associated with the primary tags; Entity recognition is performed on the reference text to identify multiple reference entities in the knowledge subgraph and to determine the association information between the multiple reference entities; Determine the similarity between the plurality of reference entities, and perform a fusion process on the plurality of reference entities based on the similarity; The reference entity is populated with attributes based on the other dimension labels; Establish a data connection between the reference entity and the corresponding reference text; The collection of knowledge subgraphs corresponding to multiple first-level tags is used as the knowledge graph of the coal industry. The first determining module is used to identify the intent of the user's query statement and determine the target retrieval range from the coal industry knowledge graph based on the intent identification result, wherein the target retrieval range includes multiple candidate texts; The second determining module is used to perform a retrieval based on the user query statement in order to determine the target text from the plurality of candidate texts; The third determining module is used to determine the reliability score corresponding to each target text; The third determining module is specifically used for: Based on the industry application scenario corresponding to the target text, determine the reference score and weight value corresponding to the target text and each other dimension label; A reliability score is obtained by weighted summation based on reference scores and weight values. The input module is used to input the target text into the large language model according to the reliability score, so as to obtain the response answer text corresponding to the user query.
Citation Information
Patent Citations
Question and answer method and system based on tin smelting knowledge graph
CN118779424A