Document-oriented question answering method and apparatus, electronic device, storage medium, and product

By calculating the semantic feature vector similarity between query statements and document identification information, highly similar document paragraphs are identified and obtained, solving the matching failure problem caused by abbreviation or rewriting of document names in intelligent question answering systems, and improving the success rate of question answering and the accuracy of answers.

WO2026051626A1PCT designated stage Publication Date: 2026-03-12CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD +1
View PDF 7 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2026-03-12

AI Technical Summary

Technical Problem

Existing intelligent question-answering systems often fail to match queries containing the target document name due to abbreviations or rewriting of the document name, resulting in low success rates and inaccurate answers.

Method used

By obtaining the semantic feature vector of the user's query and the semantic feature vector of the document identification information of the source document, semantic similarity is calculated, candidate document identification information is identified, and highly similar document paragraphs are obtained from the target document to generate the answer.

Benefits of technology

It improves the success rate of question answering and the accuracy of answers, ensuring that it can accurately match the target document and generate answers that meet the user's needs even when the document name is abbreviated or rewritten.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025109792_12032026_PF_FP_ABST
    Figure CN2025109792_12032026_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of artificial intelligence, and provides a document-oriented question answering method and apparatus, an electronic device, a storage medium, and a product. The method comprises: acquiring a first semantic feature vector corresponding to a query statement, and acquiring a plurality of second semantic feature vectors corresponding to document identification information of a plurality of source documents; acquiring, from among the plurality of second semantic feature vectors, at least one third semantic feature vector having a semantic similarity to the first semantic feature vector greater than a first preset threshold; acquiring at least one piece of candidate document identification information corresponding to the at least one third semantic feature vector; when the at least one piece of candidate document identification information includes target document identification information, acquiring, from a target document corresponding to the target document identification information, at least one target document paragraph having a similarity to the query statement greater than a second preset threshold; and on the basis of the at least one target document paragraph, generating an answer corresponding to the query statement. The present disclosure can improve the success rate of question answering.
Need to check novelty before this filing date? Find Prior Art

Description

Document-oriented question answering method and device, electronic equipment, storage medium and product

[0001] The present disclosure claims priority to Chinese Patent Application No. 202411252009.1, filed on September 6, 2024 with the Chinese Patent Office, entitled "Document-oriented question answering method and device, electronic equipment, storage medium and product", the entire contents of which are incorporated herein by reference. TECHNICAL FIELD

[0002] The present disclosure relates to the field of artificial intelligence, and in particular, to a document-oriented question answering method, device, electronic equipment, storage medium and product. BACKGROUND

[0003] With the development of artificial intelligence technology and natural language processing technology, intelligent question answering systems are widely used. Generally, an intelligent question answering system maintains a knowledge base, which stores a plurality of documents and their document names. However, some users want to ask questions from only one or a few specific documents when using the system, and do not want to introduce irrelevant documents in the knowledge base. When a query statement containing a target document name is input by a user, in a traditional intelligent question answering system, the target document name is identified from the query statement, and then the target document name is matched with each document name stored in the knowledge base. If any document name matches the target document name, the corresponding target document is obtained from the knowledge base based on the document name that matches the target document name, and then an answer corresponding to the query statement is generated based on the target document.

[0004] However, the document name and the question in the query statement are combined in various grammatical forms, which are difficult to extract directly and accurately. In addition, the document names stored in the knowledge base and the document names in the query statement may be abbreviated, abbreviated, etc. When the document names in the knowledge base or the document names in the query statement are abbreviated or rewritten, the above-mentioned document name matching method cannot query the target document from the knowledge base, and cannot generate an answer corresponding to the query statement based on the target document, resulting in a low success rate of question answering. SUMMARY

[0005] The present disclosure provides a document-oriented question answering method, device, electronic equipment, storage medium and product, which can improve the success rate of question answering. The technical solution is as follows:

[0006] In a first aspect, a document-oriented question answering method is provided, the method comprising:

[0007] obtaining a first semantic feature vector corresponding to a query sentence of a user, and obtaining a plurality of second semantic feature vectors corresponding to document identification information of a plurality of source documents, the query sentence comprising target document identification information;

[0008] from the plurality of second semantic feature vectors, obtaining at least one third semantic feature vector with a semantic similarity greater than a first preset threshold to the first semantic feature vector;

[0009] obtaining at least one candidate document identification information corresponding to the at least one third semantic feature vector;

[0010] identifying whether the target document identification information is included in the at least one candidate document identification information;

[0011] when the target document identification information is included in the at least one candidate document identification information, obtaining at least one target document paragraph with a similarity higher than a second preset threshold to the query sentence from a target document corresponding to the target document identification information;

[0012] generating an answer corresponding to the query sentence based on the at least one target document paragraph.

[0013] In a second aspect, a document-oriented question answering method is provided, and the method comprises:

[0014] obtaining a first semantic feature vector corresponding to a query sentence of a user in the power field, and obtaining a plurality of second semantic feature vectors corresponding to document identification information of a plurality of source documents in the power field, the query sentence comprising target document identification information;

[0015] from the plurality of second semantic feature vectors, obtaining at least one third semantic feature vector with a semantic similarity greater than a first preset threshold to the first semantic feature vector;

[0016] obtaining at least one candidate document identification information corresponding to the at least one third semantic feature vector;

[0017] identifying whether the target document identification information is included in the at least one candidate document identification information;

[0018] when the target document identification information is included in the at least one candidate document identification information, obtaining at least one target document paragraph with a similarity higher than a second preset threshold to the query sentence from a target document corresponding to the target document identification information;

[0019] generating an answer corresponding to the query sentence based on the at least one target document paragraph.

[0020] In a third aspect, a document-oriented question answering device is provided, and the device comprises:

[0021] A first obtaining module is configured to obtain a first semantic feature vector corresponding to a query sentence of a user, and obtain a plurality of second semantic feature vectors corresponding to document identification information of a plurality of source documents, the query sentence comprising target document identification information;

[0022] A second obtaining module is configured to obtain at least one third semantic feature vector having a semantic similarity greater than a first preset threshold from the plurality of second semantic feature vectors and the first semantic feature vector;

[0023] A third obtaining module is configured to obtain at least one candidate document identification information corresponding to the at least one third semantic feature vector;

[0024] An identifying module is configured to identify whether the target document identification information is included in the at least one candidate document identification information;

[0025] A fourth obtaining module is configured to obtain at least one target document paragraph having a similarity higher than a second preset threshold with the query sentence from a target document corresponding to the target document identification information when the target document identification information is included in the at least one candidate document identification information;

[0026] A generating module is configured to generate an answer corresponding to the query sentence based on the at least one target document paragraph.

[0027] In a fourth aspect, a document-oriented question answering device is provided, and the device comprises:

[0028] A first obtaining module is configured to obtain a first semantic feature vector corresponding to a query sentence of a user in the field of electric power, and obtain a plurality of second semantic feature vectors corresponding to document identification information of a plurality of source documents in the field of electric power, the query sentence comprising target document identification information;

[0029] A second obtaining module is configured to obtain at least one third semantic feature vector having a semantic similarity greater than a first preset threshold from the plurality of second semantic feature vectors and the first semantic feature vector;

[0030] A third obtaining module is configured to obtain at least one candidate document identification information corresponding to the at least one third semantic feature vector;

[0031] An identifying module is configured to identify whether the target document identification information is included in the at least one candidate document identification information;

[0032] The first obtaining module is configured to, when the target document identification information is included in the at least one candidate document identification information, obtain at least one target document paragraph having a similarity higher than a second preset threshold between the target document paragraph and the query statement from a target document corresponding to the target document identification information.

[0033] The generating module is configured to generate an answer corresponding to the query statement based on the at least one target document paragraph.

[0034] In a fifth aspect, an electronic device is provided, including a processor and a memory; the memory stores at least one program code; the at least one program code is used to be called and executed by the processor, so as to realize the document-oriented question answering method in the first aspect or the document-oriented question answering method in the second aspect.

[0035] In a sixth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores at least one computer program; the at least one computer program is executed by a processor to realize the document-oriented question answering method in the first aspect or the document-oriented question answering method in the second aspect.

[0036] In a seventh aspect, a computer program product is provided, and the computer program product includes a computer program; the computer program is executed by a processor to realize the document-oriented question answering method in the first aspect or the document-oriented question answering method in the second aspect.

[0037] The technical scheme provided by the embodiments of the present disclosure has the following beneficial effects:

[0038] The semantic similarity between the first semantic feature vector and the second semantic feature vector is calculated based on the first semantic feature vector corresponding to the query statement of the user and the second semantic feature vector corresponding to the document identification information of the source document. Then, the candidate document identification information is selected based on the calculated semantic similarity. Since the semantic similarity can reflect the semantic similarity degree between the query statement and the document identification information, even if the document name of the source document or the document name in the query statement is abbreviated or rewritten, the document name of the source document and the query statement are still similar in semantics. Therefore, the method provided in the embodiment of the present disclosure can query the candidate document identification information similar to the query statement in semantics, and improve the success rate of question answering. In addition, the query statement of the user carries the target document identification information, and the number of candidate document identification information obtained based on the semantic similarity is usually large. In order to improve the efficiency and user satisfaction of question answering, the embodiment of the present disclosure further identifies whether the target document identification information is included in the at least one candidate document identification information, and obtains the target document corresponding to the target document identification information when the target document identification information is included in the at least one candidate document identification information. Considering that the number of document paragraphs included in the target document is still large, in order to further improve the efficiency and user satisfaction of question answering, the similarity between each document paragraph of the target document and the query statement is calculated, and then at least one target document paragraph with a similarity higher than a second preset threshold is selected from each document paragraph included in the target document. Then, the answer corresponding to the query statement is generated based on the at least one target document paragraph. BRIEF DESCRIPTION OF DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor.

[0040] FIG. 1 is a schematic diagram of an RAG link provided by an embodiment of the present disclosure;

[0041] FIG. 2 is an architecture diagram of an intelligent question answering system provided by an embodiment of the present disclosure;

[0042] FIG. 3 is a flowchart of a document-oriented question answering method provided by an embodiment of the present disclosure;

[0043] FIG. 4 is a flowchart of another document-oriented question answering method provided by an embodiment of the present disclosure;

[0044] FIG. 5 is a flowchart of another document-oriented question answering method provided by an embodiment of the present disclosure;

[0045] FIG. 6 is a structural schematic diagram of a document-oriented question answering device according to an embodiment of the present disclosure;

[0046] FIG. 7 is a structural schematic diagram of a document-oriented question answering device according to an embodiment of the present disclosure;

[0047] FIG. 8 shows a structural block diagram of an electronic device according to an example embodiment of the present disclosure. DETAILED DESCRIPTION

[0048] For the purpose, technical solutions and advantages of the present disclosure to be clearer, the embodiments of the present disclosure will be described in further detail below with reference to the drawings.

[0049] It can be understood that the terms "each", "multiple", "any" and the like used in the embodiments of the present disclosure include two or more, each refers to each of the corresponding multiple, and any refers to any one of the corresponding multiple. For example, multiple words include 10 words, and each word refers to each of the 10 words, and any word refers to any one of the 10 words.

[0050] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present disclosure are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.

[0051] Artificial intelligence is to use digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain better results. In other words, artificial intelligence is a comprehensive technology of computer science, which tries to understand the essence of intelligence and produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.

[0052] Artificial intelligence technology is a comprehensive discipline, involving a wide range of fields, both hardware and software technologies. Artificial intelligence basic technologies generally include technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.

[0053] With the research and progress of artificial intelligence technology, artificial intelligence technology is researched and applied in multiple fields, such as common smart home, smart wearable device, virtual assistant, smart sound box, smart marketing, unmanned driving, automatic driving, robot, smart medical treatment, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important value. The scheme provided by the embodiments of the present disclosure relates to natural language processing, machine learning / deep learning and other technologies of artificial intelligence, and is mainly applied to an intelligent question answering system adopting a RAG (Retrieval-Augmented Generation) framework. The RAG refers to searching relevant information from an external knowledge base before answering a question by using a large language model, and prompting the large model to answer the question based on the relevant information searched. The RAG improves the accuracy of the inference result of the large language model by combining information retrieval and the large language model.

[0054] FIG. 1 shows an intelligent question answering process of an intelligent question answering system adopting a RAG framework. Referring to FIG. 1, the intelligent question answering system pre-acquires documents of a certain field (for example, power, medicine, etc.), identifies and analyzes the acquired documents, and then cuts the documents into multiple document paragraphs, and further stores each document paragraph into a knowledge base. When a question input by a user is acquired, the relevant document paragraphs of the question input by the user are searched from the knowledge base database, and then the question, the relevant document paragraphs and a prompt template are provided to a large language model, so that the large language model accurately answers the question input by the user based on the document paragraphs, and returns the obtained answer to the user.

[0055] FIG. 2 shows an architecture diagram of an intelligent question answering system adopted by the embodiments of the present disclosure. Referring to FIG. 2, the intelligent question answering system includes a terminal 201 and a server 202.

[0056] The terminal 201 can be a smart phone, a notebook computer, a tablet computer, etc. The embodiments of the present disclosure do not specifically limit the product type of the terminal 201. The terminal 201 can be installed with an intelligent question answering application, and the conversation between a person and a machine can be completed based on the intelligent question answering application. The intelligent question answering application can be an application specially used for the conversation between a person and a machine, or can be other applications with an intelligent question answering function, such as a social application, a browser application, a search engine, etc. with an intelligent question answering function. The embodiments of the present disclosure do not specifically limit this.

[0057] The server 202 is a background server of the intelligent question answering application, which can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers, and the embodiments of the present disclosure do not make specific limitations thereto. To realize intelligent question answering, the server 202 calls a knowledge base which can store document identification information (such as document name, field standard name, etc.) of source documents in a certain field, and also store each document paragraph and its corresponding semantic feature vector divided from the source document. The server 202 can call embedding models, large language models and other models, which can be directly deployed on the server 202 or deployed on other servers, and the server 202 can call these models by interacting with other servers.

[0058] The intelligent question answering process based on the terminal 201 and the server 202 can be as follows: the user can input a query statement (question) on the terminal 201, and send a query request carrying the query statement through the terminal 201. After the server 202 receives the query request, the user's query statement is obtained, the embedding model is called to perform vectorization processing on the user's query statement to obtain a first semantic feature vector corresponding to the query statement. Then, based on the first semantic feature vector and the second semantic feature vector corresponding to the document identification information of each document in the knowledge base, the similarity between the first semantic feature vector and the second semantic feature vector corresponding to each document identification information is calculated, at least one third semantic feature vector with a semantic similarity greater than a first preset threshold is obtained from the plurality of second semantic feature vectors, and then it is identified whether the target document identification information in the query statement is included in the at least one candidate document identification information corresponding to the at least one third semantic feature vector. If the target document identification information is included in the at least one candidate document identification information, at least one target document paragraph with a similarity higher than a second preset threshold between the query statement is obtained from the target document corresponding to the target document identification information. Then, the query statement and the at least one target document paragraph are provided to the large language model, so that the large language model summarizes the answer to the query statement from the at least one target document paragraph, and then sends the answer to the terminal 201, which is provided to the user by the terminal 201.

[0059] For the intelligent question answering system using the RAG framework, the accuracy of the document content in the knowledge base directly affects the question answering result. At present, source documents obtained from different sources or at different times are all added to the knowledge base, and the document names of the source documents obtained from different sources or at different times may have abbreviations, acronyms and the like, and the target document name included in the query statement input by the user may also have abbreviations, acronyms and the like. When a question is asked for a certain document, if the document name in the knowledge base or the document name in the query statement is abbreviated or rewritten, the above-mentioned direct matching method cannot query the specific document from the knowledge base, resulting in that the specific document cannot be answered, and the question answering success rate is low. In addition, due to the existence of a large amount of redundant and incorrect information in the knowledge base, the answer may be incorrect or imprecise, and the question answering result is not accurate enough.

[0060] Therefore, the embodiment of the present disclosure provides a document-oriented question answering method, which finds the corresponding specific document based on the query intention of the user, and then answers the specific document. The embodiment of the present disclosure obtains the first semantic feature vector corresponding to the query statement of the user by vectorizing the query statement, and obtains the second semantic feature vector corresponding to the document identification information of the source document by vectorizing the document identification information of the source document when constructing the knowledge base. Through the vectorization processing mode, the problem of being unable to match due to the difference in string rewriting, abbreviation and the like is avoided. In addition, three paths are designed to determine the final target document for the candidate document identification information related to the query statement in terms of semantics, ensuring the accuracy and efficiency of the determination of the target document. The three paths designed can be used at the same time, or part of the paths can be used. The specific application scenarios can be determined according to different application scenarios.

[0061] The embodiment of the present disclosure provides a document-oriented question answering method. Taking the server in the intelligent question answering system shown in FIG. 2 as an example, referring to FIG. 3, the method flow provided by the embodiment of the present disclosure includes:

[0062] 301、Obtain the first semantic feature vector corresponding to the query statement of the user, and obtain the second semantic feature vector corresponding to the document identification information of the source document.

[0063] When a user wants to obtain an answer to a question, the user can input a query statement on a terminal of the intelligent question answering system, the terminal sends the query statement to a server of the intelligent question answering system after obtaining the query statement, the server obtains a document paragraph related to the query statement from a knowledge base based on the query statement to answer, and thus provides the answer to the user. The form of the query statement of the user can be a literal form or a voice form, etc. To enable the intelligent question answering system to answer more accurately, the query statement can include target document identification information, the target document identification information is used to find a specific document from the knowledge base, the target document identification information can be a document name, a domain standard name, etc., the domain standard name refers to a specification, a criterion, etc. of a certain domain, for example, a certain domain is the power domain, and the domain standard name can be the power dispatching regulation document, etc. The semantic feature vector is used to indicate the attribute of the statement, the document identification information or the document paragraph in the semantic aspect, and the deviation caused by rewriting, abbreviation, shorthand, etc. can be avoided.

[0064] After receiving the query statement of the user, the first semantic feature vector corresponding to the query statement of the user can be obtained by processing the query statement. In a possible implementation manner, the server can call an embedding model to perform vectorization processing on the query statement to obtain the first semantic feature vector. By directly performing vectorization processing on the query statement, the first semantic feature vector obtained contains richer information, and the accuracy of subsequent matching is improved. In another possible implementation manner, the server can identify the query statement to obtain the target document identification information, and then call the embedding model to process the target document identification information to obtain the first semantic feature vector. By identifying the query statement, not only the interference of other information in the query statement can be excluded, but also the calculation amount can be reduced, and the question answering speed can be improved. The embedding model is a model for representing high-dimensional data (such as text, picture, video, etc.) as a point (i.e. a vector) in a continuous numerical space. The embedding model not only can perform dimension reduction processing on the high-dimensional data to improve the calculation efficiency, but also the low-dimensional vector converted captures the semantic information of the high-dimensional data, which is more meaningful than the high-dimensional data. The embedding model is the core of the RAG technology and is also the key to the application landing of the large language model.

[0065] In the embodiments of the present disclosure, the knowledge base is the basis of the intelligent question answering, and is the knowledge source of the answer generated by the intelligent question answering system for the user question. To realize the intelligent question answering, the server can pre-construct the knowledge base. Specifically, the construction process of the knowledge base is as follows:

[0066] 3011、Obtain a plurality of source documents, each source document including document identification information.

[0067] The source document is an initial document without processing. The source document can be obtained from a search network or a professional website such as a journal or a newspaper office. Each source document includes document identification information, which includes a document name and can also include a domain standard name. The source document in the knowledge base can be for a certain domain or for multiple domains. When the source document in the knowledge base is for a certain domain, each source document can have the same domain tag. When the source document in the knowledge base is for multiple domains, each source document can have different domain tags. Generally, there can be multiple domain standards in the same domain. For example, the documents in the power domain have the power domain tag in common, but the power generation types in the power domain include thermal power generation, wind power generation, and nuclear power generation. Each power generation type has at least one domain standard, and each domain standard has different versions. Therefore, the documents under the power domain have different domain standard names.

[0068] 3012. Call the embedding model to perform vectorization processing on the document identification information of each source document to obtain a second semantic feature vector corresponding to the document identification information of the source document.

[0069] When any source document is obtained, the embedding model can be called to perform vectorization processing on the document identification information of the source document to obtain a second semantic feature vector corresponding to the document identification information of the source document. When the document identification information is a document name, the embedding model can be called to perform vectorization processing on the document name of the source document to obtain a second semantic feature vector corresponding to the document name of the source document, which is used to represent the document name at the semantic level. When the document identification information is a domain standard name, the embedding model can be called to perform vectorization processing on the document name of the source document to obtain a second semantic feature vector corresponding to the domain standard name of the source document, which is used to represent the domain standard name at the semantic level.

[0070] 3013. Perform segmentation processing on each source document to obtain multiple document paragraphs of each source document.

[0071] When any source document is obtained, the source document is identified to determine the positions of multiple document paragraphs in the source document, and then the source document is segmented based on the positions of each document paragraph to obtain multiple document paragraphs of the source document.

[0072] 3014. Call the embedding model to perform vectorization processing on each document paragraph of each source document to obtain a fourth semantic feature vector corresponding to each document paragraph of each source document.

[0073] 3015、based on the document identification information of the plurality of source documents and the corresponding second semantic feature vectors, the document paragraphs of each source document and the corresponding fourth semantic feature vectors, constructing a target knowledge base.

[0074] By storing the document identification information of each source document and the corresponding second semantic feature vectors, the document paragraphs of each source document and the corresponding fourth semantic feature vectors, the target knowledge base can be constructed.

[0075] Based on the constructed target knowledge base, when the user's query statement is obtained, the second semantic feature vectors corresponding to the document identification information of the plurality of source documents can be obtained from the knowledge base.

[0076] 302、From the plurality of second semantic feature vectors, at least one third semantic feature vector with a semantic similarity greater than a first preset threshold value with the first semantic feature vector is obtained.

[0077] When the first semantic feature vector corresponding to the user's query statement and the plurality of second semantic feature vectors are obtained, the semantic similarity between the first semantic feature vector and each second semantic feature vector can be calculated, and then based on the calculation result, at least one third semantic feature vector with a semantic similarity greater than a first preset threshold value with the first semantic feature vector is obtained from the plurality of second semantic feature vectors. The first preset threshold value can be set by a technician and can be 0.6, 0.7, etc. When calculating the semantic similarity between the first semantic feature vector and any second semantic feature vector, the cosine value between the first semantic feature vector and the second semantic feature vector can be calculated, the Hamming distance between the first semantic feature vector and the second semantic feature vector can be calculated, and the edit distance between the first semantic feature vector and the second semantic feature vector can be calculated, etc.

[0078] 303、Obtain at least one candidate document identification information corresponding to at least one third semantic feature vector.

[0079] After the at least one third semantic feature vector is obtained, the document identification information corresponding to each third semantic feature vector can be obtained from the knowledge base as candidate document identification information based on each third semantic feature vector. The candidate document identification information has a high semantic similarity with the query statement. However, because the number of subsequent document identification information obtained is usually large, and the target document that the user wants to query is not located, the target document identification information needs to be determined from the at least one candidate document identification information through subsequent steps 304-305, and then the target document is obtained based on the target document identification information. Alternatively, to facilitate management of the at least one candidate document identification information, the server can add the at least one candidate document identification information to a specified document list, and subsequent identification of the at least one candidate document identification information can be based on the specified document list.

[0080] 304. Identifying whether the target document identification information is included in the at least one candidate document identification information.

[0081] The embodiments of the present disclosure can use various ways to identify whether the target document identification information is included in the at least one candidate document identification information, and the specific process is as follows:

[0082] The first way is to identify based on semantic similarity

[0083] After the semantic similarity between the at least one first semantic feature vector and each second semantic feature vector is calculated, the at least one third semantic feature vector can be sorted in descending order of semantic similarity between the first semantic feature vector, and then the maximum semantic similarity is obtained. The maximum semantic similarity is compared with a third preset threshold value, and when the maximum semantic similarity is greater than the third preset threshold value, the third semantic feature vector corresponding to the maximum semantic similarity is taken as the target document identification information. The third preset threshold value is greater than the first preset threshold value, and the third preset threshold value can be 0.8, 0.9, etc.

[0084] This way is relatively simple to implement and is easy to use. By setting a higher threshold value and then filtering based on the higher threshold value, the target document identification information obtained is more accurate than other candidate document identification information, which can ensure the accuracy of the question and answer.

[0085] The second way is to identify based on a large language model

[0086] The embodiments of the present disclosure can pre-train a first large language model and a first prompt template, the first prompt template including a first position and a second position, the first position and the second position being used to fill in query sentences and document identification information respectively to obtain first prompt information to instruct the first large language model to identify whether the specified document identification information is included in the document identification information. With the help of the prompt engineering and the large language model, the server fills at least one candidate document identification information and the query sentence into the corresponding positions of the first prompt template. Specifically, the query sentence can be filled into the first position of the first prompt template, and at least one candidate document identification information can be filled into the second position of the first prompt template to obtain the first prompt information. Then, the first prompt information is input into the first large language model to enable the first large language model to identify whether the target document identification information is included in the at least one candidate document identification information to obtain an identification result.

[0087] For example, the first prompt template is: "You are a document name identification expert. According to the user's question and the provided document name, judge whether a certain document is specified in the question. If yes, output the document name. If no, return None. + first position + second position", the question is: "What are the principles of power grid operation according to the power dispatching regulation document?", and the candidate document name is: "East Power Grid Dispatching Regulation, Shandong Wind Power Management Regulation, Shandong Electric Power Ten Management Regulations". By filling the query sentence into the first position and the candidate document name into the second position, the first prompt information is obtained as:

[0088] You are a document name identification expert. According to the user's question and the provided document name, judge whether a certain document is specified in the question. If yes, output the document name. If no, return None.

[0089] Question: "What are the principles of power grid operation according to the power dispatching regulation document?"

[0090] Candidate document name: "East Power Grid Dispatching Regulation, Shandong Wind Power Management Regulation, Shandong Electric Power Ten Management Regulations".

[0091] The obtained first prompt information is input into the first large language model. According to the instruction of the first prompt information, the first large language model identifies "East Power Grid Dispatching Regulation, Shandong Wind Power Management Regulation, Shandong Electric Power Ten Management Regulations" according to the user's question "What are the principles of power grid operation according to the power dispatching regulation document?", and identifies that the candidate document name does not include the target document name in the query sentence.

[0092] The third approach is to interact with the user

[0093] By interacting with the user, the server can enable the user to identify whether at least one candidate document identifier includes the target document identifier, and return the identification result. Specifically, the server can send an identification request to the terminal, which includes at least one target document identifier. This request asks the terminal user to identify whether at least one candidate document identifier includes the target document identifier; if it does, the target document identifier is selected. The user, as the inquirer, accurately grasps the target document information they need to query. Through interaction with the user, the identification result is more accurate, and the answer summarized based on the target document corresponding to the identified target identifier better meets the user's needs, resulting in higher user satisfaction.

[0094] 305. When at least one candidate document identification information includes target document identification information, at least one target document paragraph with a similarity to the query statement higher than a second preset threshold is obtained from the target document corresponding to the target document identification information.

[0095] When at least one candidate document identifier is determined to include the target document identifier through step 304, the server can recall the target document from the documents stored in the knowledge base based on the target document identifier. Considering that the target document includes multiple document paragraphs, some of which are related to the user's query and others are not, the irrelevant paragraphs not only do not help with the answer but also waste computational resources and affect the question-answering speed. Therefore, this embodiment of the present disclosure, after obtaining the target document, will also recall document paragraphs related to the query from the target document. When recalling document paragraphs related to the query from the target document, a fourth semantic feature vector corresponding to each document paragraph of the target document can be obtained. Then, the semantic similarity between the fourth semantic feature vector corresponding to each document paragraph and the first semantic feature vector is calculated. When the semantic similarity between any fourth semantic feature vector and the first semantic feature vector is higher than a second preset threshold, the document paragraph corresponding to the fourth semantic feature vector is taken as the target document paragraph. By filtering out at least one target document paragraph related to the query from the target document, the answering process becomes more targeted, computational power consumption is reduced, and question-answering speed is improved.

[0096] 306. Based on at least one target document paragraph, generate the answer corresponding to the query statement.

[0097] The embodiments of the present disclosure can pre-train a second large language model and a second prompt template based on training data. The second prompt template includes a first position for filling a query sentence input by a user and a second position for filling a document paragraph to be summarized by the second large language model. When the query sentence and the document paragraph are filled into the corresponding positions, a prompt information can be obtained, which is used to instruct the second large language model to summarize an answer corresponding to the query sentence from the filled document paragraph. Based on the trained second large language model and the second prompt template, when at least one target document paragraph is obtained from a target document, the server generates an answer corresponding to the query sentence based on the at least one target document paragraph, including the following steps:

[0098] 3061、According to the similarity between the query sentence and the at least one target document paragraph from high to low, the at least one target document paragraph is sorted.

[0099] 3062、Fill the query sentence and the sorted at least one target document paragraph into the second prompt template to obtain the second prompt information.

[0100] By filling the query sentence into the first position of the second prompt template and filling the at least one target document paragraph into the second position of the second prompt template, the second prompt information can be obtained. For example, the second prompt information can be: you are an answer summarization expert, please summarize the answer from the target document paragraph according to the user's question.

[0101] Question: What are the principles of power grid operation according to the power dispatching regulation document?

[0102] Target document paragraph 1: The principles of power grid operation mainly include ensuring the safe, high-quality and economic operation of the power grid, promoting the coordination of power plants and grids, and maintaining the legal rights and interests of power enterprises.

[0103] Target document paragraph 2: The management regulations and rules of power grid operation aim to ensure the stable and reliable operation of the power system, while considering economic efficiency and fairness.

[0104] 3063、Input the second prompt information into the second large language model to make the second large language model summarize the answer corresponding to the query sentence from the sorted at least one target document paragraph.

[0105] The obtained second prompt information is input into the second large language model, and under the instruction of the second prompt information, the second large language model summarizes the sorted at least one target paragraph to obtain an answer corresponding to the query sentence.

[0106] In another embodiment of the present disclosure, when the target document identification information is not included in the at least one candidate document identification information, the server will further obtain the answer corresponding to the query statement from each document paragraph included in the plurality of source documents by the following method:

[0107] Firstly, the server obtains at least one reference document paragraph with a similarity higher than a third preset threshold to the query statement.

[0108] The server calculates the semantic similarity between the first semantic feature vector corresponding to the query statement and the second semantic feature vector corresponding to each document paragraph of each source document included in the knowledge base, selects at least one second semantic feature vector with a semantic similarity higher than a third preset threshold to the first semantic feature vector corresponding to the query statement in a descending order of the semantic similarity, and obtains at least one document paragraph from the knowledge base as at least one reference document paragraph based on the at least one second semantic feature vector.

[0109] Secondly, the server sorts the at least one reference document paragraph.

[0110] The server sorts the at least one reference document paragraph in a descending order of the similarity to the query statement.

[0111] Thirdly, the server fills the query statement and the sorted at least one reference document paragraph into the second prompt template to obtain third prompt information.

[0112] The server fills the query statement into the first position of the second prompt template and fills the sorted at least one reference document paragraph into the second position of the second prompt template to obtain the third prompt information.

[0113] Fourthly, the server inputs the third prompt information into the second large language model to enable the second large language model to summarize the answer corresponding to the query statement from the sorted at least one reference document paragraph.

[0114] The server inputs the third prompt information into the second large language model, and under the instruction of the third prompt information, the second large language model summarizes the sorted at least one reference document paragraph to obtain the answer corresponding to the query statement.

[0115] The method provided by the embodiments of the present disclosure can, when the target document identification information is not included in the at least one candidate document identification information, recall reference document paragraphs with high similarity to the query statement from each document segment of each source document included in the knowledge base, and then, based on the reference document paragraphs, obtain an answer corresponding to the query statement by calling a second large language model to summarize the reference document paragraphs through a prompting engineering, so that the user can be answered regardless of whether the document corresponding to the target document identification information is stored in the knowledge base, and the success rate of question answering and the user satisfaction are improved.

[0116] All the optional technical solutions described above can be combined to form optional embodiments of the present disclosure, which will not be described one by one here.

[0117] FIG. 4 shows a document-oriented complete question answering process provided by the application embodiment, taking the document identification information as a document name as an example, the process includes: the knowledge base includes N source documents, each source document has a document name, which is document name 1, document name 2, document name 3, …, and document name N respectively. The document corresponding to the document name 1 includes the document paragraph 1, the document paragraph 2 and the document paragraph 3, and the document name 1 and the document paragraph 1, the document paragraph 2 and the document paragraph 3 included therein all have corresponding semantic feature vectors; the document corresponding to the document name 2 includes the document paragraph 1, the document paragraph 2 and the document paragraph 3, and the document name 2 and the document paragraph 1, the document paragraph 2 and the document paragraph 3 included therein all have corresponding semantic feature vectors; …; the document corresponding to the document name N includes the document paragraph 1, the document paragraph 2 and the document paragraph 3, and the document name N and the document paragraph 1, the document paragraph 2 and the document paragraph 3 included therein all have corresponding semantic feature vectors. When receiving the user's question sentence, the question sentence is vectorized to obtain the semantic feature vector corresponding to the question sentence, and then based on the semantic feature vector corresponding to the question and the semantic feature vector corresponding to each document name in the knowledge base, the candidate document names with a semantic similarity between the semantic feature vector corresponding to the question and the semantic feature vector greater than a first preset threshold are recalled from the knowledge base, including document name 1, document name 2 and document name K, and then any one of path 1, path 2 and path 3 is used to identify whether the candidate document includes the specified document name. Wherein, path 1 is: sorting each semantic feature vector with a semantic similarity greater than the first preset threshold between the semantic feature vector corresponding to the question, and selecting the semantic feature vector corresponding to the document name with the maximum semantic similarity as the specified document name. Path 2: filling the question and the candidate document name into the prompt template to obtain the prompt information, and then inputting the prompt information into the large language model to output the recognition result. Path 3: providing the candidate document name to the user, identifying whether the candidate document name includes the specified document name by interacting with the user, and returning the recognition result. When determining that the candidate document name includes the specified document name based on any one of path 1, path 2 and path 3, the specified document is obtained from the knowledge base based on the specified document name, then the similarity between the semantic feature vector corresponding to the question and the semantic feature vector of each document paragraph included in the specified document is calculated, and according to the similarity calculation result, the specified paragraph with a similarity greater than a second preset threshold between the question is selected from the specified document, the specified paragraph is sorted, and then the large language model is called to summarize the sorted specified paragraph to obtain the answer corresponding to the question.When it is determined that the candidate document name does not include the specified document name based on any one of the path 1, the path 2, and the path 3, the similarity between the semantic feature vector corresponding to the question and the semantic feature vector corresponding to each document paragraph of each source document in the knowledge base is calculated based on the semantic feature vector corresponding to the question, the specified paragraphs with the similarity greater than the third preset threshold are sorted, and the large language model is called to summarize the specified paragraphs after sorting to obtain the answer corresponding to the question.

[0118] The method provided by the embodiments of the present disclosure can be applied to question and answer scenarios in various fields, and can be applied to question and answer scenarios in the power field in particular. For question and answer scenarios in the power field, the embodiments of the present disclosure provide a document-oriented question and answer method. Taking the server in the smart question and answer system shown in FIG. 2 as an example, referring to FIG. 5, the method flow provided by the embodiments of the present disclosure includes:

[0119] 501. Obtain a first semantic feature vector corresponding to a query statement of a user in the power field, and obtain a plurality of second semantic feature vectors corresponding to document identification information of a plurality of source documents in the power field.

[0120] The query statement includes target document identification information, etc.

[0121] 502. From the plurality of second semantic feature vectors, obtain at least one third semantic feature vector with a semantic similarity greater than a first preset threshold to the first semantic feature vector.

[0122] 503. Obtain at least one candidate document identification information corresponding to the at least one third semantic feature vector.

[0123] 504. Identify whether the target document identification information is included in the at least one candidate document identification information.

[0124] 505. When the target document identification information is included in the at least one candidate document identification information, obtain at least one target document paragraph with a similarity higher than a second preset threshold to the query statement from a target document corresponding to the target document identification information.

[0125] 506. Generate an answer corresponding to the query statement based on the at least one target document paragraph.

[0126] Although the application embodiments are directed to the power field, the overall question and answer process can refer to the embodiments shown in FIG. 3, which will not be described here.

[0127] Please refer to FIG. 6, which shows a structural schematic diagram of a document-oriented question and answer device provided by the embodiments of the present disclosure. The device can be realized by software, hardware or a combination of both, and become all or part of an electronic device. The device includes:

[0128] The first obtaining module 601 is configured to obtain a first semantic feature vector corresponding to a query statement of a user, and obtain a plurality of second semantic feature vectors corresponding to document identification information of a plurality of source documents, the query statement comprising target document identification information.

[0129] The second obtaining module 602 is configured to obtain at least one third semantic feature vector with a semantic similarity greater than a first preset threshold from the plurality of second semantic feature vectors and the first semantic feature vector.

[0130] The third obtaining module 603 is configured to obtain at least one candidate document identification information corresponding to the at least one third semantic feature vector.

[0131] The identification module 604 is configured to identify whether the target document identification information is included in the at least one candidate document identification information.

[0132] The fourth obtaining module 605 is configured to obtain at least one target document paragraph with a similarity higher than a second preset threshold between the query statement from a target document corresponding to the target document identification information when the target document identification information is included in the at least one candidate document identification information.

[0133] The generation module 606 is configured to generate an answer corresponding to the query statement based on the at least one target document paragraph.

[0134] In another embodiment of the present disclosure, the first obtaining module 601 is configured to identify the query statement to obtain the target document identification information, call an embedding model, process the target document identification information, and obtain the first semantic feature vector; or

[0135] The first obtaining module 601 is configured to call an embedding model, perform vectorization processing on the query statement, and obtain the first semantic feature vector.

[0136] In another embodiment of the present disclosure, the device further comprises:

[0137] The fifth obtaining module 607 is configured to obtain a plurality of source documents, each source document comprising document identification information; call an embedding model, perform vectorization processing on the document identification information of each source document, and obtain a second semantic feature vector corresponding to the document identification information of the source document.

[0138] In another embodiment of the present disclosure, the identification module 604 is configured to sort the at least one third semantic feature vector in descending order of similarity with the first semantic feature vector; when the maximum semantic similarity is greater than a third preset threshold, obtain the third semantic feature vector corresponding to the maximum semantic similarity, and take the document identification information corresponding to the third semantic feature vector as the target document identification information.

[0139] In another embodiment of the present disclosure, the identification module 604 is configured to fill the at least one candidate document identification information and the query statement into the corresponding positions of the first prompt template to obtain first prompt information; and input the first prompt information into the first large language model to enable the first large language model to identify whether the target document identification information is included in the at least one candidate document identification information, and obtain an identification result.

[0140] In another embodiment of the present disclosure, the identification module 604 is configured to send an identification request to the user, the identification request including the at least one candidate document identification information, the identification request being used to request the user to identify whether the target document identification information is included in the at least one candidate document identification information, and return an identification result.

[0141] In another embodiment of the present disclosure, the fourth acquisition module 605 is configured to acquire a fourth semantic feature vector corresponding to each document paragraph of the target document; calculate a semantic similarity between the fourth semantic feature vector corresponding to each document paragraph and the first semantic feature vector; and when the semantic similarity between any fourth semantic feature vector and the first semantic feature vector is higher than a second preset threshold, take the document paragraph corresponding to the fourth semantic feature vector as the target document paragraph.

[0142] In another embodiment of the present disclosure, the generation module 606 is configured to sort the at least one target document paragraph in an order from high to low according to the similarity between the query statement; fill the query statement and the sorted at least one target document paragraph into the second prompt template to obtain second prompt information; and input the second prompt information into the second large language model to enable the second large language model to summarize an answer corresponding to the query statement from the sorted at least one target document paragraph.

[0143] In another embodiment of the present disclosure, the device further includes:

[0144] The sixth acquisition module 608 is configured to, when the target document identification information is not included in the at least one candidate document identification information, acquire at least one reference document paragraph having a similarity higher than a third preset threshold with the query statement from each document paragraph included in the plurality of source documents;

[0145] The sorting module is configured to sort the at least one reference document paragraph;

[0146] The filling module is configured to fill the query statement and the sorted at least one reference document paragraph into the second prompt template to obtain third prompt information;

[0147] The input module is configured to input the third prompt information into the second large language model to enable the second large language model to summarize an answer corresponding to the query statement from the sorted at least one reference document paragraph.

[0148] In another embodiment of the present disclosure, the document identification information includes any one of a document name and a domain standard name.

[0149] Referring to FIG. 7, a structural schematic diagram of a document-oriented question answering device is shown, which can be implemented by software, hardware or a combination of both, and become all or part of an electronic device. The device includes:

[0150] The first obtaining module 701 is configured to obtain a first semantic feature vector corresponding to a query sentence of a user for a power domain, and obtain a plurality of second semantic feature vectors corresponding to document identification information of a plurality of source documents of the power domain, the query sentence including target document identification information.

[0151] The second obtaining module 702 is configured to obtain at least one third semantic feature vector with a semantic similarity greater than a first preset threshold from the plurality of second semantic feature vectors and the first semantic feature vector.

[0152] The third obtaining module 703 is configured to obtain at least one candidate document identification information corresponding to the at least one third semantic feature vector.

[0153] The identification module 704 is configured to identify whether the target document identification information is included in the at least one candidate document identification information.

[0154] The first obtaining module 705 is configured to, when the target document identification information is included in the at least one candidate document identification information, obtain at least one target document paragraph with a similarity higher than a second preset threshold between the query sentence from a target document corresponding to the target document identification information.

[0155] The generation module 706 is configured to generate an answer corresponding to the query sentence based on the at least one target document paragraph.

[0156] FIG. 8 shows a structural block diagram of an electronic device 800 according to an example embodiment of the present disclosure. Generally, the electronic device 800 includes a processor 801 and a memory 802.

[0157] The processor 801 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), a PLA (Programmable Logic Array). The processor 801 can also include a main processor and a coprocessor, the main processor being a processor for processing data in an awake state, and the coprocessor being a low-power processor for processing data in a standby state. In some embodiments, the processor 801 can be integrated with a GPU (Graphics Processing Unit) for rendering and drawing content required to be displayed by the display screen. In some embodiments, the processor 801 can further include an artificial intelligence processor for processing computing operations related to machine learning.

[0158] The memory 802 can include one or more computer-readable storage media that can be non-transitory computer-readable storage media, for example, a CD-ROM (Compact Disc Read-Only Memory), a ROM (Read-Only Memory), a RAM (Random Access Memory), a magnetic tape, a floppy disk, and an optical data storage device, etc. The computer-readable storage medium stores at least one computer program, which, when executed, can implement the above document-oriented question answering method.

[0159] Of course, the above electronic device can also include other components, such as an input / output interface, a communication component, etc. The input / output interface provides an interface between the processor and peripheral interface modules, which can be output devices, input devices, etc. The communication component is configured to facilitate wired or wireless communication between the electronic device and other devices.

[0160] Those skilled in the art can understand that the structure shown in FIG. 8 does not constitute a limitation on the electronic device 800, and can include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0161] The embodiments of the present disclosure provide a computer-readable storage medium, which stores at least one computer program, and the at least one computer program, when executed by a processor, can implement the above document-oriented question answering method.

[0162] The embodiment of the present disclosure provides a computer program product, the computer program product comprises a computer program, the computer program can realize the above-mentioned document-oriented question and answer method when the processor executes.

[0163] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the above-mentioned system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

[0164] The above embodiments are only used to illustrate the technical solutions of the present disclosure, but not limit them; although the foregoing embodiments of the present disclosure are described in detail, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure.

Claims

1. A document-oriented question answering method, wherein, The method comprises: obtaining a first semantic feature vector corresponding to a query statement of a user, and obtaining a plurality of second semantic feature vectors corresponding to document identification information of a plurality of source documents, the query statement comprising target document identification information; from the plurality of second semantic feature vectors, obtaining at least one third semantic feature vector with a semantic similarity greater than a first preset threshold to the first semantic feature vector; obtaining at least one candidate document identification information corresponding to the at least one third semantic feature vector; identifying whether the target document identification information is included in the at least one candidate document identification information; when the target document identification information is included in the at least one candidate document identification information, obtaining at least one target document paragraph with a similarity higher than a second preset threshold to the query statement from a target document corresponding to the target document identification information; generating an answer corresponding to the query statement based on the at least one target document paragraph.

2. The method of claim 1, wherein, The method comprises: identifying the query statement to obtain the target document identification information, calling an embedding model to process the target document identification information to obtain the first semantic feature vector; or calling an embedding model to perform vectorization processing on the query statement to obtain the first semantic feature vector.

3. The method of claim 1 or 2, wherein, The method further comprises, before obtaining the plurality of second semantic feature vectors corresponding to the document identification information of the plurality of source documents: obtaining a plurality of source documents, each source document comprising document identification information; calling an embedding model to perform vectorization processing on the document identification information of each source document to obtain a second semantic feature vector corresponding to the document identification information of the source document.

4. The method of any one of claims 1 to 3, wherein, The method comprises: sorting the at least one third semantic feature vector in descending order of similarity to the first semantic feature vector; when the maximum semantic similarity is greater than a third preset threshold, obtaining the third semantic feature vector corresponding to the maximum semantic similarity, and taking the document identification information corresponding to the third semantic feature vector as the target document identification information.

5. The method of any one of claims 1 to 3, wherein, The method comprises: filling the at least one candidate document identification information and the query statement into a corresponding position of a first prompt template to obtain first prompt information; inputting the first prompt information into a first large language model to enable the first large language model to identify whether the target document identification information is included in the at least one candidate document identification information, and obtaining an identification result.

6. The method of any one of claims 1 to 3, wherein, The method comprises: sending an identification request to the user, the identification request comprising the at least one candidate document identification information, the identification request being used to request the user to identify whether the target document identification information is included in the at least one candidate document identification information and return an identification result.

7. The method of any one of claims 1 to 6, wherein, The method further comprises: When the target document identification information is not included in the at least one candidate document identification information, at least one reference document paragraph with a similarity higher than a third preset threshold to the query statement is obtained from each document paragraph included in the plurality of source documents; The at least one reference document paragraph is sorted; The query statement and the sorted at least one reference document paragraph are filled into a second prompt template to obtain third prompt information; 8. The method of any one of claims 1 to 7, wherein, The third prompt information is input into the second large language model, so that the second large language model summarizes an answer corresponding to the query statement from the sorted at least one reference document paragraph. The document identification information includes any one of a document name and a domain standard name. The method comprises: A first semantic feature vector corresponding to a query statement of a user for a power domain is obtained, and a plurality of second semantic feature vectors corresponding to document identification information of a plurality of source documents of the power domain are obtained, the query statement including target document identification information; 9. The method of any one of claims 1 to 8, wherein, At least one third semantic feature vector with a semantic similarity greater than a first preset threshold to the first semantic feature vector is obtained from the plurality of second semantic feature vectors; At least one candidate document identification information corresponding to the at least one third semantic feature vector is obtained; It is identified whether the target document identification information is included in the at least one candidate document identification information; When the target document identification information is included in the at least one candidate document identification information, at least one target document paragraph with a similarity higher than a second preset threshold to the query statement is obtained from a target document corresponding to the target document identification information; An answer corresponding to the query statement is generated based on the at least one target document paragraph.

10. The method of any one of claims 1 to 9, wherein, The apparatus comprises:

11. A document-oriented question answering method, wherein, ​ ​ ​ ​ ​ ​ ​ 12. A document-oriented question answering apparatus, wherein, ​ The first obtaining module is configured to obtain a first semantic feature vector corresponding to a query statement of a user, and obtain a plurality of second semantic feature vectors corresponding to document identification information of a plurality of source documents, the query statement comprising target document identification information; The second obtaining module is configured to obtain at least one third semantic feature vector having a semantic similarity greater than a first preset threshold from the plurality of second semantic feature vectors and the first semantic feature vector; The third obtaining module is configured to obtain at least one candidate document identification information corresponding to the at least one third semantic feature vector; The identification module is configured to identify whether the target document identification information is included in the at least one candidate document identification information; The fourth obtaining module is configured to obtain at least one target document paragraph having a similarity higher than a second preset threshold with the query statement from a target document corresponding to the target document identification information when the target document identification information is included in the at least one candidate document identification information. The generating module is configured to generate an answer corresponding to the query statement based on the at least one target document paragraph.

13. A document-oriented question answering apparatus, wherein, The device comprises: The first obtaining module is configured to obtain a first semantic feature vector corresponding to a query statement of a user in the field of electric power, and obtain a plurality of second semantic feature vectors corresponding to document identification information of a plurality of source documents in the field of electric power, the query statement comprising target document identification information; The second obtaining module is configured to obtain at least one third semantic feature vector having a semantic similarity greater than a first preset threshold from the plurality of second semantic feature vectors and the first semantic feature vector; The third obtaining module is configured to obtain at least one candidate document identification information corresponding to the at least one third semantic feature vector; The identification module is configured to identify whether the target document identification information is included in the at least one candidate document identification information; The first obtaining module is configured to obtain at least one target document paragraph having a similarity higher than a second preset threshold with the query statement from a target document corresponding to the target document identification information when the target document identification information is included in the at least one candidate document identification information. The generating module is configured to generate an answer corresponding to the query statement based on the at least one target document paragraph.

14. An electronic device, comprising: The device comprises a processor and a memory; the memory stores at least one program code; the at least one program code is used to be called and executed by the processor to implement the document-oriented question answering method in any one of claims 1 to 10 or the document-oriented question answering method in claim 11.

15. A computer readable storage medium, wherein, The computer-readable storage medium stores at least one computer program, and the at least one computer program is executed by the processor to implement the document-oriented question answering method in any one of claims 1 to 10 or the document-oriented question answering method in claim 11.

16. A computer program product, wherein, The computer program product comprises a computer program, and the computer program is executed by the processor to implement the document-oriented question answering method in any one of claims 1 to 10 or the document-oriented question answering method in claim 11.

Citation Information

Patent Citations

  • Document processing method, device and equipment in network disk

    CN116561255A

  • Text retrieval method and device, equipment, medium and product

    CN116932701A

  • Question and answer method and device, equipment and medium

    CN117236340A

  • Knowledge question-answering method and device, equipment and storage medium

    CN117573821A

  • Document-oriented knowledge question and answer method, device and equipment and medium

    CN117786066A