Text classification semantic enhancement mapping method and system based on semantic middleware knowledge base
By constructing a multi-level mapping method based on a semantic middleware knowledge base, and utilizing pre-trained language models and confidence threshold filtering, the problems of logical errors and accuracy coverage in text classification mapping are solved, achieving efficient and accurate text classification mapping.
Patent Information
- Application Number
- CN202511679448.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-27
AI Technical Summary
Existing technologies cannot effectively understand the deep semantics of words in text classification mapping, resulting in low matching accuracy; they lack awareness of hierarchical structure, which easily leads to logical errors; they cannot systematically balance mapping accuracy and coverage; and they lack effective integration and verification mechanisms for external factual data, resulting in inaccurate mapping results.
A semantic middleware-based knowledge base is constructed. The "Statistical Product Catalog" and "Nice Classification" are used as middleware to perform multi-level semantic mapping. A pre-trained language model is used for vectorized calculation, and a confidence threshold is used to filter effective mapping relationships.
It improves the logical accuracy of mapping, solves cross-domain logical errors, systematically balances accuracy and coverage, achieves automated processing and efficient mapping, and has good robustness and scalability.
Smart Images

Figure CN121579694A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of text classification technology, and in particular to a text classification semantic enhancement mapping method and system based on a semantic middleware knowledge base. Background Technology
[0002] In many fields such as enterprise data management, industry analysis, and knowledge engineering, integrating data from different sources is a common need. However, these data often follow their own independent classification standards. For example, the national official classification of economic industries (GB / T 4754-2017) and the proprietary industry chain labeling system used by enterprises have significant differences in text description, hierarchical structure, and granularity, making it difficult for data to be interoperable. Therefore, automatically and accurately establishing the mapping relationship between these two heterogeneous and unstructured text classification systems has become a key technical bottleneck for achieving data fusion and value-added applications. Current mainstream technologies for solving this type of text mapping problem all have significant drawbacks. The most traditional method is keyword-based or bag-of-words (BOB) model-based matching. This method extracts keywords, N-gram segments, or constructs BOB vectors from the text and calculates word overlap or similarity to achieve matching. However, it cannot understand the deep semantic meaning of words and is extremely sensitive to synonyms, polysemous words, and different expressions, resulting in low matching accuracy. For example, a system relying solely on the keyword "wheat" might incorrectly match "wheat planting," belonging to the agricultural category, to "wheat processing machinery manufacturing," belonging to the manufacturing category. Although they share the core keyword, their industries are completely different. This error, caused by a lack of understanding of context and classification logic, is prevalent in this method and severely affects the usability of the mapping results. With the development of deep learning technology, a more advanced approach has emerged: using pre-trained language models (such as BERT) to convert text into high-dimensional semantic vectors and then calculating the cosine similarity between vectors to determine text relevance. This is the closest existing technology to this invention. Compared to keyword matching, it can better capture the deep semantic meaning of text and solves the problems of synonyms and sentence variations to some extent. However, it still has core drawbacks. First, the lack of awareness of hierarchical structure easily leads to logical errors. When training general semantic models, they mainly learn the co-occurrence relationships of words in a large amount of corpus to form the ability of "semantic association". When processing the mapping of classification system, they treat all texts as flat data at the same level, completely ignoring the strict hierarchical structure (such as category-major category-medium category-minor category) behind the classification labels. A typical case is that the model may give a high similarity score because "wheat planting" and "grain combine harvester" are highly related in context, but ignore the fundamental classification difference that the former belongs to the primary industry (agriculture) and the latter belongs to the secondary industry (manufacturing), resulting in a match that is "semantically related but logically wrong". Secondly, it is impossible to systematically balance the accuracy and coverage of matching. In practical applications, it is necessary to cover all items to be matched as much as possible while ensuring the accuracy of the mapping relationship. However, existing technologies usually use a single similarity threshold for judgment. If the threshold is set too high, a large number of potential correct matches will be missed (low coverage). If the threshold is set too low, a large number of incorrect matches will be introduced (low accuracy). There is a lack of a systematic mechanism to dynamically balance this contradiction. Third, there is a lack of effective mechanisms for integrating and verifying external factual data. While third-party data containing objective correlations (such as company directories labeled with two different classification tags) can be introduced as "factual" evidence, this factual data often contains a lot of "noise." For example, a company whose main business is "canned fruit and vegetable manufacturing" may also include "intellectual property services" in its business scope. Directly associating the two tags of this company will result in a semantically unrelated "pseudo-fact" mapping from "canned fruit and vegetable manufacturing" to "intellectual property services." Existing technologies usually only passively integrate this data, lacking intelligent means to internally verify and "purify" the factual data source, facing the risk of "garbage in, garbage out," and may even pollute the final mapping result due to the introduction of noisy data. In summary, existing technologies, whether traditional keyword matching or the more advanced general semantic matching, have failed to effectively solve the complex technical challenges of ensuring logical consistency, balancing accuracy and coverage, and intelligently verifying and integrating external factual data in text classification mapping. Summary of the Invention
[0003] This invention proposes a text classification semantic enhancement mapping method and system based on a semantic middleware knowledge base. By selecting the "Statistical Product Catalog" and the "Nice Classification" as semantic middleware, a multi-level semantic middleware knowledge base is constructed, consisting of [National Standard Classification Text → Product Catalog Text → Nice Classification Text]. This knowledge base is used to query the source classification system text to be mapped and perform semantic enhancement processing. Then, a pre-trained language model is used to vectorize the enhanced source text and the target classification system text, respectively. The semantic similarity between the two is calculated, and effective mapping relationships including confidence scores are filtered and output based on a preset threshold. This solves the problems of existing keyword-based or bag-of-words model matching methods, which cannot understand the deep semantics of words, are sensitive to synonyms / polysemous words leading to low matching accuracy, and lack of awareness of the hierarchical structure of classification systems, resulting in cross-domain logical errors, failing to systematically balance mapping accuracy and coverage, and lacking effective fusion and verification mechanisms for noisy external factual data.
[0004] A text classification semantic enhancement mapping method based on a semantic middleware knowledge base, the method comprising the following steps: S1. Based on the correlation and semantic characteristics of the source classification system, select the "Statistical Product Catalog" and the "Nice Classification" as middleware, collect the text data of the source classification system, the target classification system and the selected middleware, and perform standardized preprocessing. S2. First, use the official correspondence file combined with auxiliary semantic matching to construct the mapping of "national standard classification → product catalog". Then, use a specific pre-trained language model to vectorize the text, calculate the cosine similarity and construct the threshold based on the knowledge base to construct the mapping of "product catalog → Nice classification" and form a multi-level semantic middleware knowledge base. S3. Using the source classification text to be mapped as the query condition, retrieve the semantic middleware knowledge base, obtain the associated Nice Classification text, and structurally concatenate the source classification text and the associated Nice Classification text in a specific format to generate the semantically enhanced source text. S4. Using the same pre-trained language model as the knowledge base, vectorize the enhanced source text and the text in the target classification system respectively, calculate the cosine similarity between the two types of vectors, filter the effective mapping relationship according to the preset mapping judgment threshold, and output the mapping pair containing the source text, target text and confidence.
[0005] Furthermore, S1 includes the following steps: S11. Middleware selection: Select "Statistical Product Catalog" as the first-level middleware and "Nice Classification" as the second-level middleware; S12. Data Acquisition and Preprocessing: Collect the latest version of GB / T 4754-2017 and all its published amendments to the National Industrial Classification of Economic Activities, the Statistical Product Catalogue, and the latest version of the Nice Classification published by the World Intellectual Property Organization. Perform standardized preprocessing on the collected text data. Furthermore, in S12, the standardization preprocessing includes: converting the collected text data into a unified encoding, removing irrelevant punctuation marks and special characters, and standardizing text case.
[0006] Furthermore, S2 includes the following steps: S21. Construct a mapping from "National Standard Classification" to "Product Catalog": First, use the official correspondence documents provided by the National Bureau of Statistics to establish a deterministic mapping between the "National Industrial Classification of Economic Activities" (GB / T 4754-2017) as the source classification system and its directly corresponding "Product Catalog for Statistical Use" entries; for a few national standard classification entries that do not have a direct correspondence in the official documents, use an auxiliary semantic matching model to complete them; S22. Construct a semantic mapping from “Product Catalog” to “Nice Category”.
[0007] Furthermore, S22 includes the following steps: S221. Model selection: The large-scale pre-trained Transformer architecture language model shibing624 / text2vec-base-chinese was selected. S222, Text Vectorization: Use the word segmenter that matches the selected model to convert the product catalog entry text and the Nice Classification entry text into word sequence respectively. Input the word sequence into the pre-trained BERT model, obtain the output of the last hidden state of the BERT model, and extract the hidden state vector corresponding to the special start character as the semantic representation of text aggregation. S223. Similarity Calculation: The similarity between the semantic vector of each product catalog entry and the semantic vectors of all Nice category entries is calculated using the cosine similarity formula. The cosine similarity formula is as follows:
[0008] in, and These represent the semantic vectors of the two texts, with similarity scores ranging from -1 to 1. The closer the similarity score is to 1, the more semantically similar the two texts are. S224. Knowledge Link Generation: Setting a Threshold for Knowledge Base Construction If the semantic similarity score between a product catalog entry and a Nice category entry is ≥ Then a knowledge link is established between the two.
[0009] Furthermore, S3 includes the following steps: S31. Knowledge Base Query: Using the source classification system text to be mapped. Using this as input, a query operation is performed in the semantic middleware knowledge base built by S2 to retrieve all results related to... Related Nice Classification text entries form the Nice Classification text collection. ; S32. Structured text assembly: To preserve... The core information and provide a clear structure for subsequent semantic matching, according to a specific format The retrieved Nice Classification text is structurally concatenated to generate an enhanced source text with richer semantic information. The splicing format follows:
[0010] This process transforms the macroscopic abstract concepts corresponding to the source classification system text into explicit descriptions of business entities, thereby eliminating the semantic ambiguity of the source text.
[0011] Furthermore, S4 includes the following steps: S41. Vectorization processing, including: S411. The enhanced source text generated in S3. Inputting it into the same large-scale pre-trained Transformer architecture language model as S2, its enhanced semantic vectors are generated using the same method. ; S412. For each text to be matched in the target classification system... Using the exact same pre-trained language model and text vectorization method described above, semantic vectors are generated. ; S42. Final Similarity Calculation: Calculate the enhanced semantic vector using the cosine similarity formula from S223. With each target text vector Cosine similarity score between them; S43. Set the final mapping determination threshold. If the semantic vector is enhanced With a certain target text vector The cosine similarity score is greater than or equal to Then determine the source classification system text Text related to the target classification system There is a valid mapping relationship between them; S44. Output Results: Output the final mapping results, in the form of one or more mapping pairs. Each mapping pair contains three parts: the source classification system text, the source classification system text, and the final mapping result. Matched target classification system text The corresponding confidence score, which is the cosine similarity score calculated in S2, is used by users to sort and filter the mapping results based on the confidence score.
[0012] A text classification semantic enhancement mapping system based on a semantic middleware knowledge base, based on the aforementioned text classification semantic enhancement mapping method based on a semantic middleware knowledge base, includes: Data acquisition and preprocessing module: used to acquire text data from source classification system, target classification system and semantic middleware data source from external data sources, and to perform standardized preprocessing on the acquired text data. The standardized preprocessing includes converting to unified encoding, removing irrelevant punctuation marks and special characters and standardizing text case. Semantic middleware knowledge base construction module: This is an offline processing module used to build a multi-level knowledge link library from the macro-level description of the source classification system to the specific fine-grained description of business entities. The structure of the knowledge link library is [GB classification text → product catalog text → Nice classification text]; Source text semantic enhancement module: This is an online processing module used to query the source classification text to be mapped by using the knowledge link library built by the semantic middleware knowledge base construction module when performing mapping tasks, obtain the Nice classification text associated with the source classification text, and structurally concatenate the source classification text and the associated Nice classification text according to a preset format to generate semantically enhanced source text. The semantic enhancement matching module is used to receive the enhanced source text generated by the source text semantic enhancement module and the text in the target classification system, and to use a pre-trained language model to vectorize the enhanced source text and the text in the target classification system respectively, and to calculate the semantic similarity between the two types of text vectors. The mapping relationship output module is used to filter the semantic similarity results obtained by the enhanced semantic matching module according to the preset confidence threshold, determine the effective mapping relationship between the source classification text and the target classification text, and output a mapping pair containing the source classification text, the matched target classification text and the corresponding confidence score.
[0013] A storage medium storing a computer program that, when executed by a processor, implements the above-described text classification semantic enhancement mapping method based on a semantic middleware knowledge base.
[0014] A computer device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described text classification semantic enhancement mapping method based on a semantic middleware knowledge base.
[0015] Compared with the prior art, the present invention achieves the following significant beneficial effects through the above technical solution: 1. Significantly improves the logical accuracy of mapping and effectively avoids cross-domain logical errors: The core of this invention lies in "semantic enhancement" of the source text through a semantic middleware knowledge base. This enhancement is not a simple keyword stuffing, but rather concretizes a macroscopic statistical concept (such as "wheat cultivation") into a series of specific commercial entities (such as "unprocessed grains"). This allows the subsequent semantic model to make judgments within a more specific and focused semantic space when performing similarity calculations, thereby effectively avoiding cross-domain logical errors common in existing technologies due to semantic association (e.g., incorrectly associating "agricultural activities" with "manufactured products").
[0016] 2. This invention systematically resolves the inherent contradiction between accuracy and coverage: In existing technologies, increasing the similarity threshold sacrifices coverage, while decreasing the threshold sacrifices accuracy. This invention, through semantic enhancement, significantly shortens the semantic distance in the semantic space between logically correct but semantically distant matching pairs (e.g., macro-level entries in the "National Economic Industry Classification" and specific target industrial chain segments). This allows the system to maintain a very high final matching threshold. While ensuring high accuracy, it can still discover and establish mapping relationships that would be missed in traditional methods, thereby significantly improving the mapping coverage.
[0017] 3. Achieves a high degree of automation and superior operational efficiency: This invention designs the computationally intensive knowledge base construction process as an offline task, allowing for reuse multiple times after a single construction. The online mapping process involves only knowledge base querying, text concatenation, and a single vector calculation, resulting in a highly efficient workflow. This enables the method to quickly and automatically process tens of thousands of classification entries, significantly reducing the manual review costs and time required by traditional methods.
[0018] 4. Excellent robustness, scalability, and maintainability: The framework design of this invention is highly modular and flexible. By introducing targeted maintenance mechanisms, the system can adapt to dynamic updates of classification standards. For example, when the Nice Classification is updated, the system can reconstruct the knowledge base to ensure that the mapping logic keeps pace with the times. Furthermore, its core "semantic middleware" concept has strong scalability, allowing for easy replacement or addition of middleware data sources from other domains to adapt to the specific mapping needs of different industries. Attached Figure Description
[0019] Figure 1 This is a system block diagram of a text classification semantic enhancement mapping system based on a semantic middleware knowledge base according to the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Reference Figure 1 As shown, the method proposed in this invention, in chronological order, specifically includes the following steps: Step 1: Selection, Acquisition, and Preprocessing of Semantic Middleware This step aims to prepare high-quality, highly relevant data sources for subsequent knowledge base construction. The choice of middleware is not arbitrary, but based on its inherent relevance to the source classification system and its own semantic characteristics; this is a crucial technical decision.
[0022] Middleware selection: 1. *Statistical Product Catalog*: This catalog was chosen as the first-level middleware because it is published by the National Bureau of Statistics and has an official and authoritative hierarchical correspondence with the *National Industrial Classification of Economic Activities* (GB / T 4754-2017), which serves as the source classification system. This establishes a highly credible bridge from macro-level descriptions of "economic activities" (such as entries in the *National Industrial Classification of Economic Activities*) to more specific descriptions of "products or services." 2. Nice Classification: This classification was chosen as the second-layer middleware because of its standardized status in the global trademark registration field and the commercial specificity of its descriptions. The Nice Classification divides goods and services into 45 major classes, and its entries describe specific, marketable, and identifiable goods or services with very clear semantics and virtually no ambiguity. This perfectly complements the macro-level, general descriptions of the National Industrial Classification of Economic Activities. Data Acquisition and Preprocessing: 3. Collect the latest version of the National Industrial Classification of Economic Activities (GB / T 4754-2017) and all its published amendments, the Statistical Product Catalogue, and the latest version of the Nice Classification published by the World Intellectual Property Organization (WIPO). 4. Perform standardized preprocessing on the collected text data, including but not limited to: converting to a unified encoding (such as UTF-8), removing irrelevant punctuation marks and special characters, and normalizing text case, to ensure data quality.
[0023] Step 2: Construction of the Semantic Middleware Knowledge Base This step is an offline processing procedure whose goal is to build a knowledge link library with the structure [GB Classification Text → Product Catalog Text → Nice Classification Text]. This process consists of two sub-steps: Sub-step 2.1: Construct the mapping from "National Standard Classification" to "Product Catalog": First, using the official correspondence documents (national standard classification, product catalog, Nice classification) provided by the National Bureau of Statistics, a deterministic mapping between the "national standard classification" and its directly corresponding "product catalog" entries is established.
[0024] For a few national standard classification entries that do not have a direct correspondence in official documents, an auxiliary semantic matching model (e.g., a basic BERT model) is used for completion. The semantic similarity between the national standard classification text and all product catalog texts is calculated, the item with the highest similarity is selected as the candidate match, and a high confidence threshold is set, or manual review is conducted to ensure the accuracy of this supplementary mapping.
[0025] Sub-step 2.2: Construct a semantic mapping from "Product Catalog" to "Nice Category". Model selection: A large-scale pre-trained Transformer architecture language model, shibing624 / text2vec-base-chinese, was selected. This model performs well in understanding complex text semantics in this type of task. Text Vectorization: Each entry in the "Product Catalog" and each entry in the "Nice Category" are vectorized separately. Specifically, the text string is converted into a token sequence using a tokenizer compatible with the selected model. This token sequence is then input into a pre-trained BERT model to obtain the hidden state output of the last layer. Finally, the hidden state vector corresponding to the special start character is extracted. This vector is widely considered to be the aggregate semantic representation of the entire input text sequence. The dimension of this vector is determined by the selected model.
[0026] Similarity Calculation: For the semantic vector of each entry in the "Product Catalog," calculate its cosine similarity with the semantic vectors of all entries in the "Nice Category." The formula for calculating cosine similarity is as follows:
[0027] in, and These represent the semantic vectors of the two texts. The similarity score ranges from -1 to 1; the closer the score is to 1, the more semantically similar the two texts are. Knowledge link generation: Set a threshold for knowledge base construction. In a preferred case, the value is 0.72. For any entry in the "Product Catalog," if its cosine similarity score with a certain "Nice Category" entry is greater than or equal to... Then, a knowledge link is established between these two entries. A product catalog entry can link to multiple Nice category entries. Through the above two sub-steps, a comprehensive, multi-layered semantic middleware knowledge base is finally formed.
[0028] Step 3: Semantic Enhancement of the Source Text This step is an online processing procedure, performed for each source classification system text to be mapped (denoted as...). )implement.
[0029] Knowledge base query: (For example, "0111 Wheat Planting") is used as input. A query is performed in the knowledge base constructed in step two to retrieve all associated text entries from the Nice Classification, forming a set. .
[0030] Structured text concatenation: To enhance semantics while preserving the core information of the original text and providing a clear structure for the model, this invention employs a specific format for text concatenation. The original text... This text string is concatenated with the retrieved Nice category text set to form an enhanced text string. The splicing format is as follows:
[0031] This method does not simply add keywords, but rather uses a structured process to anchor a macroscopic, abstract concept of economic activity to a specific set of commercially defined goods or services (Nice Classification) through its corresponding products (product catalogs). This process can be understood as a framework of "semantic hierarchical concretization," which systematically injects precise and unambiguous contextual information into the original text, fundamentally solving its semantic ambiguity problem.
[0032] Step 4: Enhance semantic matching and mapping generation This step is the core calculation process that ultimately completes the mapping.
[0033] Vectorization processing: 1. The enhanced source text generated in step three The input is fed into the same pre-trained language model as in step two, and its augmented semantic vectors are generated using the same method (extracting the `vector`). .
[0034] 2. For each text to be matched in the target classification system. Similarly, its semantic vector is generated. .
[0035] Final similarity calculation: Calculate the enhanced semantic vector With each target text vector The cosine similarity score between them.
[0036] Mapping relationship determination: Set a final mapping determination threshold. .if With a certain The cosine similarity score is greater than or equal to Then it is considered that in the source text and target text There is a valid mapping relationship between them.
[0037] Output: The final output is one or more mapping pairs, each containing the source text. Matched target text And the corresponding confidence score (i.e., the calculated cosine similarity). This allows users to sort and filter the matching results based on the confidence score.
[0038] This invention also provides a system for implementing the above method. The system architecture mainly includes the following core functional modules: Data Acquisition and Preprocessing Module: Responsible for acquiring and cleaning source classification systems (e.g., National Economic Industry Classification GB / T 4754-2017), target classification systems (e.g., enterprise-specific industrial chain labeling system), and text data from semantic middleware data sources used to build the knowledge base from external data sources.
[0039] Semantic middleware knowledge base construction module: This is an offline processing module and one of the core innovations of this invention. It is responsible for building a knowledge link library that ranges from a macroscopic description of the source classification system to a series of specific, fine-grained descriptions of business entities.
[0040] Source Text Semantic Enhancement Module: This is an online processing module that, when performing mapping tasks, uses a pre-built knowledge base to query the input source classification text and structurally concatenates it with the associated specific descriptions in the knowledge base to form an enhanced text with richer semantic information.
[0041] Enhanced semantic matching module: This module receives the enhanced source text and all texts in the target classification system, and uses a deep learning language model to calculate the semantic similarity between them.
[0042] Mapping Relationship Output Module: This module filters the matching results based on a preset confidence threshold and outputs the final high-quality mapping relationship pairs.
[0043] When this invention maps, generates, and labels enterprise directories with a data volume of hundreds of thousands of entries, the hardware platform used has a maximum of 16GB of video memory and 20GB of RAM. It runs in a Python 3.9 software environment, and this invention has a relatively small memory and video memory footprint.
[0044] During annotation testing, the overall precision was 5.29%, recall was 9.52%, and F1 score was 6.80%. For this application example, the above test data sufficiently demonstrates that the solution effectively annotated the core industry chain; furthermore, manual evaluation of the annotation results indicates that the annotations are relatively accurate and reach a practical level.
[0045] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A text classification semantic enhancement mapping method based on a semantic middleware knowledge base, characterized in that, The method includes the following steps: S1. Based on the correlation and semantic characteristics of the source classification system, select the "Statistical Product Catalog" and the "Nice Classification" as middleware, collect the text data of the source classification system, the target classification system and the selected middleware, and perform standardized preprocessing. S2. First, use the official correspondence file combined with auxiliary semantic matching to construct the "national standard classification → product catalog" mapping. Then, use a specific pre-trained language model to vectorize the text, calculate the cosine similarity, and construct a threshold based on the knowledge base to construct the "product catalog → Nice classification" mapping, forming a multi-level semantic middleware knowledge base. S3. Using the source classification text to be mapped as the query condition, retrieve the semantic middleware knowledge base, obtain the associated Nice Classification text, and structurally concatenate the source classification text and the associated Nice Classification text in a specific format to generate the semantically enhanced source text. S4. Using the same pre-trained language model as the knowledge base, vectorize the enhanced source text and the text in the target classification system respectively, calculate the cosine similarity between the two types of vectors, filter the effective mapping relationship according to the preset mapping judgment threshold, and output the mapping pair containing the source text, target text and confidence.
2. The text classification semantic enhancement mapping method based on a semantic middleware knowledge base according to claim 1, characterized in that, S1 includes the following steps: S11. Middleware selection: Select "Statistical Product Catalog" as the first-level middleware and "Nice Classification" as the second-level middleware; S12. Data Acquisition and Preprocessing: Collect the latest version of GB / T 4754-2017 and all its published amendments to the National Industrial Classification of Economic Activities, the Statistical Product Catalog, and the latest version of the Nice Classification published by the World Intellectual Property Organization, and perform standardized preprocessing on the collected text data.
3. The text classification semantic enhancement mapping method based on a semantic middleware knowledge base according to claim 2, characterized in that, In S12, the standardization preprocessing includes: converting the collected text data into a unified encoding, removing irrelevant punctuation marks and special characters, and standardizing text case.
4. The text classification semantic enhancement mapping method based on a semantic middleware knowledge base according to claim 3, characterized in that, S2 includes the following steps: S21. Construct a mapping from "National Standard Classification" to "Product Catalog": First, use the official correspondence documents provided by the National Bureau of Statistics to establish a deterministic mapping between the "National Economic Industry Classification" as the source classification system and its directly corresponding "Statistical Product Catalog" entries; for a few national standard classification entries that do not have a direct correspondence in the official documents, use an auxiliary semantic matching model to complete them; S22. Construct a semantic mapping from "Product Catalog" to "Nice Category".
5. The text classification semantic enhancement mapping method based on a semantic middleware knowledge base according to claim 4, characterized in that, S22 includes the following steps: S221. Model selection: The large-scale pre-trained Transformer architecture language model shibing624 / text2vec-base-chinese was selected. S222, Text Vectorization: Use the word segmenter that matches the selected model to convert the product catalog entry text and the Nice Classification entry text into word sequence respectively. Input the word sequence into the pre-trained BERT model, obtain the output of the last hidden state of the BERT model, and extract the hidden state vector corresponding to the special start character as the semantic representation of text aggregation. S223. Similarity Calculation: The similarity between the semantic vector of each product catalog entry and the semantic vectors of all Nice category entries is calculated using the cosine similarity formula. The cosine similarity formula is as follows: in, and These represent the semantic vectors of the two texts, with similarity scores ranging from -1 to 1. The closer the similarity score is to 1, the more semantically similar the two texts are. S224. Knowledge Link Generation: Setting a Threshold for Knowledge Base Construction If the semantic similarity score between a product catalog entry and a Nice category entry is ≥ Then a knowledge link is established between the two.
6. The text classification semantic enhancement mapping method based on a semantic middleware knowledge base according to claim 5, characterized in that, S3 includes the following steps: S31. Knowledge Base Query: Using the source classification system text to be mapped. Using this as input, a query operation is performed in the semantic middleware knowledge base built by S2 to retrieve all results related to... Related Nice Classification text entries form the Nice Classification text collection. ; S32. Structured text assembly: To preserve... The core information and provide a clear structure for subsequent semantic matching, according to a specific format The retrieved Nice Classification text is structurally concatenated to generate an enhanced source text with richer semantic information. The splicing format follows: This process transforms the macroscopic abstract concepts corresponding to the source classification system text into explicit descriptions of business entities, thereby eliminating the semantic ambiguity of the source text.
7. The text classification semantic enhancement mapping method based on a semantic middleware knowledge base according to claim 6, characterized in that, S4 includes the following steps: S41. Vectorization processing, including: S411. The enhanced source text generated in S3. Inputting it into the same large-scale pre-trained Transformer architecture language model as S2, its enhanced semantic vectors are generated using the same method. ; S412. For each text to be matched in the target classification system... Using the exact same pre-trained language model and text vectorization method described above, semantic vectors are generated. ; S42. Final Similarity Calculation: Calculate the enhanced semantic vector using the cosine similarity formula from S223. With each target text vector Cosine similarity score between them; S43. Set the final mapping determination threshold. If the semantic vector is enhanced With a certain target text vector The cosine similarity score is greater than or equal to Then determine the source classification system text Text related to the target classification system There is a valid mapping relationship between them; S44. Output Results: Output the final mapping results, in the form of one or more mapping pairs. Each mapping pair contains three parts: the source classification system text, the source classification system text, and the final mapping result. Matched target classification system text The corresponding confidence score, which is the cosine similarity score calculated in S2, is used by users to sort and filter the mapping results based on the confidence score.
8. A text classification semantic enhancement mapping system based on a semantic middleware knowledge base, based on the text classification semantic enhancement mapping method based on a semantic middleware knowledge base as described in any one of claims 1-7, characterized in that, include: Data acquisition and preprocessing module: used to acquire text data from source classification system, target classification system and semantic middleware data source from external data sources, and to perform standardized preprocessing on the acquired text data. The standardized preprocessing includes converting to unified encoding, removing irrelevant punctuation marks and special characters and standardizing text case. Semantic middleware knowledge base construction module: This is an offline processing module used to build a multi-level knowledge link library from the macro-level description of the source classification system to the specific fine-grained description of business entities. The structure of the knowledge link library is [GB classification text → product catalog text → Nice classification text]; Source text semantic enhancement module: This is an online processing module used to query the source classification text to be mapped by using the knowledge link library built by the semantic middleware knowledge base construction module when performing mapping tasks, obtain the Nice classification text associated with the source classification text, and structurally concatenate the source classification text and the associated Nice classification text according to a preset format to generate semantically enhanced source text. The semantic enhancement matching module is used to receive the enhanced source text generated by the source text semantic enhancement module and the text in the target classification system, and to use a pre-trained language model to vectorize the enhanced source text and the text in the target classification system respectively, and to calculate the semantic similarity between the two types of text vectors. The mapping relationship output module is used to filter the semantic similarity results obtained by the enhanced semantic matching module according to the preset confidence threshold, determine the effective mapping relationship between the source classification text and the target classification text, and output a mapping pair containing the source classification text, the matched target classification text and the corresponding confidence score.
9. A storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the text classification semantic enhancement mapping method based on a semantic middleware knowledge base as described in any one of claims 1-7.
10. A computer device, characterized in that, include: The memory, the processor, and the computer program stored in the memory and executable on the processor, the processor executing the program to implement the text classification semantic enhancement mapping method based on a semantic middleware knowledge base as described in any one of claims 1-7.