An Intent Recognition Method for Question Answering in CNC Machine Tool Fault Diagnosis
By decomposing user-input queries into single-hop and multi-hop queries, and combining knowledge graphs and various text processing methods, the problem of insufficient matching accuracy in complex queries by traditional methods is solved, and high-accuracy recognition of intent is achieved in the CNC machine tool fault diagnosis question-and-answer system.
Patent Information
- Application Number
- CN202410421456.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-09
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2044-04-09
AI Technical Summary
In existing CNC machine tool fault diagnosis question-and-answer systems, traditional intent recognition methods struggle to handle complex queries, resulting in insufficient matching accuracy and an inability to fully understand and parse the deep structure and complexity of user query intent.
The user-input query statement is decomposed into single-hop query statement and multi-hop query statement. The starting point and ending point of the retrieval are identified by knowledge graph. Methods such as component syntactic analysis, AC automaton matching, text representation model and dependency parsing are used to process semantically incomplete keywords. A CNC machine tool fault diagnosis dictionary is constructed for accurate matching and semantic expansion.
It improves the accuracy of intent recognition, enabling a comprehensive understanding and parsing of the deep structure in complex query statements, ensuring that user query intent is accurately parsed and applied to the corresponding knowledge graph retrieval and service calls.
Smart Images

Figure CN118395228B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of CNC machine tool fault diagnosis technology, and more specifically, relates to an intent recognition method for question answering in CNC machine tool fault diagnosis. Background Technology
[0002] In building a CNC machine tool fault diagnosis question-and-answer system, intent recognition is a crucial step. Intent recognition accurately parses the specific intent of a user's query and categorizes it into predefined categories. This process is not only fundamental to understanding the user's query purpose but also key to activating the corresponding services or applications within the system.
[0003] In CNC machine tool fault diagnosis question-and-answer systems, traditional intent recognition methods primarily involve calculating semantic similarity or performing exact matching between the user's input question (or retrieval statement) and entities in a knowledge graph to find the corresponding entity and then perform relevant fault diagnosis retrieval. While these methods may perform well with simple queries, they often rely on fixed patterns for matching when faced with complex queries, resulting in insufficient matching accuracy. Furthermore, they can only perform knowledge graph retrieval for a single path, whereas complex queries often involve retrieval paths for multiple entities and their interrelationships.
[0004] In addition, the natural language expressions used by users in their queries are highly diverse and complex, including but not limited to synonym substitution, function word insertion, and word order reversal. This makes it difficult for traditional intent recognition methods to fully understand and analyze the deep structure and complexity of query intent when faced with these complex fault diagnosis problems, relying solely on rule-based or exact matching mechanisms. This further limits the accuracy of subsequent fault retrieval and matching. Summary of the Invention
[0005] In view of the above-mentioned defects or improvement needs of the existing technology, the present invention provides an intent recognition method for question answering in CNC machine tool fault diagnosis, the purpose of which is to improve the accuracy of intent recognition.
[0006] To achieve the above objectives, according to a first aspect of the present invention, an intent recognition method for question-and-answer processing in CNC machine tool fault diagnosis is provided, comprising: The user-input queries are divided into single-hop query statements and multi-hop query statements. The single-hop query statement includes simple single-hop queries for machine tool alarm numbers or machine tool information, while the multi-hop query statement refers to fault diagnosis questions related to fault causes and fault solutions. Extract the category and name of the query target contained in the single-hop query statement, and use the category and name of the query target as the starting point for retrieval in the knowledge graph; and extract the trigger words in the single-hop query statement that represent the relationship between the retrieval starting point and the retrieval ending point, and determine the retrieval ending point in the knowledge graph based on the trigger words and the retrieval starting point; wherein, the knowledge graph is used for CNC machine tool fault diagnosis question answering; Extract one or more fault-related entities, including fault phenomena and fault keywords, from the multi-hop query statement; use the extracted fault-related entities as the starting point for retrieval in the knowledge graph; Determine whether the trigger words used to characterize the cause of the fault can be extracted from the multi-hop query statement. If yes, the search endpoint is located on the entity in the knowledge graph that characterizes the cause of the fault. If no, the search endpoint is located on the entity in the knowledge graph that characterizes the solution to the fault, thereby achieving intent recognition. Extracting fault phenomena and fault keywords from the multi-hop query statements includes: constructing a CNC machine tool fault diagnosis dictionary, which contains entity information of fault phenomena and fault keywords from the knowledge graph; The multi-hop query statement is precisely matched with fault keywords in the dictionary. If no fault keywords are matched, a text representation model is used to generate a text vector for the multi-hop query statement, and the fault phenomenon text vector with the highest similarity to the text vector is selected as the required fault phenomenon in the knowledge graph. If a fault keyword is matched, the multi-hop query statement is segmented using the component sentence method to obtain multiple segmented clauses; the fault keywords in the clauses are precisely matched, and the semantically complete fault keywords are directly used as the required fault keywords; The semantically incomplete fault keywords are semantically expanded to obtain semantically expanded text. The similarity between the semantically expanded text and the fault keywords in the dictionary is calculated. If the similarity does not exceed a set threshold, the semantically incomplete fault keywords are used as the required fault keywords. Otherwise, the fault keyword in the dictionary with the highest similarity to the semantically expanded text is used as the required fault keyword.
[0007] Furthermore, semantically incomplete fault keywords are semantically expanded to obtain semantically expanded text, including: Construct a corresponding dependency parsing graph for clauses corresponding to semantically incomplete fault keywords; wherein, the semantically incomplete fault keywords serve as a corresponding node in the dependency parsing graph; Using semantically incomplete fault keywords in the dependency parsing graph as the starting point for retrieval, a subgraph search is performed on the dependency parsing graph to generate the corresponding retrieval subgraph; The retrieval subgraph is arranged according to the word order in the multi-hop query statement to generate corresponding text, which is then used as the semantically expanded text.
[0008] Further, the machine tool alarm number or alarm information of the multi-hop query statement is extracted, including: The machine tool alarm number is obtained by performing an exact match on the multi-hop query statement in the dictionary. The multi-hop query statement is subjected to fuzzy matching of alarm information in the dictionary to obtain alarm information; wherein, the dictionary also contains machine tool alarm numbers and alarm information in the knowledge graph.
[0009] Furthermore, an AC automaton is used to perform precise matching of fault keywords in the dictionary for the multi-hop query statement.
[0010] Furthermore, it also includes classifying user-inputted questions into command query statements; Extract the trigger words representing the current service from the instruction query statement, and then call the corresponding service; wherein, the trigger words include display, visualization, adding data or updating knowledge graph.
[0011] According to a second aspect of the present invention, a question-and-answer method for diagnosing faults in CNC machine tools is provided, comprising: using the intent recognition method described in any one of the first aspects to identify the starting point and ending point of the user's input in a knowledge graph; The search is performed on the knowledge graph based on the starting and ending points of the search.
[0012] According to a third aspect of the present invention, an intent recognition system for question-and-answering in CNC machine tool fault diagnosis is provided, comprising a computer-readable storage medium and a processor; The computer-readable storage medium is used to store executable instructions; The processor is configured to read executable instructions stored in the computer-readable storage medium and execute the intent recognition method according to any one of the first aspects.
[0013] According to a fourth aspect of the invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the intent recognition method as described in any of the first aspects, and / or the CNC machine tool fault diagnosis question-and-answer method as described in the second aspect.
[0014] According to a fifth aspect of the present invention, a computer program product is provided that, when the computer program product is run on a computer, causes the computer to execute the intent recognition method described in any one of the first aspects, or / and the CNC machine tool fault diagnosis question-and-answer method described in the second aspect.
[0015] In summary, the above-described technical solutions conceived in this invention can achieve the following beneficial effects: (1) The intent recognition method for question answering in CNC machine tool fault diagnosis of the present invention decomposes the question input by the user into single-hop query statement and multi-hop query statement, and transforms the retrieval problem of single-hop query statement and multi-hop query statement in the knowledge graph into the problem of identifying the query start point and end point in the knowledge graph. Especially for the retrieval of complex query statement (multi-hop query statement), by identifying the retrieval start point and end point in the statement, multiple paths corresponding to the start point and end point can be queried, which facilitates the comprehensive and accurate identification of all retrieval paths in complex query statement, thereby improving the accuracy of matching.
[0016] (2) Furthermore, when matching various fault keywords, the natural language is processed by the designed text processing method to extract key information from the sentence and expand the semantically incomplete keywords. This enables the identification of all starting information in complex query statements as much as possible, so that the method of the present invention can fully understand and analyze the deep structure and complexity of the query intent, and further improve the accuracy of intent recognition.
[0017] (3) Furthermore, the semantic expansion of semantically incomplete fault keywords is carried out by using dependency parsing and subgraph retrieval. The semantic expansion task is abstracted into a subgraph retrieval problem. By selecting the target fault node (semantically incomplete fault keyword) as the starting point, the dependency parsing graph is subgraphed and the obtained subgraph is reorganized into a form that conforms to the word order of natural language. The semantically expanded text can be obtained. The method is simple and has high accuracy.
[0018] (4) Furthermore, different matching methods are used to determine the starting point of retrieval based on the characteristics of different fault entity information in multi-hop query statements, which has high accuracy.
[0019] (5) Furthermore, it also includes dividing the user-input question statements into instruction query statements. By decomposing the abstract and complex task into question query statements and instruction query statements, different methods are used to retrieve or match different types of query statements. This can effectively identify and process queries and instructions in the field of CNC machine tool fault diagnosis, and ensure that the user's query intent is accurately parsed and applied to the corresponding knowledge graph retrieval and service call. Attached Figure Description
[0020] Figure 1 This is a flowchart of the intent recognition method for question answering in CNC machine tool fault diagnosis according to an embodiment of the present invention.
[0021] Figure 2This is a flowchart illustrating the determination of the retrieval starting point in a complex multi-hop query intent according to an embodiment of the present invention.
[0022] Figure 3 This is a flowchart illustrating the keyword extraction process based on dependency parsing and subgraph retrieval in an embodiment of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0024] Example 1 like Figure 1 As shown, this embodiment of the invention provides an intent recognition method for question-and-answer processing in CNC machine tool fault diagnosis, mainly including: S1. Divide user-input queries into single-hop query statements and multi-hop query statements. Single-hop query statements include simple single-hop queries for machine tool alarm numbers or machine tool information, such as a user asking which CNC models are included in a machine tool brand, alarm numbers, or what alarm information the alarm number indicates. Multi-hop query statements refer to fault diagnosis questions related to fault causes and solutions.
[0025] S2. For single-hop query statements, extract the category and name of the query target contained in the single-hop query statement, and use the category and name of the query target as the starting point for retrieval in the knowledge graph; extract the trigger words in the single-hop query statement that represent the relationship between the retrieval starting point and the retrieval ending point, and determine the retrieval ending point in the knowledge graph based on the trigger words and the retrieval starting point. For example, by accurately matching machine tool information and alarm numbers, the category and name of the query target are obtained, and used as the starting point for retrieval in the knowledge graph. Then, based on the relationships between the retrieval starting point and the ending point represented by "contains", "which ones", "brands", etc., the retrieval ending point in the knowledge graph is determined. In this embodiment of the invention, the knowledge graph is used for CNC machine tool fault diagnosis question answering. The knowledge graph constructed for the CNC machine tool fault diagnosis question answering system in this embodiment of the invention is shown in Table 1 below.
[0026] For multi-hop query statements, information is extracted from the multi-hop query statements to obtain one or more fault-related entities, including machine tool alarm number, alarm information, fault phenomenon and fault keywords; the extracted fault-related entities are used as the starting point for retrieval in the knowledge graph; The system determines whether trigger words representing the cause of the fault can be extracted from the multi-hop query. If so, the search endpoint is located on the entity representing the cause of the fault in the knowledge graph; otherwise, the search endpoint is located on the entity representing the solution to the fault in the knowledge graph. Trigger words representing the cause of the fault include "cause," "principle," and "why."
[0027] Table 1. Knowledge Graph of CNC Machine Tool Fault Diagnosis Question and Answer System
[0028] Furthermore, S1 also includes: dividing the user-inputted question into instruction query statements; extracting trigger words representing the current service from the instruction query statements, and then calling the corresponding service; wherein, the trigger words representing the current service include "display," "visualize," "add data," "update knowledge graph," etc. For example, the visualization module in the CNC machine tool fault diagnosis question and answer system is called through the trigger words "display" and "visualize"; the data update module and other services in the CNC machine tool fault diagnosis question and answer system are called through trigger words such as "add data" and "update knowledge graph."
[0029] The intent recognition method for CNC machine tool fault diagnosis question answering in this embodiment of the invention decomposes the user-input question into single-hop query statements and multi-hop query statements, and transforms the retrieval problem of single-hop and multi-hop query statements in the knowledge graph into the problem of identifying the query start and end points in the knowledge graph. Especially for the retrieval of complex query statements (multi-hop query statements), by identifying the retrieval start and end points in the statement, multiple paths corresponding to the start and end points can be queried, which facilitates the comprehensive and accurate identification of all retrieval paths in complex query statements, thereby improving the accuracy of matching.
[0030] Furthermore, the intent recognition method in this embodiment of the invention also includes dividing the user-input question statement into instruction query statements. By decomposing the abstract and complex task into question query statements and instruction query statements, different methods are used for retrieval or matching for different types of query statements. This can effectively identify and process queries and instructions in the field of CNC machine tool fault diagnosis, ensuring that the user's query intent is accurately parsed and applied to the corresponding knowledge graph retrieval and service call.
[0031] As a further design of the present invention, considering the great diversity and complexity of natural language expressions used in user queries, this embodiment of the present invention provides a specific method to determine the retrieval starting point in complex multi-hop query intents.
[0032] Specifically, such as Figure 2 and Figure 3As shown, for multi-hop query statements, information extraction is performed on the multi-hop query statement to obtain one or more fault-related entities from the machine tool alarm number, alarm information, fault phenomenon, and fault keywords in the multi-hop query statement, including: A fault diagnosis dictionary for CNC machine tools is constructed, which includes machine tool alarm numbers, alarm information, fault phenomena, and fault keyword entity information from a knowledge graph. For multi-hop query statements, perform an exact match on the machine tool alarm number in the dictionary to obtain the machine tool alarm number, and use the obtained machine tool alarm number as the retrieval starting point for the corresponding path; For multi-hop query statements, perform fuzzy matching of alarm information in the dictionary to obtain alarm information, and use the obtained alarm information as the retrieval starting point for the path; For multi-hop query statements, the fault keywords are precisely matched in the dictionary. In this embodiment of the invention, an Aho-Corasick Automaton is used to precisely match the fault keywords contained in the multi-hop query statement. If no fault keywords are matched in the dictionary, a text representation model is used to generate a text vector for the multi-hop query statement, and the fault phenomenon text vector with the highest similarity to the text vector is identified in the knowledge graph as the corresponding fault phenomenon, that is, the retrieval starting point.
[0033] If a fault keyword is matched in the dictionary, the multi-hop query statement is segmented using the component clause method to obtain multiple segmented clauses; the fault keywords in the clauses are precisely matched, and the semantically complete fault keywords are directly added to the fault keyword list; each fault keyword in the fault keyword list serves as the corresponding fault-related entity, which is also the starting point of the retrieval. For each semantically incomplete fault keyword, semantic expansion is performed to form semantically expanded text. The similarity between the semantically expanded text and fault keywords in the dictionary is calculated. If the similarity does not exceed a set threshold, the semantically incomplete fault keyword is directly used as the corresponding fault-related entity, i.e., the retrieval starting point. If the similarity is greater than the set threshold, the fault keyword with the highest similarity to the semantically expanded text in the dictionary is added to the fault keyword list. The fault keywords in the final fault keyword list are the required fault keywords. In this embodiment of the invention, the set similarity threshold is 0.75.
[0034] Preferably, in this embodiment of the invention, semantic expansion of semantically incomplete fault keywords is performed using dependency parsing and subgraph retrieval, including: For clauses corresponding to semantically incomplete fault keywords, construct corresponding dependency parsing graphs; where semantically incomplete fault keywords are used as corresponding nodes in the dependency parsing graph; if the clauses corresponding to the dependency parsing graph contain multiple semantically incomplete fault keywords, then the multiple semantically incomplete fault keywords are used as corresponding nodes in the dependency parsing graph respectively. Using semantically incomplete fault keywords in the dependency parsing graph as the starting point for retrieval, a breadth-first search (BFS) or depth-first search (DFS) strategy is used to perform subgraph search on the dependency parsing graph to generate the corresponding retrieval subgraph; The retrieval subgraphs generated for each retrieval starting point are arranged according to the word order in the multi-hop query statement to generate the corresponding text. This text is then used as the semantically expanded text corresponding to the semantically incomplete fault keyword.
[0035] The method in this embodiment of the invention employs different matching methods to determine the retrieval starting point based on the characteristics of different fault entity information in multi-hop query statements. When matching various fault keywords, a designed text processing method is used to process natural language, extract key information from sentences, and expand semantically incomplete keywords. This enables the identification of all starting point information in complex query statements as much as possible, allowing the method of this invention to fully understand and parse the deep structure and complexity of query intent, further improving the accuracy of intent recognition.
[0036] Furthermore, a semantic augmentation of semantically incomplete fault keywords is performed using dependency parsing and subgraph retrieval. The semantic augmentation task is abstracted into a subgraph retrieval problem. By selecting the target fault node (semantically incomplete fault keyword) as the starting point, subgraph retrieval is performed on the dependency parsing graph. The obtained subgraph is then reorganized into a form that conforms to the word order of natural language to obtain the semantically augmented text.
[0037] Example 2 This invention provides a question-and-answer method for diagnosing CNC machine tool faults, including: using the intent recognition method in Embodiment 1 to identify the starting point and ending point of the user's input in the knowledge graph; Searching is performed on the knowledge graph based on the starting and ending points of the search.
[0038] Example 3 This invention provides an intent recognition system for question-and-answering in CNC machine tool fault diagnosis, including a computer-readable storage medium and a processor; Computer-readable storage media are used to store executable instructions; The processor is used to read executable instructions stored in a computer-readable storage medium and execute the intent recognition method in Embodiment 1. The specific implementation method is described in Embodiment 1 above and will not be repeated here.
[0039] Example 4 This invention provides a computer-readable storage medium storing a computer program. When executed by a processor, the program implements the intent recognition method as described in Embodiment 1, or / and the CNC machine tool fault diagnosis question-and-answer method as described in Embodiment 2. Specific implementation details are provided in Embodiment 1 above and will not be repeated here.
[0040] Example 5 This invention provides a computer program product that, when run on a computer, causes the computer to execute the intent recognition method in Embodiment 1, or / and the CNC machine tool fault diagnosis question-and-answer method in Embodiment 2. The specific implementation methods are described in Embodiment 1 above and will not be repeated here.
[0041] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An intent recognition method for question-and-answer format in CNC machine tool fault diagnosis, characterized in that, include: The user-input queries are divided into single-hop query statements and multi-hop query statements. The single-hop query statement includes simple single-hop queries for machine tool alarm numbers or machine tool information, while the multi-hop query statement refers to fault diagnosis questions related to fault causes and fault solutions. Extract the category and name of the query target contained in the single-hop query statement, and use the category and name of the query target as the starting point for retrieval in the knowledge graph; and extract the trigger words in the single-hop query statement that represent the relationship between the retrieval starting point and the retrieval ending point, and determine the retrieval ending point in the knowledge graph based on the trigger words and the retrieval starting point; wherein, the knowledge graph is used for CNC machine tool fault diagnosis question answering; Extract one or more fault-related entities, including fault phenomena and fault keywords, from the multi-hop query statement; use the extracted fault-related entities as the starting point for retrieval in the knowledge graph; Determine whether the trigger words used to characterize the cause of the fault can be extracted from the multi-hop query statement. If yes, the search endpoint is located on the entity in the knowledge graph that characterizes the cause of the fault. If no, the search endpoint is located on the entity in the knowledge graph that characterizes the solution to the fault, thereby achieving intent recognition. Extracting fault phenomena and fault keywords from the multi-hop query statements includes: constructing a CNC machine tool fault diagnosis dictionary, which contains entity information of fault phenomena and fault keywords from the knowledge graph; The multi-hop query statement is precisely matched with fault keywords in the dictionary. If no fault keywords are matched, a text representation model is used to generate a text vector for the multi-hop query statement, and the fault phenomenon text vector with the highest similarity to the text vector is selected as the required fault phenomenon in the knowledge graph. If a fault keyword is matched, the multi-hop query statement is segmented using the component sentence method to obtain multiple segmented clauses; the fault keywords in the clauses are precisely matched, and the semantically complete fault keywords are directly used as the required fault keywords; The semantically incomplete fault keywords are semantically expanded to obtain semantically expanded text. The similarity between the semantically expanded text and the fault keywords in the dictionary is calculated. If the similarity does not exceed a set threshold, the semantically incomplete fault keywords are used as the required fault keywords. Otherwise, the fault keyword in the dictionary with the highest similarity to the semantically expanded text is used as the required fault keyword.
2. The intent recognition method according to claim 1, characterized in that, Semantic expansion is performed on semantically incomplete fault keywords to obtain semantically expanded text, including: Construct a corresponding dependency parsing graph for clauses corresponding to semantically incomplete fault keywords; wherein, the semantically incomplete fault keywords serve as a corresponding node in the dependency parsing graph; Using semantically incomplete fault keywords in the dependency parsing graph as the starting point for retrieval, a subgraph search is performed on the dependency parsing graph to generate the corresponding retrieval subgraph; The retrieval subgraph is arranged according to the word order in the multi-hop query statement to generate corresponding text, which is then used as the semantically expanded text.
3. The intent recognition method according to claim 1 or 2, characterized in that, Extract the machine tool alarm number or alarm information from the multi-hop query statement, including: The machine tool alarm number is obtained by performing an exact match on the multi-hop query statement in the dictionary. The multi-hop query statement is subjected to fuzzy matching of alarm information in the dictionary to obtain alarm information; wherein, the dictionary also contains machine tool alarm numbers and alarm information in the knowledge graph.
4. The intent recognition method according to claim 1 or 2, characterized in that, An AC automaton-based method is used to perform precise matching of fault keywords in the dictionary for the multi-hop query statements.
5. The intent recognition method according to claim 1, characterized in that, It also includes classifying user-input queries into instruction query statements; Extract the trigger words representing the current service from the instruction query statement, and then call the corresponding service; wherein, the trigger words include display, visualization, adding data or updating knowledge graph.
6. A question-and-answer method for diagnosing faults in CNC machine tools, characterized in that, include: Using the intent recognition method according to any one of claims 1-5, the starting point and ending point of the user's input in the knowledge graph are identified; The search is performed on the knowledge graph based on the starting and ending points of the search.
7. An intent recognition system for question-and-answer format in CNC machine tool fault diagnosis, characterized in that, Includes computer-readable storage media and processors; The computer-readable storage medium is used to store executable instructions; The processor is configured to read executable instructions stored in the computer-readable storage medium and execute the intent recognition method according to any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the intent recognition method as described in any one of claims 1-5, or / and the CNC machine tool fault diagnosis question-and-answer method as described in claim 6.
9. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to execute the intent recognition method according to any one of claims 1-5, or / and the CNC machine tool fault diagnosis question-and-answer method according to claim 6.
