CN117828064B - Question-answering system and construction method thereof - Google Patents

Question-answering system and construction method thereof Download PDF

Info

Publication number
CN117828064B
CN117828064B CN202410250376.1A CN202410250376A CN117828064B CN 117828064 B CN117828064 B CN 117828064B CN 202410250376 A CN202410250376 A CN 202410250376A CN 117828064 B CN117828064 B CN 117828064B
Authority
CN
China
Prior art keywords
text
question
database
label
reply data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410250376.1A
Other languages
Chinese (zh)
Other versions
CN117828064A (en
Inventor
沈盼
邱鹏
陈晓耀
聂旗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Lab
Original Assignee
Zhejiang Lab
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Lab filed Critical Zhejiang Lab
Priority to CN202410250376.1A priority Critical patent/CN117828064B/en
Publication of CN117828064A publication Critical patent/CN117828064A/en
Application granted granted Critical
Publication of CN117828064B publication Critical patent/CN117828064B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The specification discloses a question-answering system and a construction method of the question-answering system. The question-answering system comprises: the system comprises an interaction module, a service module, a first database, a second database and a specified large model, wherein the service module is used for receiving a problem text, sending the problem text to the first database, receiving a problem label which is obtained by searching the first database for the problem text and is matched with the problem text, judging whether the problem label is empty, if yes, sending the problem text to the specified large model, receiving reply data generated by the specified large model according to the problem text, returning the reply data generated by the specified large model to the interaction module, if not, sending the problem label to the second database, receiving the reply data which is returned by the second database for the problem label and is matched with the problem label, and returning the reply data obtained by searching the second database to the interaction module.

Description

Question-answering system and construction method thereof
Technical Field
The present disclosure relates to the field of natural language processing technologies, and in particular, to a question-answering system and a method for constructing a question-answering system.
Background
The question and answer assistant is an intelligent robot based on artificial intelligence technology, which can understand and answer the questions of users through natural language processing technology, and has the advantages of high efficiency and clear field characteristics. The question and answer assistant can rapidly process a large amount of data and search for information needed by the user instead of the user searching for the information, so that the efficiency of the user for acquiring the needed information can be improved.
In general, a question and answer assistant generates corresponding answers for users according to questions input by users through a large model, but for some vertical professional fields (such as medical services, artificial intelligence, etc.), questions with insufficient knowledge depth, knowledge accuracy and timeliness often exist when the question and answer assistant serves the fields.
Therefore, how to improve the response performance of the question and answer assistant is a urgent problem to be solved.
Disclosure of Invention
The present specification provides a question-answering system and a method for constructing a question-answering system, so as to partially solve the above-mentioned problems existing in the prior art.
The technical scheme adopted in the specification is as follows:
The present specification provides a question-answering system for answering questions in a specified field, the question-answering system comprising: the system comprises an interaction module, a service module, a first database, a second database and a specified large model;
the interaction module is used for receiving the problem text sent by the user, sending the problem text to the service module, and receiving reply data returned by the service module and displaying the reply data to the user;
The service module is used for receiving the problem text, encoding the problem text to obtain a problem text vector corresponding to the problem text, sending the problem text vector to the first database, receiving a problem label matched with the problem text vector and obtained by searching the problem text vector by the first database, judging whether the problem label is empty, if yes, sending the problem text to the appointed large model, receiving reply data generated by the appointed large model according to the problem text, and returning the reply data generated by the appointed large model to the interaction module, wherein the problem label is extracted in advance according to historical problems in the appointed field;
If not, the problem label is sent to the second database, reply data matched with the problem label and returned after the second database searches the problem label is received, and the reply data obtained by searching the second database is returned to the interaction module.
Optionally, the first database is a vector database;
The first database is used for judging whether the similarity between the label vector corresponding to each preset problem label and the problem text vector exceeds a preset similarity threshold value or not according to each preset problem label;
If yes, determining the question label as the question label matched with the question text.
Optionally, the second database is a key value database, wherein, for each preset problem label, the problem label is used as a key, and reply data corresponding to the problem label is used as a value, so that one key value pair in the second database is formed and stored in the second database;
The second database is used for receiving the problem label sent by the service module, and determining key value pairs, which are matched with the problem label, of the contained keys from the prestored key value pairs as target key value pairs;
and determining reply data matched with the problem label according to the target key value pair and returning the reply data to the service module.
Optionally, the service module is configured to perform deserialization processing on the received reply data matched with the problem tag returned by the second database or the reply data generated by the specified large model, so as to convert the reply data matched with the problem tag returned by the second database or the reply data generated by the specified large model into a specified format, and then return the converted reply data to the interaction module.
Optionally, the interaction module is configured to determine a data type of the reply data as a target data type;
And selecting a display component matched with the target data type from preset display components as a target display component, and displaying the reply data to the user through the target display component.
Optionally, if the reply data received by the interaction module is reply data generated by the specified big model, the interaction module is configured to generate identification information of the reply data generated by the specified big model, and display the identification information and the reply data to the user.
The specification provides a method for constructing a question-answering system, which is used for constructing the question-answering system and comprises the following steps:
Acquiring historical problem texts in the appointed field and reply data corresponding to the historical problem texts;
Analyzing the historical problem text to disassemble the historical problem text into a main body and keywords to obtain a problem label, encoding the problem label to obtain a label vector corresponding to the historical problem text, and storing the problem label and the label vector into a first database;
Taking the question label of the historical question text as a key, taking a reply text corresponding to the historical question text as a value, constructing a key value pair corresponding to the historical question text, and storing the key value pair corresponding to the historical question text in a second database;
and constructing a question-answering system according to the first database, the second database, a preset interaction module, a preset service module and a preset specified large model.
Optionally, the question label of the historical question text is used as a key, the answer text corresponding to the historical question text is used as a value, a key value pair corresponding to the historical question text is constructed, and the key value pair corresponding to the historical question text is stored in a second database, specifically including:
And taking the question label of the historical question text as a key, converting the reply text corresponding to the historical question text into a character string of a specified type as a value, constructing a key value pair corresponding to the historical question text, and storing the key value pair corresponding to the historical question text in a second database.
The present specification provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the question-answering system construction method described above.
The present specification provides an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the question-answering system construction method described above when executing the program.
The above-mentioned at least one technical scheme that this specification adopted can reach following beneficial effect:
In the question-answering system provided in the present specification, the question-answering system is for answering questions in a specified field, and includes: the system comprises an interaction module, a service module, a first database, a second database and a designated big model, wherein the interaction module is used for receiving a problem text sent by a user, sending the problem text to the service module, receiving reply data returned by the service module and showing the reply data to the user, the service module is used for receiving the problem text, coding the problem text to obtain a problem text vector corresponding to the problem text, sending the problem text vector to the first database, receiving a problem label matched with the problem text vector and obtained by searching the first database for the problem text vector, judging whether the problem label is empty, sending the problem text to the designated big model if yes, receiving reply data generated by the designated big model according to the problem text, returning the reply data generated by the designated big model to the interaction module, if not, sending the problem label to the second database, receiving reply data matched with the problem label and returned by the second database after searching the problem label, and returning the reply data obtained by the second database to the interaction module.
According to the method, the first database and the second database can be combined with the appointed large model, part of known questions in the appointed field are recorded in the second database, the questions in the appointed field are answered by a user in a preset answer mode, and questions which are not preset in the appointed field and are proposed by the user can be answered by the appointed large model, so that the answer performance of a question and answer assistant in the appointed field is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification, illustrate and explain the exemplary embodiments of the present specification and their description, are not intended to limit the specification unduly. In the drawings:
FIG. 1 is a schematic diagram of a question-answering system provided in the present specification;
FIG. 2 is a schematic flow chart of a question-answering system for question answering provided in the present specification;
FIG. 3 is a schematic flow chart of a question and answer system construction provided in the present specification;
FIG. 4 is a schematic diagram of a model training apparatus provided in the present specification;
fig. 5 is a schematic diagram of an electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present specification more apparent, the technical solutions of the present specification will be clearly and completely described below with reference to specific embodiments of the present specification and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present specification. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
The following describes in detail the technical solutions provided by the embodiments of the present specification with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of a question-answering system provided in the present specification.
As can be seen in conjunction with fig. 1, the question-answering system provided in this specification may include: the system comprises an interaction module, a service module, a first database, a second database and a specified large model.
The interaction module may be configured to receive a question text sent by a user through a client used by the user, send the received question text to the service module, and receive reply data returned by the service module and display the reply data to the user, where the client used by the user may be a natural language question-answering assistant, and the question text may be a text corresponding to a question written by the user in a specified field using natural language.
It should be noted that the above specified domain may be a vertical professional domain with a deeper knowledge depth, for example: software development field, cloud computing field, medicine development field, personal asset management field, agricultural planting field, etc.
The service module is configured to receive a question text, encode the question text to obtain a question text vector corresponding to the question text, send the question text vector to the first database, receive a question label matching the question text vector and obtained by searching the question text vector by the first database, determine whether the question label is empty, if yes, send the question text to a specified large model, receive reply data generated by the specified large model according to the question text, and return the reply data generated by the specified large model to the interaction module, as shown in fig. 2.
Fig. 2 is a schematic flow chart of a question replying by a question answering system provided in the present specification.
As can be seen from fig. 2, the first database may be a preset vector database, and for each problem label stored in the first database in advance, it may be determined whether the similarity between the label vector corresponding to the problem label and the problem text vector exceeds a preset similarity threshold, if so, it is determined that the problem label is a problem label matched with the received problem text.
In the foregoing, the method for encoding the question text may be that the question text is input into a preset text feature extraction model, so as to extract a question text vector corresponding to the question text through the text feature extraction model.
In the above, the problem tag stored in the first database in advance may be extracted in advance from the history problem in the designated area. Specifically, each history problem in the above specified area may be collected in advance, and for each collected history problem in the specified area, the intention information and the domain keyword included in the history problem may be extracted as description information corresponding to the history problem, and further the description information of the history problem may be used as a problem tag corresponding to the history problem.
For example: how is the image uploaded for history problems? ", the intention information can be extracted as: the method is sought, and the domain keywords are: upload the image and then get "how to upload the image? "descriptive information corresponding to this history problem, i.e., { intention information: search for methods, domain keywords: uploading the mirror image }, and further using the determined description information as a problem label corresponding to the history problem.
Further, the server may input the description information corresponding to the historical problem into a preset text feature extraction model, so as to extract a feature vector corresponding to the historical problem through the text feature extraction model, use the feature vector as a label vector corresponding to the historical problem, and store the label vector corresponding to the historical problem and the problem label corresponding to the historical problem in the first database.
It should be noted that the above specified large model may be set according to actual requirements, for example: the specified large model described above may be used to generate Content models for artificial intelligence (ARTIFICIAL INTELLIGENCE GENERATED Content, AIGC).
It should be noted that, when the number of problem labels matched with the problem text obtained by searching the problem text by the first database exceeds a preset number threshold, the first database may sort the problem labels according to the similarity between the label vector corresponding to each problem label and the problem text vector, so that a specified number of problem labels may be selected from the sorted problem labels and returned to the service module.
Further, if the problem label which is obtained by searching the first database for the problem text and is matched with the problem text and is received by the service module is not empty, the received problem label can be sent to the second database, reply data which is returned by the second database for searching the problem label and is matched with the problem label is received, and the reply data obtained by searching the second database is returned to the interaction module.
Specifically, the second database is configured to receive the problem label sent by the service module, pre-store key value pairs that are determined by each key value pair and that are matched with the problem label, and determine reply data that is matched with the problem label according to the target key value pairs as the target key value pairs, and return the reply data to the service module.
The second database may be a Key-Value (KV) database, in the second database, for each preset problem label, the problem label is used as a Key, and reply data corresponding to the problem label is used as a Value, so as to form one Key Value pair in the second database, where each preset problem label may be a problem label corresponding to each historical problem in a specified field included in the first database, and each reply data may be reply data of each historical problem in a specified field corresponding to each problem label included in the first database acquired in advance.
In a practical application scenario, the reply data may be of different presentation types, for example: text, pictures, audio, links and the like, therefore, in the second database, the reply data can be stored in the form of a Json character string, when the service module receives reply data matched with the problem label returned by the second database or reply data generated by the specified large model, deserialization processing can be performed on the received reply data so as to convert the reply data matched with the problem label returned by the second database or the reply data generated by the specified large model into a specified format, and then return the converted reply data to the interaction module.
The above specified format may be: type: the answer display type text|image|video|link, message is returned: returning text content of the answer, url: links corresponding to image video link types.
From the above, it can be seen that the service module can convert the received reply data in Json format into a structure body composed of three fields and return the structure body to the interaction module, where when the reply data is of text type, the url field can be empty.
In addition, if the second database does not determine the target key value pair, the service module may send the question text to the specified large model, receive reply data generated by the specified large model according to the question text, and return the reply data generated by the specified large model to the interaction module.
Further, when receiving the reply data returned by the service module, the interaction module can determine the data type of the reply data as a target data type, select a display assembly matched with the target data type from preset display assemblies as a target display assembly, and display the reply data to a user through the target display assembly. The presentation component here may be an HTML component, for example: when the reply data to be displayed is of a text type, the reply data can be displayed through a < span > tag component. For another example, when the reply data to be displayed is of a picture type, the reply data can be displayed through the < image > tag component. For another example, when the reply data to be presented is of a link type, a < url > tag component may be used as a component for presenting the reply data.
In addition, since the accuracy of the reply data generated by the specified large model is lower than that of the reply data acquired from the second database, if the reply data received by the interaction module is the reply data generated by the specified large model, the identification information of the reply data generated by the specified large model can be generated, and the identification information and the reply data are displayed to the user, wherein the identification information is used for identifying that the reply information is the reply data acquired by the specified large model.
It should be noted that, when the interaction module sends the question text to the service module, and the service module sends the question text to the first database or designates a large model, the question text may be assembled into Websocket information for transmission, and similarly, when the interaction module and the service module receive reply data, the assembled Websocket information may also be received.
The Websocket information may include: data: json string (value in KV database), dataSource: data source db|ai, timetemp: timestamp, id: unique id of information, etc.
From the above, it can be seen that, by combining the KV database with the specified large model, some known questions in the specified domain can be recorded in the KV database, the questions in the specified domain can be answered by the user in the form of preset answers, and questions in the specified domain, which are presented by the user and are not preset with questions, can be answered by the specified large model, so that the answer performance of the question and answer assistant in the vertical domain is optimized.
Fig. 3 is a schematic flow chart of a question and answer system construction provided in the present specification, including the following steps:
S301: and acquiring historical problem texts in the appointed field and reply data corresponding to the historical problem texts.
S302: analyzing the historical problem text to disassemble the historical problem text into a main body and keywords, obtaining a problem label, encoding the problem label to obtain a label vector corresponding to the historical problem text, and storing the problem label and the label vector into a first database.
S303: and taking the question label of the historical question text as a key, taking a reply text corresponding to the historical question text as a value, constructing a key value pair corresponding to the historical question text, and storing the key value pair corresponding to the historical question text in a second database.
S304: and constructing a question-answering system according to the first database, the second database, a preset interaction module, a preset service module and a preset specified large model.
And taking the question label of the historical question text as a key, converting the answer text corresponding to the historical question text into a character string of a specified type as a value, constructing a key value pair corresponding to the historical question text, and storing the key value pair corresponding to the historical question text in a second database.
From the above, it can be seen that the first database and the second database may be pre-constructed, so that at least some problems in the specified domain proposed by the user may be replied through the first database and the second database, thereby improving accuracy of reply data returned to the user.
The above is a method for constructing one or more question-answering systems in the present specification, and based on the same thought, the present specification further provides a corresponding device for constructing a question-answering system, as shown in fig. 4.
Fig. 4 is a schematic diagram of a model training device provided in the present specification, including:
An obtaining module 401, configured to obtain a historical problem text in a specified field and reply data corresponding to the historical problem text;
the parsing module 402 is configured to parse the historical problem text to disassemble the historical problem text into a main body and a keyword, obtain a problem label, encode the problem label to obtain a label vector corresponding to the historical problem text, and store the problem label and the label vector in a first database;
A first construction module 403, configured to construct a key value pair corresponding to the historical question text by using the question label of the historical question text as a key and using a reply text corresponding to the historical question text as a value, and store the key value pair corresponding to the historical question text in a second database;
and the second construction module 404 is configured to construct a question-answering system according to the first database, the second database, the preset interaction module, the service module and the specified large model.
Optionally, the first construction module 403 is specifically configured to take the question label of the historical question text as a key, convert the reply text corresponding to the historical question text into a character string of a specified type as a value, construct a key value pair corresponding to the historical question text, and store the key value pair corresponding to the historical question text in a second database.
The present specification also provides a computer-readable storage medium storing a computer program operable to execute a question-answering system construction method provided in fig. 1, described above.
The present specification also provides a schematic structural diagram of an electronic device corresponding to fig. 1 shown in fig. 5. At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile storage, as illustrated in fig. 5, although other hardware required by other services may be included. The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to realize the question-answering system construction method described in fig. 1. Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present description, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
Improvements to one technology can clearly distinguish between improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) and software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable GATE ARRAY, FPGA)) is an integrated circuit whose logic functions are determined by user programming of the device. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented with "logic compiler (logic compiler)" software, which is similar to the software compiler used in program development and writing, and the original code before being compiled is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but HDL is not just one, but a plurality of kinds, such as ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language), and VHDL (Very-High-SPEED INTEGRATED Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application SPECIFIC INTEGRATED Circuits (ASICs), programmable logic controllers, and embedded microcontrollers, examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present specification.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present description is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present disclosure and is not intended to limit the disclosure. Various modifications and alterations to this specification will become apparent to those skilled in the art. Any modifications, equivalent substitutions, improvements, or the like, which are within the spirit and principles of the present description, are intended to be included within the scope of the claims of the present description.

Claims (9)

1. A question-answering system for answering questions in a specified area, the question-answering system comprising: the system comprises an interaction module, a service module, a first database, a second database and a specified large model;
the interaction module is used for receiving the problem text sent by the user, sending the problem text to the service module, and receiving reply data returned by the service module and displaying the reply data to the user;
the service module is used for receiving the problem text, encoding the problem text to obtain a problem text vector corresponding to the problem text, sending the problem text vector to the first database, receiving a problem label which is determined by the first database according to the similarity between the problem text vector and a label vector corresponding to each preset problem label and is matched with the problem text vector, judging whether the problem label is empty, if yes, sending the problem text to the appointed large model, receiving reply data generated by the appointed large model according to the problem text, and returning the reply data generated by the appointed large model to the interaction module, wherein the problem label is determined in advance according to intention information and field keywords contained in historical problems of the appointed field;
If not, the problem label is sent to the second database, reply data matched with the problem label and returned after the second database searches the problem label is received, and the reply data obtained by searching the second database is returned to the interaction module.
2. The question-answering system according to claim 1, wherein the second database is a key-value database, wherein for each preset question label, the question label is used as a key, and reply data corresponding to the question label is used as a value, so that one key-value pair in the second database is formed and stored in the second database;
The second database is used for receiving the problem label sent by the service module, and determining key value pairs, which are matched with the problem label, of the contained keys from the prestored key value pairs as target key value pairs;
and determining reply data matched with the problem label according to the target key value pair and returning the reply data to the service module.
3. The question-answering system of claim 1, wherein the service module is configured to perform deserialization processing on the received reply data that matches the question label returned by the second database or the reply data generated by the specified large model, so as to convert the reply data that matches the question label returned by the second database or the reply data generated by the specified large model into a specified format, and then return the converted reply data to the interaction module.
4. The question-answering system according to claim 1, wherein the interaction module is for determining a data type of the reply data as a target data type;
And selecting a display component matched with the target data type from preset display components as a target display component, and displaying the reply data to the user through the target display component.
5. The question-answering system of claim 1, wherein if the reply data received by the interaction module is reply data generated by the specified big model, the interaction module is configured to generate identification information of the reply data generated for the specified big model, and display the identification information and the reply data to the user.
6. A method for constructing a question-answering system according to any one of claims 1 to 5, the method comprising:
Acquiring historical problem texts in the appointed field and reply data corresponding to the historical problem texts;
Analyzing the historical problem text to disassemble the historical problem text into a main body and keywords to obtain a problem label, encoding the problem label to obtain a label vector corresponding to the historical problem text, and storing the problem label and the label vector into a first database;
Taking the question label of the historical question text as a key, taking a reply text corresponding to the historical question text as a value, constructing a key value pair corresponding to the historical question text, and storing the key value pair corresponding to the historical question text in a second database;
and constructing a question-answering system according to the first database, the second database, a preset interaction module, a preset service module and a preset specified large model.
7. The method of claim 6, wherein the question label of the historical question text is used as a key, and the answer text corresponding to the historical question text is used as a value, and the key value pair corresponding to the historical question text is constructed, and the key value pair corresponding to the historical question text is stored in a second database, specifically comprising:
And taking the question label of the historical question text as a key, converting the reply text corresponding to the historical question text into a character string of a specified type as a value, constructing a key value pair corresponding to the historical question text, and storing the key value pair corresponding to the historical question text in a second database.
8. A computer readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 6-7.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of the preceding claims 6-7 when executing the program.
CN202410250376.1A 2024-03-05 2024-03-05 Question-answering system and construction method thereof Active CN117828064B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410250376.1A CN117828064B (en) 2024-03-05 2024-03-05 Question-answering system and construction method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410250376.1A CN117828064B (en) 2024-03-05 2024-03-05 Question-answering system and construction method thereof

Publications (2)

Publication Number Publication Date
CN117828064A CN117828064A (en) 2024-04-05
CN117828064B true CN117828064B (en) 2024-05-28

Family

ID=90509971

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410250376.1A Active CN117828064B (en) 2024-03-05 2024-03-05 Question-answering system and construction method thereof

Country Status (1)

Country Link
CN (1) CN117828064B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538803A (en) * 2020-04-20 2020-08-14 京东方科技集团股份有限公司 Method, device, equipment and medium for acquiring candidate question text to be matched
CN111914073A (en) * 2020-07-15 2020-11-10 中国联合网络通信集团有限公司 Customer service response method, device, equipment and storage medium
WO2022105115A1 (en) * 2020-11-17 2022-05-27 平安科技(深圳)有限公司 Question and answer pair matching method and apparatus, electronic device and storage medium
CN114625858A (en) * 2022-03-25 2022-06-14 中国电子产业工程有限公司 Intelligent government affair question-answer replying method and device based on neural network
CN116108150A (en) * 2022-12-19 2023-05-12 达闼科技(北京)有限公司 Intelligent question-answering method, device, system and electronic equipment
WO2023124215A1 (en) * 2021-12-31 2023-07-06 马上消费金融股份有限公司 User question labeling method and device
CN117235226A (en) * 2023-09-21 2023-12-15 支付宝(杭州)信息技术有限公司 Question response method and device based on large language model
CN117370536A (en) * 2023-12-07 2024-01-09 之江实验室 Task execution method and device, storage medium and electronic equipment
CN117520491A (en) * 2023-10-27 2024-02-06 山东浪潮科学研究院有限公司 Intelligent question-answering method and device based on large language model
CN117520514A (en) * 2023-11-23 2024-02-06 亚信科技(中国)有限公司 Question-answering task processing method, device, equipment and readable storage medium
CN117609475A (en) * 2024-01-10 2024-02-27 四川云知声智能科技有限公司 Question-answer reply method, system, terminal and storage medium based on large model

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538803A (en) * 2020-04-20 2020-08-14 京东方科技集团股份有限公司 Method, device, equipment and medium for acquiring candidate question text to be matched
CN111914073A (en) * 2020-07-15 2020-11-10 中国联合网络通信集团有限公司 Customer service response method, device, equipment and storage medium
WO2022105115A1 (en) * 2020-11-17 2022-05-27 平安科技(深圳)有限公司 Question and answer pair matching method and apparatus, electronic device and storage medium
WO2023124215A1 (en) * 2021-12-31 2023-07-06 马上消费金融股份有限公司 User question labeling method and device
CN114625858A (en) * 2022-03-25 2022-06-14 中国电子产业工程有限公司 Intelligent government affair question-answer replying method and device based on neural network
CN116108150A (en) * 2022-12-19 2023-05-12 达闼科技(北京)有限公司 Intelligent question-answering method, device, system and electronic equipment
CN117235226A (en) * 2023-09-21 2023-12-15 支付宝(杭州)信息技术有限公司 Question response method and device based on large language model
CN117520491A (en) * 2023-10-27 2024-02-06 山东浪潮科学研究院有限公司 Intelligent question-answering method and device based on large language model
CN117520514A (en) * 2023-11-23 2024-02-06 亚信科技(中国)有限公司 Question-answering task processing method, device, equipment and readable storage medium
CN117370536A (en) * 2023-12-07 2024-01-09 之江实验室 Task execution method and device, storage medium and electronic equipment
CN117609475A (en) * 2024-01-10 2024-02-27 四川云知声智能科技有限公司 Question-answer reply method, system, terminal and storage medium based on large model

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于词项聚类的文本语义标签抽取研究;李雄;丁治明;苏醒;郭黎敏;;计算机科学;20181115(S2);全文 *

Also Published As

Publication number Publication date
CN117828064A (en) 2024-04-05

Similar Documents

Publication Publication Date Title
US20200301954A1 (en) Reply information obtaining method and apparatus
US20190103111A1 (en) Natural Language Processing Systems and Methods
US20180349355A1 (en) Artificial Intelligence Based Method and Apparatus for Constructing Comment Graph
CN111695345B (en) Method and device for identifying entity in text
CN113221555B (en) Keyword recognition method, device and equipment based on multitasking model
CN111258995A (en) Data processing method, device, storage medium and equipment
KR101133515B1 (en) Apparatus and Method for Managing Personal Life
CN115952272A (en) Method, device and equipment for generating dialogue information and readable storage medium
CN116720008B (en) Machine reading method and device, storage medium and electronic equipment
US20230367972A1 (en) Method and apparatus for processing model data, electronic device, and computer readable medium
CN111046304B (en) Data searching method and device
CN112182255A (en) Method and apparatus for storing media files and for retrieving media files
CN117076650B (en) Intelligent dialogue method, device, medium and equipment based on large language model
CN117290481A (en) Question and answer method and device based on deep learning, storage medium and electronic equipment
CN116974676A (en) Page content sending method, device and equipment
CN117828064B (en) Question-answering system and construction method thereof
CN117332852A (en) Knowledge graph-based large model training deployment method and system
CN107977395A (en) A kind of help user reads and understands method and the intelligent sound assistant of electronics article
CN116701601A (en) Man-machine interaction method
CN116069915A (en) Government service processing method and device
CN113641817B (en) Report generation method and device based on theme and timeline abstract
CN112784030B (en) Method and device for generating sample, storage medium and electronic equipment
CN112328751A (en) Method and device for processing text
CN117573849B (en) Knowledge graph multi-hop question-answering method, device, equipment and storage medium
CN113569007B (en) Method, device and storage medium for processing knowledge service resources

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant