A semantic similarity calculation method for digital urban management field
Patent Information
- Application Number
- CN202611209536.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-10-30
AI Technical Summary
[0006]本发明为了解决现有技术中相似度匹配精度不足、缺乏领域知识引导和可解释性差的问题,提供了一种既能够利用领域知识库处理同义表述、突出核心要素的权重,又能借助预训练模型捕捉通用语义信息,还可通过自适应权重动态平衡两种方法的贡献,满足数字城管业务对相似度匹配准确性和可解释性需求的面向数字城管领域的语义相似度计算方法
本发明提出一种数字城管语义相似度计算方法,采用融合领域知识增强与多粒度语义匹配的算法CitySentenceSimilar,通过领域词典与句法分析相结合的方式抽取文本的结构化要素,再分别从要素层面和语义层面进行相似度计算,并通过自适应加权融合实现优势互补,从而在保证精度的同时兼顾可解释性。本发明通过预先构建城管领域知识库,提取文本核心四元组要素并对不同要素设置差异化权重,能够突出城管业务的核心信息,提升匹配的准确性;通过融合领域同义词表,能够有效处理同一语义的不同表述,解决语义鸿沟问题;利用领域适配后的Sentence-BERT模型计算语义向量,弥补了传统方法无法捕捉隐式语义的不足;通过四元组抽取置信度动态调整融合权重,在抽取准确时依赖可解释的规则匹配,抽取不准确时借助预训练模型的语义能力,兼顾了结果的准确性与可解释性,适配数字城管业务的实际需求。
Smart Images

Figure CN123013949A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital urban management, and in particular to a semantic similarity calculation method for the field of digital urban management. Background Technology
[0002] In digital urban management operations, a key step in case dispatch is to match newly reported problem descriptions with descriptions of previously handled problems based on similarity, thereby determining the appropriate handling department based on historical experience. However, problem descriptions in the urban management field have distinct characteristics: on the one hand, the texts are mostly short, with heavily colloquial language, and the same semantic concept often has multiple expressions (e.g., "streetlights not working" and "lighting facility malfunction" both refer to the same problem); on the other hand, although the expressions are diverse, the core elements of the text are relatively fixed in structure, usually including key information such as facilities, problems, locations, and actions.
[0003] In existing technologies, text similarity calculation methods are mainly divided into two categories: The first category consists of methods based on traditional set theory, such as the Jaccard coefficient. These methods measure similarity by calculating the intersection-union ratio of two text sets, which is simple and efficient, but has obvious drawbacks: First, they treat the importance of words equally, failing to highlight the core elements in urban management operations (such as facility type and location, which are often more critical than action descriptions); second, they rely on precise character matching, making it impossible to handle the semantic gap caused by synonyms and near-synonyms.
[0004] The second category is semantic vector methods based on deep learning, such as the Sentence-BERT (Bidirectional Encoder Representations from Transformers) model. These methods map text into dense vectors using neural networks, effectively capturing contextual semantic information. However, purely data-driven methods have two limitations in the urban management field: first, they lack guidance from domain knowledge, resulting in insufficient ability to distinguish between specialized terms like "manhole cover" and "rain grate"; second, they exhibit strong black-box characteristics, making it difficult to provide interpretable matching evidence, which does not meet the transparency requirements of government operations.
[0005] Therefore, there is a need for a semantic similarity calculation method that can be applied to the field of digital urban management and combine the advantages of domain knowledge rules and pre-trained models. Summary of the Invention
[0006] To address the problems of insufficient similarity matching accuracy, lack of domain knowledge guidance, and poor interpretability in existing technologies, this invention provides a semantic similarity calculation method for the digital urban management domain. This method can utilize a domain knowledge base to process synonymous expressions and highlight the weights of core elements, while also capturing general semantic information with the help of a pre-trained model. Furthermore, it can dynamically balance the contributions of the two methods through adaptive weights, thus meeting the requirements of digital urban management business for accuracy and interpretability in similarity matching.
[0007] The semantic similarity calculation method for the field of digital urban management as described in this invention includes: S1. Construct a domain knowledge base; A pre-constructed urban management domain dictionary; the domain dictionary includes a facilities dictionary. Question Dictionary Location dictionary Action dictionary A domain thesaurus, wherein the domain thesaurus records different expressions of the same semantic concept and their mapping relationships; S2, Domain Enhancement Preprocessing and Quadruple Extraction; Using LTP for input and The two statements are segmented, part-of-speech tagged, and subjected to dependency parsing. After unifying the original names with the domain dictionary, four types of information are extracted to form a quadruple, represented as Q(F, P, L, A), which is the first sentence. Corresponding to Quadruple No. 1 Second sentence Corresponding to the second quadruple ; S3, Improved Jaccard similarity calculation; According to the first quadruple and the second quaternion Calculate the improved Jaccard similarity ; (2); in, The weight coefficients are feature type weights that satisfy... ; S4, Cosine Similarity calculate; Will and Inputting into the pre-trained Sentence-BERT model, each is mapped to a sentence vector. and Calculate cosine similarity : (5); S5, Adaptive Weighted Fusion; Based on the confidence and syntactic confidence extracted from the quadruples, the fusion weight λ is dynamically calculated, and then the Jaccard similarity is applied. Similarity to cosine Weighted fusion is performed to obtain the final semantic similarity S: (6).
[0008] Furthermore: for the two input texts in the urban management field... , Perform the following sub-steps respectively: S21. Using the LTP tool, perform word segmentation, part-of-speech tagging, and dependency parsing on the text. Based on the urban management domain dictionary, perform domain word matching on the text to identify candidate words for facility F, problem P, and action A. Determine the modification relationship between each element according to the syntactic arc, and identify the location element L according to the address pattern. S22. Determine the element type Type(w) for each word w in the text according to the following rules: If w∈ Then Type(w) = F; If w∈ Then Type(w) = P; If w conforms to the address pattern, then Type(w) = L; If w∈ Then Type(w) = A; The text T is represented as a quadruple Q(T) = (F, P, L, A), where each element is represented as a set, and if a certain type of element is missing, the corresponding set is empty.
[0009] Furthermore, the Sentence-BERT model is pre-adjusted using a contrastive learning loss function on the urban management domain corpus, thereby narrowing the distance between similar text pairs and widening the distance between dissimilar text pairs; similar text pairs labeled in the urban management domain are used as training data, with positive examples being description pairs of the same case type and negative examples being description pairs of different case types.
[0010] Furthermore: In S5, , and The calculation is shown in formula (7), to calculate For example: (7); This represents the level of confidence in the syntax; a higher value indicates greater confidence in the syntax. The confidence score for extracting four tuples from text T1 is the matching score obtained by matching the domain term set after dependency parsing by LTP. It is used to measure the coverage and completeness of domain terms in text T1, as shown in formula (8). (8); In the formula, It is the total number of all candidate element words identified by LTP. This refers to the number of words in the urban management field dictionary that can be successfully matched among these candidate words. The higher the value, the more standardized the expression of text T1 is and the more reliable the extraction of the four-tuple. The syntactic confidence is calculated based on the analysis results after using the LTP tool for dependency parsing. The calculation method is shown in formula (9).
[0011] (9); in, This is the set of key dependency relations we define. In the field of urban management, dependencies include SBV, VOB, ATT, and Deps(T1), which is the set of all dependency arcs of text T1. It is an LTP-dependent arc The prediction probability, the max operation mainly selects the most reliable arc in each key relationship; When the confidence level is high, λ approaches 1, and semantic similarity depends on rule-driven improved Jaccard similarity; when the confidence level is low, λ approaches 0, and semantic similarity depends on model-driven cosine similarity.
[0012] Furthermore: In S3, in the improved Jaccard similarity calculation, the weight coefficients are adjusted based on the confidence of the two sentences.
[0013] Furthermore, the domain thesaurus is constructed through a combination of manual annotation and automatic expansion. The automatic expansion uses a word vector model trained on the urban management corpus to discover potential synonyms through vector similarity.
[0014] The beneficial effects of this invention are: This invention proposes a semantic similarity calculation method for digital urban management systems. It employs the CitySentenceSimilar algorithm, which integrates domain knowledge enhancement and multi-granularity semantic matching. By combining a domain dictionary with syntactic analysis, it extracts structured elements from the text and then calculates similarity at both the element and semantic levels. Adaptive weighted fusion achieves complementary advantages, ensuring both accuracy and interpretability. This invention pre-constructs a knowledge base for urban management, extracts core four-tuple elements from the text, and assigns differentiated weights to different elements, highlighting core information of urban management operations and improving matching accuracy. By integrating a domain thesaurus, it effectively handles different expressions of the same semantic meaning, addressing the semantic gap. The domain-adapted Sentence-BERT model is used to calculate semantic vectors, compensating for the inability of traditional methods to capture implicit semantics. By dynamically adjusting the fusion weights based on the confidence of the extracted four-tuples, it relies on interpretable rule matching when extraction is accurate, and leverages the semantic capabilities of the pre-trained model when extraction is inaccurate, balancing accuracy and interpretability to meet the actual needs of digital urban management operations.
[0015] The present invention has the following beneficial effects: 1. Improved accuracy: By integrating structured element matching enhanced by domain knowledge with semantic vector matching from deep learning, the system balances precise matching of professional terms in the urban management field with flexible understanding of contextual semantics, significantly improving the accuracy of similarity calculation.
[0016] 2. High interpretability: By extracting and matching evidence through quadruples, it provides decision-makers with clear and visual matching criteria, meeting the transparency requirements of government affairs.
[0017] 3. Strong adaptability: It dynamically adjusts the fusion weights based on the completeness of the structured information in the text, and can maintain good performance on data of different quality.
[0018] 4. High computational efficiency: Compared with methods that rely on large language models, this invention has lower computational costs while ensuring accuracy, making it suitable for the real-time processing needs of actual urban management systems. Attached Figure Description
[0019] Figure 1 This is a diagram illustrating the overall architecture of the CitySentenceSimilar algorithm of this invention. Figure 2 This is a flowchart illustrating the quadruplet extraction process of the present invention. Figure 3 This is an example diagram of synonym matching in the Jaccard similarity calculation of this invention; Figure 4 This is an example diagram of synonym matching in the improved Jaccard similarity calculation of this invention; Figure 5 This is a schematic diagram illustrating the adaptive weight changes under different confidence levels in an embodiment of the present invention. Detailed Implementation
[0020] The following are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. The embodiments described below are only for explaining the present invention and should not be construed as limiting the present invention. The scope of protection of the present invention should be determined by the scope of the claims. The embodiments of the present invention are described in detail below. In order to facilitate the description of the present invention and simplify the description, the technical terms used in the specification of the present invention should be interpreted broadly, including but not limited to conventional alternatives not mentioned in this application, and including both direct and indirect implementation methods.
[0021] Example 1 Combination Figures 1-5 This embodiment discloses a semantic similarity calculation method for the digital urban management field. Addressing the characteristics of colloquial text descriptions and fixed element structures but diverse expressions in the digital urban management field, this paper proposes a CitySentenceSimilar algorithm that integrates domain knowledge enhancement and multi-granular semantic matching. This method constructs a "facility-problem-location-action" quadruple using a domain dictionary and LTP syntactic analysis, and calculates the similarity of problem descriptions by weighted fusion of an improved Jaccard coefficient and Sentence-BERT vector similarity.
[0022] The overall framework of the CitySentenceSimilar algorithm includes: given two short texts T1 and T2 from the field of digital urban management, the goal is to calculate their semantic similarity score S∈[0,1]. The overall process of the CitySentenceSimilar algorithm is as follows: Figure 1 As shown.
[0023] S1. Construct a domain knowledge base; Pre-build a dictionary for the urban management field, including a facilities dictionary. Question Dictionary Location dictionary Action dictionary A domain thesaurus, wherein the domain thesaurus records different expressions of the same semantic concept and their mapping relationships; S2, Domain Enhancement Preprocessing and Quadruple Extraction; The entire process is divided into three stages: The first stage is domain augmentation preprocessing, which utilizes a domain dictionary and the LTP (Language Technology Platform) tool to process the input... and Two statements are segmented, part-of-speech tagging is performed, and dependency parsing is used to extract four types of information from the text: facilities, questions, locations, and actions, forming a quadruple denoted as Q(F, P, L, A), with the first statement being the first word / phrase. Corresponding to Quadruple No. 1 Second sentence Corresponding to the second quadruple ; Domain knowledge enhancement and quadruple extraction: The core elements of digital urban management text are highly structured and defined as quadruples, where: Facility: such as "streetlight", "manhole cover", "garbage can"; Problem: such as "damaged", "missing", "overflowing"; Location: such as "southeast corner of the intersection", "in front of No. XX on XX Road"; Action: such as "repair", "replace", "clean".
[0024] S21. Using the LTP tool, the text is segmented, part-of-speech tagging and dependency parsing are performed. Based on the urban management domain dictionary, domain word matching is performed on the text to identify candidate words for facility F, problem P and action A. For text T, the extraction process of its quadruple Q(T)=(F, P, L, A) is as follows: First, domain dictionary matching is performed. Based on the constructed urban management domain dictionary (including synonym expansion, such as "not lit" → "fault"), candidate words F, P, and A are identified.
[0025] The modification relationships between elements are determined based on syntactic arcs such as subject-verb (SBV) and verb-object (VOB), and the location element L is identified based on the address pattern. Secondly, syntactic analysis is performed using LTP (Language Technology Platform) for dependency parsing. Based on syntactic arcs such as subject-verb (SBV) and verb-object (VOB), the modification relationship between "facilities-problems" and "location" is determined. If a certain type of element is missing in the text (such as no explicit action), the corresponding set is empty. After the quadruples are extracted, the text is represented as a set of four features.
[0026] Where D is the domain dictionary set of the corresponding element. For example, in "The street light at the southeast corner of Hongqi intersection is not working and needs to be repaired", "street light" is the subject of "not working". "Southeast corner of Hongqi intersection" modifies "street light" through the location structure (LOC). The resulting quadruple Q correspondence is shown in Table 1.
[0027] Table 1. Corresponding values of Q elements;
[0028] S22. Determine the element type Type(w) for each word w in the text according to the following rules: For each word w in text T, its element type is determined by the rule of formula (1).
[0029] (1); If w∈ Then Type(w) = F; If w∈ Then Type(w) = P; If w conforms to the address pattern, then Type(w) = L; If w∈ Then Type(w) = A; The text T is represented as a quadruple Q(T) = (F, P, L, A), where each element is represented as a set, and if a certain type of element is missing, the corresponding set is empty.
[0030] S3. The second stage is multi-granularity similarity calculation, which calculates the improved Jaccard similarity based on quadruples. Cosine similarity based on Sentence-BERT ; The quadruple structure is improved by weighting the Jaccard similarity calculation.
[0031] Definition 1 (Improved Jaccard Similarity): Given , Quadruple , The Jaccard similarity is calculated using formula (2): (2); in, The weight coefficients are feature type weights that satisfy... According to the operational logic of urban management, facilities and location are the core judging factors, with the highest weight. =0.35, The problem is secondary. ), weakest movement ( ); The calculation follows the union calculation method. Unlike the traditional Jaccard method that relies on exact element matching to calculate Jaccard similarity, in the field of digital urban management, the same semantic concept often has multiple expressions (such as "streetlight" and "lighting facilities"). Therefore, a domain synonym-aware intersection calculation method is introduced, as shown in formula (3). To enhance the intersection calculation method, it is defined as: (3); in, The semantic matching function is shown in formula (4).
[0032] (4); Here, The function is a query function based on a pre-built thesaurus of urban management terms, where θ is a configurable similarity threshold (in this paper, we take...). If words of the same element are similar, a match is returned, thus ensuring that the matching of core semantic elements is no longer constrained by literal differences. In the improved Jaccard similarity calculation, the weight coefficients are adaptively adjusted according to the characteristics of urban management business in different cities. If a certain type of element is of prominent importance in a specific business scenario, its weight coefficient can be increased accordingly.
[0033] The improved Jaccard algorithm overcomes the shortcomings of the traditional Jaccard algorithm, which treats keywords equally and highlights core business elements.
[0034] S4. Cosine similarity calculation: To capture contextual semantics that four-tuples cannot cover (such as the temporal logic in "the streetlights that were just repaired are broken again"), we introduce a Sentence-BERT model with depth fine-tuned on urban management corpora to map text into sentence vectors. , Then calculate the cosine similarity. As shown in formula (5): (5); The fine-tuning process employs a contrastive learning loss function to bring similar text pairs closer together and push dissimilar text pairs further apart, enabling the model to better adapt to the distribution of urban management texts.
[0035] The training data used for fine-tuning came from 4,000 text pairs exported from the X City Digital Urban Management Service Platform. Each text pair had a binary label (1 indicates that the two texts refer to the same physical event and are similar; 0 indicates that they are dissimilar). The training set was divided in a 7:3 ratio, with a total of 2,800 text pairs used for fine-tuning.
[0036] S41. Load the pre-trained Sentence-BERT model (paraphrase-multilingual-MiniLM-L12-v2). S42. Input the 2800 training text pairs into the model to generate sentence vectors. , ; S43. Calculate the Euclidean distance between two vectors. ; S44. Calculate the contrastive learning loss L based on the label y and the distance d; S45. Backpropagate gradients and update model parameters (reduce the distance between similar pairs and increase the distance between dissimilar pairs). S46. Repeat S42-S45 to complete 3 epochs of iteration; S47. Save the fine-tuned model parameters as the semantic vector generation module of CitySentenceSimilar.
[0037] S5, Adaptive Weighted Fusion and Interpretability: The final similarity is not a simple linear weighting, but is adaptively adjusted based on the completeness of the extracted quadruples, as shown in formula (6).
[0038] (6); , and The calculation is shown in formula (7), to calculate For example: (7); in, The confidence level for syntax is a constant; a higher value indicates greater confidence in the syntax. To balance the impact of syntax confidence and dictionary matching confidence on the final fusion weight, it is set to 0.4 here. The confidence score for extracting four tuples from text T1 is the matching score obtained by matching the domain term set after dependency parsing by LTP. It is used to measure the coverage and completeness of domain terms in text T1, as shown in formula (8). (8); In the formula, It is the total number of all candidate element words identified by LTP (i.e., words that are preliminarily judged to be likely to belong to F / P / L / A based on parts of speech, position, etc.). This refers to the number of words in the urban management field dictionary that can be successfully matched among these candidate words. The higher the value, the more standardized the expression of text T1 is and the more reliable the extraction of the four-tuple. The syntactic confidence is calculated based on the analysis results after using the LTP tool for dependency parsing. The calculation method is shown in formula (9).
[0039] (9); in, This is the set of key dependencies we define. In the field of urban management, dependencies include SBV, VOB, and ATT. 1) is the set of all dependent arcs of text T1. It is an LTP-dependent arc The prediction probability, the max operation mainly selects the most reliable arc in each key relationship; The interpretability of formula (6) is reflected in two aspects: First, the fusion weights Confidence based on dictionary matching and syntactic structure confidence Jointly decided (Formula 7-9). The value of clearly reveals the decision source of the current similarity judgment—when →1 indicates that the input text has a high degree of structure and complete coverage of domain terminology, and the similarity mainly comes from traceable rule matching; when A score of →0 indicates that the text is complex or lacks essential elements, and the similarity score relies more on the reasoning of the deep semantic model. Secondly, while outputting the final similarity score S, the algorithm simultaneously outputs the details of the matched quadruplets (e.g., "matched facilities: streetlights / lighting facilities") and the dependency tree, transforming the abstract similarity score into a concrete chain of evidence: "which elements match, why they match, and how confident are they in the match." This score-evidence collaborative output design makes the similarity judgment process completely transparent to business personnel, meeting the rigid requirements of government systems for traceable and auditable decision-making.
[0040] The final semantic similarity is not a simple linear weighting, but is adaptively adjusted according to the completeness of the extracted quadruples, as shown in formula (6).
[0041] S6. Output the matching results and interpretable evidence; Output the semantic similarity score S of T1 and T2, and also output detailed evidence of the four-tuple matching, including the matching status of each element, to meet the business transparency requirements.
[0042] Example 2 This embodiment is illustrated in conjunction with Example 1. This embodiment discloses a semantic similarity calculation method for the field of digital urban management. This embodiment uses two typical problem description texts in the field of digital urban management as examples to illustrate the complete implementation process of the present invention.
[0043] Input text: T1: "The streetlight at the southeast corner of Hongqi Road intersection is not working and needs to be repaired." T2: "Lighting facilities malfunction at the southeast corner of the intersection of Hongqi Road and Guangming Road"; S1. Domain knowledge base construction; The pre-built domain dictionary contains: ={“Lighting Facilities”: [“Streetlights”, “Lamps”, “Landscape Lights”, “Streetlights”...], “Manhole Covers”: [“Inspection Wells”, “Manhole Covers”], ...}, ={"Fault": ["Not lit", "Damaged"...]}, ={"Repair": ["Inspection", "Replacement"...]}. The parentheses contain synonyms for the corresponding key values.
[0044] The thesaurus contains mappings such as: "damaged" → ["destroy", "damaged", "broken", "broken"...], "replace" → ["replace", "update", "switch", "swap"...], etc.
[0045] S2, Quadruple Extraction; right LTP syntactic analysis identified "streetlight" as facility element F, "not lit" as problem element P, "southeast corner of Hongqi intersection" as location element L, and "maintenance" as action element A, resulting in... =( ={streetlights} ={Not lit} ={Southeast corner of Hongqi Road intersection} ={Inspection}).
[0046] right Perform the same process to obtain =( ={Lighting fixtures}, ={fault}, ={Southeast side of the intersection of Hongqi Road and Guangming Road} )(Note: The action was not explicitly stated, therefore (This is an empty set).
[0047] S3, Improved Jaccard similarity calculation; To visually demonstrate the interpretability mechanism of CitySentenceSimilar, Table 3 presents the similarity calculation process and output results for a set of typical text pairs.
[0048] Table 3 Interpretability Output
[0049] As shown in Table 3, the dictionary matching confidence of T1 is 0.75 and the syntactic confidence is 0.82, calculated using formulas (8) and (9). The solution is obtained using formula (7). The value is 0.778; the dictionary matching confidence score for T2 is calculated to be 1, and the syntactic confidence score is 0.85. The value is 0.94, and the final fusion weight takes the minimum value of the two, λ is 0.778, and the final similarity is calculated to be 0.88 according to formula (6). CitySentenceSimilar not only outputs a similarity score of 0.88, but also provides a complete matching evidence chain: the facility elements "streetlight" and "lighting facility" are confirmed as synonyms through the thesaurus, the problem elements "not lit" and "malfunction" are also matched through thesaurus mapping, and the location elements achieve partial matching. Fusion weight This indicates that the text is highly structured and has sufficient confidence, with similarity judgment primarily relying on traceable rule matching. Business personnel can use this to verify the rationality of each matching step without blindly trusting the output of a black-box model.
[0050] Taking facility element F as an example, (Streetlights, lighting facilities). A search of the thesaurus shows that "streetlights" and "lighting facilities" are synonyms. Similar=1.0≥θ(0.7), so δ=1, which means they are considered a match.
[0051] Union calculation: |{streetlight}|+|{lighting facility}|-|{streetlight}∩{lighting facility}| (exact match) = 2-1 = 1 (if no synonym expansion is performed) or deduplication is performed by set. In this embodiment, normalization is performed after synonym mapping.
[0052] Finally, calculate the Jaccard similarity. : ; S4. Cosine similarity calculation; Will and Inputting the finely tuned Sentence-BERT model yields sentence vectors. and Calculate cosine similarity =0.92.
[0053] S5, Adaptive Weighted Fusion; Calculate the confidence level: =0.4×0.82+0.6×3 / 4=0.778, =0.4×0.85+0.6×3 / 3=0.94, λ=min(0.778, 0.94)=0.778.
[0054] Calculate the final semantic similarity: =0.778×0.636+0.222×0.92=0.699.
[0055] S6. Output the results; The output similarity score is 0.699, and the matching evidence is also output: facility matching (streetlight). Lighting facilities), location matching (southeast corner of Hongqi Road intersection) Southeast side of the intersection of Hongqi Road and Guangming Road), problem matching (not lit) (fault), action elements Missing.
[0056] Example 3 This embodiment is illustrated in conjunction with Embodiment 2. This embodiment discloses a semantic similarity calculation method for the field of digital urban management. This embodiment also illustrates the adaptive fusion effect in low-confidence scenarios.
[0057] If you enter text The sentence, "The streetlights seem to have a problem," is written in a colloquial style and lacks clear structured elements, resulting in a low confidence level (λ) of approximately 0.3. The final similarity score is... Model-driven semantic similarity dominates, avoiding rule matching failures caused by insufficient structured information.
Claims
1. A semantic similarity calculation method for the field of digital urban management, characterized in that, include: S1. Construct a domain knowledge base; A pre-constructed urban management domain dictionary; the domain dictionary includes a facilities dictionary. Question Dictionary Location dictionary Action dictionary A domain thesaurus, wherein the domain thesaurus records different expressions of the same semantic concept and their mapping relationships; S2, Domain Enhancement Preprocessing and Quadruple Extraction; Using LTP for input and The two statements are segmented, part-of-speech tagged, and subjected to dependency parsing. After unifying the original names with the domain dictionary, four types of information are extracted to form a quadruple, represented as Q(F, P, L, A), which is the first sentence. Corresponding to Quadruple No. 1 Second sentence Corresponding to the second quadruple ; S3, Improved Jaccard similarity calculation; According to the first quadruple and the second quaternion Calculate the improved Jaccard similarity ; (2); in, The weight coefficients are feature type weights that satisfy... ; S4, Cosine Similarity calculate; Will and Inputting into the pre-trained Sentence-BERT model, each is mapped to a sentence vector. and Calculate cosine similarity : (5); S5, Adaptive Weighted Fusion; Based on the confidence and syntactic confidence extracted from the quadruples, the fusion weight λ is dynamically calculated, and then the Jaccard similarity is applied. Similarity to cosine Weighted fusion is performed to obtain the final semantic similarity S: (6)。 2. The semantic similarity calculation method for the field of digital urban management according to claim 1, characterized in that, For the two short texts in the field of urban management input , Perform the following sub-steps respectively: S21. Using the LTP tool, perform word segmentation, part-of-speech tagging, and dependency parsing on the text. Based on the urban management domain dictionary, perform domain word matching on the text to identify candidate words for facility F, problem P, and action A. Determine the modification relationship between each element according to the syntactic arc, and identify the location element L according to the address pattern. S22. Determine the element type Type(w) for each word w in the text according to the following rules: If w∈ Then Type(w) = F; If w∈ Then Type(w) = P; If w conforms to the address pattern, then Type(w) = L; If w∈ Then Type(w) = A; The text T is represented as a quadruple Q(T) = (F, P, L, A), where each element is represented as a set, and if a certain type of element is missing, the corresponding set is empty.
3. The semantic similarity calculation method for the field of digital urban management according to claim 1, characterized in that, The Sentence-BERT model is pre-adjusted using a contrastive learning loss function on the urban management domain corpus, thereby narrowing the distance between similar text pairs and widening the distance between dissimilar text pairs. Similar text pairs labeled in the urban management domain are used as training data, with positive examples being description pairs of the same case type and negative examples being description pairs of different case types.
4. The semantic similarity calculation method for the field of digital urban management according to claim 1, characterized in that, In S5, , and The calculation is shown in formula (7), to calculate For example: (7); in, This represents the level of confidence in the syntax; a higher value indicates greater confidence in the syntax. The confidence score for extracting four tuples from text T1 is the matching score obtained by matching the domain term set after dependency parsing by LTP. It is used to measure the coverage and completeness of domain terms in text T1, as shown in formula (8). (8); In the formula, It is the total number of all candidate element words identified by LTP. This refers to the number of words in the urban management field dictionary that can be successfully matched among these candidate words. The higher the value, the more standardized the expression of text T1 is and the more reliable the extraction of the four-tuple. The syntactic confidence is calculated based on the analysis results after using the LTP tool for dependency parsing. The calculation method is shown in formula (9). (9); in, This is the set of key dependencies we define. In the field of urban management, dependencies include SBV, VOB, and ATT. 1) is the set of all dependent arcs of text T1. It is an LTP-dependent arc The prediction probability, the max operation mainly selects the most reliable arc in each key relationship; When the confidence level is high, λ approaches 1, and semantic similarity depends on rule-driven improved Jaccard similarity; when the confidence level is low, λ approaches 0, and semantic similarity depends on model-driven cosine similarity.
5. A semantic similarity calculation method for the field of digital urban management according to claim 1, characterized in that, In S3, in the improved Jaccard similarity calculation, the weight coefficients are adjusted based on the confidence of the two sentences.
6. The semantic similarity calculation method for the field of digital urban management according to claim 1, characterized in that, The domain thesaurus is constructed through a combination of manual annotation and automatic expansion. The automatic expansion uses a word vector model trained on the urban management corpus to discover potential synonyms through vector similarity.
