Knowledge base construction method, data query method and electronic equipment
Process document fragments and hierarchical structure information through large language models, generate query information, and build query knowledge bases, which solves the problem of difficulty in matching information in knowledge bases in the existing technology, and improves user experience and accuracy of information matching.
Patent Information
- Application Number
- CN202410370254.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2024-10-15
AI Technical Summary
Existing document-based knowledge base construction makes it difficult to find matching information, reduces user experience, and requires a lot of manual or AI technical sorting work.
Use a large language model to process document fragments in the document, obtain hierarchical structure information, split the document, form query information, generate feedback information through the query information generation model, build a query knowledge base, and perform information matching by combining document fragments and related information .
It improves the accuracy of information matching, improves user experience, and simplifies the knowledge base construction and query process.
Smart Images

Figure CN118779462A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of knowledge bases, and in particular to a knowledge base construction method, a data query method and an electronic device. Background Art
[0002] Enterprise knowledge is often stored in the form of unstructured documents. Therefore, building an enterprise knowledge base and providing it to downstream applications often requires a deep understanding of the business and a lot of technical work. Currently, document-based knowledge base construction first requires the design of the document's knowledge system information, then the use of manual or AI methods to extract information, and then store it in the knowledge graph. However, the knowledge base built in this way is difficult to find matching information when used, which reduces the user experience. Summary of the invention
[0003] In view of this, embodiments of the present application provide a knowledge base construction method, a data query method, and an electronic device.
[0004] According to the first aspect of the present application, an embodiment of the present application provides a knowledge base construction method, including:
[0005] Processing at least one document fragment in the document based on the large language model to obtain relevant information corresponding to the document fragment;
[0006] Obtain at least one query information established based on the knowledge system information corresponding to the document;
[0007] Determine feedback information of the query information based on the relevant information;
[0008] A query knowledge base is formed based on the document fragments, related information, query information and corresponding feedback information.
[0009] Optionally, at least one document fragment in the document is processed based on the large language model to obtain relevant information corresponding to the document fragment, including:
[0010] Get the hierarchical structure information of the document;
[0011] Based on the hierarchical structure information of the document, split the document into at least one document fragment;
[0012] At least one document segment and corresponding hierarchical structure information are processed based on the large language model to obtain relevant information corresponding to the document segment.
[0013] Optionally, obtaining at least one query information established based on the knowledge system information corresponding to the document includes:
[0014] The knowledge system information and related information corresponding to the document are processed based on the query information generation model to obtain at least one query information.
[0015] Optionally, based on the relevant information, feedback information of the query information is determined, including:
[0016] The answer to the query information is determined by taking the relevant information as the first answer source of the query information and the document fragment as the second answer source of the query information, and obtaining feedback information of the query information.
[0017] According to the second aspect of the present application, an embodiment of the present application provides a data query method, including:
[0018] Get the information to be queried input by the user;
[0019] Determine the similarity between the information to be queried and the relevant information in the query knowledge base; the query knowledge base is a knowledge base constructed by the knowledge base construction method of the first aspect or any embodiment of the first aspect;
[0020] determining at least one candidate related information based on the similarity;
[0021] Feedback query knowledge base with document fragments corresponding to candidate related information.
[0022] Optionally, before determining at least one candidate related information based on the similarity, the data query method further includes:
[0023] Determine the similarity between the information to be queried and the historical query information in the query knowledge base;
[0024] Accordingly, determining at least one candidate related information based on the similarity includes:
[0025] At least one candidate relevant information is determined based on the similarity between the information to be queried and the relevant information in the query knowledge base, and the similarity between the information to be queried and the historical query information in the query knowledge base.
[0026] Optionally, before determining at least one candidate related information based on the similarity, the data query method further includes:
[0027] Determine the similarity between the query information and the feedback information and / or document fragments in the query knowledge base;
[0028] Accordingly, determining at least one candidate related information based on the similarity includes:
[0029] At least one candidate relevant information is determined based on the similarity between the information to be queried and the relevant information in the query knowledge base, and the similarity between the information to be queried and the feedback information and / or document fragments in the query knowledge base.
[0030] Optionally, determining at least one candidate related information based on the similarity includes:
[0031] determining at least one relevant information having a high similarity ranking;
[0032] At least one related information with a higher similarity ranking is used as at least one candidate related information.
[0033] Optionally, the data query method further includes:
[0034] The query information and the document fragment are processed based on the large language model to obtain answer information of the query information; the answer information includes key information corresponding to the query information selected from the document fragment;
[0035] Feedback answer information.
[0036] According to a third aspect of the present application, an embodiment of the present application provides an electronic device, including:
[0037] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor executes a knowledge base construction method as in the first aspect or any embodiment of the first aspect, or a data query method as in the second aspect or any embodiment of the second aspect.
[0038] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of a knowledge base construction method in an embodiment of the present application;
[0040] Figure 2 A schematic diagram of another knowledge base construction method in an embodiment of the present application;
[0041] Figure 3 A schematic diagram of a document and the hierarchical structure information included therein in an embodiment of the present application;
[0042] Figure 4 A schematic diagram of a document fragment in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of document fragments and corresponding hierarchical structure information in an embodiment of the present application;
[0044] Figure 6 A schematic diagram of relevant information in the embodiments of the present application;
[0045] Figure 7A flowchart of a data query method in an embodiment of the present application;
[0046] Figure 8 This is a flow chart of another data query method in an embodiment of the present application;
[0047] Fig. 9 This is a schematic diagram of the hardware structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0049] The present application embodiment provides a knowledge base construction method, such as Figure 1 As shown, including:
[0050] S101, processing at least one document segment in a document based on a large language model to obtain relevant information corresponding to the document segment.
[0051] In this embodiment, the Large Language Model (LLM) may be a general artificial intelligence model designed to understand and generate human language.
[0052] In this embodiment, the knowledge base is constructed based on documents. When the knowledge base needs to be constructed, the document can be split into multiple document fragments based on the context information of the document. For example, the document can be split into multiple document fragments based on the hierarchical structure information of the document, the paragraph information of the document, or the paging information of the document.
[0053] In some embodiments, for each document fragment in a document, the document fragment and the corresponding hierarchical structure information or segmentation information or paging information can be input into a large language model, and the large language model combines and rewrites the content of the document fragment and the corresponding hierarchical structure information or segmentation information or paging information to obtain relevant information corresponding to the document fragment. Thus, the relevant information includes not only the content corresponding to the document fragment, but also the contextual information such as the hierarchical structure information, segmentation information or paging information of the document fragment.
[0054] In some embodiments, multiple document fragments corresponding to a document can be simultaneously input into a large language model, and the large language model can extract hierarchical structure information, segmentation information, or paging information based on the multiple document fragments, and then rewrite the content of each document fragment based on the extracted hierarchical structure information, segmentation information, or paging information to obtain relevant information corresponding to the document fragment. Thus, the relevant information includes not only the content corresponding to the document fragment, but also contextual information such as the hierarchical structure information, segmentation information, or paging information of the document fragment.
[0055] S102: Obtain at least one query information established based on the knowledge system information corresponding to the document.
[0056] In this embodiment, the knowledge system information corresponding to the document is the knowledge ontology corresponding to the document. Multiple categories of knowledge ontologies can be pre-established. For example, for maintenance, the knowledge ontology can be tools, equipment, replacement time, number of operators, etc.; for installation, the knowledge ontology can be workshop, operating table, equipment, number of operators, etc. Each category of knowledge ontology can represent the user's query needs. The knowledge ontology corresponding to a document can represent the user's query needs for the document.
[0057] Then, the category to which the document belongs can be determined based on the content of the document, and then the knowledge ontology of the document, that is, the knowledge system information of the document, can be determined, and then at least one query information can be established based on the knowledge system information of the document. For example, if the content of the document is about the platform door maintenance procedures, the knowledge system information corresponding to the document can include tools, equipment, replacement time, number of operators, etc. Based on the knowledge system information of the document, the query information that can be established may include: what tools are required for platform door maintenance, what equipment is required for platform door maintenance, replacement time for platform door maintenance, and number of operators required for platform door maintenance.
[0058] S103: Determine feedback information of the query information based on the relevant information.
[0059] In some embodiments, relevant information may be used to sequentially attempt to answer the at least one query information to obtain corresponding feedback information.
[0060] S104, forming a query knowledge base based on the document fragments, related information, query information and corresponding feedback information.
[0061] In this embodiment, the document fragments, related information, query information, and corresponding feedback information may be associated and stored to form a query knowledge base.
[0062] The knowledge base construction method provided in the embodiment of the present application processes at least one document fragment in a document based on a large language model to obtain relevant information corresponding to the document fragment; obtains at least one query information established based on the knowledge system information corresponding to the document; determines feedback information of the query information based on the relevant information; forms a query knowledge base based on the document fragment, the relevant information, the query information and the corresponding feedback information; in this way, the query knowledge base not only stores the document fragment, but also stores relevant information with document fragment content and context information, so that when the user needs to use the query knowledge base to query information, he can not only refer to the document fragment content, but also refer to the context information of the document fragment, so as to match accurate information and recall accurate document fragments; and the query knowledge base also stores query information corresponding to the document fragment, and feedback information corresponding to the query information, so that information matching can be performed from multiple dimensions, the accuracy of information matching is improved, and the user experience is improved.
[0063] In an optional embodiment, step S101, processing at least one document segment in a document based on a large language model to obtain relevant information corresponding to the document segment includes:
[0064] S1011, obtaining the hierarchical structure information of the document.
[0065] S1012: Split the document into at least one document segment based on the hierarchical structure information of the document.
[0066] S1013: Process at least one document segment and corresponding hierarchical structure information based on the large language model to obtain relevant information corresponding to the document segment.
[0067] In this embodiment, for S1011, Figure 2 As shown, the document can be hierarchically analyzed to determine the hierarchical structure information of the document. For example, the hierarchical structure information of the document can be determined based on the hierarchical structure of the title. Figure 3 As shown, through the hierarchical analysis of the document, it can be determined that the hierarchical structure information of the document includes: Title (Platform Door Maintenance Procedure) - Title 1 (Fault Operation) - Title 2 (Carbon Brush) - Title 3 (Startup Process) - Text (Text corresponding to the startup process). The hierarchical structure information of the document can also include: Platform Door Maintenance Procedure - Product Structure - Sliding Door - Text (Text corresponding to the sliding door); Platform Door Maintenance Procedure - Product Structure - Emergency Door - Text (Text corresponding to the emergency door).
[0068] In this embodiment, with respect to S1012, after the hierarchical structure of the document is determined, the document can be split based on the hierarchical structure information by means of rules or models. The document can be split into multiple document segments based on all hierarchical structure information corresponding to the document. For example, for Figure 3The document shown in the figure is based on the hierarchical structure information of platform door maintenance procedures-product structure-emergency door-text. The document can be split into the following Figure 4 A document fragment is shown.
[0069] In this embodiment, for S1013, after the document is split into document fragments, each document fragment and the hierarchical structure information corresponding to the document fragment can be input into the large language model, and the large language model is used to rewrite the content of the document fragment and the corresponding hierarchical structure information, such as Figure 2 As shown in , the relevant information corresponding to the document fragment is obtained, that is, the rewritten content. For example, the document fragment and the hierarchical structure information corresponding to the document fragment are as follows Figure 5 As shown in the figure, the document fragment and the hierarchical structure information corresponding to the document fragment are input into the large language model, and the following can be obtained: Figure 6 Related information shown.
[0070] In this embodiment, the hierarchical structure information of the document is obtained; based on the hierarchical structure information of the document, the document is split into at least one document fragment; at least one document fragment and the corresponding hierarchical structure information are processed based on a large language model to obtain relevant information corresponding to the document fragment; in this way, the relevant information corresponding to the document fragment can include not only the content of the text fragment, but also the context information of the document fragment.
[0071] In an optional embodiment, step S102, obtaining at least one query information established based on the knowledge system information corresponding to the document, includes:
[0072] The knowledge system information and related information corresponding to the document are processed based on the query information generation model to obtain at least one query information.
[0073] In specific implementation, the knowledge ontology (knowledge system information) corresponding to the document and related information (rewritten content) can be input into a pre-trained query information generation model to output at least one query information.
[0074] In this embodiment, query information is generated based on a query information generation model, so that more query information can be generated conveniently. Moreover, query information is generated based on the knowledge system information and related information corresponding to the document, so that query information about knowledge system information can be generated more specifically based on the document fragment content, which is in line with the user's actual query needs.
[0075] In an optional embodiment, step S103, determining feedback information of the query information based on the relevant information, includes:
[0076] The answer to the query information is determined by taking the relevant information as the first answer source of the query information and the document fragment as the second answer source of the query information, and obtaining feedback information of the query information.
[0077] In this embodiment, the relevant information is used as the main answer source of the query information, and the document fragment is used as the secondary answer source of the query information to answer the query information and determine the answer to the query information.
[0078] When implementing it, Figure 2 As shown, at least one query information can be established based on the knowledge ontology (knowledge system information) corresponding to the document, and then the relevant information is used as the first answer source of the query information, and the document fragment is used as the second answer source of the query information to generate questions and answers to obtain the answer to the query information, that is, feedback information. Then, the query information and feedback information are formed into a question-answer pair, and the corresponding document fragment and related information are recorded to form a (s, q, a, s') tuple, where s is the document fragment, q is the query information, a is the feedback information, and s' is the related information. Then, the tuple is vectorized to obtain a vector pair; then the vector pair is stored in the vector library to obtain a query knowledge base.
[0079] In this embodiment, relevant information is used as the first answer source of query information, and document fragments are used as the second answer source of query information. The answer to the query information is determined, and feedback information of the query information is obtained, so that the answer to the query information can be obtained more accurately.
[0080] The present application also provides a data query method, such as Figure 7 As shown, including:
[0081] S701, obtaining the information to be queried input by the user.
[0082] In this embodiment, when a user wants to query the answer corresponding to the information to be queried through the query knowledge base constructed in the above embodiment, the user can input the information to be queried into the electronic device. The information to be queried can be a question statement.
[0083] S702, determining the similarity between the information to be queried and the relevant information in the query knowledge base; the query knowledge base is a knowledge base constructed by using the knowledge base construction method in any of the above implementation modes.
[0084] In this embodiment, after the electronic device obtains the information to be queried input by the user, since the relevant information in the query knowledge base not only has the content of the document fragment but also includes the context information of the document fragment, the similarity between the information to be queried and the relevant information in the query knowledge base can be calculated first.
[0085] S703: Determine at least one candidate related information based on the similarity.
[0086] In this embodiment, after the similarity between the information to be queried and each related information is determined, the related information with the highest similarity can be used as the candidate related information, or multiple related information with the highest similarity ranking can be used as the candidate related information.
[0087] S704, feeding back document segments corresponding to the candidate related information in the query knowledge base.
[0088] In this embodiment, since the relevant information is associated with the document fragment, after the candidate relevant information is determined, the document fragment associated with the candidate relevant information can be fed back to the user, so that the user can obtain the answer to the information to be queried from the document fragment, as well as the original document fragment of the answer.
[0089] The data query method provided by the embodiment of the present application obtains the information to be queried input by the user; determines the similarity between the information to be queried and the relevant information in the query knowledge base; determines at least one candidate relevant information based on the similarity; and feeds back the document fragment corresponding to the candidate relevant information in the query knowledge base; in this way, since each relevant information in the query knowledge base not only has the content of the document fragment but also includes the context information of the document fragment, when searching for the document fragment corresponding to the information to be queried, not only the content of the document fragment but also the context information of the document fragment can be referred to, so as to quickly and accurately recall the corresponding document fragment and improve the user experience.
[0090] In an optional embodiment, before determining at least one candidate related information based on the similarity in step S703, the data query method further includes:
[0091] Determine the similarity between the information to be queried and the historical query information in the query knowledge base.
[0092] Accordingly, determining at least one candidate related information based on the similarity includes:
[0093] At least one candidate relevant information is determined based on the similarity between the information to be queried and the relevant information in the query knowledge base, and the similarity between the information to be queried and the historical query information in the query knowledge base.
[0094] In specific implementation, for the information to be queried input by the user, while calculating the similarity between the information to be queried and the related information, the similarity between the information to be queried and each historical query information in the query knowledge base can also be calculated. Based on the similarity between the information to be queried and each historical query information in the query knowledge base, it can be determined whether there is historical query information similar to the information to be queried in the query knowledge base. If there is similar historical query information, the related information corresponding to the historical query information will also be used as candidate related information.
[0095] Specifically, based on the similarity between the information to be queried and the relevant information in the query knowledge base, multiple related information with a high ranking can be determined, and then together with the relevant information corresponding to the historical query information, they can be used as candidate related information. If there are duplicate related information in the candidate related information, the duplicate related information will be deleted.
[0096] In this embodiment, not only the similarity between the relevant information in the query knowledge base and the information to be queried is calculated, but also the similarity between the historical query information and the information to be queried is calculated, so that relevant information related to the information to be queried can be found from multiple dimensions, making it easier to find relevant information related to the information to be queried more accurately.
[0097] In an optional embodiment, before determining at least one candidate related information based on the similarity in step S703, the data query method further includes:
[0098] Determine the similarity between the query information and the feedback information and / or document fragments in the query knowledge base;
[0099] Accordingly, determining at least one candidate related information based on the similarity includes:
[0100] At least one candidate relevant information is determined based on the similarity between the information to be queried and the relevant information in the query knowledge base, and the similarity between the information to be queried and the feedback information and / or document fragments in the query knowledge base.
[0101] In specific implementation, for the information to be queried input by the user, while calculating the similarity between the information to be queried and related information, the similarity between the information to be queried and each feedback information and / or document fragment in the query knowledge base can also be calculated.
[0102] Specifically, based on the similarity between the information to be queried and the relevant information in the query knowledge base, and the similarity between the information to be queried and the feedback information and / or document fragments in the query knowledge base, multiple relevant information with high similarity rankings and the relevant information corresponding to the feedback information and / or document fragments can be determined as candidate relevant information. If there are duplicate relevant information in the candidate relevant information, the duplicate relevant information will be deleted.
[0103] In this embodiment, not only the similarity between the relevant information in the query knowledge base and the information to be queried is calculated, but also the similarity between the query information and the feedback information and / or document fragments in the query knowledge base is calculated, so that relevant information related to the information to be queried can be found from multiple dimensions, making it easier to find relevant information related to the information to be queried more accurately.
[0104] In an optional embodiment, step S703, determining at least one candidate related information based on the similarity, includes:
[0105] Determine at least one related information with a high similarity ranking; and use the at least one related information with a high similarity ranking as at least one candidate related information.
[0106] In this embodiment, at least one related information with a high similarity ranking is used as at least one candidate related information, so that related information that is relatively relevant to the information to be queried can be obtained.
[0107] In an optional embodiment, the data query method further includes:
[0108] The query information and document fragments are processed based on the large language model to obtain answer information of the query information; the answer information includes key information selected from the document fragment and corresponding to the query information; and the answer information is fed back.
[0109] In this embodiment, if only document fragments are fed back to the user, the user still needs to find the answer from the document fragments. If the document fragment is long, or there are several document fragments, it will take some time for the user to get the answer. In order to facilitate the user to directly obtain the answer to the query information, the information to be queried and the document fragments can be input into the large language model, and the key information corresponding to the information to be queried can be selected from the document fragments by the large language model, and then the answer information of the information to be queried is generated. Finally, the answer information is fed back to the user. In this way, not only the original document fragment is fed back to the user, but also the answer is directly fed back to the user, which is convenient for the user to directly read the answer and get the source of the answer.
[0110] When implementing it, Figure 8 As shown, when a user inputs a question statement, a vector can be constructed first to obtain a question vector, and then the question vector and the vector in the vector library (query knowledge base) can be constructed to determine a similar vector. Based on the similar vector, the original text index is performed, and the original text index refers to the document fragment index. After the document fragment is determined, the rewritten content (related information) corresponding to the document fragment can be found, and then based on the rewritten content and the question statement, a context-based question and answer operation is performed to generate an answer to the question statement and output it to the user; at the same time, the document fragment can be output to the user, and the user obtains the reference original text.
[0111] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
[0112] Fig. 9A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0113] like Fig. 9 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0114] Multiple components in the electronic device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0115] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as a knowledge base construction method or a data query method. For example, in some embodiments, the knowledge base construction method or the data query method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the knowledge base construction method or the data query method described above may be executed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the knowledge base construction method or the data query method in any other appropriate manner (eg, by means of firmware).
[0116] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0117] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0118] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0119] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0120] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0121] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0122] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0123] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0124] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A knowledge base construction method, comprising: Processing at least one document fragment in the document based on the large language model to obtain relevant information corresponding to the document fragment; Acquire at least one query information established based on the knowledge system information corresponding to the document; Determining feedback information of the query information based on the relevant information; A query knowledge base is formed based on the document fragment, the relevant information, the query information and the corresponding feedback information.
2. According to the knowledge base construction method of claim 1, the step of processing at least one document fragment in a document based on a large language model to obtain relevant information corresponding to the document fragment comprises: Obtaining hierarchical structure information of the document; Based on the hierarchical structure information of the document, split the document into at least one document segment; At least one of the document fragments and the corresponding hierarchical structure information is processed based on the large language model to obtain relevant information corresponding to the document fragment.
3. The knowledge base construction method according to claim 1, wherein the step of obtaining at least one query information established based on the knowledge system information corresponding to the document comprises: The knowledge system information corresponding to the document and the related information are processed based on the query information generation model to obtain at least one query information.
4. The knowledge base construction method according to claim 1, wherein the step of determining feedback information of the query information based on the relevant information comprises: The answer to the query information is determined by using the relevant information as the first answer source of the query information and the document fragment as the second answer source of the query information to obtain feedback information of the query information.
5. A data query method, comprising: Get the information to be queried input by the user; Determine the similarity between the information to be queried and the relevant information in the query knowledge base; The query knowledge base is a knowledge base constructed by the knowledge base construction method according to any one of claims 1 to 4; determining at least one candidate related information based on the similarity; Feedback is given to document segments in the query knowledge base corresponding to the candidate related information.
6. The data query method according to claim 5, before determining at least one candidate related information based on the similarity, further comprising: Determine the similarity between the information to be queried and the historical query information in the query knowledge base; Accordingly, determining at least one candidate related information based on the similarity includes: At least one candidate relevant information is determined based on the similarity between the information to be queried and the relevant information in the query knowledge base, and the similarity between the information to be queried and the historical query information in the query knowledge base.
7. The data query method according to claim 5, before determining at least one candidate related information based on the similarity, further comprising: Determining the similarity between the information to be queried and the feedback information and / or document fragments in the query knowledge base; Accordingly, determining at least one candidate related information based on the similarity includes: At least one candidate relevant information is determined based on the similarity between the information to be queried and the relevant information in the query knowledge base, and the similarity between the information to be queried and the feedback information and / or document fragments in the query knowledge base.
8. The data query method according to claim 5, determining at least one candidate related information based on the similarity comprises: determining at least one relevant information having a high similarity ranking; The at least one related information with a higher similarity ranking is used as the at least one candidate related information.
9. The data query method according to claim 5, further comprising: Processing the information to be queried and the document fragment based on the large language model to obtain answer information of the information to be queried; The answer information includes key information selected from the document fragment and corresponding to the information to be queried; Feedback the answer information.
10. An electronic device, comprising: at least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the knowledge base construction method as described in any one of claims 1-4 or the data query method as described in any one of claims 5-9.
