Policy project industry classification method and device based on Aho-Corasick algorithm and large model

The policy project industry classification method that combines the Aho-Corasick algorithm with a large model solves the accuracy and flexibility problems of traditional methods in complex policy environments, achieves efficient and accurate policy industry classification, and ensures the transparency and adaptability of the system through a template update mechanism.

CN120670593APending Publication Date: 2025-09-19HANGZHOU BREEZE ENTERPRISE TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510521743.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing technologies are unable to provide sufficient accuracy and flexibility in the face of rapidly changing policy environments and complex industry interactions. Traditional methods lack an in-depth understanding of the industry and have poor interpretability.

Method used

A policy project industry classification method that combines the Aho-Corasick algorithm with a large model is adopted. By constructing templates of keywords and industries, multi-mode matching is used to identify keywords, and the large model is called for semantic analysis, industry classifications are dynamically generated, and the templates are updated through a feedback mechanism.

Benefits of technology

It improves the accuracy and flexibility of industry classification of policy projects, enhances the interpretability of classification results, ensures that the template can adapt to changes in the policy environment in real time, and improves the accuracy and transparency of classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670593A_ABST
    Figure CN120670593A_ABST
Patent Text Reader

Abstract

The invention discloses a policy project industry classification method and device based on an Aho-Corasick algorithm and a large model. The method comprises the following steps: constructing templates of keywords and industries; obtaining policy item data to be classified, and performing preprocessing to obtain a preprocessing result; performing multi-mode matching on the preprocessing result to obtain matched keywords and unmatched keywords; mapping the matched keywords by adopting the template, and calling a large model to perform semantic analysis on unmatched keywords to generate industry classification so as to obtain a classification result; and outputting the classification result. By implementing the method provided by the invention, a complicated and dynamic policy environment can be adapted, and the classification accuracy and interpretability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to computers, and more particularly to a policy project industry classification method and device based on an Aho-Corasick algorithm and a large model. Background Art

[0002] Currently, policy project industry classification techniques primarily rely on methods such as expert systems, machine learning, and natural language processing. While these technologies can, to a certain extent, help analyze and categorize the impact of policy changes on industries, they also have limitations. In particular, in the face of a rapidly evolving policy environment and complex industry interactions, traditional methods often lack sufficient accuracy and flexibility.

[0003] Expert systems perform classification by emulating the empirical rules of domain experts. They estimate the potential impact of policies based on policy details and expert judgment. However, expert systems often rely on expert knowledge and judgment, making them susceptible to subjective factors. Moreover, they may lack sufficient accuracy and flexibility when dealing with complex and ever-changing policy environments. Machine learning, particularly deep learning and ensemble learning methods, has been widely used in the industry classification of policy projects. For example, algorithms such as support vector machines (SVMs), random forests, and XGBoost have been used to analyze policy impacts. These methods automatically extract patterns from large amounts of data and are better able to handle nonlinear and high-dimensional data. However, machine learning models typically require large amounts of labeled data for training. Furthermore, some traditional machine learning methods, such as decision trees and support vector machines, lack a deep understanding of industry domains and may have difficulty capturing the complex social and economic factors underlying policy impacts. With advances in natural language processing (NLP) technology, text-based policy classification methods are gaining attention. For example, language models such as BERT and GPT are used to analyze text such as policy documents and news reports to extract information about potential industry impacts. Although text analysis methods can process large amounts of information, they still face challenges in text understanding, especially when dealing with polysemous words, ambiguous language, and implicit information, which can easily lead to misunderstandings.

[0004] While existing technologies can provide effective classification support in some cases, they remain significantly limited when navigating complex and dynamic policy environments. Many methods, such as time series analysis and machine learning, rely on large amounts of historical data, and classification accuracy declines significantly when data is insufficient. Traditional models lack a deep understanding of the industry and struggle to cope with complex or emerging policy environments. Methods like deep learning also suffer from poor interpretability, making it difficult to provide decision makers with a transparent basis for their decisions.

[0005] Therefore, it is necessary to design a new method to adapt to the complex and dynamic policy environment and improve classification accuracy and interpretability. Summary of the Invention

[0006] The purpose of the present invention is to overcome the defects of the prior art and provide a policy project industry classification method and device based on the Aho-Corasick algorithm and large model.

[0007] To achieve the above objectives, the present invention adopts the following technical solutions: a policy project industry classification method based on the Aho-Corasick algorithm and a large model, including:

[0008] Build templates for keywords and industries;

[0009] Obtaining policy project data to be classified and performing preprocessing to obtain preprocessing results;

[0010] Performing multi-mode matching on the preprocessing results to obtain matched keywords and unmatched keywords;

[0011] The template is used to map the matched keywords, and the large model is used to perform semantic analysis on the unmatched keywords to generate industry classifications to obtain classification results;

[0012] The classification result is output.

[0013] A further technical solution is: after mapping the matched keywords using the template and performing semantic analysis on the unmatched keywords using the big model to generate industry classifications to obtain classification results, the method further includes:

[0014] The unmatched keywords and the results obtained from the corresponding industry classifications are added to the template.

[0015] A further technical solution is as follows: the template for constructing keywords and industries includes:

[0016] Obtaining policy-related raw data;

[0017] Cleaning and normalizing the raw data and converting it into structured data to obtain a processing result;

[0018] Analyzing the processing results using a large model combined with prompt words to obtain keywords related to the industry, business scope, and enterprise type of the enterprise;

[0019] Based on the industry classification standards in the knowledge base, the keywords are mapped to specific sub-industries using a large model and RAG technology to obtain a template for keywords and industries.

[0020] A further technical solution is: obtaining the policy project data to be classified and preprocessing it to obtain preprocessing results, including:

[0021] Obtain the policy project data to be classified, clean and normalize it, and convert it into structured data to obtain preprocessing results.

[0022] A further technical solution is: performing multi-mode matching on the preprocessing results to obtain matched keywords and unmatched keywords, including:

[0023] The preprocessing results are subjected to multi-pattern matching using the Aho-Corasick algorithm in combination with a pre-built dictionary tree to obtain matched keywords and unmatched keywords.

[0024] A further technical solution is: using the Aho-Corasick algorithm in combination with a pre-built dictionary tree to perform multi-pattern matching on the pre-processing results to obtain matched keywords and unmatched keywords, including:

[0025] Constructing a dictionary tree according to the template;

[0026] Build failure pointer;

[0027] The preprocessing result is subjected to text scanning and matching through the dictionary tree and the failure pointer to determine matched keywords and unmatched keywords.

[0028] A further technical solution is: the template is used to map the matched keywords, and the large model is used to perform semantic analysis on the unmatched keywords to generate industry classifications to obtain classification results, including:

[0029] Matching the matching keywords with one or more related industries using the template to obtain matching results;

[0030] For unmatched keywords, the large model and RAG technology are called to generate industry classifications, and the generated industry classifications are combined with the matching results to form classification results.

[0031] The present invention also provides a policy project industry classification device based on the Aho-Corasick algorithm and a large model, including:

[0032] Template building unit, used to build templates for keywords and industries;

[0033] A preprocessing unit is used to obtain policy item data to be classified and perform preprocessing to obtain preprocessing results;

[0034] a multi-mode matching unit, configured to perform multi-mode matching on the preprocessing result to obtain matched keywords and unmatched keywords;

[0035] A classification unit is used to map the matched keywords using the template, and to call the large model to perform semantic analysis on the unmatched keywords to generate industry classifications to obtain classification results;

[0036] An output unit is used to output the classification result.

[0037] The present invention further provides a computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.

[0038] The present invention also provides a storage medium, wherein the storage medium stores a computer program, and the computer program implements the above method when executed by a processor.

[0039] The beneficial effects of the present invention compared with the existing technology are as follows: the present invention combines the latest policy data, adopts a large model to analyze and generate industry-related keyword templates, ensuring that the templates can adapt to changes in the policy environment in real time; uses an efficient multi-mode matching algorithm to quickly screen policy data, accurately identify policy-related keywords, and improve matching efficiency; for unmatched keywords, calls the large model for deep semantic analysis, dynamically generates relevant industry classifications, and enhances the flexibility and accuracy of classification; maps matched keywords with industry templates, and updates the templates based on the semantic analysis results of unmatched keywords to ensure continuous optimization and accuracy of the templates; through clear templates and matching logic, the classification results are guaranteed to be highly interpretable, allowing users to understand the relationship between each keyword and the industry, thereby enhancing the transparency of the system.

[0040] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1 A schematic diagram of an application scenario of the policy project industry classification method based on the Aho-Corasick algorithm and large model provided in an embodiment of the present invention;

[0043] Figure 2 A schematic diagram of a process for classifying policy projects based on the Aho-Corasick algorithm and a large model according to an embodiment of the present invention;

[0044] Figure 3A schematic diagram of a sub-process of a policy project industry classification method based on the Aho-Corasick algorithm and a large model provided in an embodiment of the present invention;

[0045] Figure 4 A schematic diagram of a sub-process of a policy project industry classification method based on the Aho-Corasick algorithm and a large model provided in an embodiment of the present invention;

[0046] Figure 5 A schematic diagram of a sub-process of a policy project industry classification method based on the Aho-Corasick algorithm and a large model provided in an embodiment of the present invention;

[0047] Figure 6 A schematic block diagram of a policy project industry classification device based on the Aho-Corasick algorithm and large model provided in an embodiment of the present invention;

[0048] Figure 7 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0050] It will be understood that when used in this specification and the appended claims, the terms “comprises” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0051] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in the specification and appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0052] 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.

[0053] See also Figure 1 and Figure 2 , Figure 1Schematic diagram of an application scenario of the policy project industry classification method based on the Aho-Corasick algorithm and large model provided in an embodiment of the present invention. Figure 2 This is a schematic flow chart of a policy project industry classification method based on the Aho-Corasick algorithm and a large model provided by an embodiment of the present invention. The policy project industry classification method based on the Aho-Corasick algorithm and a large model is applied to a server. The server interacts with the terminal to exchange data, cleans and normalizes the original policy data, and combines the big model with industry standards to generate keywords and industry templates that can reflect dynamic changes, ensuring that the templates can adapt to the complexity of the policy environment; uses the Aho-Corasick algorithm combined with the dictionary tree for efficient multi-mode matching to ensure rapid identification of policy-related keywords and improve the accuracy and speed of classification; for unmatched keywords, calls the big model for in-depth semantic analysis, dynamically generates industry classifications, improves the accuracy of classification results, and adapts to the rapid changes in the policy environment; by feeding back the results of unmatched keywords and industry classifications into the template, the template is self-updated, further improving the long-term adaptability of the classification model; uses the big model and RAG technology to accurately map keywords to specific industry segments, improve the interpretability of classification, and ensure comprehensive coverage of complex industries; by continuously feeding back the latest policy data and classification results, optimizes the template and matching mechanism to adapt to the dynamic changes of the policy environment, enhances the classification accuracy and the interpretability of the system.

[0054] Figure 2 This is a flow chart of the policy project industry classification method based on the Aho-Corasick algorithm and large model provided by the embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S160.

[0055] S110. Build templates for keywords and industries.

[0056] In this example, the keyword and industry template is a template created by mapping core keywords in the policy text to specific industry categories through a series of automated and intelligent processing steps. This template is intended to provide a structured approach to quickly and accurately understand the policy's impact on specific industries, laying the foundation for subsequent analysis, classification, and decision support.

[0057] In one embodiment, see Figure 3 , the above-mentioned step S110 may include steps S111 to S114.

[0058] S111. Obtain policy-related original data.

[0059] In this example, we first collected policy-related raw data from multiple authoritative sources, such as websites, announcements, official documents, and industry association documents. This data forms the foundation for all subsequent analysis, ensuring the official and reliable source of information. The collected data includes basic information such as title, release date, source link, source, level (e.g., provincial or district), province, city, district, and county, providing a detailed information background for subsequent policy analysis.

[0060] S112: Clean and normalize the original data and convert it into structured data to obtain a processing result.

[0061] In this embodiment, the processing result refers to the result obtained after the original data is cleaned, normalized, and converted into structured data.

[0062] Specifically, the raw data is cleaned and normalized, redundant information is removed, the core content of the policy is extracted, and the unstructured policy text is converted into structured data. This process includes, but is not limited to, extracting key information from the policy document, such as the project name, beneficiary, support content, eligibility conditions, and policy validity period, thereby forming a data set that is convenient for further analysis.

[0063] S113. Analyze the processing results using a large model combined with prompt words to obtain keywords related to the industry, business scope, and enterprise type of the enterprise.

[0064] In this example, based on the cleaned data, a pre-trained large model, combined with customized prompts, is used to automatically extract core keywords from policy texts. This step accurately and efficiently identifies key terms directly related to a company's industry, business scope, and type, while simultaneously eliminating irrelevant terms, reducing manual intervention and improving analysis efficiency. The final output is a concise and highly relevant keyword list, with each list containing up to five keywords.

[0065] Specifically, the prompt words are shown in Table 1.

[0066] Table 1. Prompt words

[0067]

[0068] S114. Based on the industry classification standards in the knowledge base, the keywords are mapped to specific sub-industries using a large model and RAG technology to obtain a template of keywords and industries.

[0069] In this embodiment, the last step is to build a template for keywords and industries. This process relies on the knowledge base of the economic industry classification as the industry classification standard. Through the large model and retrieval enhancement generation (RAG) technology, the keywords extracted in the previous step are accurately mapped to the corresponding sub-industries. This process is not only completed by algorithm automation, but also combined with manual verification to ensure accuracy. The final template is an intuitive correspondence table, in which each keyword is associated with one or more specific industry categories, thereby realizing a direct mapping from policy text to industry impact, providing strong support for industry research and corporate decision-making, and providing a predictive basis for future new policy analysis. Among them, {data} is the keyword extracted by the large model.

[0070] In this step, prompt words can also be used in combination with a large model. The prompt words used are shown in Table 2.

[0071] Table 2. Prompt words

[0072]

[0073] The final template is shown in Table 3.

[0074] Table 3. Templates

[0075]

[0076] To sum up, the process of building keyword and industry templates is a complex process that comprehensively uses technologies such as data collection, cleaning, keyword extraction and industry mapping. It enables the implicit information in the policy text to be clearly presented, and thus provides a scientific basis for the development planning and strategic adjustments of different industries.

[0077] S120: Obtain policy project data to be classified and perform preprocessing to obtain preprocessing results.

[0078] In this embodiment, the preprocessing result refers to the result obtained after cleaning, normalizing and converting the data into structured data.

[0079] Specifically, the policy project data to be classified is obtained, cleaned and normalized, and converted into structured data to obtain preprocessing results.

[0080] This step still involves collecting policy data through automated collection technology and manual organization. The agent removes redundant information, extracts the core content of the policy, and converts the unstructured policy text into structured data. The specific implementation details can be found in step S112 and will not be repeated here.

[0081] S130: Perform multi-mode matching on the preprocessing result to obtain matched keywords and unmatched keywords.

[0082] In this embodiment, matched keywords refer to keywords that can be matched by the dictionary tree constructed by the Aho-Corasick algorithm combined with the template, and unmatched keywords refer to keywords that cannot be matched by the dictionary tree constructed by the Aho-Corasick algorithm combined with the template.

[0083] Specifically, the Aho-Corasick algorithm is combined with a pre-built dictionary tree to perform multi-pattern matching on the pre-processing results to obtain matched keywords and unmatched keywords.

[0084] In this embodiment, multi-pattern matching is a key step in searching for keywords in the core content of the policy. Its core is to quickly identify key information in the policy text based on the combination of the multi-pattern matching algorithm (Aho-Corasick) and the keyword industry template. The multi-pattern matching algorithm is a multi-pattern matching algorithm based on a dictionary tree (Trie), which can efficiently match multiple pattern strings (keywords) within a time complexity of O(n). In this process, all known policy keywords and industry templates are constructed into a dictionary tree. After the policy text is entered, the occurrence positions of all keywords are quickly located through a single scan.

[0085] In one embodiment, see Figure 4 , the above-mentioned step S130 may include steps S131 to S133.

[0086] S131. Construct a dictionary tree according to the template.

[0087] In this embodiment, all known policy keywords and industry templates are constructed into a dictionary tree structure to facilitate rapid identification of key information in the policy text.

[0088] Collect all the keywords to be matched and insert them into an empty trie. Each keyword is inserted into the trie one by one in character order, forming branches or sharing existing paths. If a character already exists in the trie, the existing path is used; if not, a new node is created.

[0089] For example, suppose there is a set K containing m keywords = {k1, k2, ..., k m}, each keyword k i They are all composed of a series of characters. We insert the characters of these keywords into the dictionary tree to build a tree structure. Assume that the i-th keyword where c ij Represents the characters in the keyword. The dictionary tree is constructed by inserting characters one by one. in, Indicates keyword ki The character set in .

[0090] S132: Build failure pointer.

[0091] In this embodiment, when the current node cannot be matched any further, a mechanism is provided to jump to other possible matching nodes, ensuring that the algorithm can complete the matching within the time complexity of O(n).

[0092] For each non-root node, calculate its failure pointer, which points to another node that can continue matching. The setting of the failure pointer depends on the failure pointer of the parent node and the next function value of the current character.

[0093] For example, in the above dictionary tree, if the character 'c' is not matched, the failure pointer can be used to jump from node 'd' to the sibling node of node 'b' or other suitable nodes to try to match the next character.

[0094] Specifically, the fail pointer in the Aho-Corasick algorithm is used to jump to the next node in the tree that may match during the matching process. If the current node cannot continue to match the characters in the text, it is necessary to jump to a parent node or sibling node in the tree through the fail pointer and continue to try to match. For each node, especially non-root nodes, if the current character does not match, the fail pointer points to a node that can match the character. The jump process of this fail pointer is represented by fail(v) = next(fail(p), c). Among them, v is the current node, p is the parent node of the current node, c is the current character, and the next function means to continue from the parent node p along the character c to find the next matching child node. For example, assuming that the current node v represents the character c, if the character in the text cannot be matched at this node, then jump to the node p through the fail pointer, and then continue to check the character c until a match is found or return to the root node.

[0095] S133 , performing text scanning and matching on the preprocessing result through the dictionary tree and the failure pointer to determine matched keywords and unmatched keywords.

[0096] In this example, given a policy text to be analyzed, the system matches each character against the trie, starting with the first character. If a character matches successfully, the system moves to a child node and continues matching. If a match fails, the system adjusts the failure pointer to an appropriate location and rematches. Throughout this process, once a complete keyword match is found (i.e., a leaf node is reached in the trie), the keyword is recorded and output. This process is repeated until the entire text is scanned.

[0097] Specifically, the matching process of the Aho-Corasick algorithm is completed through the dictionary tree and the failure pointer. In the process of scanning the text, the matching is performed character by character and the decision is made based on the structure of the dictionary tree. Given a text T = {t1, t2, ..., t n}, where t i is the i-th character in the text. During the matching process, starting with the first character of the text, the search proceeds character by character through the dictionary tree. If a node matches successfully, the search continues downward; if the match fails, the failure pointer jumps to the appropriate node and continues matching. This process repeats until all text characters have been scanned. If a matching node is found during the scan, the keyword is output.

[0098] In summary, multi-pattern matching leverages the power of the Aho-Corasick algorithm. By pre-building a dictionary tree and setting a failure pointer, it quickly and accurately locates keywords in policy texts. This approach not only improves search efficiency but also maintains linear time complexity even for long texts, providing solid technical support for classifying policies by industry.

[0099] Output all found keywords and their locations, providing a basis for subsequent steps such as industry mapping

[0100] S140: Map the matched keywords using the template, and use the big model to perform semantic analysis on the unmatched keywords to generate industry classifications to obtain classification results.

[0101] In this embodiment, the classification results refer to the industry categories corresponding to all keywords, etc.

[0102] After identifying keywords within the policy text, these keywords are mapped to corresponding industries. Industry matching relies on existing industry classification templates and keyword-industry mappings. If no corresponding industry is found for certain keywords, the system proceeds to a supplementary phase, where a large model is used to further extract keywords and generate corresponding industries.

[0103] In one embodiment, see Figure 5 , the above-mentioned step S140 may include steps S141 to S142.

[0104] S141: Use the template to match the matching keyword with one or more related industries to obtain a matching result.

[0105] In this embodiment, the matching keywords are directly mapped using industry templates. For example, "5G technology" may be mapped to industries such as "communication equipment manufacturing" and "software development." In the process of mapping keywords to industries, a mapping function can be used to represent this process. Assuming that keyword K is mapped to the corresponding industry H, it can be described by the following formula:

[0106] f:K->H, where K={k1,k2,...,k n}, represents the keyword set extracted from the large model, H = {h1,h2,...,h m} represents the industry set. The mapping goal is to transform each keyword k i Mapped to one or more industries, f(k i )=h j , where h j ∈H.

[0107] S142. For unmatched keywords, the large model and RAG technology are used to generate industry classifications, and the generated industry classifications are combined with the matching results to form classification results.

[0108] In this embodiment, if some keywords cannot find corresponding industries, the system calls the big model and RAG technology to perform semantic analysis on the keywords and generate industry classifications. The big model can understand the semantic attributes of keywords based on the context and give more detailed industry suggestions. It also reduces the generation of non-standard industry content by the big model by searching the knowledge base. Specifically, f 补充 (k i )=h j (generated by model) for processing.

[0109] Specifically, during the initial keyword-industry mapping process, some keywords may not be directly matched to corresponding industry categories due to their ambiguity or uniqueness. These keywords are referred to as "unmatched keywords." They may be newly emerging concepts, compound words, or expressions unique to policy documents, making it difficult for traditional mapping methods to accurately determine their industry affiliation.

[0110] For these unmatched keywords, the system activates a large-scale model for in-depth semantic analysis. Trained on a vast amount of text, the large-scale model possesses powerful natural language understanding capabilities. Based on the specific context in which the keyword appears, it parses the semantic attributes underlying the keyword and infers the likely industry sectors involved. For example, if a keyword appears in multiple policy documents regarding agricultural technology support, the large-scale model may infer its connection to agriculture, even if the term itself is not an agricultural term.

[0111] To ensure that the generated industry classifications are both standard and segmented into specific industry sectors, the system further incorporates RAG technology. The core of RAG technology lies in the integration of retrieval and generation. While the large model generates industry suggestions, it verifies and adjusts the generated results by searching authoritative industry classification information in the knowledge base. This has the advantage of reducing the risk of generating non-standard industry content and improving the accuracy and reliability of the classification. For example, when the large model suggests a possible industry, RAG technology can quickly consult the knowledge base to confirm whether the industry actually exists and its accurate classification code.

[0112] After combined processing using the large model and RAG technology, the system generates a series of industry classification suggestions for unmatched keywords. These newly generated industry classifications are combined with previously successfully matched results to form the final classification results. This comprehensive classification result not only covers all keywords, but also corresponds to one or more clear industry classifications for each keyword, providing complete data support for subsequent policy impact analysis.

[0113] In summary, step S142, by incorporating a large model and RAG technology, resolves the industry classification challenge of unmatched keywords and ensures the integrity of the entire keyword and industry template construction process. This mechanism embodies the application of intelligence and automation in policy analysis, enhances the breadth and depth of data analysis, and lays a solid foundation for more accurate industry impact assessments.

[0114] S150: Supplement the unmatched keywords and the corresponding industry classification results into the template.

[0115] In this example, to continuously optimize and expand the content of industry templates, the system will add the mapping relationship between new keywords generated by the large model and corresponding industry classifications to the existing industry templates. This process is intended to ensure that industry templates can be continuously updated and improved as new information is added, thereby providing more comprehensive and accurate support for subsequent policy text processing.

[0116] Assuming that the existing industry template is H0, and the supplementary industry mapping generated by the large model is H1, the update of the industry template can be completed through the merge operation: H = H0 ∪ H1, where H0 is the original industry template and H1 is the industry template generated by the large model, eventually forming an updated industry template H.

[0117] Through this merging process, all newly identified keywords and their corresponding industry classifications will be integrated into the industry template, ensuring the timeliness and completeness of the template content. This dynamic update mechanism not only helps capture emerging vocabulary and concepts in policy documents, but also more accurately reflects changes and development trends in different industry sectors, thereby improving the quality and efficiency of policy analysis.

[0118] In summary, step S150 realizes the function of supplementing the keyword-industry mapping generated by the large model to the industry template, ensuring the continuous improvement and adaptability of the industry template and providing a solid data foundation for policy text processing.

[0119] S160: Output the classification result.

[0120] In this embodiment, the classification result is output to the terminal for display.

[0121] This method uses automation and intelligent means to efficiently process policy documents and provide accurate industry classification. It combines the advantages of classic algorithms with modern large language models to ensure high efficiency and improved accuracy in large-scale data processing.

[0122] First, an intelligent agent automatically collects the latest policy data and normalizes the raw data. This process includes removing redundant information, cleaning irrelevant words, and retaining the most valuable content, thereby improving data quality and usability and providing a solid foundation for subsequent analysis.

[0123] Leveraging advanced large language model technology, the system accurately extracts core keywords from complex policy texts. This not only reduces the need for manual intervention but also ensures the accuracy and relevance of keyword extraction. By fine-tuning specific prompt words, it can more effectively identify key terms such as "project name," "beneficiary," and "support content," and then link them to relevant information such as the company's industry and business scope.

[0124] To accelerate keyword recognition and location, the Aho-Corasick multi-pattern matching algorithm was employed. This algorithm constructs a dictionary tree structure that can scan and locate all predefined keywords within an O(n) time complexity. This efficient matching method ensures rapid keyword recognition, even when faced with massive amounts of policy data.

[0125] The templates are dynamically updated. Whenever new keywords or emerging industry sectors emerge, the system automatically uses the large language model to generate corresponding mappings and incorporates them into the industry templates. This mechanism ensures that the templates can adapt to the ever-changing policy environment and provide users with the latest industry classification support.

[0126] For keywords that can't be directly matched to existing industries, we use large models and RAG (Retrieval Enhanced Generation) technology to conduct in-depth semantic analysis. This allows the system to infer the most appropriate industry classification, enhancing the flexibility and comprehensiveness of industry mapping and reducing classification blind spots.

[0127] Combining these technologies and methods not only allows us to categorize policies by industry based on existing keywords, but also automatically generates industry classifications for new keywords that may appear in the future, further improving industry templates. This continuous optimization process ensures that the system is always in optimal condition, providing reliable data support for policy analysis and industry research.

[0128] In summary, the method of this embodiment realizes the automation of the entire process from data collection to cleaning and analysis, and improves overall efficiency. Relying on a large language model to accurately capture the core keywords in the policy text. The Aho-Corasick algorithm is used to ensure fast and accurate positioning of keywords. The template is constantly updated as new information is added to cope with the changing policy environment. Even if you encounter an unknown keyword, you can find the correct industry classification through semantic analysis. Not only can you accurately classify the industry to which the policy belongs, but you can also foresee the potential impact of policy changes on different fields.

[0129] The above-mentioned policy project industry classification method based on the Aho-Corasick algorithm and the big model, by combining the latest policy data, uses the big model to analyze and generate industry-related keyword templates, ensuring that the template can adapt to changes in the policy environment in real time; uses an efficient multi-mode matching algorithm to quickly screen policy data, accurately identify policy-related keywords, and improve matching efficiency; for unmatched keywords, calls the big model for in-depth semantic analysis, dynamically generates relevant industry classifications, and enhances the flexibility and accuracy of classification; maps the matched keywords to the industry template, and updates the template according to the semantic analysis results of the unmatched keywords to ensure continuous optimization and accuracy of the template; through clear templates and matching logic, the classification results are guaranteed to be highly interpretable, allowing users to understand the relationship between each keyword and the industry, thereby enhancing the transparency of the system.

[0130] Figure 6 This is a schematic block diagram of a policy project industry classification device 300 based on the Aho-Corasick algorithm and large model provided by an embodiment of the present invention. Figure 6As shown, corresponding to the above-mentioned policy project industry classification method based on the Aho-Corasick algorithm and the large model, the present invention also provides a policy project industry classification device based on the Aho-Corasick algorithm and the large model. The policy project industry classification device 300 based on the Aho-Corasick algorithm and the large model includes a unit for executing the above-mentioned policy project industry classification method based on the Aho-Corasick algorithm and the large model, and the device can be configured in a server. Specifically, please refer to Figure 6 The policy project industry classification device 300 based on the Aho-Corasick algorithm and the large model includes a template construction unit 301, a preprocessing unit 302, a multi-mode matching unit 303, a classification unit 304, a supplementing unit 305 and an output unit 306.

[0131] The template construction unit 301 is used to construct a template for keywords and industries. The preprocessing unit 302 is used to obtain policy project data to be classified and perform preprocessing to obtain preprocessing results. The multi-mode matching unit 303 is used to perform multi-mode matching on the preprocessing results to obtain matching keywords and unmatched keywords. The classification unit 304 is used to map the matching keywords using the template and, for unmatched keywords, call the large model to perform semantic analysis to generate industry classifications to obtain classification results. The supplementation unit 305 is used to supplement the unmatched keywords and the corresponding industry classification results into the template. The output unit 306 is used to output the classification results.

[0132] In one embodiment, the template construction unit 301 includes:

[0133] The original data acquisition subunit is used to obtain policy-related original data; the processing subunit is used to clean and normalize the original data and convert it into structured data to obtain processing results; the keyword extraction subunit is used to use a large model combined with prompt words to analyze the processing results to obtain keywords related to the industry, business scope, and enterprise type of the enterprise; the classification subunit is used to map the keywords to specific sub-industries based on the industry classification standards in the knowledge base, using large models and RAG technology to obtain keyword and industry templates.

[0134] In one embodiment, the preprocessing unit 302 is used to obtain policy item data to be classified, perform cleaning and normalization processing on the data, and convert the data into structured data to obtain preprocessing results.

[0135] In one embodiment, the multi-pattern matching unit 303 is configured to perform multi-pattern matching on the pre-processing result using the Aho-Corasick algorithm in combination with a pre-built dictionary tree to obtain matched keywords and unmatched keywords.

[0136] In one embodiment, the multi-pattern matching unit 303 includes:

[0137] A dictionary tree construction subunit is used to construct a dictionary tree according to the template; a failure pointer construction subunit is used to construct a failure pointer; and a scanning and matching subunit is used to perform text scanning and matching on the preprocessing results through the dictionary tree and the failure pointer to determine matched keywords and unmatched keywords.

[0138] In one embodiment, the classification unit 304 includes:

[0139] The industry matching sub-unit is used to use the template to match the matching keywords with one or more related industries to obtain matching results; the classification generation sub-unit is used to call the big model and RAG technology to generate industry classifications for unmatched keywords, and combine the generated industry classifications with the matching results to form classification results.

[0140] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned policy project industry classification device 300 and each unit based on the Aho-Corasick algorithm and large model can refer to the corresponding description in the aforementioned method embodiment. For the convenience and brevity of the description, it will not be repeated here.

[0141] The above-mentioned policy project industry classification device 300 based on the Aho-Corasick algorithm and the large model can be implemented in the form of a computer program. The computer program can be used in Figure 7 Runs on the computer device shown.

[0142] See also Figure 7 , Figure 7 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of multiple servers.

[0143] See Figure 7 The computer device 500 includes a processor 502 , a memory, and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0144] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, which, when executed, can cause the processor 502 to execute a policy project industry classification method based on the Aho-Corasick algorithm and a large model.

[0145] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500.

[0146] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a policy project industry classification method based on the Aho-Corasick algorithm and the large model.

[0147] The network interface 505 is used to communicate with other devices through the network. Figure 7 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0148] The processor 502 is configured to execute a computer program 5032 stored in the memory to implement the following steps:

[0149] Construct a template for keywords and industries; obtain policy project data to be classified and perform preprocessing to obtain preprocessing results; perform multi-mode matching on the preprocessing results to obtain matched keywords and unmatched keywords; use the template to map the matched keywords, and call the large model to perform semantic analysis on the unmatched keywords to generate industry classifications to obtain classification results; output the classification results.

[0150] In one embodiment, after implementing the steps of mapping the matched keywords using the template and performing semantic analysis on the unmatched keywords using the large model to generate industry classifications to obtain classification results, the processor 502 further implements the following steps:

[0151] The unmatched keywords and the results obtained from the corresponding industry classifications are added to the template.

[0152] In one embodiment, when implementing the step of constructing a template of keywords and industries, the processor 502 specifically implements the following steps:

[0153] Obtain policy-related raw data; clean and normalize the raw data and convert it into structured data to obtain processing results; use a large model combined with prompt words to analyze the processing results to obtain keywords related to the industry, business scope, and enterprise type of the enterprise; based on the industry classification standards in the knowledge base, use the large model and RAG technology to map the keywords to specific sub-industries to obtain keyword and industry templates.

[0154] In one embodiment, when the processor 502 implements the step of obtaining the policy item data to be classified and performing preprocessing to obtain the preprocessing result, the processor 502 specifically implements the following steps:

[0155] Obtain the policy project data to be classified, clean and normalize it, and convert it into structured data to obtain preprocessing results.

[0156] In one embodiment, when the processor 502 performs multi-pattern matching on the preprocessing result to obtain matched keywords and unmatched keywords, the processor 502 specifically implements the following steps:

[0157] The preprocessing results are subjected to multi-pattern matching using the Aho-Corasick algorithm in combination with a pre-built dictionary tree to obtain matched keywords and unmatched keywords.

[0158] In one embodiment, when the processor 502 implements the step of performing multi-pattern matching on the preprocessing result using the Aho-Corasick algorithm in combination with a pre-built dictionary tree to obtain matched keywords and unmatched keywords, the processor 502 specifically implements the following steps:

[0159] A dictionary tree is constructed according to the template; a failure pointer is constructed; and text scanning and matching is performed on the preprocessing result through the dictionary tree and the failure pointer to determine matched keywords and unmatched keywords.

[0160] In one embodiment, when the processor 502 implements the steps of mapping the matched keywords using the template and calling the large model to perform semantic analysis on the unmatched keywords to generate industry classifications to obtain classification results, the processor 502 specifically implements the following steps:

[0161] The template is used to match the matched keywords with one or more related industries to obtain matching results; for unmatched keywords, the large model and RAG technology are called to generate industry classifications, and the generated industry classifications are combined with the matching results to form classification results.

[0162] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0163] Those skilled in the art will appreciate that all or part of the steps in the method of the above-described embodiment can be implemented by instructing the relevant hardware through a computer program. The computer program includes program instructions, which can be stored in a storage medium that is computer-readable. The program instructions are executed by at least one processor in the computer system to implement the steps in the method of the above-described embodiment.

[0164] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor performs the following steps:

[0165] Construct a template for keywords and industries; obtain policy project data to be classified and perform preprocessing to obtain preprocessing results; perform multi-mode matching on the preprocessing results to obtain matched keywords and unmatched keywords; use the template to map the matched keywords, and call the large model to perform semantic analysis on the unmatched keywords to generate industry classifications to obtain classification results; output the classification results.

[0166] In one embodiment, after executing the computer program to implement the steps of mapping the matched keywords using the template and calling the large model to perform semantic analysis on the unmatched keywords to generate industry classifications to obtain classification results, the processor further implements the following steps:

[0167] The unmatched keywords and the results obtained from the corresponding industry classifications are added to the template.

[0168] In one embodiment, when the processor executes the computer program to implement the step of constructing a template of keywords and industries, the processor specifically implements the following steps:

[0169] Obtain policy-related raw data; clean and normalize the raw data and convert it into structured data to obtain processing results; use a large model combined with prompt words to analyze the processing results to obtain keywords related to the industry, business scope, and enterprise type of the enterprise; based on the industry classification standards in the knowledge base, use the large model and RAG technology to map the keywords to specific sub-industries to obtain keyword and industry templates.

[0170] In one embodiment, when the processor executes the computer program to implement the step of obtaining the policy item data to be classified and performing preprocessing to obtain a preprocessing result, the processor specifically implements the following steps:

[0171] Obtain the policy project data to be classified, clean and normalize it, and convert it into structured data to obtain preprocessing results.

[0172] In one embodiment, when the processor executes the computer program to implement the step of performing multi-pattern matching on the preprocessing results to obtain matched keywords and unmatched keywords, the processor specifically implements the following steps:

[0173] The preprocessing results are subjected to multi-pattern matching using the Aho-Corasick algorithm in combination with a pre-built dictionary tree to obtain matched keywords and unmatched keywords.

[0174] In one embodiment, when the processor executes the computer program to implement the step of performing multi-pattern matching on the preprocessing results using the Aho-Corasick algorithm in combination with a pre-built dictionary tree to obtain matched keywords and unmatched keywords, the processor specifically implements the following steps:

[0175] A dictionary tree is constructed according to the template; a failure pointer is constructed; and text scanning and matching is performed on the preprocessing result through the dictionary tree and the failure pointer to determine matched keywords and unmatched keywords.

[0176] In one embodiment, when the processor executes the computer program to implement the steps of mapping the matched keywords using the template and calling the large model to perform semantic analysis on the unmatched keywords to generate industry classifications to obtain classification results, the processor specifically implements the following steps:

[0177] The template is used to match the matched keywords with one or more related industries to obtain matching results; for unmatched keywords, the large model and RAG technology are called to generate industry classifications, and the generated industry classifications are combined with the matching results to form classification results.

[0178] The storage medium may be any computer-readable storage medium that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk.

[0179] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the composition and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0180] In the several embodiments provided herein, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the various units is merely a logical functional division, and actual implementation may employ other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented.

[0181] The steps in the methods of the embodiments of the present invention may be adjusted in order, combined, or deleted as needed. The units in the devices of the embodiments of the present invention may be combined, divided, or deleted as needed. Furthermore, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit.

[0182] If this integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the existing technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, terminal, or network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present invention.

[0183] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. The policy project industry classification method based on the Aho-Corasick algorithm and large model is characterized by: include: Build templates for keywords and industries; Obtaining policy project data to be classified and performing preprocessing to obtain preprocessing results; Performing multi-mode matching on the preprocessing results to obtain matched keywords and unmatched keywords; The template is used to map the matched keywords, and the large model is used to perform semantic analysis on the unmatched keywords to generate industry classifications to obtain classification results; The classification result is output.

2. The policy project industry classification method based on the Aho-Corasick algorithm and large model according to claim 1 is characterized in that: After mapping the matched keywords using the template and performing semantic analysis on the unmatched keywords using the big model to generate industry classifications to obtain classification results, the method further includes: The unmatched keywords and the results obtained from the corresponding industry classifications are added to the template.

3. The policy project industry classification method based on the Aho-Corasick algorithm and large model according to claim 1 is characterized in that: The template for constructing keywords and industries includes: Obtaining policy-related raw data; Cleaning and normalizing the raw data and converting it into structured data to obtain a processing result; Analyzing the processing results using a large model combined with prompt words to obtain keywords related to the industry, business scope, and enterprise type of the enterprise; Based on the industry classification standards in the knowledge base, the keywords are mapped to specific sub-industries using a large model and RAG technology to obtain a template for keywords and industries.

4. The policy project industry classification method based on the Aho-Corasick algorithm and large model according to claim 3 is characterized in that: The step of obtaining the policy item data to be classified and performing preprocessing to obtain preprocessing results includes: Obtain the policy project data to be classified, clean and normalize it, and convert it into structured data to obtain preprocessing results.

5. The policy project industry classification method based on the Aho-Corasick algorithm and large model according to claim 1 is characterized in that: The performing multi-mode matching on the preprocessing results to obtain matched keywords and unmatched keywords includes: The preprocessing results are subjected to multi-pattern matching using the Aho-Corasick algorithm in combination with a pre-built dictionary tree to obtain matched keywords and unmatched keywords.

6. The policy project industry classification method based on the Aho-Corasick algorithm and large model according to claim 5 is characterized in that: The Aho-Corasick algorithm is combined with a pre-built dictionary tree to perform multi-pattern matching on the pre-processing results to obtain matched keywords and unmatched keywords, including: Constructing a dictionary tree according to the template; Build failure pointer; The preprocessing result is subjected to text scanning and matching through the dictionary tree and the failure pointer to determine matched keywords and unmatched keywords.

7. The policy project industry classification method based on the Aho-Corasick algorithm and large model according to claim 1 is characterized in that: The matched keywords are mapped using the template, and the unmatched keywords are semantically analyzed using the big model to generate industry classifications to obtain classification results, including: Matching the matching keywords with one or more related industries using the template to obtain matching results; For unmatched keywords, the large model and RAG technology are called to generate industry classifications, and the generated industry classifications are combined with the matching results to form classification results.

8. The policy project industry classification device based on the Aho-Corasick algorithm and large model is characterized by: include: Template building unit, used to build templates for keywords and industries; A preprocessing unit is used to obtain policy item data to be classified and perform preprocessing to obtain preprocessing results; a multi-mode matching unit, configured to perform multi-mode matching on the preprocessing result to obtain matched keywords and unmatched keywords; A classification unit is used to map the matched keywords using the template, and to call the large model to perform semantic analysis on the unmatched keywords to generate industry classifications to obtain classification results; An output unit is used to output the classification result.

9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Enterprise industry multi-label classification method

    CN109783818A

  • Positive and negative emotion analysis method, terminal equipment and storage medium

    CN110888983A

  • Industrial category determination method and device, storage medium and electronic equipment

    CN114297347A

  • NLP text security auditing multi-level retrieval system

    CN114579693A

  • Industrial field identification method and device, electronic equipment and storage medium

    CN115757774A