Method and system for detecting domestic rate of enterprise equipment based on large model
Through the domestic rate detection method of enterprise equipment based on large models, the equipment's origin information is automatically identified, and the problems of time-consuming, labor-intensive and accurate accuracy of traditional manual inspection methods are solved, achieving efficient and accurate domestic rate detection.
Patent Information
- Application Number
- CN202411529624.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-25
AI Technical Summary
Traditional manual detection methods are time-consuming and labor-intensive, requiring manual search and judgment of equipment suppliers and origin information one by one, resulting in waste of human resources and human errors, and the accuracy is limited by subjective factors.
The domestic rate detection method of enterprise equipment based on large models is used to extract equipment attribute data through structured query language, convert it into word vectors using natural language processing technology, calculate word frequency-reverse file frequency values, extract text keywords, and identify production location information based on pre-trained large models to determine domestic equipment.
It realizes automated detection of the domestic production rate of equipment, significantly improves detection efficiency and accuracy, reduces errors caused by manual operations, and reduces labor costs and operational error rates.
Smart Images

Figure CN119515457A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of language processing technology, and in particular to a method and system for detecting the domestic production rate of enterprise equipment based on a large model. Background Art
[0002] The domestic production rate of enterprise equipment is one of the important indicators for evaluating enterprise procurement and supply chain management. With the development of the global economy and the increase in international trade, enterprises are facing more and more choices in the process of equipment procurement. However, for some countries and regions, domestic enterprises have given priority to domestic equipment when purchasing equipment.
[0003] Traditional manual inspection methods have some problems when testing the domestic production rate of enterprise equipment. First, manual inspection methods are time-consuming and labor-intensive, requiring manual search and judgment of the supplier and origin information of the equipment one by one, which not only wastes a lot of human resources, but is also prone to human errors and omissions; second, the accuracy of manual inspection methods is limited and easily affected by subjective factors and personal experience, resulting in inconsistent and unreliable results.
[0004] Currently, no effective solution has been proposed for the problems in the related technologies. Summary of the invention
[0005] In order to overcome the above problems, the present invention aims to propose a method and system for detecting the domestic production rate of enterprise equipment based on a large model, with the aim of solving the problem that the manual detection method is time-consuming and labor-intensive, and requires manual search and judgment of the supplier and origin information of the equipment one by one, which not only wastes a lot of human resources, but is also prone to human errors and omissions; the accuracy of the manual detection method is limited, and it is easily affected by subjective factors and personal experience, resulting in inconsistency and unreliability of the results.
[0006] To this end, the specific technical solution adopted by the present invention is as follows:
[0007] According to one aspect of the present invention, a method for detecting the domestic production rate of enterprise equipment based on a large model is provided, and the method for detecting the domestic production rate of enterprise equipment includes the following steps:
[0008] S1. Use structured query language to extract and preprocess the enterprise's equipment attribute data; based on natural language processing technology, convert the text in the preprocessed equipment attribute data into word vectors;
[0009] S2. Calculate the word frequency-inverse file frequency value of each word in the word vector by a statistical method, and extract text keywords in the device attribute data based on the word frequency-inverse file frequency value;
[0010] S3. Based on the pre-trained large model, identify the text keywords in the equipment attribute data, obtain the production location information of the equipment, and determine the domestic equipment based on the production location information;
[0011] S4. Calculate the proportion of domestically produced equipment in the enterprise's equipment based on the number of domestically produced equipment in the enterprise's equipment and the total equipment;
[0012] S5. Statistically analyze the number, proportion, and distribution of domestic and non-domestic devices, and analyze the market acceptance of domestic devices based on sentiment analysis technology and user reviews.
[0013] Optionally, using structured query language to extract the equipment attribute data of the enterprise and preprocessing it; based on natural language processing technology, converting the text in the preprocessed equipment attribute data into a word vector includes the following steps:
[0014] S11. Extracting attribute data of the equipment from the enterprise equipment database using structured query language, and the attribute data includes name, model, supplier information, purchase date and place of origin information;
[0015] S12, performing data cleaning on the extracted equipment attribute data including name, model, supplier information, purchase date and origin information;
[0016] S13, performing word segmentation processing on the cleaned device attribute data;
[0017] S14, check each word after word segmentation, process missing values and abnormal values therein, and delete missing data or abnormal data as needed;
[0018] S15. Use the Word2Vec word vector model to convert the text in the processed device attribute data into word vectors and capture semantic relationships.
[0019] Optionally, calculating the word frequency-inverse file frequency value of each word in the word vector by a statistical method, and extracting text keywords in the device attribute data based on the word frequency-inverse file frequency value includes the following steps:
[0020] S21. Train the Word2Vec word vector model through the continuous bag-of-words model to predict the relationship between the center word and the context word vector, maximize the semantic match between the context and the center word, and optimize the training efficiency of the continuous bag-of-words model in combination with negative sampling.
[0021] S22. Calculate the word frequency-inverse file frequency value of each word from the input data of the trained Word2Vec model, mine text keywords based on the word frequency-inverse file frequency value, set thresholds according to the importance of text keywords, and eliminate words with low thresholds.
[0022] Optionally, training a Word2Vec word vector model through a continuous bag-of-words model, predicting the relationship between the center word and the context word vector, maximizing the semantic match between the context and the center word, and optimizing the training efficiency of the continuous bag-of-words model in combination with negative sampling include the following steps:
[0023] S211, selecting the Word2Vec word vector model during the training process of the continuous bag-of-words model;
[0024] S212, in the continuous bag-of-words model, vectorize the pre-given context words, calculate the average value of the word vectors after the context words are vectorized, and generate a word vector representing the context;
[0025] S213, using negative sampling technology, randomly selecting a preset number of negative samples from the vocabulary, and training a continuous bag-of-words model in combination with actual context words;
[0026] S214. Optimize the objective function of the continuous bag-of-words model by maximizing the semantic match between the average value of the word vector and the central word vector, and use the Sigmoid function to convert the prediction into a probability value. Through iterative training, the word vector is continuously updated.
[0027] Optionally, the objective function of the continuous bag of words model is expressed as:
[0028]
[0029] Where L represents the objective function of the continuous bag-of-words model;
[0030] σ represents the conversion of prediction into probability using Sigmoid function;
[0031] v w The word vector representing the central word w;
[0032] con(w) represents the average value of the word vectors of all words in the context window;
[0033] Represents negative samples neg k (w) word vector;
[0034] K represents the number of negative samples set;
[0035] k represents the index variable in the negative sampling process.
[0036] Optionally, from the input data of the trained Word2Vec model, the word frequency-inverse file frequency value of each word is calculated, the text keywords are mined based on the word frequency-inverse file frequency value, and a threshold is set according to the importance of the text keywords. The words with a low threshold are eliminated, which includes the following steps:
[0037] S221, call gensim library, jieba library and re library to train the Word2Vec model;
[0038] S222, obtaining preprocessed equipment information from the enterprise equipment database as corpus, and mining text keywords based on word frequency-inverse file frequency values to generate word sets for different equipment brands and models;
[0039] S223, calculating the word frequency-reverse file frequency value of each word in each word set, using the word frequency-reverse file frequency value of the word as the word weight, setting a threshold of the word frequency-reverse file frequency value of a preset ratio, and eliminating words whose word frequency-reverse file frequency value is lower than the threshold.
[0040] Optionally, based on a pre-trained large model, identifying text keywords in the device attribute data to obtain the production location information of the device, and determining the domestic device according to the production location information includes the following steps:
[0041] S31. Optimize the ChatGLM-6B model using low-rank adaptive technology;
[0042] S32, input the keywords in the enterprise equipment text into the optimized ChatGLM-6B model for semantic matching;
[0043] S33. If the current equipment information is already in the enterprise equipment database, output the equipment's origin information;
[0044] If the current device information does not exist in the enterprise device database, the search API interface is called and the web crawler is started to obtain more device-related information, which is then analyzed by the ChatGLM-6B model;
[0045] S34, using a weighted sampling method with word frequency-inverse file frequency value as weight, extracting text keywords from the text data set to form keyword clusters, and inputting the keyword clusters into the optimized ChatGLM-6B model for semantic analysis;
[0046] S35. Obtain the production location information of the equipment by analyzing the content in the keyword cluster, and determine the domestic equipment based on the production location information.
[0047] Optionally, statistically analyzing the number, proportion, and distribution of domestic devices and non-domestic devices, and analyzing the market acceptance of domestic devices based on sentiment analysis technology and combined with user comments include the following steps:
[0048] S51. Statistic and analyze the number, proportion and distribution of domestic and non-domestic equipment to obtain the number and proportion of different types of equipment, and analyze the relationship between equipment and suppliers to obtain the impact of different suppliers on the domestic rate;
[0049] S52. Use the Word2vec model to convert the captured user comment data into a low-dimensional embedding matrix as the semantic representation of the text; use the four categories of sentiment vocabulary to construct the sentiment vector and merge it with the language vector to form a text representation matrix;
[0050] S53, inputting the fused text representation matrix into a bidirectional long short-term memory network, extracting effective features through an attention layer and performing dimensionality reduction processing, and sending the text after dimensionality reduction processing into a classifier to output a sentiment prediction result;
[0051] S54. Based on the prediction results of sentiment analysis, capture and analyze user reviews of the device, predict the market acceptance of the device, and provide purchase recommendations for the device.
[0052] Optionally, inputting the fused text representation matrix into a bidirectional long short-term memory network, extracting effective features through an attention layer and performing dimensionality reduction processing, and sending the text after dimensionality reduction processing into a classifier to output a sentiment prediction result includes the following steps:
[0053] S531, inputting the fused text representation matrix into a bidirectional long short-term memory network, extracting bidirectional context features of the text, and capturing positive and negative semantic information respectively;
[0054] S532, input the extracted bidirectional context features into the attention layer, fuse them with the language vector and perform a pooling operation;
[0055] S533, concatenating the feature vector processed by the attention layer with the feature vector output by the bidirectional long short-term product memory network layer, and unifying the dimensions through zero padding or a fully connected layer;
[0056] S534, the feature vector after dimension reduction is sent to the output layer of the classifier, and the probability distribution of the sentiment category is generated using the softmax function. The classifier outputs the sentiment prediction result of the comment.
[0057] According to another aspect of the present invention, there is also provided a system for detecting the domestic rate of enterprise equipment based on a large model, the system comprising: a data integration and preprocessing module, a semantic analysis and keyword extraction module, a production location information identification module, a domestic equipment ratio calculation module and a sentiment analysis module;
[0058] The data integration and preprocessing module is used to extract and preprocess the enterprise's equipment attribute data using structured query language; based on natural language processing technology, the text in the preprocessed equipment attribute data is converted into word vectors;
[0059] The semantic analysis and keyword extraction module is used to calculate the word frequency-inverse file frequency value of each word in the word vector by statistical method, and extract text keywords in the device attribute data based on the word frequency-inverse file frequency value;
[0060] The production location information recognition module is used to identify text keywords in the equipment attribute data based on the pre-trained large model, obtain the equipment's production location information, and determine the domestic equipment based on the production location information;
[0061] The module for calculating the proportion of domestically produced equipment calculates the proportion of domestically produced equipment in an enterprise's equipment according to the number of domestically produced equipment in the enterprise and the total equipment;
[0062] The sentiment analysis module is used to statistically analyze the number, proportion and distribution of domestic and non-domestic devices. Based on sentiment analysis technology, it combines user comments to analyze the market acceptance of domestic devices.
[0063] Compared with the prior art, this application has the following beneficial effects:
[0064] 1. The present invention utilizes big models and natural language processing technology, enabling enterprises to realize automated detection of the domestic production rate of equipment, significantly improving detection efficiency and accuracy; through the deep semantic analysis and sentiment analysis capabilities of the big model, the attributes and origin information of the equipment can be quickly identified, reducing errors caused by manual operations, and ensuring high efficiency and accuracy when processing large amounts of data; the automation process not only improves the detection speed, but also greatly reduces labor costs and operational error rates.
[0065] 2. The present invention considers multiple dimensions in equipment identification and evaluation by combining the specific data of enterprise equipment and relevant national policy standards; this makes the identification of domestic equipment more comprehensive, avoids the evaluation limitations brought by a single standard, and ensures the accuracy and compliance of the domestic rate calculation.
[0066] 3. The present invention also has the function of dynamically updating data and policies. It can automatically synchronize the latest policies and equipment information and adjust the equipment classification and domestic production rate calculation model in real time. This flexibility enables enterprises to respond to market changes and policy adjustments in a timely manner, ensure the forward-looking and real-time nature of data, and provide a reliable basis for enterprises in strategic decision-making and policy formulation. At the same time, the architecture design based on the large model has good scalability and can flexibly respond to the needs of different enterprises. In addition, it can also adapt to different industries and fields, meet diverse equipment management needs, enhance the wide applicability of domestic production rate detection, and promote enterprises to maintain competitive advantages in complex environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] The above characteristics, features and advantages of the present invention and their implementation methods and methods will become more clearly understood in conjunction with the following description of the embodiments, which are described in detail in conjunction with the accompanying drawings. Herein, a schematic diagram is shown:
[0068] Figure 1 is a flow chart of a method for detecting the domestic production rate of enterprise equipment based on a large model according to an embodiment of the present invention;
[0069] Figure 2 It is a principle block diagram of a large model-based enterprise equipment domestic production rate detection system according to an embodiment of the present invention;
[0070] Figure 3 It is a schematic diagram of the Lora fine-tuning principle in a large-model-based enterprise equipment domestic production rate detection method according to an embodiment of the present invention.
[0071] In the figure:
[0072] 1. Data integration and preprocessing module; 2. Semantic analysis and keyword extraction module; 3. Production location information identification module; 4. Domestic equipment ratio calculation module; 5. Sentiment analysis module. DETAILED DESCRIPTION
[0073] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0074] According to an embodiment of the present invention, a method and system for detecting the domestic production rate of enterprise equipment based on a large model are provided.
[0075] The present invention is further described with reference to the accompanying drawings and specific embodiments. Figure 1 and Figure 3 As shown, according to one embodiment of the present invention, a method for detecting the domestic production rate of enterprise equipment based on a large model is provided, and the method for detecting the domestic production rate of enterprise equipment includes the following steps:
[0076] S1. Use structured query language to extract and preprocess the enterprise's equipment attribute data; based on natural language processing technology, convert the text in the preprocessed equipment attribute data into word vectors.
[0077] Preferably, using structured query language to extract the equipment attribute data of the enterprise and preprocessing it; based on natural language processing technology, converting the text in the preprocessed equipment attribute data into word vectors includes the following steps:
[0078] S11. Extracting attribute data of the equipment from the enterprise equipment database using structured query language, and the attribute data includes name, model, supplier information, purchase date and place of origin information;
[0079] S12, performing data cleaning on the extracted equipment attribute data including name, model, supplier information, purchase date and origin information;
[0080] S13, performing word segmentation processing on the cleaned device attribute data;
[0081] S14, check each word after word segmentation, process missing values and abnormal values therein, and delete missing data or abnormal data as needed;
[0082] S15. Use the Word2Vec word vector model to convert the text in the processed device attribute data into word vectors and capture semantic relationships.
[0083] It needs to be explained that it is necessary to integrate with the company's existing resource planning system, including the equipment management system or supply chain system, to obtain relevant data of the equipment, including the equipment name, model, supplier information, purchase date, etc., use SQL query (Structured Query Language) or language to extract equipment data information from the enterprise equipment library, complete data collection, and clean the data, including removing stop words, stemming or word form restoration, and removing punctuation, splitting the text into words, processing missing values and outliers, checking whether there are missing values or outliers in the data, and choosing to delete abnormal rows.
[0084] S2. Calculate the term frequency-inverse document frequency value (TF-IDF value) of each word in the word vector by statistical method, and extract text keywords in the device attribute data based on the term frequency-inverse document frequency value.
[0085] Preferably, calculating the word frequency-inverse file frequency value of each word in the word vector by a statistical method, and extracting text keywords in the device attribute data based on the word frequency-inverse file frequency value includes the following steps:
[0086] S21. Use the Word2Vec word vector model to convert the text in the processed device attribute data into word vectors and capture semantic relationships;
[0087] S22. Train the Word2Vec word vector model through the continuous bag-of-words model to predict the relationship between the center word and the context word vector, maximize the semantic match between the context and the center word, and optimize the training efficiency of the continuous bag-of-words model in combination with negative sampling;
[0088] S23. Calculate the word frequency-inverse file frequency value of each word from the input data of the trained Word2Vec model. The specific steps are as follows:
[0089] 1. The expression for calculating word frequency is as follows:
[0090]
[0091] 2. The expression for calculating the frequency of the reverse file is as follows:
[0092]
[0093] 3. The expression for calculating word frequency-inverse file frequency is as follows:
[0094] TFIDF(t,d,D)=TF(t,d)×IDF(t,D);
[0095] In the formula, f t,d represents the number of times word t appears in document d, the denominator d represents the total number of times all words appear in the document, t′ represents other words in the document, which is different from t and represents all other words in the same document except word t; N is the total number of documents, and the denominator represents the number of documents containing word t; TF(t,d) represents the term frequency of each word; IDF(t,D) represents the inverse document frequency, which is a measure to evaluate the prevalence or rarity of term t in document set D;
[0096] TFIDF(t,d,D) stands for Term Frequency-Inverse Document Frequency, which is the product of term frequency (TF) and inverse document frequency (IDF), and is used to evaluate the importance of term t in a specific document d.
[0097] In this way, the weight of each word in the text can be obtained, and this weight can be used to further analyze the keywords and importance of the words in the text. Based on the word frequency-inverse file frequency value, text keywords are mined, and thresholds are set according to the importance of text keywords to eliminate words with low thresholds.
[0098] Preferably, training the Word2Vec word vector model through the continuous bag of words model, predicting the relationship between the center word and the context word vector, maximizing the semantic matching between the context and the center word, and optimizing the training efficiency of the continuous bag of words model in combination with negative sampling include the following steps:
[0099] S221, selecting the Word2Vec word vector model during the training process of the continuous bag-of-words model;
[0100] S222, in the continuous bag-of-words model, vectorize the pre-given context words, calculate the average value of the word vectors after the context words are vectorized, and generate a word vector representing the context;
[0101] S223, using negative sampling technology, randomly selecting a preset number of negative samples from the vocabulary, and training a continuous bag-of-words model in combination with actual context words;
[0102] S224. Optimize the objective function of the continuous bag-of-words model by maximizing the semantic match between the average value of the word vector and the central word vector, and use the Sigmoid function to convert the prediction into a probability value. Through iterative training, the word vector is continuously updated.
[0103] Preferably, the objective function of the continuous bag-of-words model is expressed as:
[0104]
[0105] Where L represents the objective function of the continuous bag-of-words model;
[0106] σ represents the conversion of prediction into probability using Sigmoid function;
[0107] v w The word vector representing the central word w;
[0108] con(w) represents the average value of the word vectors of all words in the context window;
[0109] Represents negative samples neg k (w) word vector;
[0110] K represents the number of negative samples, usually set to 8;
[0111] k represents the index variable in the negative sampling process, which is used to traverse the negative samples. In the negative sampling process, K negative samples (usually words outside the context of the target word) are randomly selected from the vocabulary. In the formula, k ranges from 1 to K, representing the index of each negative sample.
[0112] Preferably, from the input data of the trained Word2Vec model, the word frequency-inverse file frequency value of each word is calculated, the text keywords are mined based on the word frequency-inverse file frequency value, and a threshold is set according to the importance of the text keywords. The words with a low threshold are eliminated, which includes the following steps:
[0113] S231. Call the gensim library, jieba library, and re library to train the Word2Vec model. Word2Vec is a model widely used to generate word vectors that can capture the semantic and grammatical relationships between words. In the Word2Vec model, the continuous bag of words model is used to predict the target word based on the context. Use the re library to perform regular expression operations, clean text data, and remove special characters and numbers. Then use the jieba library to perform Chinese word segmentation. Import the gensim library and use the preprocessed text data to train the Word2Vec model. In the parameter setting, set the vector size to 100, the window size to 5, and the minimum word frequency to 5. Save the model after training.
[0114] S232, obtaining preprocessed equipment information from the enterprise equipment database as corpus, and mining text keywords based on word frequency-inverse file frequency values to generate word sets for different equipment brands and models;
[0115] S233, calculating the word frequency-reverse file frequency value of each word in each word set, taking the word frequency-reverse file frequency value of the word as the word weight, setting a threshold of the word frequency-reverse file frequency value of a preset ratio, and eliminating words whose word frequency-reverse file frequency value is lower than the threshold.
[0116] It should be explained that the Word2Vec word vector model is used for semantic representation. The Word2Vec word vector model maps words or phrases in the text into a continuous vector space with semantic information. By converting the text in the device data into a word vector representation, the semantic relationship between words can be captured, thereby better understanding the text.
[0117] The Word2Vec model is trained and constructed using the continuous bag of words (CBOW) model. The continuous bag of words model arranges the context words corresponding to the central word in order, projects the context words in the selected window to the same position, and averages their vectors. The output result is the word vector of the central word. The work of predicting the central word w needs to be completed by mapping the background word vector con(w) corresponding to the central word. In the binary tree of the model, the left node is marked with 1, representing a negative sample, corresponding to the background word con(w), here denoted as neg(w); the right node is marked with 0, representing a positive sample, corresponding to the central word w, and the sample category can be represented as:
[0118]
[0119] In the formula, w represents the central word to be predicted, con(w) represents the context vector corresponding to w, neg(w) represents the negative class sample, that is, other background words except the central word w. The model objective function can be represented as maximizing the following log-likelihood function; represents an indicator function, indicating that when When it is equal to w, the output is 1; when When it is not equal to w, the output is 0. Indicates the central word that needs to be predicted currently.
[0120] The gensim library, jieba library and re library are called to implement Word2vec model training. The corpus source is the equipment information in the company's existing equipment database. Text keywords are mined based on word frequency-reverse file frequency values. Different equipment word models are obtained for different equipment brands and models to obtain word set A.
[0121] A={α1,α2,α3,α4,α5...,α s};
[0122] Calculate the word frequency-inverse document frequency value of each word in each set to obtain set B;
[0123]
[0124] Among them, ω is the word frequency-inverse document frequency value of each word, α j represents a specific element in the set. And j=1,2,3,4,5,...,s represents the number of elements.
[0125] A represents the word set, B represents its frequency set, represents the weight of each word, and j=1,2,3,4,5,...,s represents the number of elements.
[0126] The word frequency-reverse file frequency value of a word is used as the weight of the word. The higher the word frequency-reverse file frequency value, the higher the weight of the word, indicating that the word is more important; the lower the word frequency-reverse file frequency value, the lower the weight of the word, indicating that the word is less important. Set the word frequency-reverse file frequency value threshold, select the 75% quantile as the threshold, and remove words with a word frequency-reverse file frequency value lower than this quantile. Improve the accuracy of model recognition. This effectively avoids the invalid calculation of redundant information.
[0127] S3. Based on the pre-trained large model, the text keywords in the equipment attribute data are identified to obtain the production location information of the equipment, and the domestic equipment is determined based on the production location information.
[0128] Preferably, based on the pre-trained large model, identifying the text keywords in the device attribute data to obtain the production location information of the device, and determining the domestic device according to the production location information includes the following steps:
[0129] S31. Use low-rank adaptive technology to optimize the ChatGLM-6B model. The specific steps are as follows: Use the tool TensorBoard to visualize the importance and activity of each layer's weights to determine the size and complexity of the weight matrix in the model. According to the results of the preliminary analysis, select singular value decomposition (SVD) decomposition to generate a low-rank approximation for the first k singular values of the weight matrix, where k is much smaller than the original rank, where k represents the number of singular values. Decompose the large weight matrix into multiple smaller matrices, and replace the original matrix with these smaller matrices in the model input layer. Use the Adam algorithm to fine-tune the model, and introduce L2 regularization to help the model avoid overfitting. Finally, evaluate the performance of the model to verify the effect of the optimization;
[0130] S32, input the keywords in the enterprise equipment text into the optimized ChatGLM-6B model for semantic matching;
[0131] S33. If the current equipment information is already in the enterprise equipment database, output the equipment's origin information;
[0132] If the current device information does not exist in the enterprise device database, the search API interface is called and the web crawler is started to obtain more device-related information, which is then analyzed by the ChatGLM-6B model;
[0133] S34, using a weighted sampling method with word frequency-inverse file frequency value as weight, extracting text keywords from the text data set to form keyword clusters, and inputting the keyword clusters into the optimized ChatGLM-6B model for semantic analysis;
[0134] S35. Obtain the production location information of the equipment by analyzing the content in the keyword cluster, and determine the domestic equipment based on the production location information.
[0135] It should also be explained that among many large language models, the ChatGLM-6B model was selected, which showed excellent performance in semantic understanding and generation. In order to improve the training speed of the model and reduce the computing requirements, the Low-Rank Adaptation (LoRA) fine-tuning scheme is adopted. The characteristics of this method are freezing the original parameters, inserting a decomposed low-rank matrix module, and fine-tuning fewer parameters. The dimension of the pre-trained model is W0∈R d×k . LoRA constructs a low-rank decomposition such that:
[0136] W0+ΔW=W;
[0137] This is the weight update formula, where W0 represents the original pre-trained model weights, ΔW is the adjustment to these weights, and W is the updated weight, which is the sum of the original weights and the adjustment terms. Therefore, a lot of model parameters that need to be trained can be reduced. In the forward process, W0 and ΔW are both multiplied by the input x and then added. In the training process of LoRA, C and D are newly introduced low-rank matrices, W0 is fixed, and only C and D are training parameters. In the forward process, W0 and ΔW are multiplied by the same input x and finally added;
[0138] h=W0x+ΔWx=W0x+DCx;
[0139] Where C is a low-rank matrix, usually of small dimensions (r×k, where r is the rank and k is the output dimension), which is used to multiply with another matrix W to form a specific pattern adapted to a specific task. D is usually another low-rank matrix used in conjunction with C, with dimensions adapted to C (d×r, where d is the input dimension), D∈R d×r , C∈R r×k , and r<<min(d,k), the DC part is a supplement to the original weight W0, so that the model can be fine-tuned for new tasks while retaining the learned knowledge. h is the output of the layer calculated by combining the original weight matrix W0 and the low-rank decomposition matrix DC. This output is then passed to the next layer, or used to calculate the loss function of the layer (if it is an output layer).
[0140] The dimension of the weights trained in LoRA fine-tuning is much lower than the dimension of the original model weights. LoRA fine-tuning can significantly reduce the number of model parameters and computational complexity while maintaining high performance.
[0141] First, the collected equipment information is imported into the big model. This information includes detailed information such as equipment specifications, functions, and manufacturers. The big model will perform preliminary processing and judgment on this information. If the equipment information already exists in the database, the big model will output the corresponding origin information.
[0142] If the device information does not exist in the database, the big model will use its function calling function to access the Baidu search API interface. Through this interface, more information about the device can be obtained, including the latest online reviews, user feedback, professional reviews, etc.
[0143] Then, the crawler program is started to search the Internet for all relevant information about the device.
[0144] The collected data will be integrated with the large model, and the weighted sampling method with word frequency-inverse file frequency as the weight will be used to extract keywords from the text data set, and the mined text information will be clustered in keyword clusters, and the keyword clusters will be imported into the fine-tuned ChatGLM-6B large model. ChatGLM-6B is a bidirectional generative pre-trained language model based on the Transformer architecture. It is the first open source Chinese conversation language model with a 6B parameter level in China.
[0145] Finally, the big model obtains key information from these keyword families, such as certain manufacturing company names that may directly or indirectly indicate the origin of the equipment.
[0146] Relying on the semantic understanding and pattern matching capabilities of the big model, the device information is deeply analyzed to accurately identify domestic devices. The domestic attributes of the device are determined by analyzing the specifications, functions, manufacturers and other information of the device and comparing them with the known information in the database.
[0147] After identifying domestic devices, count the number of domestic devices. This includes not only the currently identified domestic devices, but also the domestic devices that were previously identified and stored in the database. Through a precise counting mechanism, the accuracy of the number of domestic devices is ensured.
[0148] Next, count the total number of equipment. This includes the total number of all equipment in the enterprise, whether domestic or imported. By combining it with the statistics of the number of domestic equipment, the exact value of the total number of equipment can be obtained.
[0149] S4. Calculate the proportion of domestically produced equipment in the enterprise's equipment based on the number of domestically produced equipment in the enterprise's equipment and the total equipment;
[0150] After obtaining the number of domestically produced equipment and the total number of equipment, the domestic production rate will be calculated. The domestic production rate refers to the ratio of the number of domestically produced equipment to the total number of equipment, which is obtained through precise calculation.
[0151]
[0152] S5. Statistically analyze the number, proportion, and distribution of domestic and non-domestic devices, and analyze the market acceptance of domestic devices based on sentiment analysis technology and user reviews.
[0153] Preferably, statistically analyzing the number, proportion and distribution of domestic devices and non-domestic devices, and analyzing the market acceptance of domestic devices based on sentiment analysis technology and combined with user comments include the following steps:
[0154] S51. Statistic and analyze the number, proportion and distribution of domestic and non-domestic equipment to obtain the number and proportion of different types of equipment, and analyze the relationship between equipment and suppliers to obtain the impact of different suppliers on the domestic rate;
[0155] S52. Use the Word2vec model to convert the captured user comment data into a low-dimensional embedding matrix as the semantic representation of the text; use the four categories of sentiment vocabulary to construct the sentiment vector and merge it with the language vector to form a text representation matrix;
[0156] S53, inputting the fused text representation matrix into a bidirectional long short-term memory network, extracting effective features through an attention layer and performing dimensionality reduction processing, and sending the text after dimensionality reduction processing into a classifier to output a sentiment prediction result;
[0157] S54. Based on the prediction results of sentiment analysis, capture and analyze user reviews of the device, predict the market acceptance of the device, and provide purchase recommendations for the device.
[0158] Preferably, the fused text representation matrix is input into a bidirectional long short-term memory network, effective features are extracted through an attention layer and dimension reduction is performed, and the text after dimension reduction is input into a classifier to output a sentiment prediction result, which includes the following steps:
[0159] S531, inputting the fused text representation matrix into a bidirectional long short-term memory network, extracting bidirectional context features of the text, and capturing positive and negative semantic information respectively;
[0160] S532, input the extracted bidirectional context features into the attention layer, fuse them with the language vector and perform a pooling operation;
[0161] S533, concatenating the feature vector processed by the attention layer with the feature vector output by the bidirectional long short-term product memory network layer, and unifying the dimension of the feature vector through zero padding or a fully connected layer;
[0162] S534, the feature vector after dimension reduction is sent to the output layer of the classifier, and the probability distribution of the sentiment category is generated using the softmax function. The classifier outputs the sentiment prediction result of the comment.
[0163] It needs to be explained that the number, proportion and distribution of domestic and non-domestic equipment are first counted and analyzed. Through accurate counting and proportion calculation, the number and proportion of different types of equipment can be clearly obtained. In addition, the present invention also analyzes the relationship between equipment and suppliers, and obtains the impact of different suppliers on the domestic rate. Sentiment analysis technology can quickly capture and integrate a large amount of unstructured comment data on the Internet, mine subjective texts with emotional tendencies, and realize the process of analysis, processing, induction and reasoning. First, the Word2vec model is used in the word embedding layer to convert text data into a low-dimensional embedding matrix as a semantic representation, and the sentiment vector of the vocabulary is constructed through four types of sentiment lexicons. The semantic vector is combined with the sentiment vector as the initial feature matrix of the text and input into the network model for training. The network model is divided into two parts. One part sends the fused text representation matrix to the bidirectional long short-term product memory network layer (BiLSTM) for feature extraction. The input of each time step is a feature vector, which contains the semantic information and sentiment information of the corresponding word. The forward LSTM processes the data in the order of the input sequence (from left to right). At each time step, it reads a feature vector and uses its internal state (including memory cells and hidden states) to generate an output. This output, together with the input of the current time step, is used to update the internal state of the LSTM and prepare for the next time step. The backward LSTM processes data in the opposite order (from right to left). In parallel with the forward LSTM, it also reads a feature vector at each time step and uses its internal state to generate an output. It can capture information from the end of the sequence to the current position. At each time step, both the forward LSTM and the backward LSTM produce an output, which are combined by splicing. The merged output vector sequence contains the bidirectional contextual information of the text, which is the feature extracted from the text. Then enter the attention layer to learn the effective features, and send the results to the pooling layer for filtering; the other part directly performs a pooling operation on the results of the bidirectional long short-term product memory network layer to filter the effective features; finally, the two features are fused and reduced in dimension. The specific steps are as follows:
[0164] First, the feature vector processed by the attention layer and the feature vector directly output from the bidirectional long short-term product memory network layer are concatenated. The two vectors are simply connected together to form a longer vector. If the dimensions of the two features are different, their dimensions need to be adjusted so that they can be concatenated. This is done by adding zero padding after the shorter feature vector or using a fully-connected layer. Secondly, the pooling operation is applied again to further reduce the dimension. Finally, the reduced-dimensional features are fed into the output layer of the classifier for the sentiment analysis task. The output layer is usually a fully-connected layer with the number of output nodes equal to the number of sentiment categories (e.g., positive, negative, neutral, etc.). The output can then be converted into a probability distribution using a softmax function to represent the probability that the input text belongs to each sentiment category.
[0165] The sentiment prediction results of the text data are output by the classifier. The data set uses the online shopping platform user feedback comment data set, with a total of 7,000 positive comments and 3,000 negative comments. The sequence.pad_sequences() method in Python is used to unify the sentence length, and then the train_test_split() function in the sklearn library is called to realize the division of 80% training set and 20% test set.
[0166] Based on the prediction results, we can capture user reviews of the device from the Internet and predict the emotional direction of the user reviews of the device, so as to derive the impact of the localization of the device on the reputation of the device and provide a procurement plan for the device.
[0167] The present invention also has the function of dynamically updating data and policies. It can automatically synchronize the latest policies and equipment information and adjust the equipment classification and domestic production rate calculation model in real time. This flexibility enables enterprises to respond to market changes and policy adjustments in a timely manner, ensure the forward-looking and real-time nature of data, and provide a reliable basis for enterprises in strategic decision-making and policy formulation. At the same time, the architecture design based on the large model has good scalability and can flexibly respond to the needs of different enterprises. In addition, it can also adapt to different industries and fields, meet diverse equipment management needs, enhance the wide applicability of domestic production rate detection, and promote enterprises to maintain their competitive advantages in complex environments.
[0168] According to another embodiment of the present invention, Figure 2 As shown, a system for detecting the domestic rate of enterprise equipment based on a large model is also provided, and the system comprises: a data integration and preprocessing module 1, a semantic analysis and keyword extraction module 2, a production location information identification module 3, a domestic equipment ratio calculation module 4 and a sentiment analysis module 5;
[0169] Data integration and preprocessing module 1 is used to extract and preprocess the equipment attribute data of the enterprise using structured query language; based on natural language processing technology, the text in the preprocessed equipment attribute data is converted into word vectors;
[0170] Semantic analysis and keyword extraction module 2, used to calculate the word frequency-inverse file frequency value of each word in the word vector by statistical method, and extract text keywords in the device attribute data based on the word frequency-inverse file frequency value;
[0171] The production location information identification module 3 is used to identify the text keywords in the equipment attribute data based on the pre-trained large model, obtain the production location information of the equipment, and determine the domestic equipment according to the production location information;
[0172] The domestic equipment ratio calculation module 4 calculates the ratio of domestic equipment in the enterprise equipment according to the number of domestic equipment in the enterprise equipment and the total equipment;
[0173] Sentiment analysis module 5 is used to statistically analyze the number, proportion and distribution of domestic and non-domestic devices, and analyze the market acceptance of domestic devices based on sentiment analysis technology and combined with user comments.
[0174] In summary, with the help of the above technical solutions of the present invention, the present invention uses large models and natural language processing technology, so that enterprises can realize the automated detection of the domestic production rate of equipment, significantly improving the detection efficiency and accuracy; through the deep semantic analysis and sentiment analysis capabilities of the large model, the attributes and origin information of the equipment can be quickly identified, reducing the errors caused by manual operation, and ensuring high efficiency and accuracy when processing large amounts of data; the automation process not only improves the detection speed, but also greatly reduces the labor cost and the operation error rate; the present invention considers multiple dimensions in equipment identification and evaluation by combining the specific data of the enterprise equipment and the relevant national policy standards; this makes the identification of domestic equipment more comprehensive and avoids a single standard The evaluation limitations brought about by this ensure the accuracy and compliance of the domestic production rate calculation; the present invention also has the function of dynamically updating data and policies, and adjusts the equipment classification and domestic production rate calculation model in real time by automatically synchronizing the latest policies and equipment information; this flexibility enables enterprises to respond to market changes and policy adjustments in a timely manner, ensures the forward-looking and real-time nature of data, and provides a reliable basis for enterprises in strategic decision-making and policy formulation; at the same time, the architecture design based on the large model has good scalability and can flexibly respond to the needs of different enterprises; in addition, it can also adapt to different industries and fields, meet diverse equipment management needs, enhance the wide applicability of domestic production rate detection, and promote enterprises to maintain their competitive advantage in complex environments.
[0175] Although the present invention has been disclosed as above with preferred embodiments, the embodiments are merely examples for the convenience of description and are not intended to limit the present invention. Those skilled in the art may make several changes and modifications without departing from the spirit and scope of the present invention. The scope of protection claimed by the present invention shall be based on the claims.
Claims
1. A method for detecting the domestic production rate of enterprise equipment based on a large model, characterized in that: The enterprise's equipment domestic rate detection method includes the following steps: S1. Use structured query language to extract and preprocess the enterprise's equipment attribute data; based on natural language processing technology, convert the text in the preprocessed equipment attribute data into word vectors; S2. Calculate the word frequency-inverse file frequency value of each word in the word vector by a statistical method, and extract text keywords in the device attribute data based on the word frequency-inverse file frequency value; S3. Based on the pre-trained large model, identify the text keywords in the equipment attribute data, obtain the production location information of the equipment, and determine the domestic equipment based on the production location information; S4. Calculate the proportion of domestically produced equipment in the enterprise's equipment based on the number of domestically produced equipment in the enterprise's equipment and the total equipment; S5. Statistically analyze the number, proportion, and distribution of domestic and non-domestic devices, and analyze the market acceptance of domestic devices based on sentiment analysis technology and user reviews.
2. According to the method for detecting the domestic production rate of enterprise equipment based on a large model according to claim 1, it is characterized in that: The structured query language is used to extract the equipment attribute data of the enterprise and perform preprocessing; Based on natural language processing technology, converting the text in the preprocessed device attribute data into word vectors includes the following steps: S11. Extracting attribute data of the equipment from the enterprise equipment database using structured query language, and the attribute data includes name, model, supplier information, purchase date and place of origin information; S12, performing data cleaning on the extracted equipment attribute data including name, model, supplier information, purchase date and origin information; S13, performing word segmentation processing on the cleaned device attribute data; S14, check each word after word segmentation, and delete missing values and abnormal values in the words; S15. Use the Word2Vec word vector model to convert the text in the processed device attribute data into word vectors and capture semantic relationships.
3. According to the method for detecting the domestic production rate of enterprise equipment based on a large model in claim 1, it is characterized in that: The method of calculating the word frequency-inverse file frequency value of each word in the word vector by a statistical method and extracting text keywords in the device attribute data based on the word frequency-inverse file frequency value comprises the following steps: S21. Train the Word2Vec word vector model through the continuous bag-of-words model to predict the relationship between the center word and the context word vector, maximize the semantic match between the context and the center word, and optimize the training efficiency of the continuous bag-of-words model in combination with negative sampling. S22. Calculate the word frequency-inverse file frequency value of each word from the input data of the trained Word2Vec model, mine text keywords based on the word frequency-inverse file frequency value, set thresholds according to the importance of text keywords, and eliminate words with low thresholds.
4. According to the method for detecting the domestic production rate of enterprise equipment based on a large model according to claim 3, it is characterized in that: The method of training the Word2Vec word vector model through the continuous bag of words model, predicting the relationship between the center word and the context word vector, maximizing the semantic matching between the context and the center word, and optimizing the training efficiency of the continuous bag of words model by combining negative sampling includes the following steps: S211, selecting the Word2Vec word vector model during the training process of the continuous bag-of-words model; S212, in the continuous bag-of-words model, vectorize the pre-given context words, calculate the average value of the word vectors after the context words are vectorized, and generate a word vector representing the context; S213, using negative sampling technology, randomly selecting a preset number of negative samples from the vocabulary, and training a continuous bag-of-words model in combination with actual context words; S214. Optimize the objective function of the continuous bag-of-words model by maximizing the semantic match between the average value of the word vector and the central word vector, and use the Sigmoid function to convert the prediction into a probability value. Through iterative training, the word vector is continuously updated.
5. According to the method for detecting the domestic production rate of enterprise equipment based on a large model according to claim 4, it is characterized in that: The objective function of the continuous bag-of-words model is expressed as: Where L represents the objective function of the continuous bag-of-words model; σ represents the conversion of prediction into probability using Sigmoid function; v w The word vector representing the central word w; con(w) represents the average value of the word vectors of all words in the context window; Represents negative sample neg k (w) word vector; K represents the number of negative samples set; k represents the index variable in the negative sampling process.
6. The method for detecting the domestic production rate of enterprise equipment based on a large model according to claim 5 is characterized in that: The method of calculating the word frequency-inverse file frequency value of each word from the input data of the trained Word2Vec model, mining text keywords based on the word frequency-inverse file frequency value, setting a threshold according to the importance of the text keywords, and eliminating words with a low threshold includes the following steps: S221, call gensim library, jieba library and re library to train the Word2Vec model; S222, obtaining preprocessed equipment information from the enterprise equipment database as corpus, and mining text keywords based on word frequency-inverse file frequency values to generate word sets for different equipment brands and models; S223, calculating the word frequency-reverse file frequency value of each word in each word set, using the word frequency-reverse file frequency value of the word as the word weight, setting a threshold of the word frequency-reverse file frequency value of a preset ratio, and eliminating words whose word frequency-reverse file frequency value is lower than the threshold.
7. According to the method for detecting the domestic production rate of enterprise equipment based on a large model in claim 1, it is characterized in that: The method of identifying text keywords in the device attribute data based on the pre-trained large model to obtain the production location information of the device and determining the domestically produced device according to the production location information includes the following steps: S31. Optimize the ChatGLM-6B model using low-rank adaptive technology; S32, input the keywords in the enterprise equipment text into the optimized ChatGLM-6B model for semantic matching; S33. If the current device information already exists in the enterprise device database, the device origin information is output; if the current device information does not exist in the enterprise device database, the search API interface is called, and the web crawler is started to obtain more device-related information, which is then analyzed by the ChatGLM-6B model; S34, using a weighted sampling method with word frequency-inverse file frequency value as weight, extracting text keywords from the text data set to form keyword clusters, and inputting the keyword clusters into the optimized ChatGLM-6B model for semantic analysis; S35. Obtain the production location information of the equipment by analyzing the content in the keyword cluster, and determine the domestic equipment based on the production location information.
8. According to the large model-based enterprise equipment domestic production rate detection method of claim 1, it is characterized in that: The statistical analysis of the number, proportion and distribution of domestic and non-domestic devices, based on sentiment analysis technology, combined with user comments to analyze the market acceptance of domestic devices includes the following steps: S51. Count and analyze the quantity, proportion and distribution of domestic and non-domestic equipment, obtain the quantity and proportion of different types of equipment, and analyze the relationship between equipment and suppliers; S52. Use the Word2vec model to convert the captured user comment data into a low-dimensional embedding matrix as the semantic representation of the text; use the four categories of sentiment vocabulary to construct the sentiment vector and merge it with the language vector to form a text representation matrix; S53, inputting the fused text representation matrix into a bidirectional long short-term memory network, extracting effective features through an attention layer and performing dimensionality reduction processing, and sending the text after dimensionality reduction processing into a classifier to output a sentiment prediction result; S54. Based on the prediction results of sentiment analysis, capture and analyze user reviews of the device, predict the market acceptance of the device, and provide purchase recommendations for the device.
9. The method for detecting the domestic production rate of enterprise equipment based on a large model according to claim 8 is characterized in that: The step of inputting the fused text representation matrix into a bidirectional long short-term memory network, extracting effective features through an attention layer and performing dimensionality reduction processing, and sending the text after dimensionality reduction processing into a classifier to output a sentiment prediction result comprises the following steps: S531, inputting the fused text representation matrix into a bidirectional long short-term memory network, extracting bidirectional context features of the text, and capturing positive and negative semantic information respectively; S532, input the extracted bidirectional context features into the attention layer, fuse them with the language vector and perform a pooling operation; S533, concatenating the feature vector processed by the attention layer with the feature vector output by the bidirectional long short-term product memory network layer, and unifying the dimensions through zero padding or a fully connected layer; S534, the feature vector after dimension reduction is sent to the output layer of the classifier, and the probability distribution of the sentiment category is generated using the softmax function. The classifier outputs the sentiment prediction result of the comment.
10. A system for detecting the domestic production rate of enterprise equipment based on a large model, used to implement the method for detecting the domestic production rate of enterprise equipment based on a large model according to any one of claims 1 to 9, characterized in that: The enterprise equipment domestic rate detection system includes: data integration and preprocessing module, semantic analysis and keyword extraction module, production location information identification module, domestic equipment ratio calculation module and sentiment analysis module; The data integration and preprocessing module is used to extract and preprocess the enterprise's equipment attribute data using structured query language; based on natural language processing technology, the text in the preprocessed equipment attribute data is converted into word vectors; The semantic analysis and keyword extraction module is used to calculate the word frequency-inverse file frequency value of each word in the word vector by statistical method, and extract text keywords in the device attribute data based on the word frequency-inverse file frequency value; The production location information recognition module is used to identify text keywords in the equipment attribute data based on the pre-trained large model, obtain the equipment's production location information, and determine the domestic equipment based on the production location information; The module for calculating the proportion of domestically produced equipment calculates the proportion of domestically produced equipment in an enterprise's equipment according to the number of domestically produced equipment in the enterprise and the total equipment; The sentiment analysis module is used to statistically analyze the number, proportion and distribution of domestic and non-domestic devices. Based on sentiment analysis technology, it combines user comments to analyze the market acceptance of domestic devices.