Intelligent question and answer method and device, electronic equipment, storage medium and product
By constructing a sememe database for keyword matching and semantic analysis, the problems of cumbersome operations and inaccurate intelligent Q&A in the engineering project management system are solved, and intelligent Q&A and rapid retrieval of engineering project management are realized.
Patent Information
- Application Number
- CN202410861563.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-18
AI Technical Summary
The operation steps of the engineering project management system are cumbersome and the required information cannot be quickly retrieved. The existing intelligent question and answer system cannot achieve accurate matching and cannot meet the needs of engineering project management.
By constructing a sememe database, the keywords entered by the user are matched with the engineering project database and the sememe database, semantic analysis is performed, the question semantics are identified, and the answer information is retrieved in the engineering project database.
It achieves accurate identification of question semantics and accuracy of answer information, improves intelligent question and answer capabilities in engineering project management, and achieves rapid retrieval.
Smart Images

Figure CN118797005A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to an intelligent question-answering method, device, electronic device, storage medium, and product. Background Technology
[0002] In engineering project management, data queries and statistics on project information are frequently required. Currently, engineering project management primarily relies on Project Management Systems (PMS). Querying project information through PMS mainly involves manual, hierarchical navigation. To retrieve even a simple project information, multiple levels of the system's directory structure must be navigated, resulting in cumbersome operation and hindering the rapid retrieval of desired information. Furthermore, existing intelligent question-answering systems for other scenarios rely on fuzzy matching, failing to provide precise results and thus not meeting the requirements of engineering project management.
[0003] Therefore, how to achieve intelligent question-and-answer functionality in engineering project management is an urgent problem to be solved. Summary of the Invention
[0004] This invention provides an intelligent question-answering method, device, electronic device, storage medium, and product to address the shortcomings of existing engineering project management systems, such as cumbersome operation steps and inability to quickly retrieve required information. It achieves accurate identification of question semantics, improves the accuracy of semantic analysis, and thus realizes intelligent question-answering for engineering project management.
[0005] This invention provides an intelligent question-answering method, comprising: Obtain the question statement input by the user and extract the keywords from the question statement; Match the keywords of the question statement with data items in the project database and the semantic database; Semantic analysis is performed based on the keyword matching results to obtain the semantic analysis results of the question; Based on the semantic analysis results of the question, the answer information is retrieved from the project database and a response statement is provided.
[0006] According to an intelligent question-answering method provided by the present invention, the semantic primitive database is constructed in the following manner: Keywords from the type items in the engineering project database and engineering project terminology from the question statements are selected as semantic bases; The final semantic primitive expression is determined based on the semantic primitives and the keywords of the question statement; wherein the final semantic primitive expression includes a semantic primitive and at least one corresponding keyword; A semantic primitive matrix is constructed based on multiple final semantic primitive expressions to obtain a semantic primitive database.
[0007] According to an intelligent question-answering method provided by the present invention, the step of determining the final semantic primitive expression based on the semantic primitive and the keywords of the question statement includes: Keywords with a weight higher than a preset weight threshold are identified as feature keywords; Based on the weight of the feature keywords in descending order, query the semantic source corresponding to the feature keywords; If no semantic source corresponding to the feature keyword is found, then the feature keyword is set as the semantic source; If the semantic primitive corresponding to the feature keyword is found, the feature keyword is expanded into the corresponding semantic primitive expression to determine the final semantic primitive expression.
[0008] According to an intelligent question-answering method provided by the present invention, the step of expanding the feature keywords into the corresponding semantic primitive expressions to determine the final semantic primitive expressions includes: The feature keywords are expanded into the corresponding semantic primitive expressions to obtain the expanded semantic primitive expressions; The extended primitive expression is verified by iteratively removing keywords from iterative expressions, calculating the recall and precision of the extended primitive expressions under each iteration, and selecting the primitive expression with the highest recall and precision as the final primitive expression.
[0009] According to the intelligent question-answering method provided by the present invention, the step of performing semantic analysis based on keyword matching results to obtain question semantic analysis results includes: If the first keyword of the question statement matches a content item in the engineering project database, then the first keyword is marked as a search condition; If the second keyword of the question statement matches a type item in the project database, or a semantic primitive corresponding to the type item, then the second keyword will be marked as a search field. If the third keyword of the question statement matches a question semantic primitive in the semantic primitive database, then the third keyword is marked as a detailed question.
[0010] According to an intelligent question-answering method provided by the present invention, when the number of the second keyword is 1 and the number of the first keyword is n, the semantic primitive corresponding to the type item that matches the second keyword is used as the search field, and the n first keywords are used as the search conditions.
[0011] According to an intelligent question-answering method provided by the present invention, when the number of second keywords is n and the number of first keywords is m, the m first keywords are used as search conditions, duplicate semantic primitives in the semantic primitives corresponding to the type items that match the n second keywords are deleted, and the remaining semantic primitives are marked as search fields; wherein, the duplicate semantic primitives are semantic primitives that are duplicated in the semantic primitives corresponding to the type items that match the m first keywords; wherein, m is greater than 1 and n is greater than 1.
[0012] According to the intelligent question-answering method provided by the present invention, the step of performing semantic analysis based on keyword matching results to obtain question semantic analysis results further includes: If the number of the first keyword and the number of the second keyword are both zero, then the question statement is matched with questions in the question database based on similarity. The question with the highest matching degree is taken as the result of semantic analysis.
[0013] The present invention also provides an intelligent question-and-answer device, comprising: The acquisition module is used to acquire the question statement input by the user and extract the keywords of the question statement; The matching module is used to match the keywords of the question statement with data items in the project database and the semantic database; The analysis module is used to perform semantic analysis based on keyword matching results to obtain the semantic analysis results of the question; The retrieval module is used to retrieve answer information from the engineering project database and provide a response statement based on the semantic analysis results of the question.
[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the intelligent question-answering method as described above.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the intelligent question-answering method as described above.
[0016] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the intelligent question-answering method as described above.
[0017] The intelligent question-answering method, device, electronic device, storage medium, and product provided by this invention introduces a semantic primitive database, matches the keywords of the question statement with data items in the engineering project database and the semantic primitive database, and performs semantic association analysis based on the keyword matching results. This enables accurate identification of the question's semantics, improves the accuracy of semantic analysis, and consequently improves the accuracy of the answer information retrieved based on the semantic analysis results, thereby realizing intelligent question-answering for engineering project management. By introducing intelligent question-answering into engineering project management, rapid retrieval of engineering project query content can be achieved. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 This is one of the flowcharts of the intelligent question-answering method provided in the embodiments of the present invention.
[0020] Figure 2 This is a schematic diagram of the matching process provided in an embodiment of the present invention.
[0021] Figure 3 This is the second flowchart of the intelligent question-answering method provided in the embodiments of the present invention.
[0022] Figure 4 This is a schematic diagram of the process for constructing a semantic primitive database provided in an embodiment of the present invention.
[0023] Figure 5 This is a schematic diagram of the intelligent question-answering device provided in an embodiment of the present invention.
[0024] Figure 6 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0026] Figure 1 This is one of the flowcharts illustrating the intelligent question-answering method provided in this embodiment of the invention. (Refer to...) Figure 1, an embodiment of the present invention provides an intelligent question-answering method, and the method may specifically include the following steps: Step 110, obtain the question statement input by the user, and extract the keywords of the question statement.
[0027] It should be noted that the execution subject of the intelligent question-answering method provided by the embodiment of the present invention may be an electronic device, a component in the electronic device, an integrated circuit or a chip. The electronic device may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a wearable device, an Ultra-mobile Personal Computer (UMPC), a netbook or a Personal Digital Assistant (PDA), etc., and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, etc. The embodiment of the present invention does not make specific limitations thereto.
[0028] Hereinafter, the embodiment of the present invention will be described with a server as the execution subject. In the embodiment of the present invention, the server can obtain the question statements input by the user through the question-answering terminal. For example, "What were the construction projects of the engineering project management system last year?", "What are the currently unfinished projects?", etc.
[0029] Specifically, after obtaining the question statement input by the user, noise reduction preprocessing can be performed on the input question statement to remove punctuation marks and words such as "of" and "already" that have no impact on the result, so as to improve the running speed and accuracy. After noise reduction, word segmentation can be performed on the question statement, so as to divide a Chinese sentence into several words, and analyze the meaning of the entire sentence by understanding the meaning of the words, so as to obtain at least one keyword of the question statement. In the embodiment of the present invention, a word segmentation method based on a Hidden Markov Model (HMM) may be adopted, or jieba word segmentation may be adopted in software development.
[0030] Step 120, match the keywords of the question statement with the data items in the engineering project database and the semantic primitive database.
[0031] The engineering project database may include basic information for retrieving projects. The data in the engineering project database can be obtained from the engineering project management system, can be obtained by establishing an interface online, or can be obtained by importing data offline.
[0032] An engineering project database can include multiple data items, such as project number, project name, project year, approved project amount, approved design amount, and completion status. Specifically, data items can include type items and content items. Type items can include completion status, while content items can include project number, project year, etc.
[0033] In linguistics, a sememe is the smallest indivisible semantic unit. Synonyms can all be categorized into one semantic unit, and keywords with similar semantics can share the same sememe. In this embodiment of the invention, the sememe database can refer to semantic units related to engineering projects. By comparing the keywords of the question statement with the sememe database, the semantics of the question and answer can be accurately understood.
[0034] The semantic primitive database can be divided into three parts: project management semantic primitive database (a collection of semantic units related to project management), problem semantic primitive database (a collection of semantic units composed of keywords related to project problems), and high-frequency semantic primitive database (a collection of semantic primitives composed of semantic units for some high-frequency content and common problems).
[0035] Figure 2 This is a schematic diagram of the matching process provided in an embodiment of the present invention. (Refer to...) Figure 2 In this embodiment of the invention, after preprocessing the question statement, the text can be converted into keywords, thereby allowing for precise or fuzzy matching of the extracted keywords with data items in the engineering project database. Precise matching requires a complete match with database content items during retrieval, such as project numbers; fuzzy matching requires semantic matching during retrieval, such as the project name "2023 Engineering Project Management System Construction Project" and "2023 Engineering Project System" having the same semantic meaning, thus allowing for fuzzy matching.
[0036] If a keyword is matched, it is marked, and semantic association analysis is performed based on the marking results. Database marking methods can be divided into type marking and content marking. When a keyword matches a database type, type marking can be performed, such as marking the completion status as "type"; when a keyword matches specific database content, content marking can be performed, such as marking the specific construction year or specific project number as "content".
[0037] If no keyword is found in the project database, it can be further matched with the semantic primitive database. If the keyword is found in the semantic primitive database, it can be marked as a semantic primitive, and semantic association analysis can be performed based on the marking results. If the keyword is not found in the semantic primitive database, it can be added to the corpus for training, and the semantic primitive database can be expanded based on the training results. If the keyword is meaningless after training, it can be discarded.
[0038] Step 130: Perform semantic analysis based on the keyword matching results to obtain the semantic analysis results of the question.
[0039] After matching the keywords of the question statement with the data items in the project database and the semantic primitive database, the semantic result of each keyword in the question statement can be determined based on the matching results.
[0040] This invention introduces a semantic primitive database and combines the matching results between the keywords of the question statement and the data items in the project database and the semantic primitive database to identify the semantic meaning of the question through association analysis. This helps to improve the accuracy of semantic analysis and thus improves the accuracy of the obtained question semantic analysis results.
[0041] Step 140: Based on the semantic analysis results of the question, retrieve answer information from the project database and provide a response statement.
[0042] After obtaining the semantic analysis results of the question, the answer information can be retrieved from the project database based on the semantic analysis results, and a response statement can be fed back based on the retrieved answer information.
[0043] Specifically, the database can be processed by summing, listing, and performing conditional statistics on the retrieved answers. The results can then be fed back to the question-and-answer terminal in natural language, thus providing the user with the response.
[0044] Figure 3 This is the second flowchart illustrating the intelligent question-answering method provided in this embodiment of the invention. (Refer to...) Figure 3 The project database can obtain data from the project management system. The semantic primitive database can be obtained through supervised learning. The sources of the supervised learning training corpus can include question statements input through a question-answering terminal and the project database. When obtaining question statements input through the question-answering terminal, the keywords of the question statements can be matched with data items in the project database and the semantic primitive database. Semantic analysis is then performed based on the keyword matching results to obtain the question semantic analysis results.
[0045] Furthermore, answer information can be retrieved from the project database based on the semantic analysis results of the question, the retrieved answer information can be processed, and the processing results can be fed back to the question-and-answer terminal in the form of natural language, thereby providing the response statement to the user.
[0046] This invention, through the introduction of a semantic primitive database, matches keywords of question statements with data items in both the engineering project database and the semantic primitive database. Semantic association analysis is then performed based on the keyword matching results, enabling precise identification of the question's semantics. This improves the accuracy of semantic analysis and, consequently, the accuracy of the retrieved answers, thus achieving intelligent question answering for engineering project management. By introducing intelligent question answering into engineering project management, rapid retrieval of engineering project query content can be achieved.
[0047] Figure 4 This is a schematic diagram of the process for constructing a semantic primitive database provided by an embodiment of the present invention. Based on any of the above embodiments, refer to... Figure 4 The semantic primitive database can be constructed through the following steps: Step 410: Select keywords from the type items in the project database and project-related professional terms from the question statement as semantic bases.
[0048] A semantic primitive can correspond to at least one keyword. Therefore, when selecting semantic primitives, it is necessary to ensure that unnecessary noise is not introduced, and that there is a sufficient number of primitives, because a small number will not contain enough semantic information. In this embodiment of the invention, the principle for selecting semantic primitives can be: to find the minimum set of feature semantic primitives that contains the necessary information from the original keywords. Therefore, a threshold can be set when extracting semantic primitives, and it should be ensured that the keyword corresponding to the semantic primitive should be more than once, and that semantic primitives with different semantic meanings should be different.
[0049] The semantic primitive database can be obtained through supervised learning. The sources of the supervised learning training corpus can be divided into two parts: question statements input through a question-answering terminal and an engineering project database. In this embodiment of the invention, keywords of type items in the engineering project database can be selected as semantic primitives, and engineering project professional terms in the input question statements can be selected as semantic primitives.
[0050] Step 420: Determine the final semantic primitive expression based on the semantic primitive and the keywords of the question statement; wherein the final semantic primitive expression includes a semantic primitive and at least one corresponding keyword.
[0051] In this embodiment of the invention, multiple keywords can be extracted from the input question statement, the semantic primitive corresponding to each keyword can be determined, and the final semantic primitive expression can be constructed based on the semantic primitive and at least one corresponding keyword.
[0052] Step 430: Construct a semantic primitive matrix based on multiple final semantic primitive expressions to obtain a semantic primitive database.
[0053] In this embodiment of the invention, each semantic primitive expression can consist of one semantic primitive and n keywords corresponding to that semantic primitive. Multiple semantic primitive expressions can form a semantic primitive matrix, which can be used to construct a semantic primitive database for semantic analysis of problematic statements.
[0054] For example, the semantic primitive matrix can be as follows: Among them, S m It can represent the m-th semantic primitive, t m1 ,t m2 ,…,t mn It can represent the n keywords corresponding to the m-th semantic primitive, where n > 1 and is a positive integer.
[0055] This invention introduces professional terminology from engineering projects as semantic primitives, then constructs semantic primitive expressions and extends them to a semantic primitive matrix, which facilitates accurate identification of problem semantics and improves the accuracy of semantic analysis.
[0056] The embodiments of the present invention construct a minimal set of feature primitives for semantic recognition, which preserves the key information for semantic recognition and avoids invalid interference, thereby improving the accuracy of semantic recognition.
[0057] Based on any of the above embodiments, determining the final semantic primitive expression based on the semantic primitive and the keywords of the question statement may specifically include: Step 421: Keyword weights that are higher than a preset weight threshold are identified as feature keywords; Step 422: Query the semantic primitives corresponding to the feature keywords according to their weights from high to low; Step 423: If no semantic primitives corresponding to the feature keywords are found, set the feature keywords as semantic primitives. Step 424: If the semantic primitive corresponding to the feature keyword is found, the feature keyword is expanded into the corresponding semantic primitive expression to determine the final semantic primitive expression.
[0058] In this embodiment of the invention, the weight of each keyword in the question statement can be calculated, and keywords with weights higher than a preset weight threshold are retained as feature keywords. The weight calculation formula can be as follows: Where T represents the number of times keyword t appears in the training library, N represents the number of keywords in the training library, and D... i Let D(t) represent the i-th question-and-answer statement. i This indicates the number of times the keyword t appears in the i-th question statement.
[0059] You can query the semantic primitives corresponding to each feature keyword in descending order of their weight. If no semantic primitive is found for the currently queried feature keyword, you can set that feature keyword as a semantic primitive.
[0060] If the semantic primitive corresponding to the feature keyword is found, the feature keyword can be expanded into the corresponding semantic primitive expression to determine the final semantic primitive expression. For example, assuming the number of keywords in the semantic primitive corresponding to the feature keyword is n (n>0), the number of keywords corresponding to the semantic primitive can be increased by 1, i.e., n = n+1. After expansion, the semantic primitive expression S = {S1, t1, t2, t3, t4, ..., t} can be obtained. n , t n+1}
[0061] This invention determines feature keywords by calculating the weights of keywords, then constructs semantic primitive expressions and extends them to semantic primitive matrices, which is beneficial for achieving accurate identification of problem semantics and improving the accuracy of semantic analysis.
[0062] Based on any of the above embodiments, the step of expanding the feature keywords into the corresponding semantic primitive expression to determine the final semantic primitive expression may specifically include: Step 4241: Expand the feature keywords into the corresponding semantic primitive expressions to obtain the expanded semantic primitive expressions; Step 4242: Verify the extended primitive expression, iteratively remove keywords from the extended primitive expression, calculate the recall and precision of the extended primitive expression under each iteration, and select the primitive expression with the highest recall and precision as the final primitive expression.
[0063] In this embodiment of the invention, after expanding the feature keywords into the corresponding semantic primitive expressions to obtain the expanded semantic primitive expressions, the expanded semantic primitive expressions can be verified in semantic analysis, and the verification results are expressed by recall and precision.
[0064] If the recall and precision when validating the expanded semantic primitive expression meet the preset ratio threshold (i.e., the expected value), the semantic primitive expression can be retained. If the recall and precision when validating the expanded semantic primitive expression do not meet the expected value, the preset weight threshold can be adjusted. The process of identifying keywords with a weight higher than the preset weight threshold as feature keywords and querying the semantic primitives corresponding to the feature keywords in descending order of their weights can be repeated. If no semantic primitive is found, the feature keyword is set as a semantic primitive. If a semantic primitive is found, the feature keyword is expanded into the corresponding semantic primitive expression. This process continues until the recall and precision of the new expanded semantic primitive expression meet the expected value.
[0065] It can iteratively remove keyword entries from the semantic primitive expressions, calculate the recall and precision of the semantic primitive expressions under each iteration, and select the semantic primitive expression with the highest recall and precision as the final semantic primitive expression.
[0066] After verification, identical semantic primitives in different semantic categories can be removed to avoid interference.
[0067] The embodiments of the present invention employ a cyclic weighting and cyclic verification method to eliminate interference words, thereby reducing the interference of invalid words on semantic analysis results while covering useful information, thus ensuring the accuracy of semantic recognition.
[0068] Based on any of the above embodiments, the step of performing semantic analysis based on keyword matching results to obtain question semantic analysis results may specifically include: Step 131: If the keywords of the question statement match the content items in the engineering project database, then mark the keywords as search conditions; Step 132: If the keyword of the question statement matches a type item in the project database, or a semantic primitive corresponding to the type item, then mark the keyword as a search field; Step 133: If the keywords of the question statement match the question semantic primitives in the semantic primitive database, then the keywords are marked as detailed questions.
[0069] In this embodiment of the invention, when performing semantic association recognition, matching keywords can be marked. The marked content can include three parts: "search conditions", "search content", and "detailed question". For example, for the question "What projects were not completed in 2024?", "2024" and "not completed" can be marked as "search conditions", "projects" can be marked as "search content", that is, the specific content of the returned answer, and "what projects were not completed" can be marked as "detailed question" for further understanding the question.
[0070] Keyword tagging and discrimination methods can be as follows: (1) Determination of search criteria: When the keywords of the question statement completely match the content items in the database, the keywords of the question statement can be marked as search criteria. Alternatively, when the confidence level of the match exceeds the confidence level threshold, the keywords of the question statement can also be marked as search criteria.
[0071] (2) Identification of search content: When the keywords of the question statement are precisely matched or fuzzily matched to the category (type) item in the database, or matched to the semantic primitive corresponding to the type item, the keywords of the question statement can be marked as the search field.
[0072] (3) Detailed question identification: Match the keywords of the question statement with the trained question semantic primitives in the semantic primitive database. If a question semantic primitive is matched, the keywords of the question statement are marked as detailed questions.
[0073] After tagging all keywords in the question statement, the text can be converted into a structured query statement that a computer can recognize. The fields in a structured query statement are unique. For example, the fields of a structured query statement might look like this: Search criteria = {condition 1; condition 2; condition 3; ...}; Search content = {search field 1; search field 2; search field 3; ...}; Detailed questions = {Question 1; Question 2; Question 3; ...}.
[0074] In this embodiment of the invention, a reverse semantic parsing method can be used. This involves using the structured query statement corresponding to the question statement to perform a reverse query in the semantic primitive database and the project database. When the question characters precisely or fuzzily match the semantic primitive database or the project database, the keyword can be removed from the original string to avoid duplicate use. Different processing methods can be adopted for reverse retrieval depending on the specific circumstances.
[0075] Based on any of the above embodiments, when the number of the second keyword is 1 and the number of the first keywords is n, the semantic primitive corresponding to the type item that matches the second keyword is used as the search field, and the n first keywords are used as the search conditions.
[0076] In this embodiment of the invention, questions can be queried in reverse using a semantic primitive database and an engineering project database. A fuzzy matching method is employed. If the retrieved question statement contains one semantic primitive of the type keyword (i.e., one second keyword matching the semantic primitive corresponding to the database type item), and the number of keywords containing database content is n (i.e., n first keywords matching the database content item), then all n first keywords can be used as search conditions, and the semantic primitives corresponding to the database type items matching the second keywords can be used as search fields. For example, the discrimination method can be as follows: if N type =1 and N content =n (n>0): type∈{search field1; search field2; search field3; ...}, content∈{condition1; condition2; condition3; ...}.
[0077] N type N represents the number of database type primitives contained in the question statement. contentThis represents the number of database content keywords contained in the question statement. `type` is the definition of the database type, and `content` represents the keywords in the database content.
[0078] The answer can be obtained using a Structured Query Language (SQL) query: `SELECT type FROM database WHERE condition1 = content1 ... conditionn = content` n .
[0079] This invention uses fuzzy matching to reverse search the project database and the semantic primitive database. It can perform precise semantic analysis based on the number of matching keywords retrieved, which is beneficial for accurate identification of the semantics of the problem and improves the accuracy of semantic analysis.
[0080] Based on any of the above embodiments, when the number of second keywords is n and the number of first keywords is m, the m first keywords are used as search conditions, and duplicate semantic primitives in the semantic primitives corresponding to the type items that match the n second keywords are deleted, and the remaining semantic primitives are marked as search fields; wherein, the duplicate semantic primitives are semantic primitives that are duplicated in the semantic primitives corresponding to the type items that match the m first keywords; wherein, m is greater than 1 and n is greater than 1.
[0081] In this embodiment of the invention, when the retrieved question statement contains n (n>1) type keyword semantic primitives (i.e., n second keywords matching the semantic primitives corresponding to database type items) and m (m>1) content keywords (i.e., m first keywords matching database content items), all m first keywords can be used as search conditions. Since each content keyword... i All correspond to the type keyword j It can be found in n type keywords. i Remove the part with type j The duplicate parts are used as the search field (i.e., duplicate semantic primitives are deleted from the semantic primitives corresponding to the type items that match the n second keywords, and the non-duplicate semantic primitives are used as the search field). For example, the discrimination method can be as follows: if N type =n (n>1)and N content =m (m>1): ∑type i -∑type j ∈{search field1; search field2; search field3}, ∑content j ∈{Condition 1; Condition 2; Condition 3}.
[0082] type j The type keyword is the corresponding category keyword to the content keyword. i Let i be the semantic primitive corresponding to the i-th database type item.
[0083] The answer can be obtained using an SQL search statement; you can specify the type. i Remove the type j Repeated parts are used as search fields: if i≠j:Select type i From database where condition1 = content1...conditionm = content m .
[0084] Based on any of the above embodiments, the step of performing semantic analysis based on keyword matching results to obtain question semantic analysis results may further include: Step 134: If the number of the first keyword and the number of the second keyword are both zero, then perform similarity matching between the question statement and the questions in the question database; Step 135: The question with the highest matching degree is taken as the semantic analysis result of the question.
[0085] In this embodiment of the invention, if the number of semantic primitives of type keywords in the retrieved database is 0 (i.e., the number of second keywords that match the semantic primitives corresponding to the database type items is 0) or the number of content keywords is 0 (i.e., the number of first keywords that match the database content items is 0), the condition will be insufficient. The question statement can be matched with the questions in the existing question database, and the question with the highest matching degree can be taken as the question to be raised, i.e., the question semantic analysis result.
[0086] Specifically, semantic similarity calculation methods can employ the Term Frequency–Inverse Document Frequency (TFIDF) method to weight keywords, forming a Vector Space Model (VSM). Then, the cosine theorem is used to calculate the similarity, and the highest similarity score is taken as the semantic answer to the question. For example: if N type =0 or N content =0: Similarity(Q1, Q2)=arcMax(answer).
[0087] In this embodiment of the invention, after matching the keywords of the question statement with the data items in the project database and the semantic primitive database, the matched keywords can be used to perform corresponding operations on the SQL statement retrieval results according to preset rules to obtain semantic analysis results.
[0088] This invention, through the introduction of a semantic primitive database, matches keywords of question statements with data items in both the engineering project database and the semantic primitive database. Semantic association analysis is then performed based on the keyword matching results, enabling precise identification of the question's semantics. This improves the accuracy of semantic analysis and, consequently, the accuracy of the retrieved answers, thus achieving intelligent question answering for engineering project management. By introducing intelligent question answering into engineering project management, rapid retrieval of engineering project query content can be achieved.
[0089] The intelligent question-answering device provided by the present invention is described below. The intelligent question-answering device described below can be referred to in correspondence with the intelligent question-answering method described above.
[0090] Figure 5 This is a structural schematic diagram of the intelligent question-answering device provided in an embodiment of the present invention. (Refer to...) Figure 5 This invention provides an intelligent question-answering device, which may specifically include the following modules: The acquisition module 510 is used to acquire the question statement input by the user and extract the keywords of the question statement; The matching module 520 is used to match the keywords of the question statement with data items in the project database and the semantic database; Analysis module 530 is used to perform semantic analysis based on keyword matching results to obtain the semantic analysis results of the question; The retrieval module 540 is used to retrieve answer information from the engineering project database and provide a response statement based on the semantic analysis results of the question.
[0091] Based on any of the above embodiments, the semantic primitive database is constructed through the following modules: The semantic source selection module is used to select keywords from type items in the project database and professional terms from the question statements of the project as semantic sources. An expression determination module is used to determine a final semantic primitive expression based on the semantic primitives and the keywords of the question statement; wherein the final semantic primitive expression includes a semantic primitive and at least one corresponding keyword; The matrix construction module is used to construct a semantic primitive matrix based on multiple final semantic primitive expressions, thereby obtaining a semantic primitive database.
[0092] Based on any of the above embodiments, the expression determination module is specifically used for: Keywords with a weight higher than a preset weight threshold are identified as feature keywords; Based on the weight of the feature keywords in descending order, query the semantic source corresponding to the feature keywords; If no semantic source corresponding to the feature keyword is found, then the feature keyword is set as the semantic source; If the semantic primitive corresponding to the feature keyword is found, the feature keyword is expanded into the corresponding semantic primitive expression to determine the final semantic primitive expression.
[0093] Based on any of the above embodiments, the expression determination module is specifically used for: The feature keywords are expanded into the corresponding semantic primitive expressions to obtain the expanded semantic primitive expressions; The extended primitive expression is verified by iteratively removing keywords from iterative expressions, calculating the recall and precision of the extended primitive expressions under each iteration, and selecting the primitive expression with the highest recall and precision as the final primitive expression.
[0094] Based on any of the above embodiments, the analysis module is specifically used for: If the first keyword of the question statement matches a content item in the engineering project database, then the first keyword is marked as a search condition; If the second keyword of the question statement matches a type item in the project database, or a semantic primitive corresponding to the type item, then the second keyword will be marked as a search field. If the third keyword of the question statement matches a question semantic primitive in the semantic primitive database, then the third keyword is marked as a detailed question.
[0095] Based on any of the above embodiments, the analysis module is specifically used to: when the number of the second keyword is 1 and the number of the first keywords is n, use the semantic primitives corresponding to the type items that match the second keyword as search fields, and use the n first keywords as search conditions.
[0096] Based on any of the above embodiments, the analysis module is specifically used to: when the number of second keywords is n and the number of first keywords is m, use the m first keywords as search conditions, delete duplicate semantic primitives in the semantic primitives corresponding to the type items that match the n second keywords, and mark the remaining semantic primitives as search fields; wherein, the duplicate semantic primitives are semantic primitives that are duplicated in the semantic primitives corresponding to the type items that match the m first keywords; wherein, m is greater than 1 and n is greater than 1.
[0097] Based on any of the above embodiments, the analysis module is further configured to: If the number of the first keyword and the number of the second keyword are both zero, then the question statement is matched with questions in the question database based on similarity. The question with the highest matching degree is taken as the result of semantic analysis.
[0098] This invention, through the introduction of a semantic primitive database, matches keywords of question statements with data items in both the engineering project database and the semantic primitive database. Semantic association analysis is then performed based on the keyword matching results, enabling precise identification of the question's semantics. This improves the accuracy of semantic analysis and, consequently, the accuracy of the retrieved answers, thus achieving intelligent question answering for engineering project management. By introducing intelligent question answering into engineering project management, rapid retrieval of engineering project query content can be achieved.
[0099] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6 As shown, the electronic device may include a processor 610, a communications interface 620, a memory 630, and a communication bus 640, wherein the processor 610, communications interface 620, and memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute an intelligent question-answering method. This method includes: acquiring a question input by a user and extracting keywords from the question; matching the keywords of the question with data items in an engineering project database and a semantic primitive database; performing semantic analysis based on the keyword matching results to obtain a question semantic analysis result; and retrieving answer information from the engineering project database and providing a response statement based on the question semantic analysis result.
[0100] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0101] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the intelligent question-answering method provided by the above methods. The method includes: acquiring a question statement input by a user and extracting keywords from the question statement; matching the keywords of the question statement with data items in an engineering project database and a semantic primitive database; performing semantic analysis based on the keyword matching results to obtain a question semantic analysis result; and retrieving answer information from the engineering project database and providing a response statement based on the question semantic analysis result.
[0102] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the intelligent question-answering method provided by the above methods. The method includes: acquiring a question statement input by a user and extracting keywords from the question statement; matching the keywords of the question statement with data items in an engineering project database and a semantic primitive database; performing semantic analysis based on the keyword matching results to obtain a question semantic analysis result; and retrieving answer information from the engineering project database and providing a response statement based on the question semantic analysis result.
[0103] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0104] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An intelligent question-answering method, It is characterized in that include: Obtaining a question sentence input by a user and extracting keywords from the question sentence; Matching the keywords of the question sentence with the data items in the engineering project database and the semantic database; Perform semantic analysis based on the keyword matching results to obtain the semantic analysis results of the question; According to the result of semantic analysis of the question, answer information is retrieved in the engineering project database and a response statement is fed back.
2. The intelligent question-answering method according to claim 1, It is characterized in that The sememe database is constructed by: selecting keywords of type items in the engineering project database and engineering project professional terms in question sentences as sememes; Determine a final semantic original expression according to the semantic original and the keywords of the question sentence; wherein the final semantic original expression includes a semantic original and at least one corresponding keyword; A sememe matrix is constructed according to multiple final sememe expressions to obtain a sememe database.
3. The intelligent question-answering method according to claim 2, It is characterized in that The determining of the final sememe expression according to the sememe and the keywords of the question sentence includes: Determine keywords whose keyword weights are higher than a preset weight threshold as feature keywords; According to the order of the weights of the characteristic keywords from high to low, query the semantic primitives corresponding to the characteristic keywords; If the semantic origin corresponding to the feature keyword is not found, the feature keyword is set as the semantic origin; If the semantic primitive corresponding to the characteristic keyword is found, the characteristic keyword is expanded into the corresponding semantic primitive expression to determine the final semantic primitive expression.
4. The intelligent question-answering method according to claim 3, It is characterized in that The step of expanding the characteristic keywords into corresponding semantic primitive expressions to determine a final semantic primitive expression includes: Expanding the characteristic keyword into the corresponding semantic original expression to obtain an expanded semantic original expression; The expanded semantic primitive expression is verified, keywords in the expanded semantic primitive expression are cyclically eliminated, the recall rate and precision rate of the expanded semantic primitive expression in each cycle are calculated, and the semantic primitive expression with the highest recall rate and precision rate is selected as the final semantic primitive expression.
5. The intelligent question-answering method according to claim 1, It is characterized in that The semantic analysis is performed according to the keyword matching results to obtain the question semantic analysis results, including: If the first keyword of the question statement matches a content item in the engineering project database, marking the first keyword as a search condition; If the second keyword of the question statement matches a type item in the engineering project database, or a semantic primitive corresponding to the type item, marking the second keyword as a search field; If the third keyword of the question sentence matches the question semantics in the semantic database, the third keyword is marked as a detailed question.
6. The intelligent question-answering method according to claim 5, It is characterized in that When the number of the second keyword is 1 and the number of the first keywords is n, the semantic primitive corresponding to the type item matching the second keyword is used as the search field, and the n first keywords are used as the search conditions.
7. The intelligent question-answering method according to claim 5, It is characterized in that When the number of the second keywords is n and the number of the first keywords is m, the m first keywords are used as search conditions, the duplicated semantic primitives in the semantic primitives corresponding to the type items matching the n second keywords are deleted, and the remaining semantic primitives are marked as search fields; wherein the duplicated semantic primitives are the semantic primitives corresponding to the type items matching the m first keywords, and wherein m is greater than 1 and n is greater than 1.
8. The intelligent question-answering method according to claim 5, It is characterized in that The performing semantic analysis according to the keyword matching result to obtain the question semantic analysis result also includes: If the number of the first keywords and the number of the second keywords are zero, performing similarity matching between the question statement and the questions in the question database; The question with the highest matching degree is taken as the result of question semantic analysis.
9. An intelligent question-answering device, It is characterized in that include: An acquisition module, used to acquire a question sentence input by a user and extract keywords of the question sentence; A matching module, used for matching the keywords of the question sentence with the data items in the engineering project database and the semantic original database; An analysis module is used to perform semantic analysis based on the keyword matching results to obtain the semantic analysis results of the question; The retrieval module is used to retrieve answer information in the engineering project database and feed back a response statement based on the result of the semantic analysis of the question.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the intelligent question-answering method as described in any one of claims 1 to 8 is implemented.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the intelligent question-answering method according to any one of claims 1 to 8 is implemented.
12. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the intelligent question-answering method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
FAQ Chinese request-answering system implementing method in tourism field
CN101373532A
Question answer query method and system in question and answer system and computer equipment
CN109815318A
Central routing method and device combining atlas questions and answers with retrieval questions and answers
CN110909140A
Database building system and method
CN113495899A
Chatbot project management system
KR102324766B1
Cited By
Information retrieval and guidance method and device based on big data software system
CN119577124A
Project management method for intelligent dialogue and computer equipment
CN119988571A
