A method and system for constructing an expert system knowledge base
Through deep learning models and improved feature extraction algorithms, semantic recognition and classification problems are solved, a large knowledge base for operation and maintenance of manufacturing enterprises is built, and scientific support for operation and maintenance optimization is realized.
Patent Information
- Application Number
- CN202110197687.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-22
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2041-02-22
AI Technical Summary
The prior art cannot effectively identify semantic components and their correspondence in sentences, resulting in the inability to accurately classify, limiting the acquisition and optimization of knowledge in the operation and maintenance process of manufacturing enterprises.
A two-way long and short-term memory condition random field model based on deep learning is used to perform Chinese word segmentation, combined with Word2vec and improved TF-IDF algorithm to extract text features, use KNN algorithm to classify, and build an expert system knowledge base through clustering algorithm to achieve automatic acquisition and Classification knowledge.
It significantly improves the effect of Chinese word segmentation, and the extracted feature data is more accurate. It quickly builds a large knowledge base for operation and maintenance of manufacturing enterprises, providing scientific basis and data support for operation and maintenance optimization.
Smart Images

Figure CN112836509B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the cross-technical field of data mining, machine learning and natural language processing, and specifically relates to a method and system for constructing an expert system knowledge base. Background Art
[0002] Manufacturing enterprises face the problem of complicated data types and sources in the operation and maintenance process, and fail to form an effective closed loop for the various problems found in design and production and manufacturing, and feedback to design and production and manufacturing. Based on big data modeling technology and architecture, by providing various structured and unstructured data such as drawings, models, documents, etc. covering the design and development of manufacturing enterprises, applying text feature extraction technology and text mining methods to automatically acquire knowledge, effectively acquire and apply knowledge in business areas such as design, manufacturing, and management, and standardize various data throughout the life cycle of manufacturing enterprises to form an expert system knowledge base for manufacturing R&D and design, and realize digital value-added services based on operation and maintenance data and on-demand optimization of the design and manufacturing process.
[0003] At present, due to the limitations of natural language processing technology and related extraction technology, the semantic components and their corresponding relationships in a sentence cannot be well identified, and therefore cannot be accurately classified. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide an expert system knowledge base construction method and system in view of the deficiencies in the above-mentioned prior art, automatically acquire knowledge using text feature extraction technology, and classify the selected features using a classification method based on machine learning to form a systematic manufacturing enterprise operation and maintenance knowledge base, provide data support and scientific basis for subsequent similar design optimization and construction management decisions, and realize optimization of the entire manufacturing process.
[0005] The present invention adopts the following technical solutions:
[0006] A method for constructing an expert system knowledge base comprises the following steps:
[0007] S1. Collect design problems, manufacturing problems and user feedback during the operation and maintenance of manufacturing enterprises through the web front end, and use the bidirectional long short-term memory conditional random field model based on the deep learning algorithm to perform Chinese word segmentation training on the collected text to obtain the word segmentation tag sequence;
[0008] S2, generate word embedding vectors by training the word segmentation tag sequence in step S1 through the Word2vec model, and then analyze the weight of each word vector in the text by improving the TF-IDF algorithm based on class frequency variance, and construct a text vector representation feature data based on the word vector and weight;
[0009] S3, using the KNN algorithm to classify the text vectors obtained in step S2, and completing the feature data corresponding to the classified text vectors through the expert system knowledge base and storing them in the feedback information database;
[0010] S4. Periodically use a clustering algorithm to process the feedback information database of step S3 to build an expert system knowledge base.
[0011] Specifically, in step S1, after removing the non-text part of the data collected by the web front end through Python regular expression or beautiful soup, the data is trained; assuming that character c is input at time t t , the window size is k; the character sequence corresponds to k sub-vectors of dimension d in the word embedding layer, and each sub-vector is connected in series to form a long vector x t ∈R H1 , H1=k×d, connect the series x t The embedding vector is used as the input of the BI-LSTM and CRF networks, and the output h is obtained after transformation by the BI-LSTM and CRF networks. t , and then a vector y with the same dimension as the label set is obtained through softmax transformation t ∈R D Indicates c t The score of each tag, D is the number of word position tags, and finally the tag sequence with the highest probability is output.
[0012] Specifically, step S2 is as follows:
[0013] S201. Use the Word2vec model to train the label sequence obtained by text segmentation and convert the segmented text into a low-dimensional numerical vector For word w i The word vector of , k is the dimension of the word vector;
[0014] S202. Use the improved TF-IDF algorithm to calculate the weight of each word vector in the text, consider the frequency of the feature words in the entire corpus and their distribution in different categories, and extract the feature words.
[0015] Furthermore, in step S202, the feature word vec(d i ) is expressed as:
[0016]
[0017] Among them, V t For the word w i The word vector of tf is the word w i Frequency of occurrence in document d, idf for word w iThe inverse document frequency in document d, τ t,i For the word w i In the document d j The class-frequency variance of .
[0018] Specifically, the improved TF-IDF algorithm is as follows:
[0019] tf-idf-τ i,j =tf-idf i,j *τ i
[0020] Among them, the introduction of the frequency-like variance τ i The distribution of words in different categories is measured as follows:
[0021]
[0022] Among them, df(d,w i ) is the text library d containing word w i The number of documents, For category c j Contains the word w i The number of documents, N is the number of text categories, τ i For word w i The class-frequency variance of .
[0023] Specifically, step S3 is as follows:
[0024] S301, after a new text arrives, determine the vector of the new text based on the feature words; select the k texts most similar to the new text from the training text set, and measure the similarity using the cosine of the vector angle; calculate the weight of each class in the k neighbors of the new text in turn, and the weight of each class is equal to the sum of the similarities between the training samples and the test samples belonging to the class in the k neighbors; compare the weights of the classes, and classify the text into the class with the largest weight;
[0025] S302. After the feature data is classified, the production framework knowledge representation rules based on the expert system are used to represent the feature data as data with a conditional behavior structure, and the framework is used as the main body to embed the data into the framework, so that the framework can find the corresponding rules through the rule class, and the rule class can find the corresponding framework through the affiliated framework name, and finally the processed data is stored in the feedback information database.
[0026] Specifically, step S4 is as follows:
[0027] S401, set a period through a trigger, use a clustering algorithm to regularly process the feedback information database, arbitrarily select k objects from n data objects as initial cluster centers, and assign the remaining data to corresponding clusters according to their similarity with these cluster centers, and then calculate the cluster center of each new cluster obtained, and repeat this process until the standard measurement function begins to converge;
[0028] S402. Set the thresholds A and B of the cluster size to judge the data to be stored in the knowledge base; for feedback data not stored in the knowledge base, directly store the data with a cluster size greater than the threshold A into the knowledge base, and manually confirm whether the data with a cluster size less than the threshold A and greater than the threshold B should be stored in the knowledge base; for newly added knowledge, add a mark to the corresponding record in the feedback information database.
[0029] Another technical solution of the present invention is an expert system knowledge base construction system, comprising:
[0030] The preprocessing module collects design and manufacturing problems in the operation and maintenance process of manufacturing enterprises and user feedback during use through the web front end, and uses a bidirectional long short-term memory conditional random field model based on a deep learning algorithm to perform Chinese word segmentation training on the collected text to obtain a word segmentation tag sequence;
[0031] The analysis module uses the Word2vec model to train the word segmentation tag sequence to generate word embedding vectors. Then, the TF-IDF algorithm is improved based on class frequency variance to analyze the weight of each word vector in the text and construct a text vector representation based on word vectors and weights.
[0032] The classification module uses the KNN algorithm for classification; after the feature data is obtained through classification, it is completed through the knowledge representation rules of the expert system knowledge base and stored in the feedback information database;
[0033] The building module periodically uses machine learning clustering algorithms to process the feedback information database and build the expert system knowledge base.
[0034] Compared with the prior art, the present invention has at least the following beneficial effects:
[0035] The invention discloses a method for constructing an expert system knowledge base. Based on big data modeling technology and architecture, the invention applies text feature extraction technology and a classification method based on machine learning to automatically acquire and classify knowledge, construct a big data knowledge base for R&D and design of manufacturing enterprises, and provide digital value-added services for operation and maintenance optimization: in the text preprocessing stage, a model based on the combination of BI-LSTM and CRF is used to process Chinese word segmentation, and the effect of Chinese word segmentation is significantly improved. In the feature extraction stage, a feature extraction method combining Word2Vec and improved TF-IDF is used, which not only considers the frequency of occurrence of feature words in the entire text library, but also considers its distribution in different categories, and the extracted feature data is more accurate. In the knowledge base construction stage, a production framework rule is used to represent and reason data. At the same time, a clustering algorithm is used to periodically classify, extract and mark data to avoid repeated processing and storage, so as to automatically and quickly establish a manufacturing enterprise operation and maintenance expert knowledge base.
[0036] Furthermore, a bidirectional long short-term memory conditional random field model based on a deep learning algorithm is used to train Chinese word segmentation on the collected text to obtain a word segmentation tag sequence. This model can automatically learn text features and model text context dependency information. At the same time, the CRF layer considers the label information before and after the sentence characters and infers the text information. It has good word segmentation performance and good generalization ability on cross-domain data.
[0037] Furthermore, the word embedding vector is generated by training the tag sequence in step S1 of the Word2vec model, and then the weight of each word vector in the text is analyzed by improving the TF-IDF algorithm based on class frequency variance, and a text vector based on the word vector and the weight is constructed to represent the feature data.
[0038] Furthermore, Word2vec is used for word representation, and the word vector obtained is a low-dimensional dense real number, which better retains semantic information, but cannot express the importance of vocabulary, so the TF-IDF algorithm is introduced to calculate the weight of each word vector in the text. However, the TF-IDF algorithm only considers the frequency of feature words in the entire corpus, ignoring the distribution of feature words in different categories, resulting in the loss of some words that contribute to category judgment. Therefore, the improved TF-IDF algorithm based on class frequency variance is used to form a vector text representation based on word vectors and weights, which well retains the contextual relationship of words.
[0039] Furthermore, the KNN algorithm is used for prediction and multi-classification, and the feature data corresponding to the classified text vector is completed through the knowledge representation rules of the expert system knowledge base and stored in the feedback information database.
[0040] Furthermore, the feedback information database is processed periodically using a clustering algorithm to quickly build an expert system knowledge base, and corresponding records in the feedback information database are marked to avoid repeated processing.
[0041] In summary, the present invention can quickly and accurately construct a knowledge base of an expert system.
[0042] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a flow chart of the present invention;
[0044] Figure 2 It is a schematic diagram of the structure of the combination of BI-LSTM and CRF of the present invention;
[0045] Figure 3 This is a schematic diagram of a model combining Word2Vec and improved TF-IDF of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0048] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0049] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0050] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.
[0051] The present invention provides a method for constructing an expert system knowledge base. Aiming at the problem of complex data types and sources in the operation and maintenance process of manufacturing enterprises, a Chinese word segmentation model based on the combination of BI-LSTM and CRF neural network is adopted in the word segmentation stage, which not only retains the characteristic of LSTM that can use context information, but also considers the dependencies between output labels through the CRF layer, and the Chinese word segmentation effect is significantly improved. In the feature extraction stage, Word2Vec is used to map words to vector space, convert them into word vectors, and the improved TF-IDF feature extraction method is combined with the word vector, which not only considers the semantic information of words, but also controls the dimension of word vectors. The present invention can better combine the big data of manufacturing enterprises to deeply mine the needs of enterprises and users, and provide digital value-added services for operation and maintenance optimization.
[0052] See also Figure 1 The present invention provides a method for constructing an expert system knowledge base, comprising the following steps:
[0053] S1. Collect design and manufacturing problems in the operation and maintenance process of manufacturing enterprises and user feedback during use through the web front end, and use the bidirectional long short-term memory conditional random field model based on the deep learning algorithm to perform Chinese word segmentation training on the collected text to obtain the word segmentation tag sequence;
[0054] After removing the non-text part of the data collected by the web front end through Python regular expression or beautiful soup, the data is trained; assuming that character c is input at time t t , the window size is k; the character sequence corresponds to k sub-vectors of dimension d in the word embedding layer, and each sub-vector is connected in series to form a long vector x t ∈R H1 , H1=k×d, connect the series x t The embedding vector is used as the input of the BI-LSTM and CRF networks, and the output h is obtained after transformation by the BI-LSTM and CRF networks. t , and then a vector y with the same dimension as the label set is obtained through softmax transformation t ∈R D Indicates c tThe score of each tag, D is the number of word position tags, and finally the tag sequence with the highest probability is output.
[0055] S2, generate word embedding vectors by training the tag sequence in step S1 through the Word2vec model, and then analyze the weight of each word vector in the text by improving the TF-IDF algorithm based on class frequency variance, and construct a text vector based on the word vector and weight to represent the feature data;
[0056] See also Figure 2 The bidirectional long short-term memory conditional random field model can automatically learn text features and model text context dependency information; at the same time, the conditional random field algorithm considers the label information before and after the sentence characters when reasoning about text information, has good word segmentation performance, and also has good generalization ability on cross-domain data.
[0057] S201. Use the Word2vec model to train the label sequence obtained by text segmentation and convert the segmented text into a low-dimensional numerical vector For word w i The word vector of , k is the dimension of the word vector;
[0058] S202. Use the improved TF-IDF algorithm to calculate the weight of each word vector in the text, consider the frequency of the feature words in the entire corpus and their distribution in different categories, and extract the feature words.
[0059] Feature word vec(d i ) is expressed as:
[0060]
[0061] Among them, V t For the word w i The word vector of tf is the word w i Frequency of occurrence in document d, idf for word w i The inverse document frequency in document d, τ t,i For the word w i In the document d j The class-frequency variance
[0062] The improved TF-IDF algorithm is as follows:
[0063] tf-idf-τ i,j =tf-idf i,j *τ i
[0064] Among them, the introduction of the frequency-like variance τ i The distribution of words in different categories is measured as follows:
[0065]
[0066] Among them, df(d,w i ) is the text library d containing word w i The number of documents, For category c j Contains the word w i The number of documents, N is the number of text categories, τ i For word w i The class-frequency variance of .
[0067] S3, classifying the text space vector obtained by processing in step S2 using the KNN algorithm, completing the feature data corresponding to the classified text vector using the knowledge representation rules of the expert system knowledge base, and storing it in the feedback information database;
[0068] First, all the word vectors in the sample are obtained through Word2vec model training; then the improved TF-IDF algorithm based on class frequency variance is used to analyze the weight of each word vector in the text and construct a text vector representation based on word vectors and weights; the text classification model combining the two has better classification effect than traditional machine learning text classification.
[0069] See also Figure 3 , calculate the TF-IDF value of the word, and use the TF-IDF value to extract feature words, use Word2vec word vector, and perform dimensionality reduction by calculating feature selection and feature weights based on the bag-of-words model.
[0070] S301, after a new text arrives, determine the vector of the new text based on the feature words; select the k texts most similar to the new text from the training text set, and measure the similarity using the cosine of the vector angle; calculate the weight of each class in the k neighbors of the new text in turn, and the weight of each class is equal to the sum of the similarities between the training samples and the test samples belonging to the class in the k neighbors; compare the weights of the classes, and classify the text into the class with the largest weight;
[0071] S302. After the feature data is classified, the production framework knowledge representation rules based on the expert system are used to represent the feature data as data with a conditional behavior structure, and the framework is used as the main body to embed the data into the framework, so that the framework can find the corresponding rules through the rule class, and the rule class can find the corresponding framework through the affiliated framework name, and finally the processed data is stored in the feedback information database.
[0072] S4. Periodically use the clustering algorithm to process the feedback information database in step S3 to construct the expert system knowledge base. For feedback data not stored in the knowledge base, the data with a cluster size greater than the threshold A is directly stored in the knowledge base, and the data with a cluster size less than the threshold A and greater than the threshold B is manually confirmed to decide whether to store it in the knowledge base; for newly added knowledge, the corresponding record in the feedback information database is marked to avoid repeated processing.
[0073] S401, set a period through a trigger, use a clustering algorithm to regularly process the feedback information database, arbitrarily select k objects from n data objects as initial cluster centers, and assign the remaining data to corresponding clusters according to their similarity with these cluster centers, and then calculate the cluster center of each new cluster obtained, and repeat this process until the standard measurement function begins to converge;
[0074] S402. Set the thresholds A and B of the cluster size to judge the data to be stored in the knowledge base; for the feedback data not stored in the knowledge base, directly store the data with a cluster size greater than the threshold A into the knowledge base, and manually confirm whether to store the data with a cluster size less than the threshold A and greater than the threshold B into the knowledge base; for the newly added knowledge, add a mark to the corresponding record in the feedback information database to avoid repeated processing.
[0075] In another embodiment of the present invention, an expert system knowledge base construction system is provided, which can be used to implement the above-mentioned expert system knowledge base construction method. Specifically, the expert system knowledge base construction system includes a preprocessing module, a word segmentation module, an analysis construction module and a classification module.
[0076] The preprocessing module collects design and manufacturing problems in the operation and maintenance process of manufacturing enterprises and user feedback during use through the web front end, and uses a bidirectional long short-term memory conditional random field model based on a deep learning algorithm to perform Chinese word segmentation training on the collected text to obtain a word segmentation tag sequence;
[0077] The analysis module generates word embedding vectors through Word2vec model training, and then analyzes the weight of each word vector in the text by improving the TF-IDF algorithm based on class frequency variance, and constructs a text vector representation based on word vectors and weights;
[0078] The classification module uses the KNN algorithm for classification. After the feature data is classified, it is completed through the knowledge representation rules of the expert system knowledge base and stored in the feedback information database;
[0079] The construction module periodically uses the machine learning clustering algorithm to process the feedback information database. For feedback data that has not been stored in the knowledge base, the data with a cluster size greater than the threshold A is directly stored in the knowledge base, and the data with a cluster size less than the threshold A and greater than the threshold B is manually confirmed to decide whether to store it in the knowledge base again; for newly added knowledge, the corresponding records in the feedback information database are marked to avoid repeated processing;
[0080] The user inputs the ship's operation and maintenance information through the web client interface. After collecting the text, preprocessing and feature extraction are performed to obtain the feature data of "low lubricating oil pressure". This feature data is classified into the "lubrication system" category. The reasons for low lubricating oil pressure include rupture of the lubricating oil pipe or air, dirty and blocked lubricating oil filter, low lubricating oil viscosity, etc. The production framework knowledge representation rules are used to complete the data:
[0081]
[0082]
[0083] After storing the characteristic data with the production framework structure into the feedback information database one by one, data is regularly extracted from the database for cluster analysis and marking according to the cycle time set by the trigger. For data not stored in the knowledge base, data with a cluster size greater than threshold A and not accessed are stored in the knowledge base, and data with a cluster size less than threshold A and greater than threshold B are stored after manual confirmation, and the marked data are not processed.
[0084] In summary, the present invention provides an expert system knowledge base construction method and system, which is aimed at the operation and maintenance big data of manufacturing enterprises, applies text feature extraction technology and classification methods based on machine learning to automatically acquire and classify knowledge, constructs the R&D and design big data knowledge base of manufacturing enterprises, and provides digital value-added services for operation and maintenance optimization.
[0085] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0086] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0087] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0088] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0089] The above contents are only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A method for constructing an expert system knowledge base, characterized in that: The following steps are involved: S1. Collect design problems, manufacturing problems and user feedback during the operation and maintenance of manufacturing enterprises through the web front end, and use the bidirectional long short-term memory conditional random field model based on the deep learning algorithm to perform Chinese word segmentation training on the collected text to obtain the word segmentation tag sequence; S2, generate word embedding vectors through the word segmentation tag sequence in step S1 of the Word2vec model training step, and then analyze the weight of each word vector in the text by improving the TF-IDF algorithm based on class frequency variance, and construct a text vector representation feature data based on word vectors and weights, specifically: S201. Use the Word2vec model to train the label sequence obtained by text segmentation and convert the segmented text into a low-dimensional numerical vector For word w i The word vector of , k is the dimension of the word vector; S202, using the improved TF-IDF algorithm to calculate the weight of each word vector in the text, considering the frequency of the feature word in the entire corpus and the distribution in different categories, extract the feature word, the feature word vec(d i ) is expressed as: Among them, V t For the word w i The word vector of tf is the word w i Frequency of occurrence in document d, idf for word w i The inverse document frequency in document d, τ t,i For the word w i In the document d i The class-frequency variance of The improved TF-IDF algorithm is specifically: tf-idf-τ i,j =tf-idf i,j *τ i Among them, the introduction of the frequency-like variance τ i The distribution of words in different categories is measured as follows: Among them, df(d,w i ) is the text library d containing word w i The number of documents, df(d cj ,w i ) is category c j Contains the word w i The number of documents, N is the number of text categories, τ i For word w i The class-frequency variance of S3, using the KNN algorithm to classify the text vectors obtained in step S2, and storing the feature data corresponding to the classified text vectors in the feedback information database after completion through the expert system knowledge base, specifically: S301, after a new text arrives, determine the vector of the new text based on the feature words; select the k texts most similar to the new text from the training text set, and measure the similarity using the cosine of the vector angle; calculate the weight of each class in the k neighbors of the new text in turn, and the weight of each class is equal to the sum of the similarities between the training samples and the test samples belonging to the class in the k neighbors; compare the weights of the classes, and classify the text into the class with the largest weight; S302, after the feature data is obtained through classification, the feature data is represented as data with a conditional behavior structure by using a production framework knowledge representation rule based on an expert system, and the data is embedded into the framework with the framework representation as the main body, so that the framework finds the corresponding rule through the rule class, and the rule class finds the corresponding framework through the affiliated framework name, and finally the processed data is stored in the feedback information database; S4, periodically use the clustering algorithm to process the feedback information database of step S3 to build an expert system knowledge base, specifically: S401, set a period through a trigger, use a clustering algorithm to regularly process the feedback information database, arbitrarily select k objects from n data objects as initial cluster centers, and assign the remaining data to corresponding clusters according to their similarity with these cluster centers, and then calculate the cluster center of each new cluster obtained, and repeat this process until the standard measurement function begins to converge; S402. Set the thresholds A and B of the cluster size to judge the data to be stored in the knowledge base; for feedback data not stored in the knowledge base, directly store the data with a cluster size greater than the threshold A into the knowledge base, and manually confirm whether the data with a cluster size less than the threshold A and greater than the threshold B should be stored in the knowledge base; for newly added knowledge, add a mark to the corresponding record in the feedback information database.
2. The method according to claim 1, characterized in that In step S1, after removing the non-text part of the data collected by the web front end through Python regular expression or beautiful soup, the data is trained; assuming that character c is input at time t t , the window size is k; the character sequence corresponds to k sub-vectors of dimension d in the word embedding layer, and each sub-vector is connected in series to form a long vector x t ∈R H1 , H1=k×d, connect the series x t The embedding vector is used as the input of the BI-LSTM and CRF networks, and the output h is obtained after transformation by the BI-LSTM and CRF networks. t , and then a vector y with the same dimension as the label set is obtained through softmax transformation t ∈R D Indicates c t The score of each tag, D is the number of word position tags, and finally the tag sequence with the highest probability is output.
3. An expert system knowledge base construction system, characterized in that: include: The preprocessing module collects design and manufacturing problems in the operation and maintenance process of manufacturing enterprises and user feedback during use through the web front end, and uses a bidirectional long short-term memory conditional random field model based on a deep learning algorithm to perform Chinese word segmentation training on the collected text to obtain a word segmentation tag sequence; The analysis module trains the word segmentation tag sequence through the Word2vec model to generate word embedding vectors, and then improves the TF-IDF algorithm based on class frequency variance to analyze the weight of each word vector in the text and construct a text vector representation based on word vectors and weights. Specifically: S201. Use the Word2vec model to train the label sequence obtained by text segmentation and convert the segmented text into a low-dimensional numerical vector For word w i The word vector of , k is the dimension of the word vector; S202, using the improved TF-IDF algorithm to calculate the weight of each word vector in the text, considering the frequency of the feature word in the entire corpus and the distribution in different categories, extract the feature word, the feature word vec(d i ) is expressed as: Among them, V t For the word w i The word vector of tf is the word w i Frequency of occurrence in document d, idf for word w i The inverse document frequency in document d, τ t,i For the word w i In the document d j The class-frequency variance of The improved TF-IDF algorithm is specifically: tf-idf-τ i,j =tf-idf i,j *τ i Among them, the introduction of the frequency-like variance τ i The distribution of words in different categories is measured as follows: Among them, df(d,w i ) is the text library d containing word w i The number of documents, For category c j Contains the word w i The number of documents, N is the number of text categories, τ i For word w i The class-frequency variance of The classification module uses the KNN algorithm for classification; after the feature data is obtained through classification, it is completed through the knowledge representation rules of the expert system knowledge base and stored in the feedback information database, specifically: S301, after a new text arrives, determine the vector of the new text based on the feature words; select the k texts most similar to the new text from the training text set, and measure the similarity using the cosine of the vector angle; calculate the weight of each class in the k neighbors of the new text in turn, and the weight of each class is equal to the sum of the similarities between the training samples and the test samples belonging to the class in the k neighbors; compare the weights of the classes, and classify the text into the class with the largest weight; S302, after the feature data is obtained through classification, the feature data is represented as data with a conditional behavior structure by using a production framework knowledge representation rule based on an expert system, and the data is embedded into the framework with the framework representation as the main body, so that the framework finds the corresponding rule through the rule class, and the rule class finds the corresponding framework through the affiliated framework name, and finally the processed data is stored in the feedback information database; The building module periodically uses machine learning clustering algorithms to process the feedback information database and build an expert system knowledge base, specifically: S401, set a period through a trigger, use a clustering algorithm to regularly process the feedback information database, arbitrarily select k objects from n data objects as initial cluster centers, and assign the remaining data to corresponding clusters according to their similarity with these cluster centers, and then calculate the cluster center of each new cluster obtained, and repeat this process until the standard measurement function begins to converge; S402. Set the thresholds A and B of the cluster size to judge the data to be stored in the knowledge base; for feedback data not stored in the knowledge base, directly store the data with a cluster size greater than the threshold A into the knowledge base, and manually confirm whether the data with a cluster size less than the threshold A and greater than the threshold B should be stored in the knowledge base; for newly added knowledge, add a mark to the corresponding record in the feedback information database.
