Automatic question answering method

By generating reference parsed text in an automatic question answering system and using matching weight information to select target document data, the problem of irrelevant document matching in the prior art is solved, and the accuracy of automatic question answering and the accuracy of answers are improved.

CN118377887BActive Publication Date: 2024-09-24ALIBABA CLOUD FEITIAN (HANGZHOU) CLOUD COMPUTING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410824422.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-09-24
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

Existing technologies fail to fully consider other information that affects the degree of document matching in automatic question answering, resulting in the identified document not being the most relevant, thus affecting the ability of large models to generate correct answers.

Method used

By receiving question instructions, the corresponding document database is determined, a reference parsed text is generated, and the target document data is selected based on the matching weight information to generate the answer text, thereby improving the accuracy of the answer.

Benefits of technology

Improved accuracy of automated Q&A, ensuring that selected documents are more logical and relevant, resulting in more accurate responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118377887B
    Figure CN118377887B
Patent Text Reader

Abstract

The embodiment of the present specification provides an automatic question-answering method, wherein the automatic question-answering method comprises: receiving a question instruction including a question text and determining a document database corresponding to the question instruction; determining at least one reference document data in the document database and generating a reference parsing text based on the question text and the reference document data, wherein the reference parsing text is a text that parses the question text based on the reference document data; obtaining matching weight information corresponding to the document data according to the reference parsing text and the document data; determining at least one target document data in the document data based on the matching weight information corresponding to the document data and generating an answer text corresponding to the question instruction according to the question text and the target document data. The matching weight information corresponding to the document data is determined by the reference parsing text, and the logical language selection in the reference parsing text is used to generate a document that is conducive to a correct response, thereby improving the accuracy of automatic question-answering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technology, and in particular to an automatic question-answering method, an automatic question-answering method applied to a cloud device, an automatic question-answering device, a computing device, a computer-readable storage medium, and a computer program product. Background Art

[0002] With the development of big model technology, its application in specific scenarios often requires the help of external knowledge bases. These knowledge bases can provide the latest knowledge that is not included in the pre-training of big models, especially in some professional fields. Without these external knowledge bases, big models may give wrong answers.

[0003] At present, the industry generally determines the documents corresponding to questions by matching questions with knowledge, and determining the first few documents that are most similar to the query, which solves the basic needs of information retrieval. However, this method often does not consider other information that may affect the degree of document matching, resulting in the determined documents may not be the most relevant documents, thus affecting the ability of large models to generate correct answers. Therefore, a more accurate automatic question-answering method is needed to more accurately mine and utilize information and improve the accuracy of the model's answers. Summary of the invention

[0004] In view of this, an embodiment of this specification provides an automatic question-answering method, an automatic question-answering method applied to a cloud device. One or more embodiments of this specification also relate to an automatic question-answering device, a computing device, a computer-readable storage medium, and a computer program product to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of this specification, there is provided an automatic question-answering method, comprising:

[0006] receiving a question instruction, and determining a document database corresponding to the question instruction, wherein the question instruction includes a question text, and the document database includes at least one document data;

[0007] Determine at least one reference document data in the document database, and generate a reference parsed text based on the question text and each reference document data, wherein the reference parsed text is a text obtained by parsing the question text based on the reference document data;

[0008] According to the reference parsed text and each document data, obtaining matching weight information corresponding to each document data;

[0009] Based on the matching weight information corresponding to each document data, at least one target document data is determined in each document data, and according to the question text and each target document data, an answer text corresponding to the question instruction is generated.

[0010] According to a second aspect of an embodiment of this specification, an automatic question-answering method is provided, which is applied to a cloud device, and the method includes:

[0011] A question instruction sent by a receiving terminal device is received, and a document database corresponding to the question instruction is determined, wherein the question instruction includes a question text, and the document database includes at least one document data;

[0012] Determine at least one reference document data in the document database, and generate a reference parsed text based on the question text and each reference document data, wherein the reference parsed text is a text obtained by parsing the question text based on the reference document data;

[0013] According to the reference parsed text and each document data, obtaining matching weight information corresponding to each document data;

[0014] Based on the matching weight information corresponding to each document data, at least one target document data is determined in each document data, and according to the question text and each target document data, an answer text corresponding to the question instruction is generated;

[0015] The answer text is returned to the terminal device.

[0016] According to a third aspect of an embodiment of this specification, a computing device is provided, including:

[0017] Memory and processor;

[0018] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the above-mentioned automatic question-answering method are implemented.

[0019] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned automatic question-answering method are implemented.

[0020] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instruction, which implements the steps of the above-mentioned automatic question-answering method when executed by a processor.

[0021] An embodiment of the present specification implements the steps of receiving a question instruction and determining a document database corresponding to the question instruction, wherein the question instruction includes a question text and the document database includes at least one document data; determining at least one reference document data in the document database, and generating a reference parsed text based on the question text and each reference document data, wherein the reference parsed text is a text obtained by parsing the question text based on the reference document data; obtaining matching weight information corresponding to each document data based on the reference parsed text and each document data; determining at least one target document data in each document data based on the matching weight information corresponding to each document data, and generating an answer text corresponding to the question instruction based on the question text and each target document data.

[0022] By applying the solution of the embodiments of this specification, a reference parsed text of the question text is obtained, and matching weight information corresponding to each document data is determined based on the reference parsed text. The more logical and written language in the reference parsed text can be used to select a target document that is conducive to generating a correct response, and then the answer corresponding to the question text is generated based on the selected target document, thereby improving the accuracy of automatic answers. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a flow chart of an automatic question-answering method provided by an embodiment of this specification;

[0024] Figure 2 is a schematic diagram of a method for calculating parsing relevance information provided by an embodiment of this specification;

[0025] Figure 3 is a flow chart of an automatic question-answering method applied to a cloud device provided by an embodiment of this specification;

[0026] Figure 4 is an architecture diagram of an automatic question-answering system provided by an embodiment of this specification;

[0027] Figure 5 is a process flow chart of a question answering method provided by an embodiment of the present specification;

[0028] Figure 6 It is a process flow chart of a legal knowledge question and answer method provided by an embodiment of this specification;

[0029] Figure 7 is a structural schematic diagram of an automatic question-answering device provided by an embodiment of this specification;

[0030] Figure 8 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0031] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0032] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0033] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0034] In addition, it should be noted that 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 one or more embodiments of this specification 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 the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0035] In one or more embodiments of this specification, a large model refers to a deep learning model with large-scale model parameters, which usually contains hundreds of millions, tens of billions, hundreds of billions, trillions, or even more than 10 trillion model parameters. A large model can also be called a foundation model / foundation model. The large model is pre-trained with large-scale unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks, and the model has good generalization ability, such as a large-scale language model (LLM), a multi-modal pre-training model, etc.

[0036] When the big model is used in practice, only a small number of samples are needed to fine-tune the pre-trained model and it can be applied to different tasks. The big model can be widely used in natural language processing (NLP), computer vision and other fields. Specifically, it can be applied to computer vision tasks such as visual question answering (VQA), image caption (IC), image generation, as well as natural language processing tasks such as text-based sentiment classification, text summary generation, and machine translation. The main application scenarios of the big model include digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, etc.

[0037] First, the terms involved in one or more embodiments of this specification are explained.

[0038] Word embedding method: It is a technology that converts words in text data into numerical form. Through this conversion, computers can process language information more efficiently. These methods are implemented by representing each word as a real vector, so that the semantic relationship between words is reflected in the vector space. The dimension of the vector is generally low. Compared with the original vocabulary space, this representation method helps to improve the efficiency and effectiveness of the algorithm. Common word embedding technologies include word to vector (Word to Vector), global vector word embedding (Global Vectors for Word Representation, referred to as GloVe), etc.

[0039] Reciprocal Rank Fusion (RPF): is a technique for merging multiple search result lists. It provides an effective way to combine multiple query results by assigning each result a reciprocal score based on its rank and summing all the reciprocal scores for the same result. This method maps the results of multiple recalls to the same value space according to their ranking, aligning the scoring criteria and thus improving the accuracy of the ranking results.

[0040] Best Matching 25 (BM25) algorithm: is a widely used ranking function for evaluating the relevance between queries and documents in information retrieval systems. The algorithm is based on a probabilistic retrieval framework and takes into account two factors: term frequency and inverse document frequency. BM25 assigns a weight to each term, which increases with the frequency of the term in the document, but decreases with the increase in term frequency, thereby avoiding excessive impact on the score.

[0041] Elasticsearch (ES) library: It is a library that provides keyword-related search and analysis. It is specially designed to handle fast search, storage, and analysis of large amounts of data. It supports structured and unstructured data, and users can easily execute and manage complex query operations.

[0042] In this specification, an automatic question-answering method is provided, an automatic question-answering method applied to a cloud device. This specification also involves an automatic question-answering device, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.

[0043] See also Figure 1 , Figure 1 A flowchart of an automatic question-answering method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0044] Step 102: Receive a question instruction, and determine a document database corresponding to the question instruction, wherein the question instruction includes a question text, and the document database includes at least one document data.

[0045] In practical applications, question instructions are instructions for obtaining answer text corresponding to question text, the document database is a database related to the question instructions, the question text is the text for which the answer needs to be obtained, and the document data is document data composed of knowledge in the field corresponding to the question instructions.

[0046] Specifically, the question instruction can be understood as an instruction for obtaining the answer text. The question instruction can be sent by the user or automatically generated by the program, and this specification does not impose any restrictions on this. Determining the document database corresponding to the question instruction can be understood as obtaining a document database that better matches the knowledge required by the question text carried in the question instruction. The document database can be understood as a library that includes at least one document data corresponding to a certain field of knowledge. The multiple document data included in the same document database are document data including the same field of knowledge.

[0047] It should be noted that the document data may be the document text directly stored, but considering that storing the document text will take up a lot of storage space, the document data may optionally be the data after the document text is processed. The document text may be processed by dividing the document text into blocks and then obtaining at least one vector corresponding to each document through a word embedding method, where each vector is the document data corresponding to the document. Alternatively, the keywords corresponding to the document text may be obtained, and the index of each document may be generated according to the weight of each keyword. Subsequently, the document may be processed into compressed data with an index in the form of a dictionary, and so on. By obtaining a document database including multiple document data corresponding to the problem instruction instead of obtaining a document text library including multiple document texts, the storage space required to execute the method may be reduced by performing vectorization processing, dictionary processing, and other compression methods on the text, thereby reducing the storage pressure of the device running the method.

[0048] In one embodiment provided in the present specification, a question instruction sent by a user is received, and the question instruction carries the question text "What is the current distribution of major manufacturers and their market share in the global electric vehicle market?". The document database corresponding to the question instruction is an electric vehicle industry analysis document database, which includes sales status document data, market share document data, consumer preference document data, technology development document data, and other document data.

[0049] By determining the document database corresponding to the question text, the confirmation scope of the target document can be reduced, thereby improving the efficiency of determining the target document data corresponding to the question instruction.

[0050] Furthermore, the document database is generated through the following steps: obtaining at least one document text and a document database description text; processing each document text according to a preset text vector strategy to generate document data corresponding to each document text, wherein the text vector strategy is used to perform vectorization processing on each document text; and determining the document database corresponding to each document text based on the document database description text and each document data.

[0051] In practical applications, the document database description text is a text that describes the knowledge field corresponding to each document data in the document database, and is used to determine the document database corresponding to the question instruction. The text vector strategy is a strategy for vectorizing each document text.

[0052] Specifically, the text vector strategy can be understood as a strategy for compressing the document text to reduce the storage pressure of the device running the method. Since the document has a long text and the length of the vector converted by the word embedding method is limited, it is optional to first segment the document text, and then convert each segmented text segment into a vector. The converted multiple vectors are the document data corresponding to the document text.

[0053] It should be noted that the document database description text can be obtained by extracting the similarities of each document text through a deep learning model and automatically generating text that describes the common domain knowledge covered by the above document texts. It can also be input by the user who uploaded the document text. This manual does not impose any restrictions on this.

[0054] In one embodiment provided in the present specification, sales status document text, market share document text, consumer preference document text, technology development document text, and other document texts are received, and description text for each document text is received. "It is a resource library that specifically stores and provides information about market conditions, trend analysis, consumer behavior, competitor analysis, etc. in various industries." After dividing each document text into text paragraphs of fixed length, each text paragraph is subjected to a word embedding method to generate each vector, and then each vector and the above-mentioned description text are combined to determine the document database.

[0055] By obtaining the document database description text that describes the knowledge domain covered by the document database, the efficiency of subsequently determining the document database corresponding to the question text can be made higher, thereby improving the efficiency of determining the target document data corresponding to the question instruction.

[0056] Furthermore, a question instruction is received, and a document database corresponding to the question instruction is determined, including: parsing the question instruction to determine a question text; in the case where the question text needs to determine a corresponding document database, obtaining at least one initial document database and an initial document database description text corresponding to each document database; calculating library description relevance information between the question text and each initial document database description text, and determining a target document database description text based on the library description relevance information corresponding to each initial document database description text; determining that the initial document database corresponding to the target document database description text is the document database corresponding to the question instruction.

[0057] In actual applications, the initial document database is the document database corresponding to the various fields of knowledge involved in a specific scenario, the initial document database description text is the description text corresponding to each document database, the library description relevance information is the degree of correlation between the problem text and the description texts of each initial document database, and the target document database description text is the document database description text that is more relevant to the problem text.

[0058] Specifically, judging whether the question text needs to determine the corresponding document database can be understood as determining whether the question requires specific information in a specific scenario before it can be answered.

[0059] In one embodiment provided in this specification, the question text obtained is "What is the current distribution of major manufacturers and their market share in the global electric vehicle market?". Since this question involves professional knowledge in the electric vehicle scenario, the question text needs to determine the corresponding document database.

[0060] In another embodiment provided in the present specification, the question text obtained is "What shape will you get if you fold a square piece of paper in half once?" Since the question does not involve any knowledge information in any specific scenario and only requires logical inference to answer, determining the question text does not require determining the corresponding document database.

[0061] By determining the degree of correlation between the question text and the description text of each initial document database (library description correlation information), the document database that is more relevant to the field involved in the question text can be determined. Compared with judging all document data in all databases, the number of judgments can be effectively reduced, thereby improving the efficiency of judgment, thereby improving the efficiency of determining the target document data corresponding to the question instruction.

[0062] Step 104: Determine at least one reference document data in the document database, and generate a reference parsed text based on the question text and each reference document data, wherein the reference parsed text is a text obtained by parsing the question text based on the reference document data.

[0063] In practical applications, the reference document data is document data used to generate reference parsed text, and the reference parsed text is parsed text of the question text based on the reference document data.

[0064] Specifically, the reference document data can be understood as document data that is relatively relevant to the question text. The reference parsed text can be understood as the parsed text for the question text automatically obtained based on the reference document data. The reference document data can be determined by using a pre-trained classification model to determine the category of the question text, and then determining the document data corresponding to the question text based on the pre-set category information corresponding to each document data, or by determining the similarity between the question text and each document data, and then determining the reference document data based on the similarity.

[0065] In one embodiment provided in the present specification, following the above example, since the question text mainly involves the specific situation of various manufacturers in the electric vehicle field in the market, the reference document data used to parse the question text is determined to be sales situation document data, market share document data and consumer preference document data.

[0066] By parsing the question text with reference document data and generating a reference parsed text, the reference parsed text can be made more accurate, which in turn can improve the accuracy of subsequent determination of target document data based on the reference parsed text, making the determined target document data more accurate, thereby improving the accuracy of automatic answers to questions.

[0067] Furthermore, a reference parsed text is generated based on the question text and each reference document data, including: obtaining at least one reference document text according to each reference document data; generating a text to be parsed based on the question text and each reference document text, wherein the text to be parsed is a prompt text for enabling a parsing generation model to generate a reference parsed text corresponding to the question text; and inputting the text to be parsed into the parsing generation model to obtain a reference parsed text output by the parsing generation model.

[0068] In practical applications, the reference document text is the text corresponding to the reference document data, and the text to be parsed is the text of the input value parsing generation model so that the parsing generation model outputs the reference parsing text.

[0069] Specifically, the specific method of generating the text to be parsed can be directly splicing the reference parsed text and the question text, and inputting the spliced ​​text into the parsing generation model so that the parsing generation model generates a reference parsed text for the question text. It can also be generating a prompt word template through parsing, combining the reference document text and the question text to generate the text to be parsed, etc. This manual does not impose any restrictions on this.

[0070] It should be noted that the parsing generation model can be understood as any text processing model that can perform text processing. Considering the accuracy of the output reference parsed text, a large language model can be optionally used to process the text to be parsed.

[0071] In an embodiment provided in the present specification, taking the example of combining the reference document text and the question text by parsing to generate a prompt word template to generate a text to be parsed, the generation of a reference parsed text using a parsing generation model is explained, and the corresponding parsing generation prompt word template is: "Question text: [Enter the question text here] Related documents: [Enter the reference document text here] Request parsing: Based on the above question text and related documents, provide a detailed analysis to explain the background of the problem, the key factors involved, and possible answers or solutions", and then insert the question text and the reference document text into the prompt word template to obtain the text to be parsed, and then input the obtained text to be parsed into the parsing generation model to obtain the reference parsed text.

[0072] Due to the problem of server storage space, the reference document data is not directly stored in the server in the form of text, so it is necessary to first convert the reference document data into reference document text, and then generate the text to be parsed based on each reference document text and the question text, so that the parsing generation model can more accurately generate the parsing corresponding to the question.

[0073] Furthermore, at least one reference document data is determined in the document database, including: generating question relevance information corresponding to each document data based on the question text and each document data, wherein the question relevance information represents the degree of relevance between each document data and the question text; obtaining reference sequence information corresponding to each document data based on the question relevance information corresponding to each document data; and determining at least one reference document data based on the reference sequence information corresponding to each document data.

[0074] In practical applications, the question relevance information is information used to reflect the degree of matching between the document data and the question text, and the reference sequence information represents the ranking of the relevance between the document data and the question text in each document data.

[0075] Specifically, determining the question relevance information of each document can be understood as calculating the degree of association between each question and answer and the question text. That is, the method of obtaining the question relevance information can be any method of determining the degree of association between the document and the question text, and this specification does not impose any restrictions on this.

[0076] In an embodiment provided in the present specification, taking the determination of keyword similarity between the question text and each document as question relevance information as an example, the keyword similarity is calculated by, for example, the BM25 (Best Matching 25) algorithm, the corresponding text of each document data is directly added to the ES (Elasticsearch) library, and the keyword similarity is directly obtained by using the method provided by the ES library, etc. The keyword similarity acquisition method obtains the keyword similarity between each document and the question text, and the question relevance is determined by the keyword similarity corresponding to each document.

[0077] In another embodiment provided in the present specification, taking determining the text feature similarity between the question text and each document as the question relevance information as an example, for example, any text processing model is used to extract the text features corresponding to the question text and the document text, the text feature similarity between the text features is calculated, the text features of the document data processed by the text processing model are added to the ES library, the method provided by the ES library is used to directly obtain the text feature similarity between the question text and each document data, and so on, to obtain the feature similarity between each document and the question text, and the feature similarity corresponding to each document is used to determine the question relevance.

[0078] It should be noted that the relevance between the document and the question text may also be determined by using the keyword similarity and feature similarity between each document and the question text to determine the question relevance between the document and the question text.

[0079] By calculating the degree of correlation between each document data and the question text, determining and sorting each document data according to the degree of correlation, and then obtaining document data with a higher degree of correlation with the question text as reference document data for parsing, document data with a higher degree of correlation with the question text can be selected for parsing the question text, thereby improving the accuracy of the reference parsed text.

[0080] Furthermore, based on the question text and each document data, question relevance information corresponding to each document data is generated, including: obtaining question keyword attribute information corresponding to the question text; determining first document data, wherein the first document data is any one of the document data; obtaining first document keyword attribute information corresponding to the first document data, and generating question keyword relevance information based on the question keyword attribute information and the first document keyword attribute information; obtaining question feature information corresponding to the question text and first document feature information corresponding to the first document data, and generating question feature relevance information based on the question feature information and the first document feature information; obtaining question relevance information corresponding to the first document data based on the question keyword relevance information and the question feature relevance information.

[0081] In practical applications, question keyword attribute information is information that characterizes keyword attributes in question text, document keyword attribute information is information that characterizes keyword attributes in document data, question keyword relevance information is the degree of relevance between document data and question text in terms of keywords, question feature information is text feature information corresponding to question text, document feature information is text feature information corresponding to document data and document text, and question feature relevance information is the degree of relevance between document data and question text in terms of text features.

[0082] Specifically, the specific method based on the question keyword relevance information and the question feature relevance information can be to perform weighted summation on the above question keyword relevance information and the question feature relevance information according to preset weights to obtain question relevance information that represents the relevance degree between the document data and the question text; it can also be to use RPF (Reciprocal Rank Fusion) to process the above question keyword relevance information and the question feature relevance information to obtain question relevance information that represents the relevance degree between the document data and the question text.

[0083] By determining the relevance between the document data and the question text in terms of keywords and text features, the relevance between the document data and the question text can be used to provide more comprehensive and accurate search results by using the comprehensiveness of keyword-direction relevance and the deep semantic understanding of text feature-direction relevance. This can further make the calculation method of the relevance between the document data and the question text more accurate.

[0084] Step 106: Acquire matching weight information corresponding to each document data according to the reference parsed text and each document data.

[0085] In practical applications, the matching weight information is information representing the degree of matching between the document data and the question instruction.

[0086] Specifically, the matching weight information can be understood as the importance of each document data when answering the question instruction. Determining the matching weight information of each document data by referring to the parsed text can be understood as obtaining a more logical reference parsed text with a more comprehensive description of the question text through further parsing the question text, and calculating the importance of each document data and the answer corresponding to the question instruction based on the reference parsed text, so that when the document data corresponding to the answer to the question instruction is selected for reference in the subsequent selection, more matching document data can be selected, thereby improving the accuracy of automatic answering.

[0087] Furthermore, according to the reference parsed text and each document data, matching weight information corresponding to each document data is obtained, including: according to the reference parsed text and each document data, obtaining parsing relevance information corresponding to each document data, wherein the question relevance information represents the degree of relevance between each document data and the reference parsed text; based on the question relevance information and parsing relevance information corresponding to each document data, determining the matching weight information corresponding to each document data.

[0088] In practical applications, the parsing relevance information is information used to reflect the degree of matching between document data and reference parsed text.

[0089] Specifically, determining the parsing relevance information of each document can be understood as calculating the degree of association between each question and answer and the reference parsing text. That is, the method of obtaining the parsing relevance information can be any method of determining the degree of association between the document and the reference parsing text, and this specification does not impose any restrictions on this.

[0090] refer to Figure 2 , Figure 2 This is a schematic diagram of a method for calculating parsing relevance information provided by an embodiment of the present specification. In this embodiment, three document data are included, namely document data 1, document data 2, and document data 3. The parsing relevance information corresponding to the above three document data is calculated by referring to the parsed text to obtain parsing relevance information 1 corresponding to document data 1, parsing relevance information 2 corresponding to document data 2, and parsing relevance information 3 corresponding to document data 3.

[0091] In an embodiment provided in the present specification, taking the determination of keyword similarity between a reference parsed text and each document as parsing relevance information as an example, keyword similarity is calculated by, for example, the BM25 algorithm, the corresponding text of each document data is directly added to the ES library, and the keyword similarity is directly obtained by using the method provided by the ES library, etc. to obtain the keyword similarity, and the parsing relevance is determined by the keyword similarity corresponding to each document.

[0092] In another embodiment provided in the present specification, taking the determination of the text feature similarity between the reference parsed text and each document as the parsing relevance information as an example, for example, any text processing model is used to extract the text features corresponding to the reference parsed text and the document text, the text feature similarity between the text features is calculated, the text features of the document data after being processed by the text processing model are added to the ES library, the method provided by the ES library is used to directly obtain the text feature similarity between the reference parsed text and each document data, and so on, to obtain the feature similarity between each document and the reference parsed text, and the parsing relevance is determined by the feature similarity corresponding to each document.

[0093] It should be noted that the relevance between a document and a reference parsed text may also be determined by using keyword similarity and feature similarity between each document and the reference parsed text to determine its parsed relevance with the reference parsed text.

[0094] It should be noted that, according to the question relevance information and analysis relevance information corresponding to each document data, the matching weight information corresponding to each document data is determined, which can be understood as determining the matching weight information corresponding to each document through the question text and the reference analysis text and the document data. Specifically, according to the question relevance information and analysis relevance information corresponding to each document data, the matching weight information corresponding to each document data is determined, which can be sorting each document data according to the relevance information and analysis relevance information corresponding to each document data, selecting document data with a high ranking in both rankings (that is, document data with a higher correlation with the question text and the question analysis than other documents), and determining its corresponding matching weight information according to its ranking; or it can be by calculating the weighted sum between the question relevance information and the analysis relevance information corresponding to a single document data, and using the calculated result as its corresponding matching weight information, and this specification does not impose any restrictions on this.

[0095] Since the reference parsed text is generated by the large model through the question text and reference data features, the importance of the document data in generating the answer is determined by the degree of association between the document data and the question text and the degree of association between the reference parsed texts. This can be understood as utilizing the generative reasoning ability of the large model to obtain documents that are more suitable for the answer model to generate the correct answer. Also, since the reference parsed text is generated by the large model, it is further equivalent to letting a large model select target document data for the answer model (which can be understood as homogeneous communication between models). Compared with manually collecting data and training a document selection model based on the collected data, the target document data is selected according to the model. Through homogeneous communication between models, more implicit knowledge can be included, and then documents that are more conducive to the model generating correct answers can be selected.

[0096] Furthermore, based on the question relevance information and the analysis relevance information corresponding to each document data, the matching weight information corresponding to each document data is determined, including: determining third document data, and determining third question relevance information and third analysis relevance information corresponding to the third document data, wherein the third document data is any one of the document data; based on the third question relevance information and the third analysis relevance information, obtaining the matching weight information corresponding to the third document data.

[0097] Specifically, the matching weight information corresponding to the document data can be determined by using the question relevance information and analysis relevance information corresponding to a single document data. The method can be to calculate the weighted sum between the above-mentioned question relevance information and analysis relevance information, and use the calculated result as the corresponding matching weight information. The method can also be to calculate the weighted sum between the question relevance information and analysis relevance information that is greater than a preset threshold and use the calculated result as the corresponding matching weight information, and so on. This specification does not impose any restrictions on this.

[0098] By determining the matching weight information corresponding to the document data through the question relevance information and analysis relevance information corresponding to the single document data, a document that is more conducive to the model generating the correct answer can be selected.

[0099] Furthermore, according to the reference parsed text and each document data, parsed relevance information corresponding to each document data is obtained, including: generating a to-be-processed parsed text according to the reference parsed text, and obtaining parsed keyword attribute information corresponding to the to-be-processed parsed text, wherein the to-be-processed parsed text is a text used to calculate the degree of association between document data and the reference parsed text; determining second document data, and obtaining second document keyword attribute information corresponding to the second document data, wherein the second document data is any one of the document data; generating parsed keyword relevance information based on the parsed keyword attribute information and the second document keyword attribute information; obtaining parsed feature information corresponding to the to-be-processed parsed text and second document feature information corresponding to the second document data, and generating second parsed feature relevance information based on the parsed feature information and the second document feature information; obtaining parsed relevance information corresponding to the second document data based on the parsed keyword relevance information and the parsed feature relevance information.

[0100] In actual applications, the text to be processed and parsed is the text used to calculate the degree of association between each document data and the reference parsed text, the parsed keyword attribute information is the information that characterizes the attributes of the keywords in the parsed text to be processed, the parsed keyword relevance information is the degree of correlation between the document data and the parsed text to be processed in terms of keywords, the parsed feature information is the text feature information corresponding to the parsed text to be processed, the document feature information is the text feature information corresponding to the document data and the document text, and the parsed feature relevance information is the degree of correlation between the document data and the parsed text to be processed in terms of text features.

[0101] Specifically, the parsed text to be processed can be understood as text used to calculate the degree of correlation between the corresponding parsing of document data and question text. The parsed text to be processed can be a reference parsed text, or a text generated by concatenating the reference parsed text and the question text, or the reference parsed text can be further processed by a large language model to highlight the key points of the reference parsed text. This specification does not impose any restrictions on this.

[0102] By determining the correlation between the document data and the reference parsed text in terms of keywords and text features, the correlation between the document data and the reference parsed text can be used to provide more comprehensive and accurate search results by using the comprehensiveness of the correlation in the keyword direction and the deep semantic understanding of the correlation in the text feature direction. This can make the calculation method of the correlation between the document data and the reference parsed text more accurate.

[0103] Furthermore, generating the to-be-processed parsed text according to the reference parsed text includes: concatenating the question text and the reference parsed text to generate the to-be-processed parsed text; or determining the reference parsed text as the to-be-processed parsed text.

[0104] Using both question text and parsed text to determine document similarity provides more comprehensive content coverage and enhanced semantic understanding than using only parsed text. This approach combines the specific information needs of the question with the detailed context of the parsing, thereby more comprehensively covering relevant topics and concepts, and improving the relevance of the calculated document data to the parsing corresponding to the question instructions, so that document data with a higher degree of relevance can be selected for answer text generation, thereby ensuring that the results are highly relevant in meeting the actual needs of users.

[0105] Step 108: Based on the matching weight information corresponding to each document data, at least one target document data is determined in each document data, and according to the question text and each target document data, an answer text corresponding to the question instruction is generated.

[0106] In actual applications, the target document data is document data used to generate an answer text for a question instruction, and the answer text is a text that answers the question described in the question text in the question instruction.

[0107] Specifically, the target document data can be understood as document data that is more closely matched with the question instruction, and the answer text can be understood as the text output by the model for the question text based on the target document data.

[0108] Furthermore, based on the question text and each target document data, an answer text corresponding to the question instruction is generated, including: obtaining at least one target document text based on each target document data; generating a text to be answered based on the question text and each target document text, wherein the text to be answered is a prompt text that enables the question-answering model to generate an answer text corresponding to the question text; and inputting the text to be answered into the question-answering model to obtain the answer text output by the question-answering model.

[0109] In actual applications, the target document text is the text corresponding to the target document data, the text to be answered is the text input into the question-answering model so that the question-answering model outputs the answer text, and the question-answering model is a model used to output the answer text in response to question instructions.

[0110] Specifically, the answer model can be understood as any text processing model that can perform text processing. The answer model can have the same model structure and parameters as the above-mentioned parsing generation model, or a deep learning model different from the above-mentioned parsing generation model can be used as a question-answering model. Considering the accuracy of the output answer text, optionally, a model with adjusted model parameters for the target scenario is used. This specification does not impose any restrictions on the structure and parameters of the model.

[0111] It should be noted that the specific method of generating the text to be answered can be directly splicing the question text and the target document text, and inputting the spliced ​​text into the question-answering model so that the question-answering model generates an answer text for the question text. It can also be generating a prompt word template through answering, combining the target document text and the question text to generate the text to be answered, etc. This manual does not impose any restrictions on the method of generating the text to be answered.

[0112] In an embodiment provided in the present specification, taking the example of combining the target document text and the question text through an answer generation prompt word template to generate the text to be answered, the generation of the answer text using the question and answer model is explained, and the corresponding answer generation prompt word template is: "Question text: [Enter the question text here] Related documents: [Enter the target document text here] Request analysis: Based on the above question text and related documents, generate a detailed answer. This answer should explain the answer to the question in a specific and accurate manner, and provide supporting evidence or arguments in combination with the information in the document data." The question text and the target document text are then inserted into the prompt word template to obtain the text to be answered, and then the obtained text to be answered is input into the question and answer model to obtain the answer text.

[0113] By applying the scheme of the embodiments of the present specification, the document database corresponding to the question text is first determined, which can reduce the confirmation scope of the target document. Subsequently, the reference document is determined based on the question relevance information between the question text and the document data in the document database, and the reference parsed text of the question text is determined based on the reference document. This can improve the accuracy of the reference parsed text, and further improve the accuracy of determining the target document data based on the reference parsed text. Subsequently, the large model is used to generate the parsed relevance information corresponding to each document data based on the above-mentioned reference parsed text, and then the matching weight corresponding to the document is determined based on the question relevance information and parsed relevance information of each document. The reasoning and analysis capabilities of the large model can be effectively used to obtain a more logical and accurate reference parsed text, so that the target document data determined using the reference parsed text is more conducive to the large model generating a document with a correct response, thereby improving the accuracy of the model's answer.

[0114] Corresponding to the above method embodiment, this specification also provides an automatic question-answering method embodiment applied to a cloud device, see Figure 3 , Figure 3 A flowchart of an automatic question-answering method applied to a cloud device provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0115] Step 302: receiving a question instruction sent by a terminal-side device, and determining a document database corresponding to the question instruction, wherein the question instruction includes a question text, and the document database includes at least one document data.

[0116] Step 304: Determine at least one reference document data in the document database, and generate a reference parsed text based on the question text and each reference document data, wherein the reference parsed text is a text obtained by parsing the question text based on the reference document data.

[0117] Step 306: According to the reference parsed text and each document data, obtain the matching weight information corresponding to each document data.

[0118] Step 308: Based on the matching weight information corresponding to each document data, at least one target document data is determined in each document data, and according to the question text and each target document data, an answer text corresponding to the question instruction is generated.

[0119] Step 310: Return the answer text to the terminal device.

[0120] Furthermore, before the question instruction is sent by the receiving device, the method also includes: at least one initial document database sent by the receiving device; or at least one document text sent by the receiving device, generating at least one initial document database based on each document text.

[0121] Specifically, considering that it takes a long time to store each document, the end-side device can complete the conversion of the document data before receiving the question instruction, that is, before generating the answer to the question, and then the user transmits the document data to the cloud device. Considering the computing power required to process the document text into document data, the end-side device can also send the document text to the cloud device, and the cloud device can complete the processing of the document data, which can reduce the computing power requirements of the end-side device and thus improve the efficiency of answering questions.

[0122] The above is a schematic scheme of an automatic question-answering method applied to a cloud device in this embodiment. It should be noted that the technical scheme of the automatic question-answering method applied to the cloud device belongs to the same concept as the technical scheme of the automatic question-answering method described above. For details not described in detail in the technical scheme of the automatic question-answering method applied to the cloud device, please refer to the description of the technical scheme of the automatic question-answering method described above.

[0123] By applying the scheme of the embodiments of the present specification, the question instructions and the initial document database sent by the receiving end-side device can improve the accuracy of determining the document database corresponding to the question text. Moreover, since the steps for answering questions that have higher hardware requirements are run on the cloud device, the end-side device only sends the question instructions and the initial document database or document text, which can effectively reduce the resource consumption of the end-side device, thereby improving the efficiency of answering questions. Moreover, since cloud devices usually have a higher hardware level, a large model with higher computing power requirements can be deployed to answer questions, thereby improving the accuracy of the model's answers. Moreover, the matching weight information corresponding to each document data is determined based on the reference parsed text, and the more logical and written language in the reference parsed text can be used to select documents that are more conducive to the large model generating correct responses, thereby further improving the accuracy of the model's answers.

[0124] See also Figure 4 , Figure 4 The present invention shows an architecture diagram of an automatic question-answering system provided by an embodiment of the present specification. The automatic question-answering system may include a client 100 and a server 200; the client 100 is used to send a question instruction to the server 200, wherein the question instruction includes a question text; the server 200 is used to receive the question instruction and determine a document database corresponding to the question instruction, wherein the question instruction includes a question text, and the document database includes at least one document data; at least one reference document data is determined in the document database, and a reference parsed text is generated based on the question text and each reference document data, wherein the reference parsed text is a text that parses the question text based on the reference document data; according to the reference parsed text and each document data, matching weight information corresponding to each document data is obtained; based on the matching weight information corresponding to each document data, at least one target document data is determined in each document data, and an answer text corresponding to the question instruction is generated according to the question text and each target document data; the answer text is sent to the client 100; the client 100 is also used to receive the answer text sent by the server 200.

[0125] By applying the solution of the embodiments of the present specification, question instructions and an initial document database sent by a client are received, which can improve the accuracy of determining the document database corresponding to the question text. Moreover, since the steps for answering questions that have higher hardware requirements are run on the server, the client only sends the question instructions and the initial document database or document text, which can effectively reduce the resource consumption of the client, thereby improving the efficiency of answering questions. Moreover, since the server usually has a higher hardware level, a large model with higher computing power requirements can be deployed to answer questions, thereby improving the accuracy of the model answer. Moreover, the matching weight information corresponding to each document data is determined based on the reference parsed text, and the more logical and written language in the reference parsed text can be used to select documents that are more conducive to the large model generating correct responses, thereby further improving the accuracy of the model answer.

[0126] The automatic question-answering system may include multiple clients 100 and a server 200, wherein the client 100 may be referred to as a client-side device and the server 200 may be referred to as a cloud device. Multiple clients 100 may establish a communication connection through the server 200. In the automatic question-answering scenario, the server 200 is used to provide automatic question-answering services between multiple clients 100. Multiple clients 100 may serve as a sender or a receiver, respectively, and achieve communication through the server 200.

[0127] The user can interact with the server 200 through the client 100 to receive data sent by other clients 100, or send data to other clients 100, etc. In the automatic question-answering scenario, the user can publish a data stream to the server 200 through the client 100, and the server 200 generates an answer text according to the data stream and pushes the answer text to other clients that have established communication.

[0128] The client 100 and the server 200 are connected via a network. The network provides a medium for a communication link between the client 100 and the server 200. The network may include various connection types, such as wired or wireless communication links or optical fiber cables, etc. The data transmitted by the client 100 may need to be encoded, transcoded, compressed, etc. before being released to the server 200.

[0129] The client 100 can be a browser, an APP (Application), or a web application such as an H5 (HyperText Markup Language 5, Hypertext Markup Language Version 5) application, or a light application (also known as a mini-program, a lightweight application) or a cloud application, etc. The client 100 can be based on the software development kit (SDK, Software Development Kit) of the corresponding service provided by the server 200, such as based on the real-time communication (RTC, Real Time Communication) SDK development and acquisition. The client 100 can be deployed in an electronic device and needs to rely on the device to run or some APPs in the device to run. For example, the electronic device can have a display screen and support information browsing, such as a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, etc. Various other types of applications can also be configured in the electronic device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0130] The server 200 may include servers that provide various services, such as servers that provide communication services to multiple clients, servers for background training that support models used on clients, and servers that process data sent by clients. It should be noted that the server 200 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server for basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0131] It is worth noting that the automatic question-answering method provided in the embodiments of this specification is generally executed by the server, but in other embodiments of this specification, the client may also have similar functions to the server, thereby executing the automatic question-answering method provided in the embodiments of this specification. In other embodiments, the automatic question-answering method provided in the embodiments of this specification may also be jointly executed by the client and the server.

[0132] The following combination Figure 5 , taking the application of the automatic question answering method provided in this specification in question answering as an example, the automatic question answering method is further described. Among them, Figure 5A process flow chart of a question answering method provided by an embodiment of the present specification is shown, which specifically includes the following steps.

[0133] Step 502: Generate at least one initial document database according to the document text.

[0134] Step 504: Receive a question instruction, and parse the question instruction to obtain the question text.

[0135] Step 506: Determine whether the question text requires a document to answer based on the document database, if so, execute step 508, if not, execute step 524.

[0136] Step 508: Determine whether the question text has a corresponding document database, if so, execute step 510, if not, execute step 526.

[0137] Step 510: Determine the document database corresponding to the question text.

[0138] Step 512: Determine the question relevance information of each document in the document database according to the question text.

[0139] Step 514: Determine reference document data for generating reference parsed texts according to the question relevance information of each document, and generate reference parsed texts according to each reference document data.

[0140] Step 516: Determine the parsing relevance information of each document in the document database according to the reference parsing text.

[0141] Step 518: Generate matching weight information for each document by combining the question relevance information and analysis relevance information of each document.

[0142] Step 520: Select document data with a preset number of matching weight information as target document data.

[0143] Step 522: The answer model outputs an answer to the question text based on the question text and the target document text corresponding to each target document data.

[0144] Step 524: The answer model directly outputs the answer to the question text based on the question text.

[0145] Step 526: Directly output: "Sorry, existing knowledge cannot support answering this question."

[0146] By applying the solution of the embodiment of this specification, the question text input by the user is judged and the specific answer method of the question text is determined, which can effectively avoid determining the corresponding document database and calling the target document for all questions.

[0147] The following combination Figure 6Taking the application of the automatic question-answering method provided in this specification in legal knowledge question-answering as an example, the automatic question-answering method is further explained. Figure 6 A flowchart of the processing process of a legal knowledge question and answer method provided by an embodiment of this specification is shown, which specifically includes the following steps.

[0148] Step 602: Receive document text A uploaded by the user: "Work 1", document text B: "Case Collection 1" corresponding to Work 1, description text 1 for document A and document B: "Documents that store all information related to disputes between individuals or businesses. These documents usually contain detailed information about contract disputes, property rights, family affairs, etc. Disputes involving personal rights and responsibilities are tracked and analyzed through this document."

[0149] Step 604: Receive document text C: "Work 2" and document text D: "Case Collection 2" corresponding to Work 2 uploaded by the user.

[0150] Step 606: Process document text A according to the word embedding method to generate document data A, process document text B according to the word embedding method to generate document data B, combine document data A and document data B to generate document database α, and use description text 1 as the database description text corresponding to document database α.

[0151] Step 608: Process document text C according to the word embedding method to generate document data C, process document text D according to the word embedding method to generate document data D, combine document data C and document data D to generate document database β, and generate description text 2 according to the contents recorded in document text C and document data D, and use description text 2 as the database description text corresponding to document database α.

[0152] Specifically, description text 2 is: "A document that stores all information related to personal or social behavior violations. These documents usually include detailed information about theft, violence, fraud, etc. This document is used to track and analyze events of personal behavior and social responsibility."

[0153] Step 610: Receive a question instruction from a user including a question text: "There is a dispute over a lease contract between a landlord and a tenant. If the tenant sublets the lease without the landlord's consent, what are the consequences of the tenant's behavior?"

[0154] Step 612: through the large model, it is determined that the correlation between the question text and description text 1 is 0.9, and the correlation between the question text and description text 2 is 0.1, then the document database α corresponding to description text 1 is determined to be the document database corresponding to the question instruction.

[0155] Step 614: then extract the question keyword attribute information corresponding to the question text: landlord, tenant, lease contract, sublease, prosecution.

[0156] Step 616: Calculate the above keyword attribute information with the document keyword attribute information corresponding to "Work 1" to determine that the relevance of the problem keyword corresponding to "Work 1" is 0.9; calculate the above keyword attribute information with the document keyword attribute information corresponding to "Case 1" to determine that the relevance of the problem keyword corresponding to "Case 1" is 0.6.

[0157] Specifically, the method for confirming the relevance of the question keywords here can be to directly calculate the keyword similarity through the BM25 algorithm; or the corresponding text of each document data can be added to the ES library, and the method provided by the ES library can be used to directly obtain the keyword similarity, etc.

[0158] Step 618: Extract feature information of the question text, and calculate the above feature information with the feature information corresponding to "Work 1" to determine that the feature correlation of the question corresponding to "Work 1" is 0.8; calculate the above feature information with the feature information corresponding to "Case 1" to determine that the feature correlation of the question corresponding to "Case 1" is 0.9.

[0159] Specifically, the above-mentioned question feature relevance can be confirmed by extracting the text features corresponding to the question text and the document text through any text processing model, and calculating the text feature similarity between the text features; it can also be a method for obtaining feature similarity by adding the text features of the document data after being processed by the text processing model to the ES library, and using the method provided by the ES library to directly obtain the text feature similarity between the question text and each document data, etc.

[0160] Step 620: Since the question keyword relevance corresponding to "Work 1" is 0.9, the question feature relevance is 0.8, and the question keyword relevance corresponding to "Case 1" is 0.6, and the question feature relevance is 0.9, the question relevance information corresponding to "Work 1" is 1.7, and the question relevance information corresponding to "Case 1" is 1.5.

[0161] Specifically, the method for confirming the above-mentioned question relevance information may be to perform a weighted summation on the above-mentioned question keyword relevance information and the question feature relevance information (the direct summation recorded in the above-mentioned step 620 may be understood as setting the weights of both to 1 for weighted summation) to obtain question relevance information representing the degree of relevance between the document data and the question text; or the method for confirming the feature relevance information may be to utilize RPF to process the above-mentioned question keyword relevance information and the question feature relevance information to obtain question relevance information representing the degree of relevance between the document data and the question text, etc.

[0162] Step 622: Since it is necessary to determine a reference document data to generate a reference parsing text, the reference parsing text is generated using "Book 1" and the question text.

[0163] Specifically, the reference text is: "Contractual Breach: Under most rental laws, if the tenant violates an express term in the contract (such as subletting without permission), this constitutes a contractual breach. (From "Book 1" page ***)

[0164] Compensation liability: The tenant needs to compensate the landlord for direct losses caused by subletting.

[0165] Liquidated damages: If there is a liquidated damages clause in the lease contract, the tenant must also pay the liquidated damages in accordance with the contract.

[0166] Legal Action: The landlord has the right to bring an action in court to confirm the tenant’s breach of contract and to seek appropriate legal remedies, including but not limited to damages.”

[0167] It should be noted that the reason why a reference document data is required here is that in the current project requirements, it is configured to determine a reference document data to generate a reference parsed text. That is to say, the number of reference document data used to generate the reference parsed text is determined based on the actual project requirements and is not limited to using one reference document data to generate the reference parsed text.

[0168] Step 624: Then, respectively calculate and determine that the analytical relevance information corresponding to the reference analytical text and "Book 1" is 1.7, and the analytical relevance information corresponding to "Case 1" is 1.9.

[0169] Specifically, the method for confirming the analytical relevance between each of the above documents and the reference analytical text is similar to the method for confirming the question relevance between each of the above documents and the reference question text, and will not be repeated here.

[0170] Step 626: Set the parameter of the above question relevance information to 0.4, set the parameter of the analysis relevance information to 0.6, and calculate the matching weight information corresponding to "Work 1" to be 1.7 and the matching weight information corresponding to "Case 1" to be 1.74.

[0171] Step 628: Determine Case 1 as the target document data, and input "Case 1" and the question text into the question-answering model to obtain the answer text.

[0172] Specifically, the answer text is: "In most cases, if subletting is clearly prohibited in the contract, the tenant's unauthorized subletting constitutes a breach of contract. Referring to similar cases, for example, in the case numbered **** (recorded on page 341 of "Case 1"), the court found that the tenant Zhang violated the non-subletting clause in the lease contract and therefore needed to bear the following responsibilities: Compensation for losses: The court will usually require the tenant to compensate the landlord for actual losses caused by the breach of contract. This may include house maintenance costs, increased management costs, etc. due to subletting. Return of property: The court ruled that the tenant must terminate the contract early and return the house due to breach of contract. Payment of liquidated damages: According to the terms of the contract, if there is a liquidated damages clause, the tenant may also need to pay the agreed liquidated damages. Court enforcement: If the tenant refuses to execute the judgment, the landlord can apply to the court for compulsory enforcement to ensure the recovery of the house and compensation."

[0173] It should be noted that the reason for determining Case 1 as the target document data here is also because in the requirements of this project, it is configured to determine a target document data to generate an answer text. In other words, the target document data used to generate the answer data is also not limited to using a reference document data to generate a reference parsed text.

[0174] By applying the scheme of the embodiments of the present specification, the document database corresponding to the question text is first determined, which can reduce the confirmation scope of the target document. Subsequently, the reference document is determined based on the question relevance information between the question text and the document data in the document database, and the reference parsed text of the question text is determined based on the reference document. This can improve the accuracy of the reference parsed text, and further improve the accuracy of determining the target document data based on the reference parsed text. Subsequently, the large model is used to generate the parsed relevance information corresponding to each document data based on the above-mentioned reference parsed text, and then the matching weight corresponding to the document is determined based on the question relevance information and parsed relevance information of each document. The reasoning and analysis capabilities of the large model can be effectively used to obtain a more logical and accurate reference parsed text, so that the target document data determined using the reference parsed text is more conducive to the large model generating a correct response document, thereby improving the accuracy of legal answers.

[0175] Corresponding to the above method embodiment, this specification also provides an automatic question-answering device embodiment, Figure 7 FIG. 1 shows a schematic diagram of the structure of an automatic question-answering device provided by an embodiment of this specification. Figure 7 As shown, the device comprises:

[0176] The instruction receiving module 702 is configured to receive a question instruction and determine a document database corresponding to the question instruction, wherein the question instruction includes a question text and the document database includes at least one document data; the parsing generation module 704 is configured to determine at least one reference document data in the document database, and generate a reference parsing text based on the question text and each reference document data, wherein the reference parsing text is a text that parses the question text based on the reference document data; the weight acquisition module 706 is configured to acquire matching weight information corresponding to each document data based on the reference parsing text and each document data; the answer generation module 708 is configured to determine at least one target document data in each document data based on the matching weight information corresponding to each document data, and generate an answer text corresponding to the question instruction based on the question text and each target document data.

[0177] Optionally, the automatic question-and-answer device also includes a database generation module, which is configured to: obtain at least one document text and a document database description text; process each document text according to a preset text vector strategy to generate document data corresponding to each document text, wherein the text vector strategy is used to perform vectorization processing on each document text; determine the document database corresponding to each document text based on the document database description text and each document data.

[0178] Optionally, the instruction receiving module 702 is further configured to: parse the question instruction to determine the question text; when the question text needs to determine the corresponding document database, obtain at least one initial document database and the initial document database description text corresponding to each document database; calculate the library description relevance information between the question text and each initial document database description text, and determine the target document database description text according to the library description relevance information corresponding to each initial document database description text; determine that the initial document database corresponding to the target document database description text is the document database corresponding to the question instruction.

[0179] Optionally, the parsing generation module 704 is further configured to: obtain at least one reference document text based on each reference document data; generate a text to be parsed based on the question text and each reference document text, wherein the text to be parsed is a prompt text for enabling the parsing generation model to generate a reference parsing text corresponding to the question text; input the text to be parsed into the parsing generation model to obtain a reference parsing text output by the parsing generation model.

[0180] Optionally, the parsing generation module 704 is further configured to: generate question relevance information corresponding to each document data based on the question text and each document data, wherein the question relevance information represents the degree of relevance between each document data and the question text; obtain reference sequence information corresponding to each document data based on the question relevance information corresponding to each document data; and determine at least one reference document data based on the reference sequence information corresponding to each document data.

[0181] Optionally, the parsing generation module 704 is further configured to: obtain question keyword attribute information corresponding to the question text; determine first document data, wherein the first document data is any one of the document data; obtain first document keyword attribute information corresponding to the first document data, and generate question keyword relevance information based on the question keyword attribute information and the first document keyword attribute information; obtain question feature information corresponding to the question text and first document feature information corresponding to the first document data, and generate question feature relevance information based on the question feature information and the first document feature information; obtain question relevance information corresponding to the first document data based on the question keyword relevance information and the question feature relevance information.

[0182] Optionally, the weight acquisition module 706 is further configured to: acquire the analysis relevance information corresponding to each document data according to the reference analysis text and each document data, wherein the question relevance information represents the degree of relevance between each document data and the reference analysis text; and determine the matching weight information corresponding to each document data based on the question relevance information and analysis relevance information corresponding to each document data.

[0183] Optionally, the weight acquisition module 706 is further configured to: generate a to-be-processed parsed text based on the reference parsed text, and obtain parsed keyword attribute information corresponding to the to-be-processed parsed text, wherein the to-be-processed parsed text is a text used to calculate the degree of association between document data and the reference parsed text; determine second document data, and obtain second document keyword attribute information corresponding to the second document data, wherein the second document data is any one of the document data; generate parsed keyword relevance information based on the parsed keyword attribute information and the second document keyword attribute information; obtain parsed feature information corresponding to the to-be-processed parsed text and second document feature information corresponding to the second document data, and generate second parsed feature relevance information based on the parsed feature information and the second document feature information; obtain parsed relevance information corresponding to the second document data based on the parsed keyword relevance information and the parsed feature relevance information.

[0184] Optionally, the weight acquisition module 706 is further configured to: concatenate the question text and the reference parsed text to generate a parsed text to be processed; or determine that the reference parsed text is the parsed text to be processed.

[0185] Optionally, the weight acquisition module 706 is further configured to: determine third document data, and determine third question relevance information and third resolution relevance information corresponding to the third document data, wherein the third document data is any one of the document data; based on the third question relevance information and the third resolution relevance information, obtain matching weight information corresponding to the third document data.

[0186] Optionally, the answer generation module 708 is further configured to: obtain at least one target document text based on each target document data; generate a text to be answered based on the question text and each target document text, wherein the text to be answered is a prompt text that enables the question-answering model to generate an answer text corresponding to the question text; input the text to be answered into the question-answering model to obtain the answer text output by the question-answering model.

[0187] By applying the scheme of the embodiment of the present specification, the document database corresponding to the question text is first determined through the instruction receiving module, which can reduce the confirmation scope of the target document. Then, the parsing generation module determines the reference document according to the question relevance information between the question text and the document data in the document database, and determines the reference parsing text of the question text according to the reference document, which can improve the accuracy of the reference parsing text, and further improve the accuracy of determining the target document data according to the reference parsing text. Then, the weight acquisition module uses the large model to generate the parsing relevance information corresponding to each document data based on the above-mentioned reference parsing text, and determines the matching weight corresponding to the document according to the question relevance information and parsing relevance information of each document. The reasoning and analysis ability of the large model can be effectively used to obtain a more logical and accurate reference parsing text, so that the answer generation module can use the target document data determined by the reference parsing text to be more conducive to the large model to generate a correct reply document, thereby improving the accuracy of the model answer.

[0188] The above is a schematic scheme of an automatic question-answering device of this embodiment. It should be noted that the technical scheme of the automatic question-answering device and the technical scheme of the automatic question-answering method described above are of the same concept, and the details not described in detail in the technical scheme of the automatic question-answering device can be found in the description of the technical scheme of the automatic question-answering method described above.

[0189] Figure 8The block diagram of a computing device 800 according to an embodiment of the present specification is shown. The components of the computing device 800 include but are not limited to a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.

[0190] The computing device 800 also includes an access device 840 that enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 840 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).

[0191] In one embodiment of the present specification, the above components of the computing device 800 and Figure 8 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 8 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0192] The computing device 800 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 800 may also be a mobile or stationary server.

[0193] The processor 820 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the above-mentioned automatic question-answering method.

[0194] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the automatic question-answering method described above are of the same concept, and the details of the technical scheme of the computing device not described in detail can be found in the description of the technical scheme of the automatic question-answering method described above.

[0195] An embodiment of the present specification also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned automatic question-answering method.

[0196] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the automatic question-answering method described above are of the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the automatic question-answering method described above.

[0197] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned automatic question-answering method when executed by a processor.

[0198] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the automatic question answering method described above are of the same concept, and the details not described in detail in the technical scheme of the computer program can be found in the description of the technical scheme of the automatic question answering method described above.

[0199] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0200] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0201] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0202] In the above embodiments, 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.

[0203] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. An automatic question answering method, comprising: receiving a question instruction, and determining a document database corresponding to the question instruction, wherein the question instruction includes a question text, and the document database includes at least one document data; Generate question relevance information corresponding to each document data according to the question text and each document data; obtain reference sequence information corresponding to each document data based on the question relevance information corresponding to each document data; determine at least one reference document data according to the reference sequence information corresponding to each document data, and generate a reference parsed text based on the question text and each reference document data, wherein the reference parsed text is a text that parses the question text based on the reference document data, the question relevance information represents the degree of relevance between each document data and the question text, and the question relevance information corresponding to the document data is obtained by question keyword relevance information and question feature relevance information between the question text and the document data; According to the reference parsed text and each document data, obtaining matching weight information corresponding to each document data; Based on the matching weight information corresponding to each document data, at least one target document data is determined in each document data, and according to the question text and each target document data, an answer text corresponding to the question instruction is generated.

2. The method according to claim 1, generating question relevance information corresponding to each document data according to the question text and each document data, comprising: Obtaining question keyword attribute information corresponding to the question text; Determine first document data, wherein the first document data is any one of the document data; Acquire first document keyword attribute information corresponding to the first document data, and generate question keyword relevance information based on the question keyword attribute information and the first document keyword attribute information; Acquire question feature information corresponding to the question text and first document feature information corresponding to the first document data, and generate question feature relevance information based on the question feature information and the first document feature information; The question relevance information corresponding to the first document data is obtained according to the question keyword relevance information and the question feature relevance information.

3. The method according to claim 1, obtaining matching weight information corresponding to each document data according to the reference parsed text and each document data, comprising: According to the reference parsed text and each document data, obtaining parsed relevance information corresponding to each document data, wherein the question relevance information represents the degree of relevance between each document data and the reference parsed text; Based on the question relevance information and analysis relevance information corresponding to each document data, the matching weight information corresponding to each document data is determined.

4. The method according to claim 3, obtaining the parsing relevance information corresponding to each document data according to the reference parsed text and each document data, comprising: Generate a to-be-processed parsed text according to the reference parsed text, and obtain parsed keyword attribute information corresponding to the to-be-processed parsed text, wherein the to-be-processed parsed text is a text used to calculate the degree of association between document data and the reference parsed text; Determine second document data, and obtain second document keyword attribute information corresponding to the second document data, wherein the second document data is any one of the document data; generating parsing keyword relevance information based on the parsing keyword attribute information and the second document keyword attribute information; Acquire the parsing feature information corresponding to the parsed text to be processed and the second document feature information corresponding to the second document data, and generate the second parsing feature relevance information based on the parsing feature information and the second document feature information; The parsing relevance information corresponding to the second document data is acquired according to the parsing keyword relevance information and the parsing feature relevance information.

5. The method according to claim 4, generating the to-be-processed parsed text according to the reference parsed text, comprising: splicing the question text and the reference parsed text to generate a parsed text to be processed; or, Determine the reference parsed text as the parsed text to be processed.

6. The method according to claim 3, determining the matching weight information corresponding to each document data based on the question relevance information and the analysis relevance information corresponding to each document data, comprising: Determine third document data, and determine third question relevance information and third resolution relevance information corresponding to the third document data, wherein the third document data is any one of the document data; Based on the third question relevance information and the third analysis relevance information, matching weight information corresponding to the third document data is obtained.

7. The method according to claim 1, generating a reference parsed text based on the question text and each reference document data, comprising: Acquire at least one reference document text according to each reference document data; Generate a text to be parsed based on the question text and each reference document text, wherein the text to be parsed is a prompt text that enables the parsing generation model to generate a reference parsing text corresponding to the question text; The text to be parsed is input into a parsing generation model, and a reference parsed text output by the parsing generation model is obtained.

8. The method according to claim 1, generating an answer text corresponding to the question instruction according to the question text and each target document data, comprising: Acquire at least one target document text according to each target document data; Generate a text to be answered based on the question text and each target document text, wherein the text to be answered is a prompt text that enables the question-answering model to generate an answer text corresponding to the question text; The text to be answered is input into the question-answering model to obtain the answer text output by the question-answering model.

9. The method according to claim 1, wherein the document database is generated by: Obtain at least one document text and a document database description text; Process each document text according to the preset text vector strategy to generate document data corresponding to each document text, where: The text vector strategy is used to perform vectorization processing on each document text; The document database corresponding to each document text is determined according to the document database description text and each document data.

10. The method according to claim 1, receiving a question instruction and determining a document database corresponding to the question instruction, comprising: Parsing the question instruction to determine the question text; In the case where the question text needs to determine a corresponding document database, obtaining at least one initial document database and initial document database description text corresponding to each document database; Calculating the database description relevance information between the question text and each initial document database description text, and determining the target document database description text according to the database description relevance information corresponding to each initial document database description text; An initial document database corresponding to the target document database description text is determined to be the document database corresponding to the question instruction.

11. An automatic question-answering method, applied to a cloud device, comprising: A question instruction sent by a receiving terminal device is received, and a document database corresponding to the question instruction is determined, wherein the question instruction includes a question text, and the document database includes at least one document data; Generate question relevance information corresponding to each document data according to the question text and each document data; obtain reference sequence information corresponding to each document data based on the question relevance information corresponding to each document data; determine at least one reference document data according to the reference sequence information corresponding to each document data, and generate a reference parsed text based on the question text and each reference document data, wherein the reference parsed text is a text that parses the question text based on the reference document data, the question relevance information represents the degree of relevance between each document data and the question text, and the question relevance information corresponding to the document data is obtained by question keyword relevance information and question feature relevance information between the question text and the document data; According to the reference parsed text and each document data, obtaining matching weight information corresponding to each document data; Based on the matching weight information corresponding to each document data, at least one target document data is determined in each document data, and according to the question text and each target document data, an answer text corresponding to the question instruction is generated; The answer text is returned to the terminal device.

12. The method according to claim 11, before receiving the question instruction sent by the terminal side device, the method further comprises: at least one initial document database sent by a receiving end-side device; or, At least one document text is sent by a receiving end-side device, and at least one initial document database is generated according to each document text.

13. A computing device comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method according to any one of claims 1 to 12 are implemented.

14. A computer-readable storage medium storing a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.

15. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.