Intelligent question-answering method, system, electronic device, and storage medium
Through the pre-trained binary classification model, the knowledge source files are classified and a unified search engine is generated, which solves the problems of low answer accuracy and inconsistent management in the existing technology, and realizes efficient knowledge source files management and search services.
Patent Information
- Application Number
- CN202111424384.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-11-26
AI Technical Summary
The single index server of the existing search system results in low accuracy of answers and lack of unified management of knowledge source files.
The target knowledge source file is classified into graph database knowledge source file and full-text search knowledge source file through a pre-trained binary classification model, and imported them into the corresponding database and engine respectively, generating a unified search engine to handle user problems, output multiple results and sort them.
It improves search accuracy and unified management of knowledge source files, and realizes unified search services for different types of knowledge source files.
Smart Images

Figure CN114020896B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and more specifically, to an intelligent question-answering method, system, electronic device, and storage medium. Background Art
[0002] With the rapid development of Internet technology, the number of Internet users is also growing rapidly. When users encounter problems, they can send the corresponding questions to the search system through the Internet, and the search system can respond with the corresponding answers based on the received questions.
[0003] However, this search system uses a single index server, resulting in low accuracy of searched answers, and this approach lacks unified management of knowledge source files. Summary of the Invention
[0004] In view of this, the present invention provides an intelligent question-answering method, system, electronic device and storage medium, with the purpose of improving search accuracy and unified management of knowledge source files.
[0005] A first aspect of the present invention discloses an intelligent question-answering method, comprising:
[0006] Obtain target knowledge source files;
[0007] Inputting the target knowledge source file into a pre-trained binary classification model so that the pre-trained binary classification model classifies the target knowledge source file to obtain a graph database knowledge source file and a full-text search knowledge source file; wherein the pre-trained binary classification model is obtained by training the binary classification model to be trained using a knowledge source file sample set; the knowledge source file sample set includes at least a historical graph database knowledge source file and a historical full-text search knowledge source file;
[0008] Importing the graph database knowledge source file into the initial graph database to obtain a target graph database, and importing the full-text search knowledge source file into the initial full-text search engine to obtain a target full-text search engine;
[0009] Generate a unified search engine based on the target graph database and the target full-text search engine;
[0010] When receiving a target question sent by a user, inputting the target question into the unified search engine, so that the unified search engine processes the target question using the target graph database to obtain at least one first result, and processes the target question using the full-text search engine to obtain at least one second result;
[0011] The at least one first result and the at least one second result are output.
[0012] Optionally, before outputting the at least one first result and the at least one second result, the method further includes:
[0013] For each of the first results, calculating the similarity between the first result and the target question;
[0014] For each second result, calculating the similarity between the second result and the target question;
[0015] According to the similarity of each first result and the similarity of each second result, sorting the first results and the second results from largest to smallest to obtain a sorting result;
[0016] The outputting of the at least one first result and the at least one second result includes:
[0017] The sorting result is output, where the sorting result includes the first results and the second results sorted in descending order of similarity.
[0018] Optionally, generating a unified search engine based on the target graph database and the target full-text search engine includes:
[0019] Encapsulating the target graph database and the target full-text search engine through a search gateway application service to generate a unified search engine, wherein the unified search engine includes a unified search export;
[0020] The step of outputting the sorting result includes:
[0021] The ranking result is outputted through the search unified export.
[0022] Optionally, the step of training the binary classification model to be trained using the knowledge source file sample set to obtain the pre-trained binary classification model includes:
[0023] Acquire a knowledge source file sample set; wherein the knowledge source file sample set includes historical graph database knowledge source files and their sample labels, historical full-text search knowledge source files and their sample labels;
[0024] Inputting each of the knowledge source file samples into the binary classification model to be trained in turn, so that the binary classification model to be trained processes each of the knowledge source file samples respectively, taking the obtained processing results close to the sample labels corresponding to each of the knowledge source file samples as the training target, and iteratively training the binary classification model to be trained until the binary classification model to be trained reaches convergence, thereby obtaining a binary classification model;
[0025] The knowledge source file sample is the historical graph database knowledge source file, or a historical full-text search knowledge source file.
[0026] A second aspect of the present invention discloses an intelligent question-answering system, comprising:
[0027] A target knowledge source file acquisition unit, used for acquiring a target knowledge source file;
[0028] A classification processing unit, configured to input the target knowledge source file into a pre-trained binary classification model, so that the pre-trained binary classification model classifies the target knowledge source file to obtain a graph database knowledge source file and a full-text search knowledge source file; wherein the pre-trained binary classification model is trained based on the training unit;
[0029] An importing unit, configured to import the graph database knowledge source file into an initial graph database to obtain a target graph database, and to import the full-text search knowledge source file into an initial full-text search engine to obtain a target full-text search engine;
[0030] A generating unit, configured to generate a unified search engine based on the target graph database and the target full-text search engine;
[0031] a question processing unit configured to, upon receiving a target question sent by a user, input the target question into the unified search engine, so that the unified search engine processes the target question using the target graph database to obtain at least one first result, and processes the target question using the full-text search engine to obtain at least one second result;
[0032] An output unit is configured to output the at least one first result and the at least one second result.
[0033] Optionally, the system further includes:
[0034] A first calculation unit is configured to calculate, for each first result, a similarity between the first result and the target question;
[0035] a second calculation unit, configured to calculate, for each second result, a similarity between the second result and the target question;
[0036] a sorting unit, configured to sort the first results and the second results from largest to smallest according to the similarity of each first result and the similarity of each second result, to obtain a sorting result;
[0037] The output unit is specifically configured to output a sorting result, where the sorting result includes each of the first results and each of the second results sorted in descending order of similarity.
[0038] Optionally, the generating unit includes:
[0039] A generating subunit, configured to encapsulate the target graph database and the target full-text search engine through a search gateway application service to generate a unified search engine, wherein the unified search engine includes a unified search export;
[0040] Wherein, the output unit is further configured to output the ranking result through the unified search export.
[0041] Optionally, the training unit includes:
[0042] A knowledge source file acquisition unit is used to acquire a knowledge source file sample set; wherein the knowledge source file sample set includes a historical graph database knowledge source file and its sample labels, a historical full-text search knowledge source file and its sample labels;
[0043] an iterative training unit, configured to sequentially input each of the knowledge source file samples into the binary classification model to be trained, so that the binary classification model to be trained processes each of the knowledge source file samples respectively, with the obtained processing result being close to the sample label corresponding to each of the knowledge source file samples as a training target, and iteratively train the binary classification model to be trained until the binary classification model to be trained reaches convergence, thereby obtaining a binary classification model;
[0044] The knowledge source file sample is the historical graph database knowledge source file, or a historical full-text search knowledge source file.
[0045] The third aspect of the present invention discloses an electronic device, which includes a processor and a memory, wherein the memory is used to store program code and data for intelligent question and answer, and the processor is used to call the program instructions in the memory to execute an intelligent question and answer method disclosed in the first aspect of the present invention.
[0046] The fourth aspect of the present invention discloses a storage medium, which includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute an intelligent question-answering method disclosed in the first aspect of the present invention.
[0047] The present invention provides an intelligent question-answering method, system, electronic device and storage medium. First, a binary classification model can be trained by using a knowledge source file sample set to obtain a binary classification model. After obtaining a target knowledge source file, the obtained target knowledge source file can be input into a pre-trained binary classification model so that the pre-trained binary classification model classifies the target knowledge source file to obtain a graph database knowledge source file and a full-text search knowledge source file; the graph database knowledge source file is imported into an initial graph database to obtain a target graph database, and the full-text search knowledge source file is imported into an initial full-text search engine to obtain a target full-text search engine; a unified search engine is generated based on the target graph database and the target full-text search engine; when a target question sent by a user is received, the target question is input into the unified search engine so that the unified search engine processes the target question using the target graph database to obtain at least one first result, and processes the target question through the full-text search engine to obtain at least one second result; and at least one first result and at least one second result are output. The technical solution provided by the present invention can first classify the target knowledge source files, and then classify and store them according to different types of knowledge source files. This allows the knowledge source files to be stored in the appropriate search engine in an optimal mode. This can not only improve the search accuracy of each search engine, but also achieve unified management of knowledge source files. In addition, based on the target graph database and the target full-text search engine, a unified search engine is generated, which can provide unified search services to the outside world. The same search engine can search for different types of knowledge source files. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in 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 merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0049] Figure 1 A flowchart of an intelligent question-answering method provided by an embodiment of the present invention;
[0050] Figure 2 A schematic diagram of the structure of an intelligent question-answering system provided by an embodiment of the present invention;
[0051] Figure 3 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only 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 making creative efforts are within the scope of protection of the present invention.
[0053] In this application, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0054] It should be noted that the intelligent question-answering method provided by the present invention can be used in the fields of cloud computing, big data, data processing technology, or finance. The above is only an example and does not limit the application field of the invention provided by the present invention.
[0055] The intelligent question-answering method provided by the present invention can be used in the financial sector or other fields, for example, in identity authentication scenarios within the financial sector. Other fields include any field other than finance, such as cloud computing. The above description is merely illustrative and does not limit the application areas of the intelligent question-answering method provided by the present invention.
[0056] See also Figure 1 , which shows a flow chart of an intelligent question-answering method provided by an embodiment of the present invention, and the intelligent question-answering method specifically includes the following steps:
[0057] S101: Obtain target knowledge source file.
[0058] In the specific process of executing step S101, the target knowledge source file that needs to be classified is obtained, wherein the target knowledge source file includes a graph database knowledge source file and a full-text search knowledge source file.
[0059] It should be noted that the graph database knowledge source file includes data with certain logical relationships, for example, data containing legal persons, users, and businesses, and the legal persons, users, and businesses in the data have certain logical relationships.
[0060] S102: Input the target knowledge source file into the pre-trained binary classification model, so that the pre-trained binary classification model classifies the target knowledge source file to obtain a graph database knowledge source file and a full-text search knowledge source file.
[0061] In the embodiment of the present application, a binary classification model is pre-trained, and the pre-trained binary classification model is obtained by training the binary classification model to be trained using a knowledge source file sample set. The knowledge source file sample set includes historical graph database knowledge source files and their sample labels, and historical full-text search knowledge source files and their sample labels.
[0062] Optionally, the process of using the knowledge source file sample set to train the binary classification model to be trained to obtain a pre-trained binary classification model is specifically as follows: obtain the knowledge source file sample set, input each knowledge source file sample into the binary classification model to be trained in turn, so that the binary classification model to be trained processes each knowledge source file sample respectively, and use the processing result of each knowledge source file sample and the sample label corresponding to each knowledge source file sample to construct a corresponding loss function, and use each loss function to iteratively train the binary classification model to be trained until the binary classification model to be trained reaches convergence, thereby obtaining a binary classification model.
[0063] The knowledge source file sample is a historical graph database knowledge source file or a historical full-text search knowledge source file. When the knowledge source file sample is a historical graph database knowledge source file, its corresponding sample label is graph database; correspondingly, when the knowledge source file sample is a historical full-text search knowledge source file, its corresponding sample label is full-text search.
[0064] In the specific process of executing step S102, after the binary classification model is trained, the target knowledge source file is obtained and input into the pre-trained binary classification model so that the pre-trained binary classification model can classify the input target knowledge source file to obtain each knowledge source file and its corresponding label, that is, obtain the graph database knowledge source file and the full-text search knowledge source file.
[0065] S103: Importing the graph database knowledge source file into the initial graph database to obtain a target graph database, and importing the full-text search knowledge source file into the initial full-text search engine to obtain a target full-text search engine.
[0066] In the specific process of executing step S103, after using the pre-trained binary classification model to classify the target knowledge source file to obtain the graph database knowledge source file and the full-text search knowledge source file, the graph database knowledge source file is processed by a pre-set logic program to obtain structured data and unstructured data; the pre-trained extraction model is used to extract the corresponding entity data from the unstructured data; the corresponding entity relationship and attribute data are extracted from the structured data through the pre-set business rules; the entity relationship and attribute data, as well as the entity data are imported into the initial graph database through a pre-set batch import program to obtain the graph database.
[0067] For the full-text search knowledge source file, the full-text search knowledge source file is sorted to obtain multiple question-answer pair data and text data, and the question-answer pair data and text data are imported into the initial full-text search engine to obtain the target full-text search engine. The structure of the question-answer pair data is structured, and there is no correlation between the question-answer pair data.
[0068] It should be noted that the initial full-text search engine may be a relational database.
[0069] In the embodiment of the present application, the pre-trained extraction model is trained using historical business text data, wherein the structure of the historical business text data is unstructured.
[0070] S104: Generate a unified search engine based on the target graph database and the target full-text search engine.
[0071] In the embodiment of the present application, technicians can write corresponding search application services through packaging programming experience.
[0072] In the specific process of executing step S103, after importing the obtained graph database knowledge source file into the initial graph database to obtain the target graph database, and importing the obtained full-text search knowledge source file into the initial full-text search engine to obtain the target full-text search engine, the target graph database and the target full-text search engine are encapsulated through the pre-written search gateway application service to generate a unified search engine with a search exit.
[0073] It should be noted that the unified search export is used to output the answer corresponding to the question, that is, the result.
[0074] S105: When a target question sent by a user is received, the target question is input into the unified search engine so that the unified search engine processes the target question using the target graph database to obtain at least one first result, and processes the target question through the full-text search engine to obtain at least one second result.
[0075] In the specific process of executing step S105, after a unified search engine is generated based on the target graph database and the target full-text search engine, it is detected in real time whether the target question sent by the user is received. When the target question sent by the user is received, the target question is input into the unified search engine so that the unified search engine searches for each result corresponding to the target question from the graph database knowledge source file stored in itself through the target graph database (for the sake of convenience, the result corresponding to the target question searched out from the target graph database is called the first result).
[0076] And analyze the target question through the full-text search engine, combine the contextual relationship, and search for each result corresponding to the target question from the full-text search knowledge source file stored in itself (for the convenience of interval, the result corresponding to the target question searched by the target full-text search engine is called the second result).
[0077] S106: Output each first result and each second result.
[0078] During the specific execution of step S106 , each first result and each second result may be outputted through a unified search exit.
[0079] Optionally, before outputting each first result and each second result through the search unified exit, the embodiment of the present application can also calculate the similarity between each first result and the target question by calling a secondary sorting algorithm, and after calculating the similarity between each second result and the target question, sort the first results and the second results from large to small according to the similarity of each first result and the similarity of each second result to obtain the sorted result, and then output the sorted result through the search unified exit.
[0080] The present invention provides an intelligent question-answering method. First, a binary classification model can be trained using a knowledge source file sample set to obtain a binary classification model. After obtaining a target knowledge source file, the obtained target knowledge source file can be input into the pre-trained binary classification model so that the pre-trained binary classification model classifies the target knowledge source file to obtain a graph database knowledge source file and a full-text search knowledge source file. The graph database knowledge source file is imported into an initial graph database to obtain a target graph database, and the full-text search knowledge source file is imported into an initial full-text search engine to obtain a target full-text search engine. A unified search engine is generated based on the target graph database and the target full-text search engine. When a target question sent by a user is received, the target question is input into the unified search engine so that the unified search engine processes the target question using the target graph database to obtain at least one first result, and processes the target question using the full-text search engine to obtain at least one second result. The at least one first result and at least one second result are output. The technical solution provided by the present invention can first classify the target knowledge source file and then classify and store different types of knowledge source files, so that the knowledge source files are stored in the appropriate search engine in the optimal mode. This can not only improve the search accuracy of each search engine, but also achieve unified management of knowledge source files. Furthermore, a unified search engine generated based on the target graph database and the target full-text search engine can provide unified search services to the outside world. The same search engine can realize the search of different types of knowledge source files.
[0081] Corresponding to the intelligent question-answering method disclosed in the above embodiment of the present invention, reference is made to Figure 2 The embodiment of the present invention further provides a structural diagram of an intelligent question-answering system, which includes:
[0082] A target knowledge source file acquisition unit 21 is used to acquire a target knowledge source file;
[0083] The classification processing unit 22 is used to input the target knowledge source file into the pre-trained binary classification model so that the pre-trained binary classification model classifies the target knowledge source file to obtain a graph database knowledge source file and a full-text search knowledge source file; wherein the pre-trained binary classification model is trained based on the training unit;
[0084] An import unit 23 is used to import the graph database knowledge source file into the initial graph database to obtain a target graph database, and to import the full-text search knowledge source file into the initial full-text search engine to obtain a target full-text search engine;
[0085] A generating unit 24 is configured to generate a unified search engine based on the target graph database and the target full-text search engine;
[0086] The question processing unit 25 is configured to, upon receiving a target question sent by a user, input the target question into the unified search engine, so that the unified search engine processes the target question using the target graph database to obtain at least one first result, and processes the target question using the full-text search engine to obtain at least one second result;
[0087] The output unit 26 is configured to output at least one first result and at least one second result.
[0088] The specific principles and execution processes of each unit in the intelligent question-answering system disclosed in the above embodiment of the present invention are the same as those in the above embodiment of the present invention. Figure 1 The disclosed intelligent question-answering method is the same as that disclosed in the embodiment of the present invention. Figure 1 The corresponding parts of the public intelligent question-answering method will not be repeated here.
[0089] The present invention provides an intelligent question-answering system. First, a binary classification model can be trained using a knowledge source file sample set to obtain a binary classification model. After obtaining a target knowledge source file, the obtained target knowledge source file can be input into the pre-trained binary classification model so that the pre-trained binary classification model classifies the target knowledge source file to obtain a graph database knowledge source file and a full-text search knowledge source file. The graph database knowledge source file is imported into an initial graph database to obtain a target graph database, and the full-text search knowledge source file is imported into an initial full-text search engine to obtain a target full-text search engine. A unified search engine is generated based on the target graph database and the target full-text search engine. When a target question sent by a user is received, the target question is input into the unified search engine so that the unified search engine processes the target question using the target graph database to obtain at least one first result, and processes the target question using the full-text search engine to obtain at least one second result. The at least one first result and at least one second result are output. The technical solution provided by the present invention can first classify the target knowledge source file and then classify and store different types of knowledge source files, so that the knowledge source files are stored in the appropriate search engine in the optimal mode. This can not only improve the search accuracy of each search engine, but also achieve unified management of knowledge source files. Furthermore, a unified search engine generated based on the target graph database and the target full-text search engine can provide unified search services to the outside world. The same search engine can realize the search of different types of knowledge source files.
[0090] Furthermore, the intelligent question-answering system provided by the embodiment of the present invention further includes:
[0091] A first calculation unit is used to calculate the similarity between each first result and the target question;
[0092] A second calculation unit is used to calculate the similarity between each second result and the target question;
[0093] a sorting unit, configured to sort the first results and the second results from largest to smallest according to the similarity of each first result and the similarity of each second result, to obtain a sorting result;
[0094] The output unit is specifically used to output the sorting result, which includes each first result and each second result sorted from large to small according to similarity.
[0095] Optionally, generate a unit, including:
[0096] A generation subunit is used to encapsulate the target graph database and the target full-text search engine through the search gateway application service to generate a unified search engine, which includes a unified search export;
[0097] The output unit is also used to output the sorting results through a unified search export.
[0098] Optional training modules include:
[0099] A knowledge source file acquisition unit is used to acquire a knowledge source file sample set; wherein the knowledge source file sample set includes a historical graph database knowledge source file and its sample labels, and a historical full-text search knowledge source file and its sample labels;
[0100] an iterative training unit, configured to sequentially input each knowledge source file sample into the binary classification model to be trained, so that the binary classification model to be trained processes each knowledge source file sample respectively, with the obtained processing result being close to the sample label corresponding to each knowledge source file sample as the training goal, and iteratively train the binary classification model to be trained until the binary classification model to be trained reaches convergence, thereby obtaining a binary classification model;
[0101] The knowledge source file sample is a historical graph database knowledge source file, or a historical full-text search knowledge source file sample.
[0102] An embodiment of the present application also provides an electronic device, which includes: a processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; and the memory is used to store a program, which is used to implement an intelligent question-answering method.
[0103] Reference below Figure 3, which shows a schematic diagram of the structure of an electronic device suitable for implementing the disclosed embodiments of the present invention. The electronic devices in the disclosed embodiments of the present invention may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 3 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments disclosed in the present invention.
[0104] like Figure 3 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 306 into a random access memory (RAM) 303. Various programs and data required for the operation of the electronic device are also stored in the RAM 303. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0105] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Figure 3 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0106] In particular, according to an embodiment disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment disclosed in the present invention includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment disclosed in the present invention are performed.
[0107] Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are used to execute the intelligent question-answering method.
[0108] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains a target knowledge source file; inputs the target knowledge source file into a pre-trained binary classification model so that the pre-trained binary classification model classifies the target knowledge source file to obtain a graph database knowledge source file and a full-text search knowledge source file; wherein the pre-trained binary classification model is obtained by training the binary classification model to be trained using a knowledge source file sample set; the knowledge source file sample set at least includes a historical graph database knowledge source file and a historical full-text search knowledge source file; imports the graph database knowledge source file into an initial graph database to obtain a target graph database, and imports the full-text search knowledge source file into an initial full-text search engine to obtain a target full-text search engine; generates a unified search engine based on the target graph database and the target full-text search engine; when receiving a target question sent by a user, inputs the target question into the unified search engine so that the unified search engine processes the target question using the target graph database to obtain at least one first result, and processes the target question through the full-text search engine to obtain at least one second result; and outputs the at least one first result and the at least one second result.
[0109] In the context disclosed by the present invention, a machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can 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 can 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.
[0110] It should be noted that the computer-readable medium disclosed in the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, 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), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0111] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0112] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without making any creative efforts.
[0113] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0114] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
[0115] The above are only preferred embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. An intelligent question-answering method, characterized in that: The method comprises: Obtaining target knowledge source files, wherein the target knowledge source files include graph database knowledge source files and full-text search knowledge source files, wherein the graph database knowledge source files include data of legal persons, users, and businesses, and wherein the legal persons, users, and businesses in the data have logical relationships; Inputting the target knowledge source file into a pre-trained binary classification model so that the pre-trained binary classification model classifies the target knowledge source file to obtain a graph database knowledge source file and a full-text search knowledge source file; wherein the pre-trained binary classification model is obtained by training the binary classification model to be trained using a knowledge source file sample set; the knowledge source file sample set includes at least a historical graph database knowledge source file and a historical full-text search knowledge source file; Importing the graph database knowledge source file into the initial graph database to obtain a target graph database, and importing the full-text search knowledge source file into the initial full-text search engine to obtain a target full-text search engine; Encapsulating the target graph database and the target full-text search engine through a search gateway application service to generate a unified search engine with a search exit; When a target question sent by a user is received, the target question is input into the unified search engine, so that the unified search engine searches for at least one first result corresponding to the target question from the graph database knowledge source files stored in the unified search engine through the target graph database, and analyzes the target question through the full-text search engine, and searches for at least one second result corresponding to the target question from the full-text search knowledge source files stored in the unified search engine in combination with the contextual relationship; outputting the at least one first result and the at least one second result; The step of importing the graph database knowledge source file into the initial graph database to obtain the target graph database includes: For the graph database knowledge source file, the graph database knowledge source file is processed through a pre-set logic program to obtain structured data and unstructured data; Use pre-trained extraction models to extract corresponding entity data from unstructured data; Extract corresponding entity relationships and attribute data from structured data through pre-set business rules; Import entity relationships and attribute data, as well as entity data, into the initial graph database through a pre-set batch import program to obtain the target graph database; The step of importing the full-text search knowledge source file into an initial full-text search engine to obtain a target full-text search engine includes: For full-text search knowledge source files, the full-text search knowledge source files are sorted out to obtain multiple question-answer pair data and text data; The question-answer pair data and text data are imported into the initial full-text search engine to obtain the target full-text search engine.
2. The method according to claim 1, characterized in that Before outputting the at least one first result and the at least one second result, the method further includes: For each of the first results, calculating the similarity between the first result and the target question; For each second result, calculating the similarity between the second result and the target question; According to the similarity of each first result and the similarity of each second result, sorting the first results and the second results from largest to smallest to obtain a sorting result; The outputting of the at least one first result and the at least one second result includes: The sorting result is output, where the sorting result includes the first results and the second results sorted in descending order of similarity.
3. The method according to claim 1, characterized in that The method of using the knowledge source file sample set to train the binary classification model to obtain the pre-trained binary classification model includes: Acquire a knowledge source file sample set; wherein the knowledge source file sample set includes historical graph database knowledge source files and their sample labels, historical full-text search knowledge source files and their sample labels; Inputting each of the knowledge source file samples into the binary classification model to be trained in turn, so that the binary classification model to be trained processes each of the knowledge source file samples respectively, and taking the obtained processing results close to the sample labels corresponding to each of the knowledge source file samples as the training target, iteratively training the binary classification model to be trained until the binary classification model to be trained reaches convergence, thereby obtaining a binary classification model; The knowledge source file sample is the historical graph database knowledge source file, or a historical full-text search knowledge source file.
4. An intelligent question-answering system, characterized in that: The system comprises: A target knowledge source file acquisition unit is used to acquire a target knowledge source file, wherein the target knowledge source file includes a graph database knowledge source file and a full-text search knowledge source file, wherein the graph database knowledge source file includes data of legal persons, users, and businesses, and wherein the legal persons, users, and businesses in the data have a logical relationship; A classification processing unit, configured to input the target knowledge source file into a pre-trained binary classification model, so that the pre-trained binary classification model classifies the target knowledge source file to obtain a graph database knowledge source file and a full-text search knowledge source file; wherein the pre-trained binary classification model is trained based on the training unit; An importing unit, configured to import the graph database knowledge source file into an initial graph database to obtain a target graph database, and to import the full-text search knowledge source file into an initial full-text search engine to obtain a target full-text search engine; A generating unit, configured to encapsulate the target graph database and the target full-text search engine through a search gateway application service to generate a unified search engine with a search exit; a question processing unit configured to, upon receiving a target question sent by a user, input the target question into the unified search engine, so that the unified search engine searches for at least one first result corresponding to the target question from a graph database knowledge source file stored in the unified search engine through the target graph database, and to analyze the target question through the full-text search engine, and search for at least one second result corresponding to the target question from a full-text search knowledge source file stored in the unified search engine in combination with a contextual relationship; an output unit, configured to output the at least one first result and the at least one second result; Wherein, the introduction unit is specifically used for: For the graph database knowledge source file, the graph database knowledge source file is processed through a pre-set logic program to obtain structured data and unstructured data; Use pre-trained extraction models to extract corresponding entity data from unstructured data; Extract corresponding entity relationships and attribute data from structured data through pre-set business rules; Import entity relationships and attribute data, as well as entity data, into the initial graph database through a pre-set batch import program to obtain the target graph database; Wherein, the introduction unit is specifically used for: For full-text search knowledge source files, the full-text search knowledge source files are sorted out to obtain multiple question-answer pair data and text data; The question-answer pair data and text data are imported into the initial full-text search engine to obtain the target full-text search engine.
5. The system according to claim 4, characterized in that The system further comprises: A first calculation unit is configured to calculate, for each first result, a similarity between the first result and the target question; a second calculation unit, configured to calculate, for each second result, a similarity between the second result and the target question; a sorting unit, configured to sort the first results and the second results from largest to smallest according to the similarity of each first result and the similarity of each second result, to obtain a sorting result; The output unit is specifically configured to output a sorting result, where the sorting result includes each of the first results and each of the second results sorted in descending order of similarity.
6. The system according to claim 4, characterized in that The training unit comprises: A knowledge source file acquisition unit is used to acquire a knowledge source file sample set; wherein the knowledge source file sample set includes a historical graph database knowledge source file and its sample labels, a historical full-text search knowledge source file and its sample labels; an iterative training unit, configured to sequentially input each of the knowledge source file samples into the binary classification model to be trained, so that the binary classification model to be trained processes each of the knowledge source file samples respectively, with the obtained processing result being close to the sample label corresponding to each of the knowledge source file samples as a training target, and iteratively train the binary classification model to be trained until the binary classification model to be trained reaches convergence, thereby obtaining a binary classification model; The knowledge source file sample is the historical graph database knowledge source file, or a historical full-text search knowledge source file.
7. An electronic device, characterized in that: The electronic device includes a processor and a memory, the memory is used to store program code and data for intelligent question answering, and the processor is used to call the program instructions in the memory to execute an intelligent question answering method as described in any one of claims 1-3.
8. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute an intelligent question-answering method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Inference type precise intelligent question-answering method based on legal knowledge graph
CN110377715A
Intelligent fault diagnosis method based on importance weighted domain adversarial adaptation
CN112101085A
Knowledge graph construction method based on meteorological field
CN113392223A