Question and answer information processing method, system, electronic device and storage medium
By using the relevance rearrangement model on the server side of the question and answer system to obtain and send the target document blocks of the answers, the accuracy and traceability problems of the answers in the question and answer system are solved, and the accuracy and reliability of the output information are improved.
Patent Information
- Application Number
- CN202410999178.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-24
AI Technical Summary
The answers given by the existing question and answer system are not very accurate and the information in the answers cannot be effectively traced, resulting in inaccuracy and unreliability of the output information.
By using the pre-trained relevance rearrangement model on the server side, the document chunks whose relevance to the answer is greater than the preset threshold are obtained from the set of document chunks referenced by the answer, and used as the target document chunk of the answer, and the answer is sent to the terminal and its access information, including title and citation identifiers, for users to trace.
It improves the accuracy and reliability of the information output by the question and answer system, enables users to accurately obtain the information source of answers, and solves the problems of low answer accuracy and poor traceability.
Smart Images

Figure CN118535712B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and specifically to a question-and-answer information processing method, system, electronic device, and storage medium. Background Art
[0002] With the continuous development of artificial intelligence technology, the question answering system (QAS) based on large language models has gradually become a major way for people to retrieve information. The question answering system can meet the needs of users to obtain information quickly and accurately. However, the answers given by the question answering system in related technologies are not accurate, and often do not provide the corresponding information source. Therefore, it is impossible to effectively trace the answers given by the system, and it is difficult to ensure the accuracy and reliability of the information output by the question answering system. Summary of the invention
[0003] In view of the above problems, the present application provides a question and answer information processing method, system, electronic device and storage medium to at least solve the technical problems in the related art that the answers given by the question and answer system are not accurate and the information in the answers cannot be effectively traced.
[0004] According to a first aspect of an embodiment of the present application, a question and answer information processing method is provided, which is applied to a server, and the method includes: obtaining an answer corresponding to a question text, and a set of document blocks corresponding to each answer in the answer; the document block set is source data referenced by the answer; for any answer in each answer segment, based on a pre-trained relevance rearrangement model, obtaining a document block with a relevance greater than a preset threshold value with the any answer segment from the document block set, and using the document block with a relevance greater than the preset threshold value as a target document block corresponding to the any answer segment; sending access information of the answer segments and the target document blocks corresponding to the answer segments to a terminal, so that the terminal displays the answer marked with the access information.
[0005] According to a second aspect of an embodiment of the present application, a question and answer information processing method is provided, which is applied to a terminal, and the method includes: obtaining a question text, and sending the question text to a server, so that the server obtains the answer corresponding to the question text and the target document block corresponding to each paragraph of the answer; the target document block is a document block obtained from a document block set based on a pre-trained association rearrangement model, and the association with the corresponding answer paragraph is greater than a preset threshold; the document block set is the source data referenced by each paragraph of the answer; receiving the answer sent by the server and the access information corresponding to the target document block, and displaying the answer marked with the access information.
[0006] According to a third aspect of an embodiment of the present application, a question and answer information processing device is provided, which is applied to a server, and the device includes: a first acquisition unit, which is used to acquire an answer corresponding to a question text, and a set of document blocks corresponding to each answer in the answer; the document block set is the source data referenced by the answer; a second acquisition unit, which is used to acquire, for any of the answers, a document block with a correlation greater than a preset threshold from the document block set based on a pre-trained correlation rearrangement model, and use the document block with a correlation greater than the preset threshold as a target document block corresponding to the any answer; a sending unit, which is used to send access information of the answers and the target document blocks corresponding to the answers to a terminal, so that the terminal displays the answer marked with the access information.
[0007] According to a fourth aspect of an embodiment of the present application, a question and answer information processing device is provided, which is applied to a terminal, and the question and answer information processing device includes: a sending unit, which is used to obtain a question text and send the question text to a server, so that the server obtains the answer corresponding to the question text and the target document block corresponding to each paragraph of the answer; the target document block is a document block obtained from a document block set based on a pre-trained relevance rearrangement model and having a relevance with the corresponding answer paragraph greater than a preset threshold; the document block set is source data referenced by each paragraph of the answer; a receiving unit, which is used to receive the answer sent by the server and access information corresponding to the target document block; the access information includes a title corresponding to the target document block and a citation identifier, and the citation identifier is used to indicate the title corresponding to the target document block; a first display unit, which is used to display the title corresponding to the target document block of each paragraph of the answer, and display each paragraph of the answer marked with the citation identifier, and the title includes the citation identifier.
[0008] According to a fifth aspect of an embodiment of the present application, there is provided a question-answer information processing system, including: a server and a terminal;
[0009] The server is used to obtain the answer corresponding to the question text and the document block set corresponding to each answer in the answer; the document block set is the source data referenced by the answer; for any answer in each answer segment, based on the pre-trained relevance rearrangement model, a document block with a relevance greater than a preset threshold value to the answer segment is obtained from the document block set, and the document block with a relevance greater than the preset threshold value is used as the target document block corresponding to the answer segment; the access information corresponding to each answer segment and the target document block corresponding to each answer segment is sent to the terminal; the terminal is used to obtain the question text and send the question text to the server; receive the answer sent by the server and the access information corresponding to the target document block, the access information includes the title and citation mark corresponding to the target document block, and the citation mark is used to indicate the title corresponding to the target document block; display the title corresponding to the target document block of each answer segment, and display each answer segment marked with the citation mark, the title includes the citation mark.
[0010] According to a sixth aspect of an embodiment of the present application, there is provided a question-answer information processing system, including: a cloud service end and a terminal;
[0011] The cloud service end is used to obtain answers corresponding to question texts in the financial field, and document block sets corresponding to each section of the answer; the document block set is the financial source data referenced by the answer; for any section of the answer, based on a pre-trained relevance rearrangement model, a document block with a relevance greater than a preset threshold value to any section of the answer is obtained from the document block set, and the document block with a relevance greater than the preset threshold value is used as a target document block corresponding to any section of the answer; access information corresponding to each section of the answer and the target document block corresponding to each section of the answer is sent to the terminal; the access information includes a title and a citation identifier corresponding to the target document block;
[0012] The terminal is used to obtain a question text in the financial field, and send the question text in the financial field to the cloud server; receive the answer sent by the cloud server, as well as the title and citation mark corresponding to the target document block, wherein the citation mark is used to indicate the title corresponding to the target document block; display the title corresponding to the target document block of each section of the answer, and display each section of the answer marked with the citation mark, wherein the title includes the citation mark.
[0013] According to the seventh aspect of the embodiments of the present application, there is also provided an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the question and answer information processing method of the first aspect or the question and answer information processing method of the second aspect through the computer program.
[0014] According to the eighth aspect of the embodiments of the present application, a computer-readable storage medium is also provided, in which a computer program is stored, wherein the computer program is configured to execute the question and answer information processing method of the first aspect or the question and answer information processing method of the second aspect when running.
[0015] According to the ninth aspect of the embodiments of the present application, a computer program product is also provided, including a computer program, wherein the computer program is executed by a processor to execute the question and answer information processing method of the first aspect or the question and answer information processing method of the second aspect.
[0016] In an embodiment of the present application, a method is adopted in which the answer corresponding to the question text and the document block set corresponding to each section of the answer are obtained based on the server; the document block set is the source data referenced by the answer; for any section of the answer, a document block with a correlation greater than a preset threshold value is obtained from the document block set based on a pre-trained correlation rearrangement model, and the document block with a correlation greater than the preset threshold value is used as the target document block corresponding to any section of the answer; the access information of each section of the answer and the target document block corresponding to each section of the answer is sent to the terminal, and the terminal displays the answer marked with the access information. The present application accurately obtains the access information of the target document block corresponding to each section of the answer through the server, and then displays it on the client, which can not only improve the accuracy of the system output information, but also accurately display the source of information corresponding to the answer to the user, so that the user can effectively trace the answer given by the system, ensure the accuracy and reliability of the information output by the question and answer system, and solve the technical problem that the answer given by the question and answer system in the related technology is not accurate and the information in the answer cannot be effectively traced. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Moreover, the same reference numerals are used throughout the drawings to represent the same components. In the drawings:
[0018] Figure 1 is a schematic diagram of an application environment of an optional question-answer information processing method according to an embodiment of the present application;
[0019] Figure 2 is a flowchart of an optional question-and-answer information processing method according to an embodiment of the present application;
[0020] Figure 3 is a flowchart of another optional question-and-answer information processing method according to an embodiment of the present application;
[0021] Figure 4 is a flowchart of another optional question-and-answer information processing method according to an embodiment of the present application;
[0022] Figure 5 is a flowchart of another optional question-and-answer information processing method according to an embodiment of the present application;
[0023] Figure 6 is a schematic diagram of a question-and-answer interface of an optional question-and-answer information processing method according to an embodiment of the present application;
[0024] Figure 7 is a schematic diagram of a question-and-answer interface of another optional question-and-answer information processing method according to an embodiment of the present application;
[0025] Figure 8 It is a structural diagram of a question-and-answer information processing device provided in an embodiment of the present application;
[0026] Fig. 9 is a structural diagram of another question-and-answer information processing device provided in an embodiment of the present application;
[0027] Fig.10 It is a structural diagram of a question-and-answer information processing system provided in an embodiment of the present application;
[0028] Fig.11 is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0029] Fig.12 is a schematic diagram of the structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only embodiments of a part of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] As an optional implementation, the above question-answer information processing method can be applied to, but is not limited to, Figure 1 In the application environment shown. The application environment may include, but is not limited to: a terminal 102 for human-computer interaction with a user, a network 110, and a server 112. A question-and-answer information processing client runs in the terminal 102. The terminal device 102 includes a display 108, a processor 106, and a memory 104. The display 108 is used to present the question text and the answer corresponding to the question text and marked with the access information. The processor 106 is used to receive the question text uploaded by the user, and send the question text to the server 112; receive the answer sent by the server 112 and the access information corresponding to the target document block, and display the answer marked with the access information. In addition, the server 112 includes a database 114 and a processing engine 116, and the database 114 is used to store the question text and the answer corresponding to the question text and marked with the access information. The processing engine 116 is used to receive the question text sent by the terminal 102, obtain the answer corresponding to the question text, and a set of document blocks corresponding to each answer in the answer; the document block set is the source data referenced by the answer; for any answer in each answer segment, based on a pre-trained relevance rearrangement model, obtain a document block with a relevance greater than a preset threshold from the document block set, and use the document block with a relevance greater than the preset threshold as the target document block corresponding to the any answer segment; send the access information of each answer segment and the target document block corresponding to each answer segment to the terminal 102.
[0033] The specific process is as follows: Assume that Figure 1The terminal 102 shown runs a question-answer information processing client. The terminal 102 executes steps S102-S104 to receive the question text input by the user and sends the question text to the server 112. The server 112 executes steps S106-S112 to obtain the answer corresponding to the question text and the document block set corresponding to each section of the answer; the document block set is the source data referenced by the answer; for any section of the answer, based on the pre-trained relevance rearrangement model, a document block with a relevance greater than a preset threshold value to any section of the answer is obtained from the document block set, and the document block with a relevance greater than the preset threshold value is used as the target document block corresponding to any section of the answer; and the access information of each section of the answer and the target document block corresponding to each section of the answer is sent to the terminal 102. The terminal 102 executes step S114 to receive the answer sent by the server 112 and the access information corresponding to the target document block, and displays the answer marked with the access information.
[0034] In one or more embodiments, the question-answer information processing method of the present application can be applied to Figure 2 In the application environment shown. Figure 2 As shown, human-computer interaction can be performed between the user 202 and the user device 204. The user device 204 includes a memory 206 and a processor 208. In this embodiment, the user device 204 can refer to but is not limited to the operations performed by the terminal 102, receive the answer sent by the server 112 and the access information corresponding to the target document block, and display the answer marked with the access information.
[0035] Optionally, the terminal 102 and the user device 204 include but are not limited to mobile phones, laptops, tablet computers, PDAs, MIDs (Mobile Internet Devices), desktop computers, smart TVs, etc. The application client with question-and-answer information processing function in the embodiment of the present application includes but is not limited to a video client, an instant messaging client, a browser client, etc. The network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that implement wireless communication. The server 112 may be a single server, or a server cluster consisting of multiple servers, or a cloud server, and the cloud server includes but is not limited to a private cloud server or a public cloud server. The above is only an example, and no limitation is made in this embodiment.
[0036] The answers given by the question-and-answer system of related technologies often do not provide the corresponding information source, so it is impossible to effectively trace the answers given by the system, and it is difficult to ensure the accuracy and reliability of the information output by the question-and-answer system.
[0037] In order to solve the above technical problems, as an optional implementation method, Figure 3 As shown, the embodiment of the present application provides a question-answer information processing method, which is applied to a server and includes the following steps:
[0038] S302, obtaining an answer corresponding to the question text and a document block set corresponding to each section of the answer; the document block set is source data referenced by the answer;
[0039] Specifically, the server in the embodiment of the present application can be a single server, or a server cluster composed of multiple servers, or a cloud server. The above-mentioned cloud server includes but is not limited to a private cloud server or a public cloud server.
[0040] It should be noted that the above question text can be the original text information input by the user, or the text obtained by transcribing the audio input by the user. The above question text can be the text obtained by supplementing the question information input by the user according to the context information of the user's chat in the question-answering system. Each document chunk (chunk) in the above document chunk set can be the source data cited by a paragraph of the answer obtained based on the preset large language model. The source data can be, for example, one or more paragraphs of text in citation data such as various papers, journals or magazines.
[0041] S304, for any of the answers, based on the pre-trained relevance rearrangement model, obtaining a document block with a relevance greater than a preset threshold to the answer from the document block set, and using the document block with a relevance greater than the preset threshold as a target document block corresponding to the answer;
[0042] Specifically, under normal circumstances, in order to be able to comprehensively and objectively answer the questions raised by users, the question-answering system will give answers to multiple paragraphs of different dimensions for the questions raised by users. For example, each of the answers in the above multiple paragraphs can correspond to information of one dimension. Assuming that the user asks a question about a product, the above different dimensions may include but are not limited to multiple dimensions such as function, price, user evaluation, technical specifications, etc. Each answer corresponds to multiple document blocks, that is, corresponding to multiple different source data; the multiple document blocks corresponding to each answer have different correlations with the answer. The application can obtain a document block with a correlation greater than a preset threshold from the document block set based on the pre-trained correlation re-ranking model, and then use the document block with a correlation greater than the preset threshold as the target document block corresponding to any answer, and the target document block can be the citation to be displayed corresponding to the answer. It should be noted that the question-answering system of the present application can flexibly adjust the preset threshold according to the needs of different users and different types of questions, so as to provide users with more accurate and satisfactory answers and improve user experience.
[0043] S306: Send the answers and access information of the target document blocks corresponding to the answers to the terminal, so that the terminal displays the answers marked with the access information.
[0044] Specifically, in the embodiment of the present application, the access information of the target document block includes, for example, a Uniform Resource Location (URL) corresponding to the target document block, title information corresponding to the target document block, a reference identifier corresponding to the target document block, etc. After the server obtains the access information of the target document block corresponding to each answer segment, the server sends the access information to the client for display.
[0045] In an embodiment of the present application, a method is adopted in which the answer corresponding to the question text and the document block set corresponding to each section of the answer are obtained based on the server; the document block set is the source data referenced by the answer; for any section of the answer, a document block with a correlation greater than a preset threshold value is obtained from the document block set based on a pre-trained correlation rearrangement model, and the document block with a correlation greater than the preset threshold value is used as the target document block corresponding to any section of the answer; the access information of each section of the answer and the target document block corresponding to each section of the answer is sent to the terminal, and the terminal displays the answer marked with the access information. The present application accurately obtains the access information of the target document block corresponding to each section of the answer through the server, and then displays it on the client, which can not only improve the accuracy of the system output information, but also accurately display the source of information corresponding to the answer to the user, so that the user can effectively trace the answer given by the system, ensure the accuracy and reliability of the information output by the question and answer system, and solve the technical problem that the accuracy of the answer given by the question and answer system in the related technology is not high, and the answer information cannot be effectively traced.
[0046] As an optional implementation, Figure 4 As shown, the embodiment of the present application provides a question-answer information processing method, which is applied to a server and includes the following steps:
[0047] S402, obtaining the answer corresponding to the question text and the document block set corresponding to each section of the answer; the document block set is the source data referenced by the answer.
[0048] S404, for any answer in each answer section, input the any answer section and the corresponding document block set into the relevance rearrangement model for processing, and obtain a first relevance index between the any answer section and each document block in the corresponding document block set;
[0049] S406: Determine the document block with the highest correlation with any one of the answers based on the first correlation index, and determine the document block with the highest correlation as the target document block corresponding to any one of the answers.
[0050] Specifically, in an embodiment of the present application, the above-mentioned first relevance index can be Euclidean distance, Manhattan distance or cosine similarity. Assuming that the answer corresponding to the current question text has 4 paragraphs, for example, including paragraph 1, paragraph 2, paragraph 3 and paragraph 4, for any of the answers in the 4 paragraphs, the 4 answers and the document block sets corresponding to the 4 answers are input into the relevance rearrangement model for processing in turn, and the first relevance index of the 4 answers and each document block in the document block set can be obtained; taking paragraph 1 as an example, assuming that the document block set corresponding to paragraph 1 is {chunk1, chunk2, chunk3}, the first relevance index is cosine similarity, and through the above-mentioned relevance rearrangement model, the cosine similarity between paragraph 1 and chunk1 is 0.5, the cosine similarity between paragraph 1 and chunk2 is 0.7, and the cosine similarity between paragraph 1 and chunk3 is 0.6; it can be determined that the relevance between chunk2 and paragraph 1 is the highest, and chunk2 is determined as the target document block corresponding to paragraph 1.
[0051] S408: Send the answers and access information of the target document blocks corresponding to the answers to the terminal, so that the terminal displays the answers marked with the access information.
[0052] The above steps S402 and S408 have been described above and will not be repeated here.
[0053] In one or more embodiments, the step of inputting the any answer and the corresponding document block set into the relevance rearrangement model for processing, obtaining a first relevance index between the any answer and each document block in the corresponding document block set, and determining the document block with the highest relevance to the any answer based on the first relevance index includes:
[0054] Based on the relevance rearrangement model, the following operations are performed:
[0055] Segmenting any of the answers, and generating a first text vector corresponding to any of the answers according to each word obtained by the segmentation;
[0056] Segmenting each document block, and generating a second text vector corresponding to each document block according to each word obtained by the segmentation;
[0057] Based on a preset similarity algorithm, respectively calculate similarity indices between the first text vector and each of the second text vectors to obtain a similarity index set, and use the similarity index as the first association index;
[0058] The document block corresponding to the maximum value in the cosine similarity set is taken as the document block with the highest relevance to any one of the answers.
[0059] Specifically, the relevance rearrangement model in the embodiment of the present application includes but is not limited to a rerank rearrangement model; in the embodiment of the present application, the first text vector and the second text vector obtained based on the relevance rearrangement model can be text embedding vectors, and the present application can set the vector dimensions of the first text vector and the second text vector accordingly according to the accuracy of the calculation. In order to obtain an accurate relevance index, the present application can use training samples from different fields to train the relevance rearrangement model to optimize the document vector acquisition process corresponding to the answer text and the document block, so as to obtain a document vector that is more consistent with the semantics of the answer text and the document block.
[0060] Assume that the answer corresponding to the current question text has 4 paragraphs, and take the similarity algorithm as the cosine similarity algorithm and the similarity index as the cosine similarity as an example, for example, including paragraph 1, paragraph 2, paragraph 3 and paragraph 4; take paragraph 1 as an example, and assume that the document block set corresponding to paragraph 1 is {chunk1, chunk2, chunk3}, paragraph 1 is segmented through the above-mentioned relevance rearrangement model, and the first text vector Vector1 corresponding to the paragraph 1 is generated according to the words obtained by the segmentation, the chunk1 is segmented, and the second text vector Vector2 corresponding to the chunk1 is generated according to the words obtained by the segmentation, the chunk2 is segmented, A second text vector Vector3 corresponding to chunk2 is generated based on the words obtained by word segmentation, chunk3 is segmented, and a second text vector Vector4 corresponding to chunk3 is generated based on the words obtained by word segmentation; the cosine similarity between Vector1 and Vector2 is calculated to be 0.5, the cosine similarity between Vector1 and Vector3 is calculated to be 0.7, and the cosine similarity between Vector1 and Vector4 is calculated to be 0.6; it can be determined that chunk2 has the highest correlation with paragraph 1, and chunk2 is determined as the target document block corresponding to paragraph 1.
[0061] In one or more embodiments, the question and answer information processing method further includes:
[0062] Obtaining a first text sequence corresponding to any of the answers and a second text sequence corresponding to any of the document blocks in the document block set;
[0063] Determine the longest common subsequence between the first text sequence and the second text sequence, and determine the sum of the lengths of the first text sequence and the second text sequence;
[0064] Determine the ratio of the length of the longest common subsequence to the sum of the lengths as a second correlation index between any one of the answers and any one of the document blocks;
[0065] The determining, based on the first relevance index, the document block with the highest relevance to any one of the answers comprises:
[0066] According to a first correlation index between any one of the answers and any one of the document blocks, and a second correlation index between any one of the answers and any one of the document blocks, a document block having the highest correlation with any one of the answers is determined.
[0067] Specifically, in an embodiment of the present application, it is assumed that the answer corresponding to the current question text has 4 paragraphs, for example, including paragraph 1, paragraph 2, paragraph 3 and paragraph 4; taking paragraph 1 as an example, it is assumed that the document block set corresponding to paragraph 1 is {chunk1, chunk2, chunk3}, and it is assumed that the first text sequence corresponding to paragraph 1 is: ABCBDAB; the second text sequence corresponding to chunk1 is: BDCABA, then the longest subsequence LCS between the two of them (paragraph 1, chunk1) = BDAB, BCAB, BCBA; the sum of the lengths of the first text sequence and the second text sequence is 13, and the length of the longest common subsequence is 4, so it can be determined that the second correlation index between paragraph 1 and chunk1 is 4 / 13; similarly, the second correlation index between paragraph 1 and chunk2 and chunk3 can be calculated. Assume that the second correlation index between paragraph 1 and chunk 2 is 7 / 13, and the second correlation index between paragraph 1 and chunk 3 is 5 / 13; through the above correlation rearrangement model, the first correlation index between paragraph 1 and chunk 1 is 0.5, the first correlation index between paragraph 1 and chunk 2 is 0.7, and the first correlation index between paragraph 1 and chunk 3 is 0.6.
[0068] In an embodiment of the present application, for example, the document block with the highest correlation with any of the answers can be determined based on the average value or variance of the first correlation index and the second correlation index corresponding to each document block; assuming that the average value of the first correlation index and the second correlation index corresponding to paragraph 1 and chunk1 is (1 / 2+4 / 13) / 2, the average value of the first correlation index and the second correlation index corresponding to paragraph 1 and chunk2 is (7 / 10+7 / 13) / 2, and the average value of the first correlation index and the second correlation index corresponding to paragraph 1 and chunk3 is (3 / 5+5 / 13) / 2, it can be determined that chunk2 has the highest correlation with paragraph 1 based on the maximum value of the above average values.
[0069] In one or more embodiments, determining the document block with the highest relevance to any of the answers according to the first relevance index between any of the answers and any of the document blocks and the second relevance index between any of the answers and any of the document blocks includes:
[0070] Obtaining a first weight corresponding to the first correlation index and a second weight corresponding to the second correlation index;
[0071] Calculating a first product of the first degree of association and a first weight, and calculating a second product of the second degree of association and a second weight;
[0072] The sum of the first product and the second product is calculated, and the document block corresponding to the largest sum value is taken as the document block with the highest relevance to any one of the answers.
[0073] In the embodiment of the present application, for example, the first weight corresponding to the first correlation index is 0.6, and the second weight corresponding to the second correlation index is 0.4; the sum of the first product and the second product corresponding to paragraph 1 and chunk 1 is (1 / 2*0.6+4 / 13*0.4), the sum of the first product and the second product corresponding to paragraph 1 and chunk 2 is (7 / 10*0.6+7 / 13*0.4), and the sum of the first product and the second product corresponding to paragraph 1 and chunk 3 is (3 / 5*0.6+5 / 13*0.4). According to the maximum value of the above sum values, it can be determined that chunk 2 has the highest correlation with paragraph 1.
[0074] In one or more embodiments, the question and answer information processing method further includes:
[0075] Acquire training sample data, the training sample data including a preset answer set and a document block set corresponding to the answer set obtained according to a document database and a preset large language model;
[0076] Based on the training sample data, a relevance rearrangement model for determining the relevance between the answer set and the document block set is trained until a convergence condition is reached to obtain the pre-trained relevance rearrangement model.
[0077] Specifically, in an embodiment of the present application, the acquired training sample data may be a preset answer set in the financial field, and a set of document blocks corresponding to the answer set obtained according to a document database and a preset large language model. Based on the training sample data, a relevance rearrangement model for determining the relevance between the answer set and the document block set is trained until the pre-trained relevance rearrangement model is obtained when the convergence condition is reached. The above-mentioned convergence condition may be, for example, that during the model training process, the prediction error of the relevance rearrangement model is reduced to a preset error value, or the loss function value used by the relevance rearrangement model is reduced to a preset error value, and then it is determined that convergence has been reached. In one example, feedback can be provided based on the accuracy of the document block corresponding to the answer given by the system in the question-and-answer system, and the training parameters of the relevance rearrangement model can be adjusted according to the feedback information to optimize the process of obtaining the document vector corresponding to the answer text and the document block, so as to obtain a document vector that is more in line with the semantics of the answer text and the document block, and further improve the accuracy of the corresponding information source given by the document system.
[0078] As an optional implementation, Figure 5 As shown, the embodiment of the present application also provides a question-answer information processing method, which is applied to a terminal and includes the following steps:
[0079] S502, obtain the question text, and send the question text to the server, so that the server obtains the answer corresponding to the question text and the target document blocks corresponding to each paragraph of the answer; the target document block is a document block obtained from a document block set based on a pre-trained relevance rearrangement model, and the relevance with the corresponding answer paragraph is greater than a preset threshold; the document block set is the source data referenced by each paragraph of the answer.
[0080] Specifically, in the embodiments of the present application, Figure 6 As shown, the terminal obtains the question text input by the user: What is the specific situation of the cloud service? The terminal sends the question text to the server, which first completes the question text according to the interactive information of the context to obtain the completed question text: What are the specific development status and achievements of Company A's cloud service in the recent period? The server obtains 4 paragraphs of answers based on the completed question text; then the server obtains the document block set corresponding to the 4 paragraphs of answers, and reorders each document block in the document block based on the pre-trained relevance reordering model, and obtains the document blocks from the document block set whose relevance to the corresponding answer paragraph is greater than the preset threshold as the target document blocks corresponding to each paragraph of the answer.
[0081] S504, receiving the answer sent by the server and access information corresponding to the target document block; the access information includes a title corresponding to the target document block and a citation identifier, and the citation identifier is used to indicate the title corresponding to the target document block;
[0082] S506, displaying the title corresponding to the target document block of each section of the answer, and displaying each section of the answer marked with the citation mark, wherein the title includes the citation mark.
[0083] Specifically, the access information of the target document block includes, for example, the Uniform Resource Location (URL) corresponding to the target document block, the title information corresponding to the target document block, the reference identifier corresponding to the target document block, etc. After the server obtains the access information of the target document block corresponding to each answer segment, it sends the access information to the client for display. Figure 6 As shown, the answer received by the terminal from the server includes four paragraphs: paragraph 1 to paragraph 4, and then the above four paragraphs are displayed on the display interface of the terminal. The title information corresponding to the target document block and the reference mark corresponding to the target document block are displayed in the relevant document area; the reference mark corresponding to the respective target document block can be displayed at the end of each paragraph 1 to paragraph 4. In this example, the reference mark is a digital number; in other examples, the reference mark can also be a letter or other identification symbol.
[0084] In an embodiment of the present application, a question text is obtained and sent to a server so that the server obtains the answer corresponding to the question text and the target document block corresponding to each section of the answer; the target document block is a document block obtained from a document block set based on a pre-trained relevance rearrangement model and having a relevance greater than a preset threshold with the corresponding answer section; the document block set is the source data referenced by each section of the answer; a method for receiving the answer sent by the server and the access information corresponding to the target document block, and displaying the answer marked with the access information. The present application accurately obtains the access information of the target document block corresponding to each section of the answer through the server, and then displays it on the client, which can not only improve the accuracy of the system output information, but also accurately display the source of information corresponding to the answer to the user, so that the user can effectively trace the answer given by the system, ensure the accuracy and reliability of the information output by the question and answer system, and solve the technical problem that the accuracy of the answer given by the question and answer system in the related technology is not high and the answer information cannot be effectively traced.
[0085] In one or more embodiments, the step of displaying the title of the target document block corresponding to each section of the answer, and displaying each section of the answer marked with the citation mark, includes:
[0086] The answer display area displays each section of the answer marked with the citation mark, and displays the title of the target document block corresponding to each section of the answer, wherein the title includes the citation mark.
[0087] Specifically, in the embodiments of the present application, Figure 6 As shown, the terminal receives the answer sent by the server, which includes 4 paragraphs: paragraph 1 to paragraph 4. Then the above 4 paragraphs are displayed in the answer display area of the terminal. The title information corresponding to the target document block and the reference mark corresponding to the target document block are displayed in the related document area. The reference mark corresponding to the respective target document block can be displayed at the end of each paragraph from paragraph 1 to paragraph 4. The reference mark is a digital number (circled number). Paragraph 1 refers to the first target document, paragraphs 2 and 3 both refer to the second target document, and paragraph 4 refers to the third target document.
[0088] In one or more embodiments, the method further comprises at least one of the following:
[0089] In response to a click operation on the target citation identifier in the answer, jump to a display area of a title corresponding to the target citation identifier, or jump to display source data to which a target document block corresponding to the target citation identifier belongs;
[0090] In response to a click operation on any title, the source data corresponding to the title is displayed in a jump manner.
[0091] Specifically, in the embodiments of the present application, Figure 6 and Figure 7 As shown, for example, if the user wants to view the citation corresponding to paragraph 2, he clicks on the citation mark (②) after paragraph 2, the color of the citation mark will change, and then jump to the display area of the title corresponding to the citation mark, and the color of the display area will also change.
[0092] In one example, when the user wants to view the citation corresponding to paragraph 2, he clicks on the citation mark (②) after paragraph 2. The color of the citation mark will change, and then the user will be redirected to the source data of the target document block corresponding to the citation mark, for example, the journal to which the target document belongs will be displayed.
[0093] In another example, when the user clicks on the display area of the title of the citation mark ② of paragraph 2, the source data corresponding to the title will pop up on the display interface of the terminal, such as the document information in the web page to which the title belongs.
[0094] Based on the above embodiment, as an optional implementation mode, the embodiment of the present application further provides a question and answer information processing method, the method comprising:
[0095] 1. First, use the rerank algorithm to segment and vectorize each answer given by the document system to generate the first vector, and segment and vectorize the document chunk corresponding to each answer to generate the second vector corresponding to each document chunk.
[0096] 2. Secondly, the cosine similarity between the first vector and each second vector is calculated using the rerank algorithm.
[0097] 3. Finally, sort by cosine similarity value and select the chunk with the largest cosine similarity value as the quotation corresponding to each answer.
[0098] Compared with the prior art, the above-mentioned technical solution of the present application has the following beneficial technical effects: it can not only improve the accuracy of the information output by the system, but also accurately display the information source corresponding to the answer to the user, so that the user can effectively trace the answer given by the system, thereby ensuring the accuracy and reliability of the information output by the question and answer system, and solving the technical problem that the answers given by the question and answer system in the related technology are not accurate and the answer information cannot be effectively traced.
[0099] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0100] According to another aspect of the embodiment of the present application, a question and answer information processing device for implementing the above-mentioned question and answer information processing method is also provided, which is applied to the server. Figure 8 As shown, the device comprises:
[0101] The first acquisition unit 802 is used to acquire the answer corresponding to the question text and the document block set corresponding to each section of the answer; the document block set is the source data referenced by the answer;
[0102] The second acquisition unit 804 is used to acquire, for any of the answers, a document block having a relevance greater than a preset threshold from the document block set based on the pre-trained relevance rearrangement model, and use the document block having a relevance greater than the preset threshold as a target document block corresponding to the answer;
[0103] The sending unit 806 is used to send the answers and access information of the target document blocks corresponding to the answers to the terminal, so that the terminal displays the answers marked with the access information.
[0104] In an embodiment of the present application, a method is adopted in which the answer corresponding to the question text and the document block set corresponding to each section of the answer are obtained based on the server; the document block set is the source data referenced by the answer; for any section of the answer, a document block with a correlation greater than a preset threshold value is obtained from the document block set based on a pre-trained correlation rearrangement model, and the document block with a correlation greater than the preset threshold value is used as the target document block corresponding to any section of the answer; the access information of each section of the answer and the target document block corresponding to each section of the answer is sent to the terminal, and the terminal displays the answer marked with the access information. The present application accurately obtains the access information of the target document block corresponding to each section of the answer through the server, and then displays it on the client, which can not only improve the accuracy of the system output information, but also accurately display the source of information corresponding to the answer to the user, so that the user can effectively trace the answer given by the system, ensure the accuracy and reliability of the information output by the question and answer system, and solve the technical problem that the accuracy of the answer given by the question and answer system in the related technology is not high, and the answer information cannot be effectively traced.
[0105] In one or more embodiments, the second obtaining unit 804 includes:
[0106] A processing module, used for inputting the any answer and the corresponding document block set into the relevance rearrangement model for processing, and obtaining a first relevance index between the any answer and each document block in the corresponding document block set;
[0107] A determination module is used to determine the document block with the highest correlation with any one of the answers based on the first correlation index, and determine the document block with the highest correlation as the target document block corresponding to any one of the answers.
[0108] In one or more embodiments, the processing module comprises:
[0109] A first generating subunit is used to perform the following operations based on the relevance rearrangement model: segmenting any of the answers, and generating a first text vector corresponding to any of the answers according to each word obtained by the segmentation;
[0110] A second generating subunit is used to segment each document block and generate a second text vector corresponding to each document block according to each word obtained by the segmentation;
[0111] A first calculation subunit is used to calculate the similarity index between the first text vector and each of the second text vectors based on a preset similarity algorithm, obtain a similarity index set, and use the similarity index as the first association index;
[0112] The determination subunit is used to take the document block corresponding to the maximum value in the similarity index set as the document block with the highest relevance to any one of the answers.
[0113] In one or more embodiments, the question and answer information processing device further includes:
[0114] A third acquisition unit is used to acquire a first text sequence corresponding to any of the answers and a second text sequence corresponding to any document block in the document block set;
[0115] A first determining unit, configured to determine the longest common subsequence between the first text sequence and the second text sequence, and determine the sum of the lengths of the first text sequence and the second text sequence;
[0116] A second determining unit is used to determine the ratio of the length of the longest common subsequence to the sum of the lengths as a second correlation index between any one of the answers and any one of the document blocks;
[0117] The determining module comprises:
[0118] The determination submodule is used to determine the document block with the highest correlation with any answer segment according to the first correlation index between any answer segment and any document block and the second correlation index between any answer segment and any document block.
[0119] In one or more embodiments, the determining submodule includes:
[0120] an acquisition subunit, configured to acquire a first weight corresponding to the first correlation index and a second weight corresponding to the second correlation index;
[0121] A second calculation subunit, configured to calculate a first product of the first degree of association and a first weight, and calculate a second product of the second degree of association and a second weight;
[0122] The third calculation subunit is used to calculate the sum of the first product and the second product, and take the document block corresponding to the largest sum value as the document block with the highest correlation with any one of the answers.
[0123] In one or more embodiments, the question and answer information processing device further includes:
[0124] A fourth acquisition unit is used to acquire training sample data, wherein the training sample data includes a preset answer set and a document block set corresponding to the answer set obtained according to a document database and a preset large language model;
[0125] A training unit is used to train a relevance rearrangement model for determining the relevance between the answer set and the document block set based on the training sample data, until the pre-trained relevance rearrangement model is obtained when a convergence condition is reached.
[0126] According to another aspect of the embodiment of the present application, a question and answer information processing device for implementing the above question and answer information processing method is also provided, which is applied to a terminal. Fig. 9 As shown, the device comprises:
[0127] The sending unit 902 is used to obtain a question text and send the question text to the server, so that the server obtains the answer corresponding to the question text and the target document block corresponding to each section of the answer; the target document block is a document block obtained from a document block set based on a pre-trained relevance rearrangement model and having a relevance greater than a preset threshold with the corresponding answer section; the document block set is the source data referenced by each section of the answer;
[0128] The receiving unit 904 is used to receive the answer sent by the server and the access information corresponding to the target document block; the access information includes the title and citation mark corresponding to the target document block, and the citation mark is used to indicate the title corresponding to the target document block;
[0129] The first display unit 906 is used to display the title corresponding to the target document block of each section of the answer, and to display each section of the answer marked with the citation mark, wherein the title includes the citation mark.
[0130] In one or more embodiments, the question and answer information processing device further includes at least one of the following:
[0131] A second display unit, configured to jump to a display area of a title corresponding to the target citation identifier in response to a click operation on the target citation identifier in the answer, or to jump to display source data to which a target document block corresponding to the target citation identifier belongs;
[0132] The third display unit is used to jump and display the source data corresponding to any title in response to a click operation on any title.
[0133] According to another aspect of the embodiment of the present application, a question and answer information processing system for implementing the above-mentioned question and answer information processing method is also provided. Fig.10 As shown, the system includes a server and a terminal;
[0134] The server is used to obtain the answer corresponding to the question text and the document block set corresponding to each section of the answer; the document block set is the source data referenced by the answer; for any section of the answer, based on the pre-trained relevance rearrangement model, a document block with a relevance greater than a preset threshold value to any section of the answer is obtained from the document block set, and the document block with a relevance greater than the preset threshold value is used as the target document block corresponding to any section of the answer; and the access information corresponding to each section of the answer and the target document block corresponding to each section of the answer is sent to the terminal;
[0135] The terminal is used to obtain a question text and send the question text to the server; receive the answer sent by the server and access information corresponding to the target document block; the access information includes a title and a citation mark corresponding to the target document block, and the citation mark is used to indicate the title corresponding to the target document block; display the title corresponding to the target document block of each section of the answer, and display each section of the answer marked with the citation mark, and the title includes the citation mark.
[0136] According to another aspect of the embodiment of the present application, there is also provided a question and answer information processing system for implementing the above-mentioned question and answer information processing method, including: a cloud service end and a terminal;
[0137] The cloud service end is used to obtain answers corresponding to question texts in the financial field, and document block sets corresponding to each section of the answer; the document block set is the financial source data referenced by the answer; for any section of the answer, based on a pre-trained relevance rearrangement model, a document block with a relevance greater than a preset threshold value to any section of the answer is obtained from the document block set, and the document block with a relevance greater than the preset threshold value is used as a target document block corresponding to any section of the answer; access information corresponding to each section of the answer and the target document block corresponding to each section of the answer is sent to the terminal; the access information includes a title and a citation identifier corresponding to the target document block;
[0138] The terminal is used to obtain a question text in the financial field, and send the question text in the financial field to the cloud server; receive the answer sent by the cloud server, as well as the title and citation mark corresponding to the target document block, wherein the citation mark is used to indicate the title corresponding to the target document block; display the title corresponding to the target document block of each section of the answer, and display each section of the answer marked with the citation mark, wherein the title includes the citation mark.
[0139] Specifically, in an embodiment of the present application, the above-mentioned question text may be the original text information in the financial field input by the user, or may be the text obtained by transcribing the audio in the financial field input by the user. The above-mentioned question text may be the text obtained by supplementing and improving the question information input by the user according to the context information of the user chatting in the question-answering system terminal. Each document chunk (chunk) in the above-mentioned document chunk set may be the source data in the financial field cited by a paragraph of the answer obtained based on the preset large language model, and the source data may be, for example, one or more paragraphs of text in citation data such as various financial papers, financial journals or financial magazines.
[0140] Specifically, under normal circumstances, in order to be able to comprehensively and objectively answer the questions raised by users, the question-answering system will give answers to multiple paragraphs of different dimensions for the financial questions raised by users. For example, each of the answers in the above multiple paragraphs can correspond to information of one dimension. Assuming that the user asks a question about financial products, the above different dimensions may include but are not limited to product type, term, income method, risk level and other dimensions. Each answer corresponds to multiple document blocks, that is, corresponding to multiple different source data; the multiple document blocks corresponding to each answer have different correlations with the answer. Based on the pre-trained correlation re-ranking model, the present application can obtain the document block with the highest correlation greater than the preset threshold from the document block set, and then use the document block with the highest correlation greater than the preset threshold as the target document block corresponding to any answer, and the target document block can be the citation to be displayed corresponding to the answer. It should be noted that the question-answering system of the present application can be flexibly adjusted according to the needs of different users and different types of questions, so as to provide users with more accurate and satisfactory answers in the financial field and improve user experience.
[0141] After the cloud server obtains the access information of the target document block corresponding to each answer segment, it sends the access information to the client for display. Figure 6 As shown, the answer received by the terminal from the cloud server includes four paragraphs: paragraph 1 to paragraph 4, and then the above four paragraphs are displayed on the display interface of the terminal. The title information corresponding to the target document block and the reference mark corresponding to the target document block are displayed in the relevant document area; the reference mark corresponding to the respective target document block can be displayed at the end of each paragraph 1 to paragraph 4. In this example, the reference mark is a digital number; in other examples, the reference mark can also be a letter or other identification symbol.
[0142] In one or more embodiments, the cloud service end is specifically used to input any one of the answers and the corresponding document block set into the association rearrangement model for processing, and obtain a first association index between any one of the answers and each document block in the corresponding document block set; based on the first association index, determine the document block with the highest association with any one of the answers, and determine the document block with the highest association as the target document block corresponding to any one of the answers.
[0143] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned question and answer information processing method is also provided. The electronic device may be Figure 1 The terminal or server shown in FIG. This embodiment is described by taking the electronic device as the server as an example. Fig.11 As shown, the electronic device includes a memory 1102 and a processor 1104. The memory 1102 stores a computer program, and the processor 1104 is configured to execute the steps in any of the above method embodiments through the computer program.
[0144] Optionally, in this embodiment, the electronic device may be at least one network device among a plurality of network devices of a computer network.
[0145] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0146] S11, obtaining an answer corresponding to the question text and a document block set corresponding to each section of the answer; the document block set is the source data referenced by the answer;
[0147] S12, for any of the answers, based on the pre-trained relevance rearrangement model, obtaining a document block with a relevance greater than a preset threshold from the document block set, and using the document block with a relevance greater than the preset threshold as a target document block corresponding to the answer;
[0148] S13, sending the answers and access information of the target document blocks corresponding to the answers to the terminal, so that the terminal displays the answers marked with the access information.
[0149] Among them, the memory 1102 can be used to store software programs and modules, such as the program instructions / modules corresponding to the question and answer information processing method and device in the embodiment of the present application. The processor 1104 executes various functional applications and data processing by running the software programs and modules stored in the memory 1102, that is, realizing the above-mentioned question and answer information processing method. The memory 1102 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1102 may further include a memory remotely arranged relative to the processor 1104, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. Among them, the memory 1102 can be specifically used, but not limited to, for storing question texts, and answers corresponding to the question texts marked with the access information.
[0150] As an example, Fig.11 As shown, the memory 1102 may include, but is not limited to, the first acquisition unit 802, the second acquisition unit 804, and the sending unit 806 in the question and answer information processing device. In addition, it may also include, but is not limited to, other module units in the question and answer information processing device, which will not be repeated in this example.
[0151] Optionally, the transmission device 1106 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 1106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1106 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0152] In addition, the electronic device mentioned above further includes: a connection bus 1108, which is used to connect various module components in the electronic device mentioned above.
[0153] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned question and answer information processing method is also provided. The electronic device may be Figure 1 The terminal or server shown in the figure. This embodiment is described by taking the electronic device as a terminal as an example. Fig.12 As shown, the electronic device includes a memory 1202 and a processor 1204. The memory 1202 stores a computer program, and the processor 1204 is configured to execute the steps in any of the above method embodiments through the computer program.
[0154] Optionally, in this embodiment, the electronic device may be at least one network device among a plurality of network devices of a computer network.
[0155] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0156] S21, obtaining a question text, and sending the question text to a server, so that the server obtains an answer corresponding to the question text and a target document block corresponding to each section of the answer; the target document block is a document block obtained from a document block set based on a pre-trained relevance rearrangement model, and having a relevance with the corresponding answer section greater than a preset threshold; the document block set is source data referenced by each section of the answer;
[0157] S22, receiving the answer sent by the server and access information corresponding to the target document block, wherein the access information includes a title corresponding to the target document block and a citation identifier, wherein the citation identifier is used to indicate the title corresponding to the target document block;
[0158] S23, displaying the title corresponding to the target document block of each section of the answer, and displaying each section of the answer marked with the citation mark, wherein the title includes the citation mark.
[0159] Among them, the memory 1202 can be used to store software programs and modules, such as the program instructions / modules corresponding to the question and answer information processing method and device in the embodiment of the present application. The processor 1204 executes various functional applications and data processing by running the software programs and modules stored in the memory 1202, that is, realizing the above-mentioned question and answer information processing method. The memory 1202 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1202 may further include a memory remotely arranged relative to the processor 1204, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. Among them, the memory 1202 can be specifically used, but not limited to, for storing question texts, and answers corresponding to the question texts marked with the access information.
[0160] As an example, Fig.12 As shown, the memory 1202 may include, but is not limited to, the sending unit 902, the receiving unit 904, and the first display unit 906 in the question and answer information processing device. In addition, it may also include, but is not limited to, other module units in the question and answer information processing device, which will not be repeated in this example.
[0161] Optionally, the transmission device 1206 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 1206 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1206 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0162] In addition, the electronic device mentioned above further includes: a connection bus 1208, which is used to connect various module components in the electronic device mentioned above.
[0163] In other embodiments, the electronic device may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. The nodes may form a peer-to-peer (P2P) network, and any form of computing device, such as a server, terminal, or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.
[0164] In one or more embodiments, the present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned question-and-answer information processing method. The computer program is configured to execute the steps of any of the above-mentioned method embodiments when it is run.
[0165] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0166] S11, obtaining an answer corresponding to the question text and a document block set corresponding to each section of the answer; the document block set is the source data referenced by the answer;
[0167] S12, for any of the answers, based on the pre-trained relevance rearrangement model, obtaining a document block with a relevance greater than a preset threshold from the document block set, and using the document block with a relevance greater than the preset threshold as a target document block corresponding to the answer;
[0168] S13, sending the answers and the access information of the target document blocks corresponding to the answers to the terminal, so that the terminal displays the answers marked with the access information. Or a computer program for executing the following steps:
[0169] S21, obtaining a question text, and sending the question text to a server, so that the server obtains an answer corresponding to the question text and a target document block corresponding to each section of the answer; the target document block is a document block obtained from a document block set based on a pre-trained relevance rearrangement model, and having a relevance with the corresponding answer section greater than a preset threshold; the document block set is source data referenced by each section of the answer;
[0170] S22, receiving the answer sent by the server and access information corresponding to the target document block, wherein the access information includes a title corresponding to the target document block and a citation identifier, wherein the citation identifier is used to indicate the title corresponding to the target document block;
[0171] S23, displaying the title corresponding to the target document block of each section of the answer, and displaying each section of the answer marked with the citation mark, wherein the title includes the citation mark.
[0172] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0173] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0174] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods of various embodiments of the present invention.
[0175] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0176] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0177] 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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0178] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0179] 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.
[0180] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
Claims
1. A question-answer information processing method, characterized in that: Applied to the server, the method includes: Obtaining the answer corresponding to the question text and the document block set corresponding to each section of the answer; the document block set is the source data referenced by the answer; For any of the answers, based on the pre-trained relevance rearrangement model, a document block having a relevance greater than a preset threshold to the answer is obtained from the document block set, and the document block having a relevance greater than the preset threshold is used as a target document block corresponding to the answer; Sending the answers and access information of the target document blocks corresponding to the answers to the terminal, so that the terminal displays the answers marked with the access information; The method also includes: obtaining a first text sequence corresponding to any one of the answers and a second text sequence corresponding to any one of the document blocks in the document block set; determining the longest common subsequence between the first text sequence and the second text sequence, and determining the sum of the lengths of the first text sequence and the second text sequence; determining the ratio of the length of the longest common subsequence to the sum of the lengths as a second correlation index between any one of the answers and any one of the document blocks; determining the document block with the highest correlation with any one of the answers based on the first correlation index between any one of the answers and any one of the document blocks, and determining the document block with the highest correlation as the target document block corresponding to any one of the answers.
2. The method according to claim 1, characterized in that The pre-trained relevance rearrangement model obtains a document block whose relevance to any one of the answers is greater than a preset threshold from the document block set, and uses the document block whose relevance is greater than the preset threshold as a target document block corresponding to any one of the answers, including: Inputting the any answer and the corresponding document block set into the relevance rearrangement model for processing to obtain a first relevance index between the any answer and each document block in the corresponding document block set; A document block with the highest relevance to any one of the answers is determined based on the first relevance index, and the document block with the highest relevance is determined as a target document block corresponding to any one of the answers.
3. The method according to claim 2, characterized in that The step of inputting the any answer and the corresponding document block set into the relevance rearrangement model for processing, obtaining a first relevance index between the any answer and each document block in the corresponding document block set, and determining the document block with the highest relevance to the any answer based on the first relevance index, comprises: Based on the relevance rearrangement model, the following operations are performed: Segmenting any of the answers, and generating a first text vector corresponding to any of the answers according to each word obtained by the segmentation; Segmenting each document block, and generating a second text vector corresponding to each document block according to each word obtained by the segmentation; Based on a preset similarity algorithm, respectively calculate similarity indices between the first text vector and each of the second text vectors to obtain a similarity index set, and use the similarity index as the first association index; The document block corresponding to the maximum value in the similarity index set is taken as the document block with the highest relevance to any one of the answers.
4. The method according to claim 1, characterized in that: The step of determining the document block with the highest relevance to any one of the answers according to the first relevance index and the second relevance index corresponding to each document block comprises: Obtaining a first weight corresponding to the first correlation index and a second weight corresponding to the second correlation index; Calculating a first product of the first degree of association and a first weight, and calculating a second product of the second degree of association and a second weight; The sum of the first product and the second product is calculated, and the document block corresponding to the largest sum value is taken as the document block with the highest relevance to any one of the answers.
5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Acquire training sample data, the training sample data including a preset answer set and a document block set corresponding to the answer set obtained according to a document database and a preset large language model; Based on the training sample data, a relevance rearrangement model for determining the relevance between the answer set and the document block set is trained until a convergence condition is reached to obtain the pre-trained relevance rearrangement model.
6. A question-answer information processing method, characterized in that: Applied to a terminal, the method comprises: Obtain a question text, and send the question text to a server, so that the server obtains the answer corresponding to the question text and the target document blocks corresponding to each section of the answer; the target document blocks are document blocks obtained from a document block set based on a pre-trained relevance rearrangement model, and the relevance with the corresponding answer section is greater than a preset threshold; the document block set is the source data referenced by each section of the answer; The server side obtains the target document block, including: obtaining a first text sequence corresponding to any one of the answers, and a second text sequence corresponding to any one of the document blocks in the document block set; determining the longest common subsequence between the first text sequence and the second text sequence, and determining the sum of the lengths of the first text sequence and the second text sequence; determining the ratio of the length of the longest common subsequence to the sum of the lengths as the second correlation index between any one of the answers and the document block; determining the document block with the highest correlation with any one of the answers according to the first correlation index between any one of the answers and the document block, and determining the document block with the highest correlation as the target document block corresponding to any one of the answers; receiving the answer sent by the server and access information corresponding to the target document block; the access information includes a title corresponding to the target document block and a citation identifier, wherein the citation identifier is used to indicate the title corresponding to the target document block; The title corresponding to the target document block of each section of the answer is displayed, and each section of the answer marked with the citation mark is displayed, and the title includes the citation mark.
7. The method according to claim 6, characterized in that The method further comprises at least one of the following: In response to a click operation on the target citation identifier in the answer, jump to a display area of a title corresponding to the target citation identifier, or jump to display source data to which a target document block corresponding to the target citation identifier belongs; In response to a click operation on any title, the source data corresponding to the title is displayed in a jump manner.
8. A question-answering information processing system, characterized in that: include: Server and terminal; The server is used to obtain the answer corresponding to the question text and the document block set corresponding to each section of the answer; The document block set is the source data referenced by the answer; for any of the answers, based on the pre-trained relevance rearrangement model, a document block with a relevance greater than a preset threshold to any of the answers is obtained from the document block set, and the document block with a relevance greater than the preset threshold is used as the target document block corresponding to any of the answers; and access information corresponding to each of the answers and the target document block corresponding to each of the answers is sent to the terminal; The server is further configured to obtain a first text sequence corresponding to any one of the answers and a second text sequence corresponding to any one of the document blocks in the document block set; determine the longest common subsequence between the first text sequence and the second text sequence, and determine the sum of the lengths of the first text sequence and the second text sequence; determine the ratio of the length of the longest common subsequence to the sum of the lengths as a second correlation index between any one of the answers and any one of the document blocks; determine the document block with the highest correlation with any one of the answers based on the first correlation index between any one of the answers and any one of the document blocks and the second correlation index between any one of the answers and any one of the document blocks, and determine the document block with the highest correlation as the target document block corresponding to any one of the answers; The terminal is used to obtain a question text and send the question text to the server; receive the answer sent by the server and access information corresponding to the target document block; the access information includes a title and a citation mark corresponding to the target document block, and the citation mark is used to indicate the title corresponding to the target document block; display the title corresponding to the target document block of each section of the answer, and display each section of the answer marked with the citation mark, and the title includes the citation mark.
9. A question-answering information processing system, characterized in that: Includes: cloud server and terminal; The cloud service end is used to obtain answers corresponding to question texts in the financial field, and a set of document blocks corresponding to each section of the answer; the document block set is the financial source data referenced by the answer; for any section of the answer, based on a pre-trained relevance rearrangement model, a document block with a relevance greater than a preset threshold to any section of the answer is obtained from the document block set, and the document block with a relevance greater than the preset threshold is used as a target document block corresponding to any section of the answer; a first text sequence corresponding to any section of the answer and a second text sequence corresponding to any document block in the document block set are obtained; the longest common subsequence between the first text sequence and the second text sequence is determined, and the The sum of the lengths of the first text sequence and the second text sequence; determining the ratio of the length of the longest common subsequence to the sum of the lengths as the second correlation index between the any answer and the any document block; determining the document block with the highest correlation with the any answer according to the first correlation index between the any answer and the any document block and the second correlation index between the any answer and the any document block, and determining the document block with the highest correlation as the target document block corresponding to the any answer; sending access information corresponding to each answer and the target document block corresponding to each answer to the terminal; the access information includes the title and citation identifier corresponding to the target document block; The terminal is used to obtain a text of a problem in the financial field, and send the text of the problem in the financial field to the cloud service end; Receive the answer sent by the cloud server, as well as the title and citation mark corresponding to the target document block, wherein the citation mark is used to indicate the title corresponding to the target document block; display the title corresponding to the target document block of each section of the answer, and display each section of the answer marked with the citation mark, wherein the title includes the citation mark.
10. The system according to claim 9, characterized in that The cloud service end is specifically used to input any one of the answers and the corresponding document block set into the association rearrangement model for processing, so as to obtain a first association index between any one of the answers and each document block in the corresponding document block set; based on the first association index, determine the document block with the highest association with any one of the answers, and determine the document block with the highest association as the target document block corresponding to any one of the answers.
11. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method according to any one of claims 1 to 5, or 6 to 7.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method according to any one of claims 1 to 5, or 6 to 7.
13. A computer program product, comprising a computer program, characterized in that The computer program is executed by a processor to implement the method according to any one of claims 1 to 5, or 6 to 7.
