# LLM-Enhanced Framework for Building Domain-Specific Lexicon for Urban Power Grid Design
## 2 Materials and Methods
### Candidate Term Filtering  
To further enhance the quality of the seed vocabulary, this study proposes a filtering method based on mutual information and entropy for domain-specific professional vocabulary. This approach effectively improves the accuracy of domain term recognition by considering both the internal cohesion and external independence of vocabulary. The process involves three key steps:  
1. Preprocessing and Candidate Vocabulary Generation: Perform sentence segmentation and word segmentation on the corpus text to generate high-frequency word segments as the candidate vocabulary set.  
2. Mutual Information and Entropy Calculation: Calculate the mutual information and entropy for all candidate terms. The weighted sum of these two statistical metrics is used as the final scoring criterion.  
3. Sorting and Manual Selection: Rank the terms based on their scores and combine manual selection to obtain a high-quality set of domain-specific seed words.  
Mutual information (_MI_) [23] is a crucial statistic for measuring the internal cohesion of word pairs, which is particularly advantageous in Chinese word segmentation problems. It is defined by Formula (2):  
\[MI(x,y)=log_{2}\frac{p(x,y)}{p(x)p(y)} \tag{2}\]  
where  
\(p(x,y)\): Joint probability of co-occurrence of two words.  
\(p(x)\) and \(p(y)\): Marginal probabilities of each word occurring independently.  
In practical applications, a higher \(M\)I value indicates a stronger bond between two characters, suggesting a higher likelihood of forming a valid word. This method is especially effective for identifying domain-specific terms and fixed expressions, as professional terminology often exhibits high internal cohesion.  
Adjacent entropy [24] measures the external independence of a word string by calculating the uncertainty of adjacent characters on either side of the candidate term. Left adjacent entropy (\(H_{L}\)) and right adjacent entropy (\(H_{R}\)) are calculated using Formulas (3) and (4), respectively:  
\[H_{left}(W) =-\sum_{W_{L}\in S_{L}}P(W_{L}|W)log_{2}P(W_{L}|W) \tag{3}\] \[H_{right}(W) =-\sum_{W_{R}\in S_{R}}P(W_{R}|W)log_{2}P(W_{R}|W) \tag{4}\]  
where  
\(S_{L}\) and \(S_{R}\): Sets of left and right adjacent characters of the candidate term \(W\).  
\(P(W_{L}|W)\) and \(P(W_{R}|W)\): Conditional probabilities of specific characters being left or right adjacent characters of \(W\).  
\[P(W_{L}|W) =\frac{N(W_{L},W)}{N(W)} \tag{5}\] \[P(W_{R}|W) =\frac{N(W_{R},W)}{N(W)} \tag{6}\]  
where  
\(N(W_{L},W)\) and \(N(W_{R},W)\): Counts of left and right adjacent characters co-occurring with the candidate term \(W\).  
\(N(W)\): Total number of occurrences of the candidate term \(W\).  
By integrating mutual information and adjacent entropy, we establish a dual-filtering mechanism to extract core seed vocabulary relevant to urban power grid design. This method not only evaluates the internal cohesion strength of vocabulary but also assesses its independence within contextual environments, significantly enhancing the accuracy of term recognition.  
The final step involves ranking the candidate terms based on their combined scores from mutual information and adjacent entropy. High-scoring terms are then manually reviewed to ensure their relevance and accuracy before inclusion in the final seed vocabulary set. This refined set serves as the foundation for subsequent synonym mining.  
This comprehensive approach ensures that the resulting seed vocabulary is both precise and contextually appropriate, providing a robust basis for building an extensive and accurate domain-specific lexicon for the power design field. The filtered seed vocabulary set will be used in the next stage for synonym discovery, thereby enriching the lexicon and enhancing its utility for intelligent systems in urban power grid design.