Intelligent question and answer method and device, electronic equipment and storage medium
By constructing query intent and physical relationship diagrams, and combined with the knowledge map library and retrieval information of the vector library, enter into the large language model after integration, solve the problem of insufficient accuracy of intelligent Q & A systems on professional issues, and realize higher professionalism Question answer accuracy and depth understanding.
Patent Information
- Application Number
- CN202411174644.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2025-01-24
AI Technical Summary
Intelligent Q&A systems are not accurate enough when answering professional questions, making it difficult to accurately capture the deep meaning of professional terms.
By parsing the input question, the query intent and entity relationship graph are constructed, combined with the retrieval information from the knowledge graph library and vector library, and then integrated and input into the large language model to generate answers.
The intelligent question answering system improves the accuracy of answering professional questions, can more deeply understand user intentions and quickly retrieve relevant answers from a huge knowledge base.
Smart Images

Figure CN119357319A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an intelligent question-answering method, device, electronic device and storage medium. Background Art
[0002] With the continuous development of technology, people can now obtain information in various fields through intelligent question-and-answer systems, which are different from the traditional way of obtaining information through paper or consulting agencies. Intelligent question-and-answer systems are an application of artificial intelligence technology that uses natural language processing technology to understand users' questions and provide corresponding answers.
[0003] At present, due to the complexity and depth of professional knowledge, the intelligent question-answering system may lack sufficient professional domain knowledge base when answering professional questions, resulting in insufficient accuracy when answering professional questions. In addition, professional terms and concepts often require specific contextual understanding, and traditional systems may find it difficult to accurately capture and parse the deep meaning of these professional terms. Based on this, although the intelligent question-answering system performs well on general questions, there is still much room for improvement in professional questions.
[0004] Therefore, how to improve the accuracy of intelligent question-answering systems in answering professional questions has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present invention provides an intelligent question-answering method, device, electronic device and storage medium, which are used to solve the problem of insufficient accuracy of the intelligent question-answering system in the prior art when answering professional questions.
[0006] The present invention provides an intelligent question-answering method, comprising the following steps: Parse the input question and build the query intent and entity relationship diagram based on the parsing results; Based on the query intent and the entity relationship graph, query the knowledge graph library to obtain first search information; Vectorizing the input question, searching a vector library based on the vectorization result, and obtaining second search information; The first search information, the second search information and the input question are integrated and input into a large language model to obtain an answer to the question output by the large language model.
[0007] According to an intelligent question answering method provided by the present invention, before vectorizing the input question and searching the vector library based on the vectorization result to obtain the second search information, the method further includes: Performing data preprocessing on the original data to obtain preprocessed data; Slicing the preprocessed data to obtain multiple data blocks; Input each of the data blocks into a vectorized model to obtain a vector outputted by the vectorized model; Each of the vectors is stored in the vector library.
[0008] According to an intelligent question answering method provided by the present invention, before querying the knowledge graph library based on the query intent and the entity relationship graph to obtain the first search information, it also includes: Extract entity attributes from the original data to obtain multiple entities and multiple attributes; Identify the relationship between the entities, and construct entity relationship pairs based on the identification results; A knowledge graph library is constructed based on the multiple entities and the entity relationship pairs.
[0009] According to an intelligent question-answering method provided by the present invention, the original data includes data obtained from multiple data sources.
[0010] According to an intelligent question-answering method provided by the present invention, the knowledge graph library is constructed based on the multiple entities and the entity relationship pairs, including: Performing data cleaning on the multiple entities and the entity relationship pairs to obtain first processed data; Performing entity disambiguation processing on the first processed data to obtain second processed data; The second processed data is subjected to data fusion processing to obtain third processed data, and the third processed data are combined to obtain a knowledge graph library.
[0011] According to an intelligent question-answering method provided by the present invention, the step of performing data cleaning on the plurality of entities and the entity relationship pairs to obtain first processed data includes: Deduplication is performed on the multiple entities and the entity relationships to obtain first cleansed data; Based on a preset format, formatting the first cleaning data to obtain second cleaning data; Based on preset data filling rules, the second cleaned data is processed by filling missing values to obtain first processed data.
[0012] The present invention also provides an intelligent question-answering device, comprising the following modules: The parsing and building module is used to parse the input question and build the query intent and entity relationship diagram based on the parsing results; A first retrieval module is used to query the knowledge graph library based on the query intent and the entity relationship graph to obtain first retrieval information; A second search module is used to vectorize the input question and search the vector library based on the vectorization result to obtain second search information; The answer generation module is used to integrate the first search information and the second search information and input them into a large language model to obtain an answer to the question output by the large language model.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the intelligent question-answering method as described above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements any of the intelligent question-answering methods described above.
[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the intelligent question-answering method as described above is implemented.
[0016] The intelligent question-answering method, device, electronic device and storage medium provided by the present invention parse the input question, construct the query intent and entity relationship graph based on the parsing result; query the knowledge graph library based on the query intent and entity relationship graph to obtain the first search information; vectorize the input question, search the vector library based on the vectorization result to obtain the second search information; integrate the first search information and the second search information and input them into the large language model to obtain the answer to the question output by the large language model. This solution constructs the query intent and entity relationship graph according to the input question, and then retrieves the knowledge fragments related to the input question from the knowledge graph library according to the query intent and the entity relationship graph, vectorizes the input question, captures the similarity and semantic relationship between the data, and inputs these knowledge fragments, vectors and the input question into the large language model. The large language model uses this additional information to generate the final answer to the question, and achieves a deep understanding and rapid response to the input question; in addition, through this method, whether it is daily consultation or professional questions, it can accurately capture the user's intention and retrieve relevant answers from the huge knowledge graph library, which can be applied to different fields and scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 This is one of the flow charts of the intelligent question-answering method provided by the present invention.
[0019] Figure 2 This is the second flow chart of the intelligent question-answering method provided by the present invention.
[0020] Figure 3 It is a structural schematic diagram of the intelligent question-answering device provided by the present invention.
[0021] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] It should be noted that in the description of the embodiments of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. The orientation or position relationship indicated by the terms "upper", "lower" and the like is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or it can be a connection between two elements. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0024] The terms "first", "second", etc. in the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" means at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0025] Combine the following Figure 1-Figure 4 The intelligent question-answering method, device, electronic device and storage medium provided in the embodiments of the present invention are described.
[0026] Figure 1 This is one of the flow charts of the intelligent question-answering method provided by the present invention; Figure 2 This is the second flow chart of the intelligent question-answering method provided by the present invention; like Figure 1-Figure 2 As shown, the method includes the following: S110, parsing the input question, and constructing a query intent and entity relationship graph based on the parsing result; S120, querying the knowledge graph library based on the query intent and the entity relationship graph to obtain first search information; S130, vectorizing the input question, and searching a vector library based on the vectorization result to obtain second search information; S140: Integrate the first search information, the second search information, and the input question and input them into a large language model to obtain an answer to the question output by the large language model.
[0027] It should be noted that the executor of the intelligent question-answering method provided in the embodiment of the present invention may be a server or a computer device, such as a mobile phone, a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, etc.
[0028] In S110, after the user inputs a question, the input question is parsed based on natural language processing technology to construct a query intent and entity relationship diagram. Query intent refers to the meaning of the information or results that the user expects to obtain when querying. Entities are proper nouns with specific meanings, such as names of people, places, names of organizations, dates, times, currency values, etc. The query intent and entity relationship diagram is a relationship diagram between query intent and entities. By parsing and constructing the query intent and entity relationship diagram, a deep understanding of user needs is ensured.
[0029] In S120, according to the query intent and entity relationship graph constructed, the relevant information nodes are accurately located based on the offline constructed knowledge graph library. The knowledge graph library is a structured semantic knowledge base that organizes complex knowledge in the form of a graph to construct a network structure consisting of nodes (representing entities) and edges (representing the relationship between entities). This structure can not only store rich factual information, but also express the complex relationship between entities, thereby providing a more intuitive and flexible way of knowledge representation for machines. In the intelligent question-answering system, the knowledge graph library can provide rich background knowledge to help the system understand the user's questions more accurately and generate relevant answers. In addition, the knowledge graph also has the ability to be dynamically updated, and can be continuously expanded and improved as new knowledge is generated, maintaining the timeliness and accuracy of knowledge. This dynamism makes the knowledge graph library an active and evolving knowledge base, providing strong knowledge support for the intelligent question-answering system.
[0030] In S130, the vector library is a data structure for storing and retrieving high-dimensional vector data. By converting the input question into a vector form, the similarity and semantic relationship between the data can be captured, and the vector library can be retrieved based on the vectorized input question to quickly find data related to the user query.
[0031] In S140, the information retrieved from the knowledge graph library and the information retrieved from the vector library are input into the large language model together with the input question to generate the answer to the question. The integration of multiple forms of knowledge information can significantly reduce the risk of the model generating misleading answers, while improving the timeliness and accuracy of the information, making the intelligent question-answering system more reliable when handling complex queries and professional field issues.
[0032] The intelligent question-answering method provided by the embodiment of the present invention parses the input question, constructs the query intent and entity relationship graph based on the parsing result; based on the query intent and entity relationship graph, queries the knowledge graph library to obtain the first search information; vectorizes the input question, searches the vector library based on the vectorization result to obtain the second search information; integrates the first search information and the second search information and inputs them into the large language model to obtain the answer to the question output by the large language model. This solution constructs the query intent and entity relationship graph according to the input question, and then retrieves the knowledge fragments related to the input question from the knowledge graph library according to the query intent and the entity relationship graph, vectorizes the input question, captures the similarity and semantic relationship between the data, and inputs these knowledge fragments, vectors and the input question into the large language model. The large language model uses this additional information to generate the final answer to the question, achieving a deep understanding and rapid response to the input question; in addition, through this method, whether it is daily consultation or professional questions, it can accurately capture the user's intention and retrieve relevant answers from the huge knowledge graph library, which can be applied to different fields and scenarios.
[0033] In an optional embodiment, before vectorizing the input question and searching the vector library based on the vectorization result to obtain the second search information, the method further includes: Performing data preprocessing on the original data to obtain preprocessed data; Slicing the preprocessed data to obtain multiple data blocks; Input each of the data blocks into a vectorized model to obtain a vector outputted by the vectorized model; Each of the vectors is stored in the vector library.
[0034] Specifically, the collected information is preprocessed, including but not limited to data cleaning, removal of special symbols and other operations; the information is then cut and processed to convert it into easy-to-process chunks; each chunk is then converted into a vector using a vectorization model to capture the semantic information of the document chunk; the generated vectors are stored in a vector library and indexed for subsequent rapid retrieval.
[0035] In an optional embodiment, before querying the knowledge graph library based on the query intent and the entity relationship graph to obtain the first search information, the method further includes: Extract entity attributes from the original data to obtain multiple entities and multiple attributes; Identify the relationship between the entities, and construct entity relationship pairs based on the identification results; A knowledge graph library is constructed based on the multiple entities and the entity relationship pairs.
[0036] Specifically, for the collected text data, natural language processing technology is used to identify entities and attributes in the text. Attributes are information or descriptions associated with entities, which help to understand the characteristics of the entities in more detail. For example, for the text "XXX is a smartphone manufactured by YY Company, with a screen size of 6.7 inches and available colors of graphite, gold, silver and blue", the entity "XXX" can be identified as the product and "YY Company" as the manufacturer (organization). The attributes "smartphone" can also be identified as the type, "6.7 inches" as the screen size, and "graphite, gold, silver and blue" as color options. The relationships between entities are extracted and relationship pairs are constructed. Based on the entity-relationship pairs, a knowledge graph is constructed, and the constructed knowledge graph is stored in a graph database to complete the construction of the knowledge graph library.
[0037] Optionally, extract the relationship between entities from the text and construct relationship pairs based on the following steps: Text preprocessing may include but is not limited to text cleaning, removing irrelevant characters and punctuation marks; word segmentation, dividing the text into words or phrases; part-of-speech tagging, marking each word with a part-of-speech tag; Named entity recognition: identifying entities in text, such as names of people, places, and organizations; marking the types of entities, such as names of people (PER), places (LOC), and organizations (ORG); Syntactic analysis, performing dependency analysis or component analysis to understand the structure of a sentence and the relationships between its components; identifying subject-verb-object structures and other important syntactic components; Relationship extraction uses machine learning models, such as support vector machines, neural networks, or rule-based methods to identify relationships between entities. Relationship types can include but are not limited to work relationships, kinship relationships, location relationships, etc. Combine the extracted entities and their relationships into a structured form, such as triples (subject, relationship, object) or other forms of data structures.
[0038] For example, for the text "Li works at AA University", the entities "Li" (name) and "AA University" (name of organization) can be identified, the relationship "working at..." can be extracted, and the entity-relationship pair (Li, working at..., AA University) can be constructed.
[0039] Furthermore, after combining the entity relationship pairs, connections between entities are constructed to form a knowledge graph.
[0040] In an optional embodiment, the raw data includes data obtained from multiple data sources.
[0041] Specifically, data sources may include but are not limited to text, databases, web pages and other data sources, and may include but are not limited to structured data (such as databases), semi-structured data (such as XML, JSON files), and unstructured data (such as text, web pages).
[0042] In an optional embodiment, constructing a knowledge graph library based on the multiple entities and the entity relationship pairs includes: Performing data cleaning on the multiple entities and the entity relationship pairs to obtain first processed data; Performing entity disambiguation processing on the first processed data to obtain second processed data; The second processed data is subjected to data fusion processing to obtain third processed data, and the third processed data are combined to obtain a knowledge graph library.
[0043] Specifically, data cleaning is the removal or correction of erroneous, incomplete, inaccurate or irrelevant data records, which may include but is not limited to deduplication: deleting duplicate entities and relationships; spelling correction: correcting spelling errors; format unification: converting data into a consistent format, such as date format; outlier detection: identifying and processing outliers, such as extreme data; missing value filling: filling in the actual attribute values, which may use methods including but not limited to statistical methods (such as averages), prediction methods or manual filling methods.
[0044] Here, entity disambiguation is to map different expressions of the same entity mentioned in the text to a standard entity representation. Specifically, use predefined rules or templates to match entities, use statistical methods to evaluate the similarity of entities, identify identical entities, link the identified entities to the corresponding entries in the authoritative knowledge base, and use clustering algorithms (such as K-means, DBSCAN) to group similar entities into one category.
[0045] Here, data fusion is to integrate information about the same entity from different sources to eliminate contradictions and inconsistencies. Specifically, different information about the same entity provided by different sources is identified, and the most appropriate value is selected by comparing the reliability, contextual consistency and other factors of different sources, and the entity attributes from multiple sources are merged to create a complete entity description.
[0046] For example, the following information was extracted from two different text sources: Text source A: Entity: Mr. Li; Relationship: Working at AA University; Attribute: Age 25; Text source B: Entity: Mr. Li; Relationship: Teaching at AA University; Attribute: Age 26; Data cleaning: De-duplicate and confirm that both records are about the same entity "Li"; ensure that all attributes are in the same format; if some attributes are missing, try to fill them in; Entity disambiguation: confirm that "Li" in the two texts refers to the same person, and confirm that "work" and "teach" are the same relationship; Data fusion: When the difference in attribute age is detected, a more reliable age value is selected considering the reliability of the text source. For example, if the weight of text source A is greater than that of text source B, age 25 is retained. The final integrated entity description is as follows: Entity: Mr. Li; Relationship: Works / teaches at AA University; Attribute: Age: 25.
[0047] In an optional embodiment, performing data cleaning on the plurality of entities and the entity relationship pairs to obtain first processed data includes: Deduplication is performed on the multiple entities and the entity relationships to obtain first cleansed data; Based on a preset format, formatting the first cleaning data to obtain second cleaning data; Based on preset data filling rules, the second cleaned data is processed by filling missing values to obtain first processed data.
[0048] For ease of understanding, the intelligent question-answering method provided by the present invention is described below by taking the input question “RAG optimization method” as an example.
[0049] For the knowledge graph library, information is collected from various data sources such as text, databases, web pages, etc., and entities and attributes in the text are identified through natural language processing technology, the relationships between entities are extracted, relationship pairs are constructed, the extracted knowledge is integrated, etc., and the constructed graph is stored in the graph database to obtain the knowledge graph library; for the vector library, scene information is collected, pre-processed and cut into blocks for easy processing, and then the blocks are converted into vectors using the vectorization module, and an index is created.
[0050] With respect to the user input “RAG optimization method”, by using natural language processing technology, it is identified that the entity therein is “RAG”, the intention is “optimization method”, and “optimization method” is an attribute of the “RAG” entity.
[0051] Query the knowledge related to the "RAG" entity from the knowledge graph library.
[0052] The user's input "RAG optimization method" and the knowledge queried from the knowledge graph are converted into vectors using a vectorization model, and then information is retrieved in the vector library to retrieve highly relevant information, which is then integrated with the knowledge queried from the knowledge graph and the user's input questions.
[0053] The input question, the knowledge related to the "RAG" entity and the fusion result of the vector library retrieval result are used as the input of the large language model. The generation ability of the large language model is used to generate answers to the questions and the generated results are fed back to the users.
[0054] In summary, the intelligent question-answering method provided by the present invention parses the user's questions through natural language processing technology, then queries relevant knowledge from the knowledge graph, and then uses retrieval technology to retrieve information related to the question from the vector library, and fuses the queried and retrieved information with the question, and the fusion result is input into the large language model to generate the answer, wherein the knowledge graph and the vector library need to be built offline, and the collected structured information and unstructured information are stored in the knowledge graph and the vector library respectively. The present invention achieves a deep understanding and rapid response to user questions by integrating advanced retrieval technology with the generation and understanding capabilities of the large language model, and can accurately capture user intentions and retrieve relevant answers from a huge information library, whether it is daily consultation or professional questions; real-time updating and multi-dimensional analysis of information ensure the accuracy and reliability of the answers.
[0055] The intelligent question-answering device provided by an embodiment of the present invention is described below. The intelligent question-answering device described below and the intelligent question-answering method described above can be referenced to each other.
[0056] Figure 3 is a schematic diagram of the structure of the intelligent question-answering device provided by the present invention. Figure 3 As shown, the intelligent question-answering device may include but is not limited to: A parsing and building module 310 is used to parse the input question and build a query intent and entity relationship diagram based on the parsing result; A first retrieval module 320 is used to query the knowledge graph library based on the query intent and the entity relationship graph to obtain first retrieval information; A second search module 330 is used to vectorize the input question and search the vector library based on the vectorization result to obtain second search information; The answer generation module 340 is used to integrate the first search information and the second search information and input them into a large language model to obtain an answer to the question output by the large language model.
[0057] It should be noted that the intelligent question and answer device provided in the embodiment of the present invention can execute the intelligent question and answer method described in any of the above embodiments during specific operation, which will not be elaborated in this embodiment.
[0058] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the intelligent question-answering method, which includes: parsing the input question, constructing the query intent and entity relationship graph based on the parsing result; querying the knowledge graph library based on the query intent and the entity relationship graph to obtain the first search information; vectorizing the input question, searching the vector library based on the vectorization result to obtain the second search information; integrating the first search information, the second search information and the input question and inputting them into the large language model to obtain the answer to the question output by the large language model.
[0059] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0060] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the intelligent question and answer method provided by the above methods, and the method includes: parsing the input question, and constructing a query intent and an entity relationship diagram based on the parsing result; based on the query intent and the entity relationship diagram, querying the knowledge graph library to obtain first retrieval information; vectorizing the input question, and searching the vector library based on the vectorization result to obtain second retrieval information; integrating the first retrieval information, the second retrieval information and the input question and inputting them into a large language model to obtain the answer to the question output by the large language model.
[0061] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the intelligent question-answering method provided by the above-mentioned methods, the method comprising: parsing an input question, and constructing a query intent and an entity relationship diagram based on the parsing result; querying a knowledge graph library based on the query intent and the entity relationship diagram to obtain first retrieval information; vectorizing the input question, and searching the vector library based on the vectorization result to obtain second retrieval information; integrating the first retrieval information, the second retrieval information and the input question and inputting them into a large language model to obtain an answer to the question output by the large language model.
[0062] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0063] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0064] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An intelligent question-answering method, characterized in that: include: Parse the input question and build the query intent and entity relationship diagram based on the parsing results; Based on the query intent and the entity relationship graph, query the knowledge graph library to obtain first search information; Vectorizing the input question, searching a vector library based on the vectorization result, and obtaining second search information; The first search information, the second search information and the input question are integrated and input into a large language model to obtain an answer to the question output by the large language model.
2. The intelligent question-answering method according to claim 1, characterized in that: Before vectorizing the input question and searching the vector library based on the vectorization result to obtain the second search information, the method further includes: Performing data preprocessing on the original data to obtain preprocessed data; Slicing the preprocessed data to obtain multiple data blocks; Input each of the data blocks into a vectorized model to obtain a vector outputted by the vectorized model; Each of the vectors is stored in the vector library.
3. The intelligent question-answering method according to claim 1, characterized in that: Before querying the knowledge graph library based on the query intent and the entity relationship graph to obtain the first search information, the method further includes: Extract entity attributes from the original data to obtain multiple entities and multiple attributes; Identify the relationship between the entities, and construct entity relationship pairs based on the identification results; A knowledge graph library is constructed based on the multiple entities and the entity relationship pairs.
4. The intelligent question-answering method according to claim 2 or 3, characterized in that: The raw data includes data acquired from various data sources.
5. The intelligent question-answering method according to claim 3, characterized in that: The step of constructing a knowledge graph library based on the multiple entities and the entity relationship pairs includes: Performing data cleaning on the multiple entities and the entity relationship pairs to obtain first processed data; Performing entity disambiguation processing on the first processed data to obtain second processed data; The second processed data is subjected to data fusion processing to obtain third processed data, and the third processed data are combined to obtain a knowledge graph library.
6. The intelligent question-answering method according to claim 5, characterized in that: The performing data cleaning on the plurality of entities and the entity relationship pairs to obtain first processed data includes: Deduplication is performed on the multiple entities and the entity relationships to obtain first cleansed data; Based on a preset format, formatting the first cleaning data to obtain second cleaning data; Based on preset data filling rules, the second cleaned data is processed by filling missing values to obtain first processed data.
7. An intelligent question-answering device, characterized in that: include: The parsing and building module is used to parse the input question and build the query intent and entity relationship diagram based on the parsing results; A first retrieval module is used to query the knowledge graph library based on the query intent and the entity relationship graph to obtain first retrieval information; A second search module is used to vectorize the input question and search the vector library based on the vectorization result to obtain second search information; The answer generation module is used to integrate the first search information and the second search information and input them into a large language model to obtain an answer to the question output by the large language model.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the intelligent question-answering method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the intelligent question-answering method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the intelligent question-answering method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Intelligent question answering method, system and equipment based on GraphRAG and medium
CN119988572A
A graph rag-based intelligent question answering method, system, device and medium
CN119988572B
Knowledge graph-based traffic engineering large model intelligent question-answering system and method
CN120407752A
Atmospheric pollution process analysis method, electronic equipment and storage medium
CN120821747A
Organ transplantation clinical aid decision-making method, device and equipment based on AI large model, medium and product
CN121096601A