Engineering machinery standard question and answer method based on large language model and processor
Through the question-and-answer method based on the large language model, the problem of low accuracy when manually retrieving standard data of construction machinery is solved, and efficient and accurate information acquisition is achieved.
Patent Information
- Application Number
- CN202411439813.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, when manually searching standard data for construction machinery, the accuracy rate is low, especially when the number of text data is large.
A question-and-answer method based on a large language model is used to detect multiple similar questions related to the target questions input by the user by receiving user input, and a pre-constructed search model is used to filter the relevant engineering machinery standard candidate text, and finally generate the answer text through the large language model.
It improves the accuracy and efficiency of obtaining standard data of construction machinery, reduces the burden of manual retrieval, and ensures the ability to accurately obtain the required information in large quantities of text.
Smart Images

Figure CN119597866A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of engineering machinery, and specifically to a question-answering method and processor for engineering machinery standards based on a large language model. Background Art
[0002] With the continuous progress of the intelligent era, a large amount of knowledge and valuable information about engineering machinery standards has been accumulated on the Internet. When designing engineering machinery, it is often necessary to extract some engineering machinery standard information to ensure the standardization of the designed engineering machinery equipment. However, due to the large amount of engineering machinery standard information stored, it is difficult for people to accurately obtain the required engineering machinery standard information.
[0003] Based on this, the prior art marks the texts obtained by the query with the same attributes, which can limit the number of texts to a certain extent. However, after the limitation, it is still necessary to manually process the text data, and manually search the text data after marking the texts with the same attributes, so as to obtain the text data people need. Therefore, if the number of text data is still large after the number of texts is limited, that is, the more text data with the same attributes, the more difficult it will be to manually search for the required text data, then it will be difficult to accurately obtain the required text data through manual search, so the accuracy of manual search is low. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a question-answering method, processor and storage medium for engineering machinery standards based on a large language model, so as to solve the problem of low accuracy of manual retrieval in the prior art.
[0005] In order to achieve the above-mentioned purpose, the first aspect of the present application provides a question-answering method for engineering machinery standards based on a large language model, comprising:
[0006] Receive target questions about construction machinery standards input by users;
[0007] Based on the pre-built large language model, identify multiple similar questions related to the target question;
[0008] Determine, based on a pre-built first retrieval model, first engineering machinery standard candidate texts related to each similar problem;
[0009] Based on the pre-built second retrieval model, determining the second engineering machinery standard candidate texts related to each similar problem;
[0010] Determine the target text of the engineering machinery standard related to the target problem according to the first candidate text of the engineering machinery standard and the second candidate text of the engineering machinery standard corresponding to each similar problem;
[0011] Through the large language model, the answer text corresponding to the target question is determined according to the target question, the standard target text of engineering machinery and the preset question template.
[0012] In an embodiment of the present application, the engineering machinery standard target text related to the target problem is determined based on the first engineering machinery standard candidate text and the second engineering machinery standard candidate text corresponding to each similar problem, including: screening a preset number of first engineering machinery standard candidate texts from the first engineering machinery standard candidate texts corresponding to each similar problem through a first retrieval model to obtain a third engineering machinery standard candidate text corresponding to each similar problem; screening a preset number of second engineering machinery standard candidate texts from the second engineering machinery standard candidate texts corresponding to each similar problem through a second retrieval model to obtain a fourth engineering machinery standard candidate text corresponding to each similar problem; determining the engineering machinery standard target text related to the target problem based on the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text corresponding to each similar problem.
[0013] In an embodiment of the present application, the first retrieval model is a vector retrieval model, and a preset number of first engineering machinery standard candidate texts are screened from the first engineering machinery standard candidate texts corresponding to each similar question through the first retrieval model to obtain the third engineering machinery standard candidate texts corresponding to each similar question, including: generating a question vector corresponding to each similar question and a first text vector of the first engineering machinery standard candidate text corresponding to each similar question through the vector retrieval model; determining the vector distance between the question vector and the first text vector to obtain a first correlation degree value between the first engineering machinery standard candidate text and the corresponding similar question; and arranging the first engineering machinery standard candidate texts corresponding to each similar question in descending order according to the first correlation degree value to obtain the third engineering machinery standard candidate text with a higher sorting position in the first engineering machinery standard candidate texts corresponding to each similar question.
[0014] In an embodiment of the present application, a preset number of second engineering machinery standard candidate texts are screened from the second engineering machinery standard candidate texts corresponding to each similar question through a second retrieval model to obtain a fourth engineering machinery standard candidate text corresponding to each similar question, including: obtaining a second correlation degree value between the second engineering machinery standard candidate text corresponding to each similar question and the corresponding similar question through a second retrieval model; and arranging the second engineering machinery standard candidate texts corresponding to each similar question in descending order according to the second correlation degree value to obtain a fourth engineering machinery standard candidate text with a higher sorting position in the second engineering machinery standard candidate texts corresponding to each similar question.
[0015] In an embodiment of the present application, based on the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text corresponding to each similar question, the engineering machinery standard target text related to the target question is determined, including: obtaining the third correlation degree value between the third engineering machinery standard candidate text corresponding to each similar question and the corresponding similar question through a first retrieval model; obtaining the fourth correlation degree value between the fourth engineering machinery standard candidate text corresponding to each similar question and the corresponding similar question through a second retrieval model; based on a preset hybrid retrieval algorithm, determining the engineering machinery standard target text whose correlation degree with the target question reaches a preset correlation degree threshold among the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text according to the third correlation degree value and the fourth correlation degree value.
[0016] In an embodiment of the present application, before receiving the target question about engineering machinery standards input by the user, the method also includes: obtaining an engineering machinery standard document; and segmenting the engineering machinery standard document to obtain an engineering machinery standard text corresponding to the engineering machinery standard document.
[0017] In an embodiment of the present application, the engineering machinery standard document includes an adjacent first paragraph and a second paragraph, and the second paragraph is located after the first paragraph. The engineering machinery standard document is segmented to obtain an engineering machinery standard text corresponding to the engineering machinery standard document, including: comparing the length of the first paragraph with a preset length value; when the length of the first paragraph is less than the preset length value, splicing the first paragraph and the second paragraph to obtain the engineering machinery standard text.
[0018] In an embodiment of the present application, a standard engineering machinery document is segmented to obtain a standard engineering machinery text corresponding to the standard engineering machinery document. The method includes: segmenting the standard engineering machinery document by overlapping segmentation to obtain a standard engineering machinery text corresponding to the standard engineering machinery document, wherein there is a preset number of repeated words between adjacent standard engineering machinery texts.
[0019] A second aspect of the present application provides a processor configured to execute the above-mentioned question-answering method for engineering machinery standards based on a large language model.
[0020] A third aspect of the present application provides a machine-readable storage medium having instructions stored thereon, the instructions being used to enable a machine to execute the above-mentioned question-answering method for engineering machinery standards based on a large language model.
[0021] The above technical solution, by receiving the target question about the engineering machinery standard input by the user, clarifies the target question input by the user, and further determines multiple similar questions related to the target question based on the pre-constructed large language model, that is, expands the different focuses of the target question to obtain multiple similar questions related to the target question, so as to obtain different answer texts for multiple similar questions, thereby providing multiple answer texts for the target question and improving the accuracy of the obtained answer text. Then, the pre-constructed first retrieval model is used to preliminarily screen the relevant engineering machinery standard documents, and the first engineering machinery standard candidate text related to each similar question can be obtained. At the same time, the pre-constructed second retrieval model is used to preliminarily screen the relevant engineering machinery standard documents, and the second engineering machinery standard candidate text can also be obtained. Different retrieval models are used to retrieve each similar question to obtain the corresponding engineering machinery candidate text, which can improve the quality of the answer text for answering the target question. Further, the first engineering machinery standard candidate text and the second engineering machinery standard candidate text are screened for the second time, so that a preset number of engineering machinery standard target texts related to the target question can be further determined. Finally, through the large language model, the target question entered by the user and the determined engineering machinery standard target text are input into the preset question template to obtain the answer text to the target question entered by the user. The screened target text is displayed to the user without manual retrieval. The user can directly view the answer text and then accurately obtain the required answer text from a limited number of target texts, which can improve the accuracy of the answer text to the target question.
[0022] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:
[0024] Figure 1 A schematic diagram of a process flow of a question-answering method for engineering machinery standards based on a large language model according to an embodiment of the present application is shown;
[0025] Figure 2 A flowchart of a question-answering method for engineering machinery standards based on a large language model according to another embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0027] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0028] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0029] Figure 1 The flowchart of a question-answering method for engineering machinery standards based on a large language model according to an embodiment of the present application is schematically shown. Figure 1 As shown, an embodiment of the present application provides a question-answering method for engineering machinery standards based on a large language model. The method is described by taking the application of the method to a processor as an example. The method may include the following steps.
[0030] Step S101, receiving a target question about engineering machinery standards input by a user.
[0031] It can be understood that the processing of receiving the questions input by the user can be performed by a mobile processor or a fixed processor. The ways for the user to input can include various input methods such as keyboard input or voice input. This standard defines the definition of construction machinery and the groups, types, and product names of major categories of products belonging to it. The construction machinery standard can guide various standards regarding construction machinery in the processes of construction machinery design, production, management, and maintenance. Construction machinery designers can refer to this construction machinery standard to design the required construction machinery and, on the premise of ensuring compliance with this construction machinery standard, carry out innovative production. The target question is the question input by the user in the retrieval interface of the processor.
[0032] In the embodiment of the present application, the user types or inputs a question about the construction machinery standard through the keyboard or by voice at a certain processor. The processor receives and recognizes the target question input by the user about the construction machinery standard. There may be some typos in the target question, but it does not affect the processor's reception of it, so as to analyze and clarify the target question and store it in the corresponding storage address for easy expansion and reference of the target question. Therefore, the processor has a certain error tolerance for the target question input by the user.
[0033] Specifically, the target question can be "What is the definition of the pumping efficiency of a concrete pump truck?" Among them, although there is an individual typo "得" in the target question, the processor can analyze and clarify the target question and store it in the corresponding storage address for easy expansion and reference of the target question.
[0034] Step S102, based on a pre-constructed large language model, determine multiple similar questions related to the target question.
[0035] It can be understood that a large language model (LLM) is also known as a large-scale language model, which is an artificial intelligence model. After being trained with a large amount of data, it can enhance the understanding and processing ability of natural language, so as to be used to understand and generate human language. The pre-constructed large language model is the large language model pre-constructed by the user. Similar questions, as the name implies, are questions similar to the target question, which are multiple similar questions obtained by expanding or deleting different key points of the target question.
[0036] In an embodiment of the present application, the processor inputs the target question input by the user into a pre-built large language model. The pre-built large language model expands or deletes the different emphases of the target question through its own understanding and processing capabilities of natural language, so as to obtain multiple similar questions related to the target question, that is, a certain language processing is performed on the target question related to the relevant engineering machinery standards input by the user to obtain multiple similar questions related to the target question, thereby obtaining an engineering machinery standard target text that can answer multiple similar questions, and then providing a variety of engineering machinery standard target texts for the target question, thereby ensuring that the obtained engineering machinery standard target text meets the user's needs to the greatest extent, thereby improving the accuracy of the obtained target text, and further, making the target text retrieved subsequently more in line with the text related to the target question expected by the user. Therefore, the target text obtained by retrieving multiple similar questions generated for the target question can include the text expected by the user, which can improve the retrieved text recall rate to a certain extent.
[0037] Among them, it can be understood that recall rate = (true positive examples) / (true positive examples + false negative examples). The text recall rate here can refer to the ratio of the number of texts expected by users (true positive examples) to the number of target texts (true positive examples + false negative examples). It can be determined that, when the number of target texts remains unchanged, the more texts expected by users contained in the target text, the higher its recall rate.
[0038] Specifically, based on the pre-built large language model, multiple similar questions related to the target question are determined. When the target question is "What is the definition of the pumping efficiency of a concrete pump truck", the pre-built large language model can generate 10 similar questions based on the target question: "How is the pumping efficiency of a concrete pump truck specifically defined? What is the standard definition of the pumping efficiency of a concrete pump truck? In a concrete pump truck, what does pumping efficiency refer to? How to accurately describe the pumping efficiency of a concrete pump truck? What is the basis for calculating the pumping efficiency of a concrete pump truck? How is the pumping efficiency of a concrete pump truck defined and measured? What are the technical standards for the pumping efficiency of a concrete pump truck? Is there any specific definition and description of the pumping efficiency of a concrete pump truck? What factors determine the definition of the pumping efficiency of a concrete pump truck? What are the industry specifications for the definition of the pumping efficiency of a concrete pump truck?".
[0039] Step S103: determining first engineering machinery standard candidate texts related to each similar question based on the pre-constructed first retrieval model.
[0040] It can be understood that the first retrieval model may include different types of retrieval models, for example, a vector retrieval model, and the pre-built model may be a model that has been pre-built by the user. The first engineering machinery candidate text may be a plurality of texts about engineering machinery standards corresponding to various similar questions determined by using the pre-built vector retrieval model.
[0041] In an embodiment of the present application, multiple similar questions related to the target question determined by the pre-constructed large language model are input into the vector retrieval model, and multiple first engineering machinery candidate texts corresponding to each similar question can be determined in various types of texts about engineering machinery stored in the input processor. Multiple first engineering machinery candidate texts corresponding to the target question and each similar question can also be determined in various types of texts about engineering machinery stored in the input processor. That is, the engineering machinery candidate texts related to the target question and each similar question are screened by the pre-constructed large language model to obtain the first engineering machinery candidate text. That is, a certain number of engineering machinery candidate texts are screened in various types of texts about engineering machinery by the first retrieval method, which can greatly reduce the number of engineering machinery candidate texts, thereby reducing the retrieval time and improving the retrieval efficiency.
[0042] Specifically, assuming that the pre-built large language model determines that there are 10 similar questions related to the target question, based on the pre-built vector retrieval model, if it is determined that the number of first engineering machinery candidate texts corresponding to one similar question among the 10 similar questions is 10, then the number of first engineering machinery candidate texts corresponding to the 10 similar questions is 100. In addition, the vector retrieval model can also be used to determine that the number of first engineering machinery candidate texts corresponding to 1 target question and one of the 10 similar questions is 10, then the number of first engineering machinery candidate texts corresponding to 11 questions is 110, that is, the target question can participate in the retrieval process of engineering machinery standard texts together with similar questions.
[0043] Step S104: determining second engineering machinery standard candidate texts related to each similar question based on the pre-constructed second retrieval model.
[0044] It can be understood that the second retrieval model may include a retrieval model different from the first retrieval model, such as a keyword retrieval model. The second engineering machinery candidate text may be a pre-built keyword retrieval model to determine multiple texts about engineering machinery standards corresponding to various similar questions, that is, the first engineering machinery model is different from the second engineering machinery model, and because the retrieval models used to obtain the first engineering machinery standard candidate text and the second engineering machinery standard candidate text are different, the obtained engineering machinery standard candidate texts are also different.
[0045] In an embodiment of the present application, multiple similar questions related to the target question determined by the pre-built large language model are input into the keyword retrieval model, and multiple second engineering machinery candidate texts corresponding to each similar question are determined in various types of texts about engineering machinery stored in the input processor. Multiple second engineering machinery candidate texts corresponding to the target question and each similar question can also be determined in various types of texts about engineering machinery stored in the input processor. That is, a second retrieval model (which can be a keyword retrieval model) different from the first retrieval model (which can be a vector retrieval model) is adopted. To a certain extent, different engineering machinery standard candidate texts corresponding to the target question and each similar question can be obtained, thereby increasing the possibility that the obtained engineering machinery standard candidate texts include the engineering machinery standard target text required by the user, thereby further improving the recall rate of the retrieval.
[0046] Specifically, assuming that the pre-built large language model determines that there are 10 similar questions related to the target question, then based on the pre-built keyword retrieval model, if it is determined that the number of second engineering machinery candidate texts corresponding to one of the 10 similar questions is 8, then the number of second engineering machinery candidate texts corresponding to the 10 similar questions is 80. In addition, the keyword retrieval model can also be used to determine that the number of first engineering machinery candidate texts corresponding to 1 target question and one of the 10 similar questions is 8, then the number of first engineering machinery candidate texts corresponding to the 11 questions is 88.
[0047] Step S105 , determining an engineering machinery standard target text related to the target question according to the first engineering machinery standard candidate texts and the second engineering machinery standard candidate texts corresponding to the similar questions respectively.
[0048] It can be understood that the engineering machinery standard target text is part of the text in the first engineering machinery standard candidate text and the second engineering machinery standard candidate text, which is obtained by re-screening the first engineering machinery standard candidate text and the second engineering machinery standard candidate text, and is the text of the engineering machinery standard related to the target question input by the user.
[0049] In the embodiment of the present application, the first engineering machinery standard candidate text and the second engineering machinery standard text are re-screened in a different manner, that is, the number of the first engineering machinery standard candidate text and the second engineering machinery standard text is reduced again, so that the number of engineering machinery standard target texts obtained is greatly reduced, thereby obtaining a smaller number of engineering machinery standard target texts related to the target problem. Therefore, the use of the secondary reduction method greatly reduces the number of engineering machinery standard target texts obtained, thereby enabling the user to accurately retrieve the required engineering machinery standard text from a smaller number of engineering machinery standard target texts, thereby improving the accuracy of the retrieval.
[0050] Specifically, assuming that there are 10 similar questions related to the target question determined by the pre-built large language model, based on the pre-built first retrieval model (such as a vector retrieval model) and the second retrieval model (such as a keyword retrieval model), if the number of first engineering machinery candidate texts and second engineering machinery candidate texts corresponding to one of the 10 similar questions is 10 and 8 respectively, if the number of first engineering machinery candidate texts and second engineering machinery candidate texts corresponding to the 10 similar questions is 100 and 80 respectively, further, the post-ranking model can be used to recalculate the 10 first engineering machinery standard candidate texts, the 8 second engineering machinery candidate texts and the corresponding After calculating the correlation degree between similar questions, the first engineering machinery candidate text and the second engineering machinery candidate text corresponding to each similar question are sorted, and the top 5 first engineering machinery candidate texts and the top 5 second engineering machinery candidate texts with higher correlation degree corresponding to each similar question are determined, that is, the number of first engineering machinery candidate texts and second engineering machinery candidate texts corresponding to each similar question is 5 and 5, then the number of first engineering machinery candidate texts and second engineering machinery candidate texts corresponding to 10 similar questions can be 50 and 50 respectively, that is, 10 target texts corresponding to the target question can be determined from the 100 (50+50) candidate texts.
[0051] Step S106, determining the answer text corresponding to the target question through the large language model according to the target question, the engineering machinery standard target text and the preset question template.
[0052] It can be understood that the preset question templates can be pre-set by the user with different style backgrounds, and can include blank input boxes for content such as the target question, engineering machinery standard target text, the time when the question is asked, and the serial number of the retrieval device used. The preset question templates can also use files in different file formats.
[0053] In an embodiment of the present application, a large language model is used to call a preset question template, the target question and the engineering machinery standard target text related to the target question are integrated into the preset question template, the target question is input into the blank input box corresponding to the target question, and the engineering machinery standard target text related to the target question is input into the blank input box corresponding to the target text, so that the answer text corresponding to the target question can be obtained, and the answer text is transmitted to the user. Since the engineering machinery standard target text related to the target question is the engineering machinery standard target text related to the target question determined after multiple screenings, the number of engineering machinery standard target texts related to the target question is limited, and the user can accurately obtain the desired text information from the limited number of engineering machinery standard target texts related to the target question, thereby improving the accuracy of retrieval.
[0054] Specifically, the question template may include: "You are a question-and-answer robot assistant in the field of engineering machinery. Your task is to answer user questions based on the known information given below. Known information: {blank input box for engineering machinery standard target text}, user asks: {blank input box for target question}", and inputs the target question and the engineering machinery standard target text into the corresponding blank input boxes to obtain an answer text corresponding to the target question, which may include: "You are a question-and-answer robot assistant in the field of engineering machinery. Your task is to answer user questions based on the known information given below. Known information: {engineering machinery standard target text}, user asks: {target question}".
[0055] The technical solution of the present application receives a target question about engineering machinery standards input by a user, clarifies the target question input by the user, and further determines multiple similar questions related to the target question based on a pre-constructed large language model, that is, expands the different focuses of the target question to obtain multiple similar questions related to the target question, so as to obtain different target texts for multiple similar questions, thereby providing multiple target texts for the target question and improving the accuracy of the obtained target text. Then, the pre-constructed first retrieval model is used to perform a preliminary screening of the relevant engineering machinery standard documents, and the first engineering machinery standard candidate text related to each similar question can be obtained. At the same time, the pre-constructed second retrieval model is used to perform a preliminary screening of the relevant engineering machinery standard documents, and the second engineering machinery standard candidate text can also be obtained. Further, the first engineering machinery standard candidate text and the second engineering machinery standard candidate text are screened for a second time, so that the engineering machinery standard target text related to the target question can be further determined from the first engineering machinery standard candidate text and the second engineering machinery standard candidate text. Finally, through the large language model, the target question entered by the user and the determined engineering machinery standard target text are input into the preset question template to obtain the answer text to the target question entered by the user. The filtered target text is then displayed to the user, and the user can directly view the answer text, and then accurately obtain the required answer text from the limited target text, thereby improving the accuracy of the user's determination of the answer text to the target question.
[0056] In one embodiment, determining the engineering machinery standard target text related to the target problem based on the first engineering machinery standard candidate texts and the second engineering machinery standard candidate texts corresponding to each similar problem can include: screening a preset number of first engineering machinery standard candidate texts from the first engineering machinery standard candidate texts corresponding to each similar problem through a first retrieval model to obtain a third engineering machinery standard candidate text corresponding to each similar problem; screening a preset number of second engineering machinery standard candidate texts from the second engineering machinery standard candidate texts corresponding to each similar problem through a second retrieval model to obtain a fourth engineering machinery standard candidate text corresponding to each similar problem; determining the engineering machinery standard target text related to the target problem based on the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text corresponding to each similar problem.
[0057] It can be understood that the preset number can be a quantity value input by the user in advance in the input box setting the corresponding number, the third engineering machinery standard candidate text is the preset number of first engineering machinery standard candidate texts, the fourth engineering machinery standard candidate text is the preset number of second engineering machinery standard candidate texts, and the engineering machinery standard target text is the text screened from the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text.
[0058] In an embodiment of the present application, through the first retrieval model, which can be a vector retrieval model, a preset number of first engineering machinery standard candidate texts in the first engineering machinery standard candidate texts can be determined; through the second retrieval model, which can be a keyword retrieval model, a preset number of second engineering machinery standard candidate texts can be screened from the second engineering machinery standard candidate texts corresponding to each similar question to obtain the fourth engineering machinery standard candidate texts corresponding to each similar question, that is, the second engineering machinery standard candidate texts corresponding to each similar question are screened to obtain a preset number of fourth engineering machinery standard candidate texts, and then, the screened third engineering machinery standard candidate texts and fourth engineering machinery standard candidate texts are re-screened to determine the engineering machinery standard target text related to the target question, that is, after multiple screenings, the number of candidate texts is greatly reduced, so that the user can accurately retrieve the required text information from a limited number of engineering machinery standard target texts. On the one hand, the accuracy of the user's retrieval can be improved, and on the other hand, the user's retrieval time can be reduced, thereby improving the efficiency of the retrieval.
[0059] In one embodiment, the first retrieval model is a vector retrieval model. Through the first retrieval model, a preset number of first engineering machinery standard candidate texts are screened from the first engineering machinery standard candidate texts corresponding to each similar question to obtain the third engineering machinery standard candidate texts corresponding to each similar question. It can include: through the vector retrieval model, generating a problem vector corresponding to each similar question and a first text vector of the first engineering machinery standard candidate text corresponding to each similar question; determining the vector distance between the problem vector and the first text vector to obtain a first correlation degree value between the first engineering machinery standard candidate text and the corresponding similar question; according to the first correlation degree value, arranging the first engineering machinery standard candidate texts corresponding to each similar question in descending order to obtain the third engineering machinery standard candidate text with a higher sorting position in the first engineering machinery standard candidate texts corresponding to each similar question.
[0060] It can be understood that the problem vector can be a vector obtained after conversion of various similar problems, the first text vector is a vector obtained after conversion of the first engineering machinery standard candidate text, the vector distance is the distance between the problem vector and the first text vector, the first correlation degree value can be represented by the vector distance, and the vector distance can be represented by the Euclidean distance or cosine distance formula, and the first correlation degree value can be represented by Arabic numerals to indicate the correlation degree between the text vector and the problem vector, which can be expressed as the larger the first correlation degree value, the greater the correlation degree between the first engineering machinery standard candidate text and its corresponding similar problems.
[0061] In an embodiment of the present application, the question vector corresponding to each similar question and the first text vector of the first engineering machinery standard candidate text corresponding to each similar question can be input into the vector retrieval model to determine the vector distance between the question vector and the first text vector, and then obtain the first relevance degree value. Wherein, the vector distance can be Euclidean distance or cosine distance, and the Euclidean distance formula or cosine distance formula can be used to determine the relevance degree between the first engineering machinery standard candidate text and each similar question corresponding to it, so as to determine the first relevance degree value between the first engineering machinery standard candidate text and each similar question corresponding to it, and further, the first engineering machinery standard candidate text corresponding to each similar question can be arranged in descending order to obtain the third engineering machinery standard candidate text with a higher ranking position in the first engineering machinery standard candidate text corresponding to each similar question, and accordingly, according to the first relevance degree value, the first engineering machinery standard candidate text corresponding to each similar question can also be arranged in ascending order to obtain the third engineering machinery standard candidate text with a lower ranking position in the first engineering machinery standard candidate text corresponding to each similar question, that is, the third engineering machinery standard candidate text with a higher ranking in the first relevance degree value of each similar question is obtained by screening.
[0062] Specifically, the cosine distance formula can be used to calculate the vector distance between 10 similar questions and their corresponding 500 (50*10) first engineering machinery standard candidate texts, thereby obtaining the degree of correlation between the 10 similar questions and their corresponding 500 first engineering machinery standard candidate texts, and then determining the first correlation degree value, and arranging the 50 first engineering machinery standard candidate texts corresponding to each similar question in descending order according to the first correlation degree value, that is, the 50 first engineering machinery standard candidate texts corresponding to each similar question can be obtained, and the top 10 first engineering machinery standard candidate texts with higher correlation degrees corresponding to each similar question can be determined. In this way, the number of retrievals can be greatly reduced, reducing the amount of calculation for subsequent retrieval processes. In addition, a post-sorting model (such as the BM25 model) can be used to re-sort the top 10 first engineering machinery standard candidate texts with higher correlation levels corresponding to the above-mentioned similar questions. After recalculating the correlation levels between the 10 first engineering machinery standard candidate texts and the corresponding similar questions, the 10 first engineering machinery standard candidate texts corresponding to each similar question are re-arranged in descending order, which can more accurately determine the correlation levels between the first engineering machinery standard candidate texts and the corresponding similar questions. In this way, the top 5 first engineering machinery standard candidate texts with higher correlation levels can be determined as the third engineering machinery standard candidate texts.
[0063] In the embodiment of the present application, the following Euclidean distance formula may be used to determine the vector distance between the question vector and the first text vector:
[0064] S=||v1-v2||
[0065] Among them, S represents the vector distance between v1 and v2, v1 represents the text vector corresponding to the similar question, and v2 represents the first engineering machinery standard candidate text vector.
[0066] The S in the above formula represents the vector distance between the question vector and the first text vector, and can also represent the text similarity between the first engineering machinery standard candidate text and its corresponding similar questions. The smaller the vector distance or text similarity, the larger the first correlation degree value, and the greater the correlation degree between the first engineering machinery standard candidate text and its corresponding similar questions.
[0067] In the embodiment of the present application, the vector distance may also be determined using the following cosine distance formula:
[0068]
[0069] Among them, D represents the text vector similarity between v1 and v2, cosθ represents the cosine value of the angle θ between v1 and v2, v1 represents the text vector corresponding to N similar questions, and v2 represents the candidate text vector of the candidate text related to N similar questions.
[0070] Since the value range of cosθ is [-1,1], the value range of D is [0,2]. Therefore, the closer the first engineering machinery standard candidate text is to 0, the greater the correlation between it and the corresponding similar questions. Therefore, the obtained first correlation degree value is larger. Using D in the above formula to represent the vector distance between the question vector and the first text vector, it can also represent the text similarity between the first engineering machinery standard candidate text and its corresponding similar questions. The smaller the vector distance or text similarity, the greater the correlation between the first engineering machinery standard candidate text and its corresponding similar questions. Therefore, the first correlation degree value is larger.
[0071] In one embodiment, a preset number of second engineering machinery standard candidate texts are screened from the second engineering machinery standard candidate texts corresponding to each similar question through a second retrieval model to obtain a fourth engineering machinery standard candidate text corresponding to each similar question, including: obtaining a second correlation degree value between the second engineering machinery standard candidate text corresponding to each similar question and the corresponding similar question through the second retrieval model; and arranging the second engineering machinery standard candidate texts corresponding to each similar question in descending order according to the second correlation degree value to obtain a fourth engineering machinery standard candidate text with a higher sorting position in the second engineering machinery standard candidate texts corresponding to each similar question.
[0072] It can be understood that the second relevance value is the relevance between the second engineering machinery standard candidate text and each similar question.
[0073] Specifically, the second search model may be a keyword search model, and the keyword search model determines the second relevance degree by: using word segmentation technology to obtain corresponding keywords after word segmentation of each similar question, wherein the word segmentation technology may be jieba word segmentation technology. Then, the keywords corresponding to each similar question are searched in the second engineering machinery standard candidate text corresponding to each similar question, the word frequency of the keywords corresponding to each similar question in the second engineering machinery standard candidate text corresponding to each similar question is determined, and the inverse document frequency of the keywords corresponding to each similar question is obtained, and then the keyword search algorithm is used to determine the second relevance degree value between the second engineering machinery standard candidate text corresponding to each similar question and the keywords corresponding to each similar question, and the second engineering machinery standard candidate text corresponding to each similar question is arranged in descending order according to the calculated second relevance degree value, so as to obtain a preset number of second engineering machinery standard candidate texts with a forward ranking position in the second engineering machinery standard candidate text corresponding to each similar question, that is, the fourth engineering machinery standard candidate text, for example, the relevance degree can be sorted by a post-sorting model.
[0074] A second retrieval model different from the first retrieval model is used, that is, a different retrieval method is used to perform a secondary screening on the second engineering machinery standard candidate texts corresponding to each similar question, so as to further determine the candidate texts that are more relevant to the target question. On the premise of ensuring the degree of relevance of the candidate texts to the target question, the number of candidate texts can be greatly reduced, thereby improving the quality of the candidate texts.
[0075] In one embodiment, determining the engineering machinery standard target text related to the target problem based on the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text corresponding to each similar problem can include: obtaining the third correlation degree value between the third engineering machinery standard candidate text corresponding to each similar problem and the corresponding similar problem through a first retrieval model; obtaining the fourth correlation degree value between the fourth engineering machinery standard candidate text corresponding to each similar problem and the corresponding similar problem through a second retrieval model; based on a preset hybrid retrieval algorithm, determining the engineering machinery standard target text among the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text whose correlation degree with the target problem reaches a preset correlation degree threshold according to the third correlation degree value and the fourth correlation degree value.
[0076] It can be understood that the third correlation degree value can represent the correlation degree between the third engineering machinery standard candidate text corresponding to each similar question and the corresponding similar question, and the fourth correlation degree value can represent the correlation degree between the fourth engineering machinery standard candidate text corresponding to each similar question and the corresponding similar question. Generally speaking, the greater the correlation degree between the two, the greater the correlation degree value. Therefore, the greater or smaller the correlation degree between the third engineering machinery standard candidate text corresponding to each similar question and the corresponding similar question, the greater or smaller the third correlation degree value is. The greater or smaller the correlation degree between the fourth engineering machinery standard candidate text corresponding to each similar question and the corresponding similar question, the greater or smaller the fourth correlation degree value is. The preset hybrid retrieval algorithm can be pre-set by the user, and the preset correlation degree threshold can be a threshold pre-set by the user for judging the engineering machinery standard target text.
[0077] In an embodiment of the present application, through the first retrieval model, the third correlation degree value between the third engineering machinery standard candidate text corresponding to each similar question and the corresponding similar question can be obtained, and through the second retrieval model, the fourth correlation degree value between the fourth engineering machinery standard candidate text corresponding to each similar question and the corresponding similar question can be obtained, that is, the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text obtained by the first retrieval model and the second retrieval model are input into the post-retrieval sorting model to obtain re-sorted third engineering machinery standard candidate text and fourth engineering machinery standard candidate text, and the third correlation degree value and the fourth correlation degree value are calculated by a hybrid retrieval algorithm to determine the engineering machinery standard target text whose correlation degree with the target question reaches a preset correlation degree threshold.
[0078] Specifically, the method for calculating the third relevance degree value and the fourth relevance degree value by using the hybrid retrieval algorithm can be determined by the following formula:
[0079]
[0080] Among them, Score(d) is the search score value of text d, rank i (d) represents the ranking number of document d in the i-th retrieval model, n represents the number of retrieval models involved in the fusion, and k is the smoothing parameter.
[0081] Generally speaking, n can represent the number of retrieval models involved in the fusion, or the retrieval method involved in the retrieval. It means that n different retrieval models provide results, and the relevant contribution of each model to document d is included in the calculation of the comprehensive score. i(d) represents the ranking number of document d in the i-th retrieval model. The ranking number is an integer starting from 1. The smaller the ranking number, the higher the ranking and the more relevant the text is to the target question. k is a fixed parameter pre-set by the user. It is a smoothing parameter used to avoid division by zero errors and can also adjust the fusion effect of the model. The existence of k can also reduce the greater impact of documents with very high rankings on the comprehensive score, making the fusion result more stable.
[0082] Specifically, the third relevance value can represent the characterization value of the relevance between the third engineering machinery standard candidate text corresponding to each similar question in the first retrieval model and the corresponding similar question, and the fourth relevance value can represent the characterization value of the relevance between the fourth engineering machinery standard candidate text corresponding to each similar question in the second retrieval model and the corresponding similar question. By calculating the sum of the third relevance value and the fourth relevance value, the relevance between each text in the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text and the target question can be determined, thereby determining the engineering machinery standard target text whose relevance to the target question reaches a preset relevance threshold set by the user, that is, to a certain extent, determining the text in the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text that has a higher relevance to the target question and using it as the engineering machinery standard target text can improve the quality of the answer text and enable accurate relevant replies to the target question.
[0083] Specifically, if the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text have the same related text (d), but the corresponding similar questions may be the same or different, in the first retrieval model, the text ranking of the third engineering machinery standard candidate text corresponding to 10 similar questions of the related text is 1, and in the second retrieval model, the text ranking of the fourth engineering machinery standard candidate text corresponding to 10 similar questions of the related text is 2, and the smoothing parameter k is 1, then the third relevance value is 10*1 / 2=5, and the fourth relevance value is 10*1 / 3=10 / 3, and the sum of the third relevance value and the fourth relevance value is calculated, that is, the Score (d) retrieval score value corresponding to the related text is 5+10 / 3= 25 / 3, compare the Score(d) retrieval score value "25 / 3" corresponding to the relevant text with the preset relevance threshold (for example, 10), and determine that the Score(d) retrieval score value corresponding to the relevant text does not reach the preset relevance threshold, then the relevant text is not the engineering machinery standard target text, wherein, if the relevant text can only be in the third engineering machinery standard candidate text or the fourth engineering machinery standard candidate text, in this case, it is only necessary to calculate the third relevance value of the third engineering machinery standard candidate text in the first retrieval model, or the fourth relevance value of the fourth engineering machinery standard candidate text in the second retrieval model, that is, to use the calculated third relevance value or fourth relevance value as the retrieval score value of the relevant text (d).
[0084] In one embodiment, before receiving the target question about engineering machinery standards input by the user, the method may further include: obtaining an engineering machinery standard document; and segmenting the engineering machinery standard document to obtain an engineering machinery standard text corresponding to the engineering machinery standard document.
[0085] It can be understood that the engineering machinery standard documents are various documents related to engineering machinery standards, and segmentation is to segment each of the various documents related to engineering machinery standards.
[0086] In one embodiment, before receiving the target question about engineering machinery standards input by the user, it is necessary to first obtain various documents about engineering machinery standards, and segment the various documents about engineering machinery standards, and divide each document into one or more texts. When the target text of engineering machinery standards is subsequently obtained, the user does not need to conduct a long search for the document corresponding to the target text of engineering machinery standards, but only needs to search for the corresponding text. Therefore, without affecting the text content, the user only needs to search for the corresponding text. To a certain extent, segmenting various documents about engineering machinery standards can filter out texts that are not related to the target question and retain questions related to the target question, thereby improving the quality of the answer text retrieved subsequently, and then determining the degree of relevance of the answer text to the target question, thereby improving the accuracy of the answer text.
[0087] In one embodiment, a standard document for engineering machinery includes a first paragraph and a second paragraph that are adjacent, and the second paragraph is located after the first paragraph. The standard document for engineering machinery is segmented to obtain a standard text for engineering machinery corresponding to the standard document for engineering machinery, including: comparing the length of the first paragraph with a preset length value; when the length of the first paragraph is less than the preset length value, splicing the first paragraph with the second paragraph to obtain the standard text for engineering machinery.
[0088] It can be understood that the preset length value is preset by the user and is used to determine the boundary value when segmenting the text.
[0089] Specifically, the method for segmenting the engineering machinery standard document may include: segmenting the document according to the length of the paragraphs in the document, specifically: the engineering machinery standard document includes adjacent first and second paragraphs, and the second paragraph is located after the first paragraph, segmenting the engineering machinery standard document, comparing the length of the first paragraph with a preset length value, and when the length of the first paragraph is less than the preset length value, splicing the first paragraph with the second paragraph to obtain a spliced paragraph, and when the spliced paragraph is less than the preset length value, splicing the spliced paragraph with the third paragraph until the length of the spliced paragraph is greater than or equal to the preset length value or there are no remaining paragraphs in the document, wherein the third paragraph is adjacent to the second paragraph, and the third paragraph is located after the second paragraph. If the engineering machinery standard document does not include the adjacent first and second paragraphs, there is no need to segment. Segmenting the engineering machinery standard document can segment a long document into multiple texts, thereby segmenting different contents in the engineering machinery standard document. In subsequent retrieval, only the engineering machinery standard text related to the target problem or similar problems needs to be retrieved, and there is no need to retrieve the paragraph content in the document again in the retrieved document, thereby improving the accuracy of text retrieval.
[0090] In one embodiment, a standard engineering machinery document is segmented to obtain a standard engineering machinery text corresponding to the standard engineering machinery document, including: segmenting the standard engineering machinery document by overlapping segmentation to obtain a standard engineering machinery text corresponding to the standard engineering machinery document, wherein there is a preset number of repeated words between adjacent standard engineering machinery texts.
[0091] Specifically, the method for segmenting the engineering machinery standard document may also include: adopting an overlapping segmentation method, specifically: it can be determined that the engineering machinery standard text after segmentation of the engineering machinery standard document is a first text with a first preset number of words, and the second text adjacent to the first text obtained by segmentation contains repeated content of a second preset number of words, that is, it can be ensured that there is some repeated content in each adjacent text. Therefore, to a certain extent, the loss of the content of the engineering machinery standard document can be avoided, thereby ensuring the integrity of the retrieved text content and improving the accuracy of the retrieved text content.
[0092] In a specific embodiment, the first text may be words 1 to 400 in the engineering machinery standard document, and the second text is the text from 301 to 701 taken from the engineering machinery standard document after moving 300 words. As in the first text and the second text extracted by the above method, words 301 to 400, a total of 100 words, appear repeatedly in the two texts, that is, repeated content from words 301 to 400 appears.
[0093] like Figure 2 As shown, the embodiment of the present application needs to segment the engineering machinery standard document before answering the user's target question. The document segmentation method can adopt paragraph segmentation method and overlapping segmentation method. The paragraph segmentation method determines whether the length of a paragraph meets the preset length value set by the user in advance. If it does not meet the preset length value set by the user in advance, the paragraph is spliced with the next adjacent paragraph to obtain the engineering machinery standard candidate text. The overlapping segmentation method is to obtain the engineering machinery standard candidate text with a preset number of words according to the word value set by the user in advance. However, there is some repeated content between the engineering machinery standard candidate text and the adjacent engineering machinery standard candidate text, which can reduce the impact of information loss caused by text segmentation to a certain extent. The engineering machinery standard candidate text after document segmentation is input into the first retrieval model and the second retrieval model for subsequent retrieval.
[0094] Then, after receiving the target question input by the user, the target question is input into the large language model to generate A similar questions related to the target question. In this way, in order to improve the recall rate of subsequent retrieval of engineering machinery standard documents, the relevance values between A similar questions and engineering machinery standard candidate texts are determined by the first retrieval model and the second retrieval model respectively, so as to obtain the TOP M candidate texts and the TOP N candidate texts in the engineering machinery standard candidate texts corresponding to each similar question, that is, A*M first engineering machinery standard candidate texts and A*N second engineering machinery standard candidate texts. The first engineering machinery standard candidate text and the second engineering machinery standard candidate text are input into the post-ranking model, and the relevance between the first engineering machinery standard candidate text and the second engineering machinery standard candidate text and similar questions is determined again, wherein the relevance between the candidate text and its similar question can be determined by the Euclidean distance formula:
[0095] S=||v1-v2||
[0096] Among them, S represents the vector distance between v1 and v2, v1 represents the text vector corresponding to the similar question, and v2 represents the first engineering machinery standard candidate text vector.
[0097] The S in the above formula represents the vector distance between the question vector and the first text vector, and can also represent the text similarity between the first engineering machinery standard candidate text and its corresponding similar questions. The smaller the vector distance or text similarity, the larger the first correlation degree value, and the greater the correlation degree between the first engineering machinery standard candidate text and its corresponding similar questions.
[0098] The relevance of a candidate text to its similar questions can be determined by the following cosine distance formula:
[0099]
[0100] Among them, D represents the text vector similarity between v1 and v2, cosθ represents the cosine value of the angle θ between v1 and v2, v1 represents the text vector corresponding to N similar questions, and v2 represents the candidate text vector of the candidate text related to N similar questions.
[0101] Therefore, A*m third engineering machinery standard candidate texts and A*n fourth engineering machinery standard candidate texts can be determined from A*M first engineering machinery standard candidate texts and A*N second engineering machinery standard candidate texts, and then according to the ranking positions of the A*m third engineering machinery standard candidate texts and the A*n fourth engineering machinery standard candidate texts in each similar question, the corresponding third relevance degree value and fourth relevance degree value are determined by the following formula:
[0102]
[0103] Among them, Score(d) is the search score value of text d, rank i (d) represents the ranking number of document d in the i-th retrieval model, n represents the number of retrieval models involved in the fusion, and k is the smoothing parameter.
[0104] Finally, the sum of the third relevance value and the fourth relevance value is calculated to obtain the relevance of each text with the target question, thereby screening out a preset number of engineering machinery standard target texts with a high degree of relevance to the target question, and inputting them together with the target question into the preset question template in the large language model to generate the answer text corresponding to the target question and feed it back to the user.
[0105] To summarize, this application repeatedly screens the candidate texts and ultimately determines a preset number of engineering machinery standard target texts that are most relevant to the target question among the candidate texts, and generates an answer text along with the target question for the retrieved texts and feeds it back to the user. The user can view a limited number of engineering machinery standard target texts corresponding to the target question in the answer text, and thus select the required answer text therefrom without having to search through the entire engineering machinery standard document, and can accurately select the required engineering machinery standard target text, thereby improving the retrieval accuracy of engineering machinery standards.
[0106] Through the above technical solution, the target question about the engineering machinery standard input by the user is received, the target question input by the user is clarified, and based on the pre-constructed large language model, multiple similar questions related to the target question are further determined, that is, the different focuses of the target question are expanded to obtain multiple similar questions related to the target question, so as to obtain different answer texts for multiple similar questions, thereby providing multiple answer texts for the target question and improving the accuracy of the obtained answer text. Then, the pre-constructed first retrieval model is used to preliminarily screen the relevant engineering machinery standard documents, and the first engineering machinery standard candidate text related to each similar question can be obtained. At the same time, the pre-constructed second retrieval model is used to preliminarily screen the relevant engineering machinery standard documents, and the second engineering machinery standard candidate text can also be obtained. Different retrieval models are used to retrieve each similar question to obtain the corresponding engineering machinery candidate text, which can improve the quality of the answer text for answering the target question. Further, the first engineering machinery standard candidate text and the second engineering machinery standard candidate text are screened for the second time, so that a preset number of engineering machinery standard target texts related to the target question can be further determined. Finally, through the large language model, the target question entered by the user and the determined engineering machinery standard target text are input into the preset question template to obtain the answer text to the target question entered by the user. The screened target text is then displayed to the user, and the user can directly view the answer text, and then accurately obtain the required answer text from a limited number of target texts, which can improve the accuracy of the answer text determined by the user to the target question.
[0107] An embodiment of the present application provides a processor configured to execute the question-answering method of engineering machinery standards based on a large language model according to the above-mentioned implementation.
[0108] An embodiment of the present application also provides a machine-readable storage medium having instructions stored thereon, the instructions being used to enable a machine to execute the above-mentioned question-and-answer method for engineering machinery standards based on a large language model.
[0109] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0110] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0111] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0112] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0113] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0114] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0115] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0116] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0117] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A question-answering method for engineering machinery standards based on a large language model, characterized in that: The question-answering method comprises: Receive target questions about construction machinery standards input by users; Based on a pre-built large language model, determining a plurality of similar questions related to the target question; Determine, based on a pre-built first retrieval model, first engineering machinery standard candidate texts related to each of the similar issues; Determine, based on a pre-built second retrieval model, second engineering machinery standard candidate texts related to each of the similar issues; Determining a target engineering machinery standard text related to the target problem according to the first engineering machinery standard candidate texts and the second engineering machinery standard candidate texts respectively corresponding to the similar problems; The answer text corresponding to the target question is determined by the large language model according to the target question, the engineering machinery standard target text and a preset question template.
2. The method according to claim 1, characterized in that Determining the engineering machinery standard target text related to the target problem according to the first engineering machinery standard candidate texts and the second engineering machinery standard candidate texts respectively corresponding to the similar problems includes: By using the first retrieval model, a preset number of first engineering machinery standard candidate texts are screened from the first engineering machinery standard candidate texts corresponding to each of the similar questions to obtain a third engineering machinery standard candidate text corresponding to each of the similar questions; By using the second retrieval model, a preset number of second engineering machinery standard candidate texts are screened from the second engineering machinery standard candidate texts corresponding to each of the similar questions to obtain a fourth engineering machinery standard candidate text corresponding to each of the similar questions; According to the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text corresponding to each of the similar problems, an engineering machinery standard target text related to the target problem is determined.
3. The method according to claim 2, characterized in that The first retrieval model is a vector retrieval model, and the first retrieval model is used to select a preset number of first engineering machinery standard candidate texts from the first engineering machinery standard candidate texts corresponding to each of the similar questions to obtain a third engineering machinery standard candidate text corresponding to each of the similar questions, including: Generate a question vector corresponding to each similar question and a first text vector of the first engineering machinery standard candidate text corresponding to each similar question through a vector retrieval model; Determine the vector distance between the question vector and the first text vector, and obtain a first correlation degree value between the first engineering machinery standard candidate text and the corresponding similar question; According to the first relevance degree value, the first engineering machinery standard candidate texts corresponding to each of the similar questions are arranged in descending order to obtain a third engineering machinery standard candidate text with a higher ranking position among the first engineering machinery standard candidate texts corresponding to each of the similar questions.
4. The method according to claim 2, characterized in that: The method of screening a preset number of second engineering machinery standard candidate texts from the second engineering machinery standard candidate texts corresponding to each of the similar questions by using the second retrieval model to obtain fourth engineering machinery standard candidate texts corresponding to each of the similar questions includes: Obtaining, by means of the second retrieval model, a second correlation degree value between the second engineering machinery standard candidate text corresponding to each of the similar questions and the corresponding similar question; According to the second relevance degree value, the second engineering machinery standard candidate texts corresponding to each of the similar questions are arranged in descending order to obtain a fourth engineering machinery standard candidate text with a higher sorting position among the second engineering machinery standard candidate texts corresponding to each of the similar questions.
5. The method according to claim 4, characterized in that Determining the target engineering machinery standard text related to the target problem according to the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text corresponding to each of the similar problems includes: Obtaining, by means of the first retrieval model, a third correlation degree value between the third engineering machinery standard candidate text corresponding to each of the similar questions and the corresponding similar question; Obtaining, by means of the second retrieval model, a fourth correlation degree value between the fourth engineering machinery standard candidate text corresponding to each of the similar questions and the corresponding similar question; Based on a preset hybrid retrieval algorithm, according to the third relevance value and the fourth relevance value, determine the engineering machinery standard target text whose relevance to the target problem reaches a preset relevance threshold among the third engineering machinery standard candidate text and the fourth engineering machinery standard candidate text.
6. The method according to claim 1, characterized in that Before receiving the target question about the engineering machinery standard input by the user, the method further includes: Obtain standard documents for construction machinery; The engineering machinery standard document is segmented to obtain an engineering machinery standard text corresponding to the engineering machinery standard document.
7. The method according to claim 6, characterized in that The engineering machinery standard document includes a first paragraph and a second paragraph that are adjacent to each other, and the second paragraph is located after the first paragraph. The engineering machinery standard document is segmented to obtain an engineering machinery standard text corresponding to the engineering machinery standard document, including: Comparing the length of the first paragraph with a preset length value; When the length of the first paragraph is less than the preset length value, the first paragraph is concatenated with the second paragraph to obtain the engineering machinery standard text.
8. The method according to claim 6, characterized in that The step of segmenting the engineering machinery standard document to obtain an engineering machinery standard text corresponding to the engineering machinery standard document includes: The engineering machinery standard document is segmented by overlapping segmentation to obtain engineering machinery standard texts corresponding to the engineering machinery standard document, wherein there are repeated contents of a preset number of words between adjacent engineering machinery standard texts.
9. A processor, characterized in that: The method is configured to execute the question-answering method of engineering machinery standards based on a large language model according to any one of claims 1 to 8.
10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions for causing a machine to execute a question-answering method for engineering machinery standards based on a large language model according to any one of claims 1 to 8.