A building design short text oriented topic extraction method, system, terminal and storage medium
By employing sentence-level semantic embedding and clustering optimization, the problems of granularity mismatch and weak structuring in the extraction of topics from short architectural design texts were solved, achieving efficient and accurate topic recognition and structured output.
Patent Information
- Application Number
- CN202511149705.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-08-18
AI Technical Summary
Existing technologies suffer from problems such as granularity mismatch, insufficient purity, weak structuring, and poor adaptability in the extraction of themes from short architectural design texts. They are unable to effectively handle semantic expressions at the sentence level and extract explicit strategy tags.
We employ sentence-level semantic embedding and clustering optimization methods, including data preprocessing, sentence vector embedding, dimensionality reduction, and clustering. We use the UMAP algorithm for dimensionality reduction and the HDBSCAN algorithm for clustering, and combine semantic similarity and keyword overlap rate for topic optimization.
It improves the adaptability and structuring of topic extraction, enhances the accuracy and semantic interpretability of topic extraction, and can effectively identify the core content in short architectural design texts.
Smart Images

Figure CN120654705B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of text processing, and in particular to a building design short text oriented theme extraction method, system, terminal and computer readable storage medium. BACKGROUND
[0002] The building design text, especially in the design weekly report, review summary and other scenarios, often presents the following characteristics: short text unit (i.e. each document usually contains only 200-500 words), semantic fragmentation (i.e. the text is mostly a summary or a transcript of oral expression, lacking coherence in context), dense architectural terminology (i.e. a large number of professional terms and complex spatial expressions, such as "modular teaching unit", etc.), strong subjectivity (i.e. the wording often contains intentional judgments or design strategy expressions), and sentence level carrying core information (i.e. most effective strategy information is concentrated in a single sentence, suitable for sentence level clustering analysis). Due to the above characteristics, the traditional theme extraction model for long text is obviously not well adapted to this scenario, resulting in a coarse output theme granularity, serious semantic overlap and poor result structuring.
[0003] The current common technical solutions for automatic clustering extraction of building design short text (i.e. building design short text theme extraction, theme extraction is to automatically identify and extract text related to a specific theme or field from a large amount of text, usually used in data mining, information retrieval and natural language processing fields; and theme extraction can quickly understand the core content of the text, and can also optimize information retrieval, i.e. in a large amount of information, theme extraction can help filter relevant content, reduce user search time and improve information retrieval efficiency) include methods based on document-level theme model, methods based on text clustering and bag-of-words model, and manual annotation and rule extraction methods. However, the existing technology has the following problems in theme recognition of building short text corpus: granularity mismatch (i.e. most methods assume document-level modeling unit, which cannot handle sentence-level semantic expression), insufficient purity (i.e. high redundancy rate of clustering results, making it difficult to extract clear strategy labels), weak structuring (i.e. lack of key word reconstruction, theme numbering and sentence indexing, etc. Structured output that can be implemented), and poor adaptability (i.e. unable to combine architectural corpus features such as term density and semantic reuse).
[0004] Therefore, the existing technology still needs to be improved and developed. SUMMARY
[0005] The main purpose of the present application is to provide a building design short text oriented theme extraction method, system, terminal and storage medium, which aims to solve the problem of poor adaptability, weak structuring and low accuracy of the existing technology for building design short text oriented theme extraction.
[0006] To achieve the above objectives, the present invention provides a method for extracting themes from short texts related to architectural design. This method includes the following steps:
[0007] Obtain a short text dataset of architectural design, and preprocess the short text dataset of architectural design to obtain a structured text dataset;
[0008] Sentence vectors are embedded based on the structured text set to obtain a sentence vector set. The sentence vector set is then subjected to dimensionality reduction to obtain a low-dimensional sentence vector set. Finally, the low-dimensional sentence vector set is clustered to obtain an initial topic clustering result.
[0009] The initial topic clustering results are optimized to obtain a topic set, and the topic set is then structured to obtain a target topic set.
[0010] Optionally, the topic extraction method for short texts on architectural design, wherein obtaining a short text dataset on architectural design and preprocessing the short text dataset to obtain a structured text set specifically includes:
[0011] Obtain a short text dataset of architectural design, extract sentences from the short text dataset of architectural design, and obtain a set of sentence text corpora;
[0012] The basic characters of all sentence texts in the sentence text corpus are denoised to obtain a denoised sentence text set, and the denoised sentence text set is then segmented to obtain the segmentation result.
[0013] The initial segmentation result is obtained by removing stop words from the segmentation result based on the stop word list, and the target segmentation result is obtained by filtering high-frequency words from the initial segmentation result based on the high-frequency term filtering table.
[0014] The target word segmentation results are subjected to synonym normalization to obtain a structured text set.
[0015] Optionally, the topic extraction method for short texts in architectural design, wherein the step of constructing a sentence vector set by embedding sentence vectors based on the structured text set specifically includes:
[0016] Obtain a word vector model, establish a mapping index between words and vectors based on the word vector model, and perform vector retrieval on the structured text set based on the mapping index to obtain multiple valid word vectors;
[0017] Element-wise averaging is performed on all the effective word vectors to obtain multiple sentence embedding vectors, and a set of sentence vectors is obtained based on all the sentence embedding vectors.
[0018] Optionally, the topic extraction method for short texts in architectural design, wherein the dimensionality reduction of the sentence vector set to obtain a low-dimensional sentence vector set, and the clustering of the low-dimensional sentence vector set to obtain an initial topic clustering result, specifically includes:
[0019] Set dimensionality reduction parameters, and perform dimensionality reduction processing on the sentence vector set according to the dimensionality reduction parameters to obtain a low-dimensional sentence vector set. The dimensionality reduction parameters include the number of neighbors, output dimension, first distance metric, and minimum distance.
[0020] Set clustering parameters, and perform clustering processing on the low-dimensional sentence vector set according to the clustering parameters to obtain the initial topic clustering result. The clustering parameters include minimum cluster size, second distance metric, and clustering mode.
[0021] Optionally, the topic extraction method for short texts on architectural design, wherein optimizing the initial topic clustering results to obtain a topic set specifically includes:
[0022] For any two initial topics from the initial topic clustering results, topic similarity is calculated to obtain multiple first similarity calculation results;
[0023] Keyword extraction is performed on all the initial topics to obtain multiple semantic identifier sets, and word sense similarity is calculated for any two semantic identifier sets to obtain multiple second similarity calculation results;
[0024] Compare all the first similarity calculation results with the first preset threshold, and compare all the second similarity calculation results with the second preset threshold;
[0025] If the first similarity calculation result of two initial topics is greater than or equal to the first preset threshold, and the second similarity calculation result of two initial topics is greater than or equal to the second preset threshold, then the two initial topics are aggregated to obtain an aggregation result.
[0026] The topic numbers are updated based on the aggregation results to obtain multiple updated topics, and a topic set is obtained based on all the updated topics.
[0027] Optionally, the topic extraction method for short texts in architectural design, wherein the step of extracting keywords from all the initial topics to obtain multiple semantic identifier sets specifically includes:
[0028] Obtain the topic sentence text of each initial topic, and construct a subset of all topic sentence texts of each initial topic to obtain multiple topic corpus subsets;
[0029] For each word in each of the aforementioned topic corpus subsets, term frequency-inverse document frequency calculation is performed to obtain multiple calculation results. Based on all the calculation results, a keyword list for each of the aforementioned initial topics is obtained, and based on all the keyword lists, a semantic identifier set for each of the aforementioned initial topics is obtained.
[0030] Optionally, in the aforementioned method for extracting topics from short texts related to architectural design, the step of calculating the term frequency-inverse document frequency for each term in each subset of the topic corpus specifically involves:
[0031] ;
[0032] in, For words, As the initial topic, The term frequency-inverse document frequency (IF) of words in the initial topic. The frequency of words appearing in the initial topic, The total number of initial topics. The initial number of topics containing words. This represents the inverse document frequency of a word.
[0033] Optionally, the topic extraction method for short texts on architectural design, wherein the topic extraction system for short texts on architectural design includes:
[0034] The data preprocessing module is used to acquire a short text dataset of architectural design, and to preprocess the short text dataset of architectural design to obtain a structured text dataset;
[0035] The text processing module is used to construct sentence vector embeddings based on the structured text set to obtain a sentence vector set, perform dimensionality reduction processing on the sentence vector set to obtain a low-dimensional sentence vector set, and perform clustering processing on the low-dimensional sentence vector set to obtain an initial topic clustering result.
[0036] The topic optimization module is used to optimize the initial topic clustering results to obtain a topic set, and to perform structuring processing on the topic set to obtain a target topic set.
[0037] Furthermore, to achieve the above objectives, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a topic extraction program for short texts on architectural design stored in the memory and executable on the processor, wherein when the topic extraction program for short texts on architectural design is executed by the processor, it implements the steps of the topic extraction method for short texts on architectural design as described above.
[0038] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a topic extraction program for short texts on architectural design, and when the topic extraction program for short texts on architectural design is executed by a processor, it implements the steps of the topic extraction method for short texts on architectural design as described above.
[0039] In this invention, a short text dataset of architectural design is acquired, preprocessed to obtain a structured text set, and then sentence vector embedding is performed on the structured text set to construct a sentence vector set. This sentence vector set is then subjected to dimensionality reduction processing to obtain a low-dimensional sentence vector set, which is then clustered to obtain an initial topic clustering result. The initial topic clustering result is then optimized to obtain a topic set, and this topic set is further structured to obtain a target topic set. This invention, through sentence-level semantic embedding and clustering optimization of short architectural design texts, not only enhances the adaptability of topic extraction but also improves the structure and accuracy of topic extraction. Attached Figure Description
[0040] Figure 1 This is a flowchart of a preferred embodiment of the topic extraction method for short texts in architectural design according to the present invention;
[0041] Figure 2 This is a schematic diagram of the terminal architecture of the topic extraction method for short texts in architectural design according to the present invention;
[0042] Figure 3 This is a schematic diagram of the overall process of the topic extraction method for short texts in architectural design according to the present invention;
[0043] Figure 4 This is a structural diagram of a preferred embodiment of the topic extraction system for short texts in architectural design according to the present invention;
[0044] Figure 5 This is a structural diagram of a preferred embodiment of the terminal of the present invention. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0046] It should be noted that if the embodiments of the present invention involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.
[0047] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0048] The preferred embodiment of the present invention describes a topic extraction method for short texts related to architectural design, such as... Figure 1 As shown, the topic extraction method for short texts oriented towards architectural design includes the following steps:
[0049] Step S10: Obtain the architectural design short text dataset, and preprocess the architectural design short text dataset to obtain a structured text set.
[0050] Specifically, in this embodiment of the invention, to address the problems in existing technologies for topic extraction from short architectural text corpora, such as granularity mismatch (i.e., most methods assume document-level modeling units and cannot handle sentence-level semantic expressions), insufficient purity (i.e., high redundancy in clustering results, making it difficult to extract clear strategy labels), weak structuring (i.e., lack of implementable structured outputs such as keyword reconstruction, topic numbering, and sentence indexing), and poor adaptability (i.e., failure to incorporate architectural corpus features (e.g., terminology density, semantic reusability), this invention proposes a topic extraction method for short architectural design texts. The corresponding terminal architecture is as follows: Figure 2 As shown, the system includes a data acquisition module, a preprocessing module, a sentence vector embedding module, a dimensionality reduction-clustering module, a topic aggregation module, and a result output module. The data acquisition module collects short text datasets related to architectural design and initializes the system's auxiliary resources (e.g., stop word lists, high-frequency term filtering tables, and word vector models). The preprocessing module performs text denoising, word segmentation, term filtering, and synonym normalization on the input sentence text corpus. The sentence vector embedding module converts each cleaned sentence text into a low-dimensional, dense semantic vector representation. The dimensionality reduction-clustering module compresses the sentence vector set into a clusterable low-dimensional semantic representation. The topic aggregation module further optimizes the initial topic clustering results. The result output module exports the final topic clustering results in a structured format.
[0051] The specific processing procedure is as follows: Figure 3As shown, the data acquisition module acquires data files sequentially imported by the user through the GUI (Graphics User Interface), including an architectural design short text dataset, a stop word list, a high-frequency terminology filter table, and a word vector model. The architectural design short text dataset contains text materials such as architect design descriptions, architectural reviews, and interview transcripts, supporting common formats such as .txt, .csv, and .xlsx. The stop word list identifies common words that are ignored or deleted during text processing. These words are typically frequently occurring function words or words without practical meaning (e.g., prepositions, conjunctions, pronouns). Stop words usually do not contribute significantly to the semantic analysis of the text and occupy a large amount of storage space and computing resources. Therefore, in text processing tasks (e.g., information retrieval), a set of stop words is often predefined and removed from the text during processing. The high-frequency terminology filter table is a list of high-frequency words obtained statistically from the architectural design text corpus. Terms with excessively high frequency but lacking semantic distinctiveness (e.g., project, building area) are removed to improve the accuracy of subsequent clustering. The word vector model (e.g., a model trained on news corpus) can provide word-level semantic embedding capabilities for subsequent generation of sentence-level vector representations. After acquiring the architectural design short text dataset, the data acquisition module needs to extract sentences from the dataset. By extracting sentences from the dataset, a sentence text corpus is obtained. Specifically, sentences are automatically extracted from each text in the dataset based on commonly used Chinese sentence-segmentation symbols (e.g., period, question mark, exclamation mark, etc.), and the document name to which it belongs is recorded. This is to facilitate indexing the document to which the sentence belongs and organizing the different topic information involved in the document when classifying the topic based on the sentence. All sentences are then unified into a sentence text corpus, represented by docs[], as the basic unit for subsequent semantic modeling.
[0052] Subsequently, the data acquisition module inputs the sentence input corpus to the preprocessing module. The preprocessing module performs text denoising, word segmentation, term filtering, and synonym normalization. Specifically, for text denoising, the basic characters of all sentences in the sentence text corpus are denoised to obtain a denoised sentence text set. This involves cleaning the basic characters of each sentence in the sentence text corpus, removing English characters, Arabic numerals, and special symbols to eliminate interference from non-Chinese information on word segmentation and vector modeling. This process follows unified regularization rules to ensure consistency and controllability. For word segmentation, the denoised sentence text set is segmented to obtain segmentation results. This is achieved using a segmentation tool based on a hybrid statistical and rule-based mechanism to divide each Chinese sentence in the denoised sentence text set into the smallest word units. At this stage, the main parts of speech (e.g., nouns, verbs, adjectives, locative words, etc.) are retained, while filtering out words with less impact on semantic recognition (e.g., auxiliary words, conjunctions, etc.). For term filtering, there are two main methods: stop word removal and high-frequency word removal. Stop word removal refers to removing stop words from the word segmentation results based on the stop word list to obtain the initial word segmentation results. In other words, in the word segmentation results, common function words appearing in the stop word list are matched and removed. High-frequency word removal refers to filtering the initial word segmentation results based on the high-frequency term filtering table to obtain the target word segmentation results. In other words, combined with the high-frequency term filtering table, terms that appear very frequently in architectural texts but have no distinguishing significance (e.g., project, plan, etc.) are further removed. Term filtering helps to compress the word vector space and improve the semantic purity of subsequent clustering. For the synonym normalization process, the target word segmentation results are subjected to synonym normalization. That is, the semantically similar words (e.g., teaching building and school building, noise and noise) in the target word segmentation results are standardized and merged through the constructed synonym mapping table. By automatically replacing synonym expressions with standardized terms, the aggregation ability of similar strategy expressions in clustering is improved. After the processing, a structured clean text set (i.e., structured text set) is obtained, represented by cleaned_docs[], and used as the input of the subsequent sentence vector embedding module. It has good semantic consistency and corpus cleanliness, which can effectively improve the clustering performance and interpretability of topic recognition.
[0053] Step S20: Construct sentence vector embeddings based on the structured text set to obtain a sentence vector set. Perform dimensionality reduction processing on the sentence vector set to obtain a low-dimensional sentence vector set. Perform clustering processing on the low-dimensional sentence vector set to obtain the initial topic clustering result.
[0054] Specifically, after receiving the structured text set, the sentence vector embedding module loads a word vector model trained on Chinese news corpus by default. This word vector model covers more than 5 million commonly used words, with each word corresponding to a 300-dimensional dense vector. After the model is loaded, a mapping index between words and vectors is established to support fast word vector retrieval and concatenation operations. The process of establishing the mapping index between words and vectors is as follows: after the word vector model is loaded, all words in the word vector model are pre-read, and a unique vector number index is assigned to each word. At the same time, the word and its corresponding semantic vector are organized into a key-value pair structure (i.e., "word → vector"), and this key-value pair structure is stored in memory, allowing any subsequent word to directly look up its corresponding vector representation in constant time, avoiding repeated calculations or disk read delays. Subsequently, for each sentence in the structured text set, the vector representation of each word in the sentence in the word vector model is retrieved first, resulting in multiple valid word vectors. These valid word vectors are the vectors corresponding to valid words, and a valid word is defined as one whose corresponding vector representation exists in the word vector model. Then, element-wise averaging is performed only on these valid word vectors. This avoids interference from low-frequency words, special characters, and other content without vector representations, thereby improving semantic stability and clustering accuracy. Finally, multiple 300-dimensional sentence embedding vectors are obtained, each reflecting the overall semantic features of the corresponding sentence. This invention preserves the semantic differences of local words during the embedding calculation process and reduces noise interference through vector averaging, making it suitable for processing short sentence corpora with simple structures and sparse vocabulary. For example, if the target platform has GPU capabilities, it can also switch to a higher-performance deep semantic model to further improve embedding accuracy and enhance the semantic separability between sentences, making it suitable for deployment scenarios with high requirements for topic boundary recognition accuracy.
[0055] Then, based on the embedding vectors of all sentences, a set of sentence vectors is obtained, and then... It means that, among them, For sentence vector set, Let be the set of real numbers. The number of sentences. For embedded dimensions, =300); the sentence vector set output by the sentence vector embedding module will be used as the direct input of the dimensionality reduction-clustering module to support the subsequent semantic structure recognition and topic tag merging process.
[0056] After the dimensionality reduction-clustering module receives the sentence vector set, considering the high dimensionality (i.e., 300 dimensions) of the sentence embedding vectors in the sentence vector set, direct clustering may cause the "curse of dimensionality" and degrade clustering performance. Therefore, in this embodiment of the invention, the UMAP (Uniform Manifold Approximation and Projection) algorithm is used as a dimensionality reduction tool to map the sentence vector set to... The UMAP dimensionality reduction process uses a low-dimensional manifold space while preserving local semantic adjacency relationships. The dimensionality reduction parameters are set as follows: number of neighbors n_neighbors=15, output dimension n_components=5, distance metric is cosine distance, and minimum distance min_dist=0. This setting effectively enhances the clustering of semantically similar sentences in the low-dimensional space, providing a good structural foundation for subsequent clustering. After dimensionality reduction, the HDBSCAN (Hierarchical Density-Based Spatial Clustering of Applications with Noise) algorithm is called to perform unsupervised topic clustering in the embedding space. Through sample point density estimation and hierarchical tree pruning strategies, it can automatically identify cluster structures and filter noisy sentences. The clustering parameters for the HDBSCAN aggregation process are set as follows: minimum cluster size... The distance metric is Euclidean distance, and the clustering mode is set to prioritize leaf node pruning to improve clustering granularity. The low-dimensional sentence vector set is clustered according to the clustering parameters to obtain initial topic clustering results. During the clustering process, intermediate outputs include a topic tag array (represented by `topics[]`) and a hierarchical relationship tree (represented by `hierarchy_tree`). The topic tag array is a topic number assigned to each sentence, and the hierarchical relationship tree displays the merging paths between topics for visualization and structural tracing. The dimensionality reduction-clustering module effectively divides a large number of architectural strategy statements into multiple semantically well-aggregated topic clusters, providing a foundation for subsequent topic optimization and semantic naming. Through dynamic clustering parameters and a density adaptive mechanism, the system can adapt to input corpora of different sizes and complexities, significantly reducing the probability of under-clustering and over-clustering.
[0057] Step S30: Optimize the initial topic clustering results to obtain a topic set, and perform structuring processing on the topic set to obtain a target topic set.
[0058] Specifically, after the dimensionality reduction-clustering module inputs the initial topic clustering results to the topic aggregation module, the topic aggregation module optimizes the initial topic clustering results to eliminate semantic redundancy and improve the purity and interpretability of the topic structure. The specific optimization process involves calculating topic similarity between any two initial topics from the initial topic clustering results, obtaining multiple first similarity calculation results. For example, for any two initial topics (e.g., topic...) and theme The cosine similarity (i.e., topic similarity) of the two topics is calculated using the following formula:
[0059] ;
[0060] in, Theme and theme cosine similarity, Theme The representative vector, Theme The representative vector, For vectors For is the Euclidean norm (i.e., the modulus). For vectors For the Euclidean norm, and All are the initial number of topics; The value range is [0, 1], and the closer it is to 1, the more similar the two topics are.
[0061] Next, for each initial topic, keywords need to be extracted from all sentences within it. Specifically, the topic sentence texts of each initial topic are obtained, and all topic sentence texts of each initial topic are used to construct subsets, resulting in multiple topic corpus subsets. For each word in each topic corpus subset, term frequency-inverse document frequency (TNF) calculation is performed to obtain multiple calculation results. The corresponding calculation formula is as follows:
[0062] ;
[0063] in, For words, As the initial topic, The term frequency-inverse document frequency (IF) of words in the initial topic. The frequency of words appearing in the initial topic, The total number of initial topics. The initial number of topics containing words. The inverse document frequency of words is used. A keyword list for each initial topic is obtained based on all calculation results, and a semantic identifier set for each initial topic is obtained based on all keyword lists. Specifically, a preset number (e.g., the first 10) of keywords from each keyword list are selected as the semantic identifier set for each initial topic for subsequent semantic overlap analysis. The purpose of setting the number of keywords to 10 is that if the number is too small (e.g., 3 to 5), it may not be able to cover the complex semantic features in architectural strategy statements; if the number is too large (e.g., 20), it will introduce high-frequency, low-weight terms, affecting the judgment of semantic overlap between topics. Experiments show that selecting 10 keywords can ensure semantic coverage while avoiding redundancy, and has a positive effect on the stability of the keyword overlap rate calculation results in the subsequent aggregation module. It can also be adjusted to any value within the range of 8 to 15 according to the characteristics of the industry corpus.
[0064] Before aggregating the initial topics, a two-factor merging rule determination is required, including semantic similarity determination and keyword overlap rate determination. For semantic similarity determination, all first similarity calculation results are compared with a first preset threshold (e.g., 0.85). For keyword overlap rate determination, all second similarity calculation results are compared with a second preset threshold (e.g., 0.4). If the first similarity calculation results of two initial topics are greater than or equal to the first preset threshold, and the second similarity calculation results of two initial topics are greater than or equal to the second preset threshold, then the two initial topics are aggregated to obtain the aggregated result. For example, for any two initial topics (e.g., topic...), and theme ), the topics need to be judged in sequence. and theme Whether the semantic similarity and keyword overlap rate are satisfied simultaneously, i.e., whether the judgment is correct. Whether it is greater than or equal to 0.85, and extract the topic respectively. Keyword list and theme Keyword list ,calculate and Jaccard similarity (i.e. and Intersection and and The ratio of the union of sets is used to determine whether the Jaccard similarity is greater than or equal to 0.4; if... If the topics are considered semantically similar and the Jaccard similarity is greater than or equal to 0.4 (significant semantic overlap exists), then the topic is determined. and theme The presence of high semantic redundancy automatically triggers a topic merging operation, generating new topic numbers. After the topic merging operation is executed, the mapping relationship between the topic numbers before and after the merge is retained, forming a traceable topic traceability table, which records the mapping relationship between the original topic numbers and the merged topics for subsequent traceability verification and manual proofreading. If the first similarity calculation result of two initial topics is less than the first preset threshold, or the second similarity calculation result of two initial topics is less than the second preset threshold, the original topic numbers of the two initial topics are retained, and the topic merging operation is not performed to ensure that semantic boundaries are preserved, thereby avoiding the loss of fine-grained strategy information due to excessive merging.
[0065] Subsequently, the topic numbers are updated based on the aggregation results, resulting in multiple updated topics. A topic set (represented by `topics_final[]`) is obtained based on all updated topics and input into the result output module. The result output module performs structured processing on the topic set to obtain the target topic set. The structured processing includes topic information table processing, topic hierarchical structure visualization processing, and model persistence processing. For topic information table processing, an Excel spreadsheet file is automatically generated from the topic set. The Excel spreadsheet file includes the topic number, keyword list, number of sentences contained in the topic, representative sentences, etc. For topic hierarchical structure visualization processing, the topic hierarchy relationship (e.g., based on a tree structure) and topic similarity matrix constructed in the topic set are output as an HTML file, supporting interactive viewing on a browser and can be used for review reports or strategy graph construction. For model persistence processing, the clustering model, parameter settings, and preprocessed corpus of the topic set are saved together as a binary model file, supporting subsequent reproduction, updating of clustering results, or iterative training. The result output module ensures the transparency, operability, and cross-platform compatibility of the end-to-end processing results.
[0066] In addition, although this invention is based on short architectural design texts, the strategy of "sentence-level vector embedding + dynamic clustering + two-factor topic aggregation" has universality. After being adapted to the thesaurus and corpus preprocessing rules, it can be applied to educational planning texts (e.g., classroom observation records, teaching space feedback), urban governance documents (e.g., opinions on street renovation), and medical case point clustering (e.g., aggregation of chief complaints and classification of rehabilitation suggestions).
[0067] Furthermore, such as Figure 4 As shown, based on the above-mentioned topic extraction method for short texts related to architectural design, this invention also provides a topic extraction system for short texts related to architectural design, wherein the topic extraction system for short texts related to architectural design includes:
[0068] Data preprocessing module 51 is used to acquire a short text dataset of architectural design, preprocess the short text dataset of architectural design, and obtain a structured text dataset.
[0069] The text processing module 52 is used to construct sentence vector embedding based on the structured text set to obtain a sentence vector set, perform dimensionality reduction processing on the sentence vector set to obtain a low-dimensional sentence vector set, and perform clustering processing on the low-dimensional sentence vector set to obtain an initial topic clustering result;
[0070] The topic optimization module 53 is used to optimize the initial topic clustering results to obtain a topic set, and to perform structuring processing on the topic set to obtain a target topic set.
[0071] Furthermore, such as Figure 5 As shown, based on the above-mentioned topic extraction method for short texts in architectural design, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 5 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0072] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc. Further, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal, such as program code installed on the terminal. The memory 20 can also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores a topic extraction program 40 for short texts related to architectural design. This topic extraction program 40 can be executed by the processor 10 to implement the topic extraction method for short texts related to architectural design in this application.
[0073] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the topic extraction method for short texts on architectural design.
[0074] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface.
[0075] In one embodiment, when processor 10 executes topic extraction program 40 for short architectural design texts in memory 20, the following steps are performed:
[0076] Obtain a short text dataset of architectural design, and preprocess the short text dataset of architectural design to obtain a structured text dataset;
[0077] Sentence vectors are embedded based on the structured text set to obtain a sentence vector set. The sentence vector set is then subjected to dimensionality reduction to obtain a low-dimensional sentence vector set. Finally, the low-dimensional sentence vector set is clustered to obtain an initial topic clustering result.
[0078] The initial topic clustering results are optimized to obtain a topic set, and the topic set is then structured to obtain a target topic set.
[0079] The step of obtaining a short text dataset of architectural designs, and preprocessing the short text dataset of architectural designs to obtain a structured text set, specifically includes:
[0080] Obtain a short text dataset of architectural design, extract sentences from the short text dataset of architectural design, and obtain a set of sentence text corpora;
[0081] The basic characters of all sentence texts in the sentence text corpus are denoised to obtain a denoised sentence text set, and the denoised sentence text set is then segmented to obtain the segmentation result.
[0082] The initial segmentation result is obtained by removing stop words from the segmentation result based on the stop word list, and the target segmentation result is obtained by filtering high-frequency words from the initial segmentation result based on the high-frequency term filtering table.
[0083] The target word segmentation results are subjected to synonym normalization to obtain a structured text set.
[0084] Specifically, the step of constructing a sentence vector set by embedding sentence vectors based on the structured text set includes:
[0085] Obtain a word vector model, establish a mapping index between words and vectors based on the word vector model, and perform vector retrieval on the structured text set based on the mapping index to obtain multiple valid word vectors;
[0086] Element-wise averaging is performed on all the effective word vectors to obtain multiple sentence embedding vectors, and a set of sentence vectors is obtained based on all the sentence embedding vectors.
[0087] Specifically, the step of reducing the dimensionality of the sentence vector set to obtain a low-dimensional sentence vector set, and then performing clustering on the low-dimensional sentence vector set to obtain initial topic clustering results, includes:
[0088] Set dimensionality reduction parameters, and perform dimensionality reduction processing on the sentence vector set according to the dimensionality reduction parameters to obtain a low-dimensional sentence vector set. The dimensionality reduction parameters include the number of neighbors, output dimension, first distance metric, and minimum distance.
[0089] Set clustering parameters, and perform clustering processing on the low-dimensional sentence vector set according to the clustering parameters to obtain the initial topic clustering result. The clustering parameters include minimum cluster size, second distance metric, and clustering mode.
[0090] The optimization process for the initial topic clustering results to obtain a topic set specifically includes:
[0091] For any two initial topics from the initial topic clustering results, topic similarity is calculated to obtain multiple first similarity calculation results;
[0092] Keyword extraction is performed on all the initial topics to obtain multiple semantic identifier sets, and word sense similarity is calculated for any two semantic identifier sets to obtain multiple second similarity calculation results;
[0093] Compare all the first similarity calculation results with the first preset threshold, and compare all the second similarity calculation results with the second preset threshold;
[0094] If the first similarity calculation result of two initial topics is greater than or equal to the first preset threshold, and the second similarity calculation result of two initial topics is greater than or equal to the second preset threshold, then the two initial topics are aggregated to obtain an aggregation result.
[0095] The topic numbers are updated based on the aggregation results to obtain multiple updated topics, and a topic set is obtained based on all the updated topics.
[0096] Specifically, the step of extracting keywords from all the initial topics to obtain multiple semantic identifier sets includes:
[0097] Obtain the topic sentence text of each initial topic, and construct a subset of all topic sentence texts of each initial topic to obtain multiple topic corpus subsets;
[0098] For each word in each of the aforementioned topic corpus subsets, term frequency-inverse document frequency calculation is performed to obtain multiple calculation results. Based on all the calculation results, a keyword list for each of the aforementioned initial topics is obtained, and based on all the keyword lists, a semantic identifier set for each of the aforementioned initial topics is obtained.
[0099] Specifically, the step of calculating the term frequency-inverse document frequency for each term in each of the subject corpus subsets involves:
[0100] ;
[0101] in, For words, As the initial topic, The term frequency-inverse document frequency (IF) of words in the initial topic. The frequency of words appearing in the initial topic, The total number of initial topics. The initial number of topics containing words. This represents the inverse document frequency of a word.
[0102] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a topic extraction program for short texts on architectural design, and the topic extraction program for short texts on architectural design, when executed by a processor, implements the steps of the topic extraction method for short texts on architectural design as described above.
[0103] In summary, this invention provides a method, system, terminal, and storage medium for topic extraction from short architectural design texts. The method includes: acquiring a dataset of short architectural design texts; preprocessing the dataset to obtain a structured text set; constructing a sentence vector set by embedding sentence vectors into the structured text set; reducing the dimensionality of the sentence vector set to obtain a low-dimensional sentence vector set; clustering the low-dimensional sentence vector set to obtain an initial topic clustering result; optimizing the initial topic clustering result to obtain a topic set; and structuring the topic set to obtain a target topic set. This invention, through sentence-level semantic embedding and clustering optimization of short architectural design texts, not only enhances the adaptability of topic extraction but also improves the structuring and accuracy of topic extraction.
[0104] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0105] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.). The program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The computer-readable storage medium can be a memory, magnetic disk, optical disk, etc.
[0106] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. A method for extracting themes from short texts related to architectural design, characterized in that, The topic extraction method for short texts oriented towards architectural design includes: Obtain a short text dataset of architectural design, and preprocess the short text dataset of architectural design to obtain a structured text dataset; Sentence vectors are embedded based on the structured text set to obtain a sentence vector set. The sentence vector set is then subjected to dimensionality reduction to obtain a low-dimensional sentence vector set. Finally, the low-dimensional sentence vector set is clustered to obtain an initial topic clustering result. The step of constructing a sentence vector set by embedding sentence vectors based on the structured text set specifically includes: Obtain a word vector model, establish a mapping index between words and vectors based on the word vector model, and perform vector retrieval on the structured text set based on the mapping index to obtain multiple valid word vectors; Element-wise averaging is performed on all the effective word vectors to obtain multiple sentence embedding vectors, and a set of sentence vectors is obtained based on all the sentence embedding vectors. The step of reducing the dimensionality of the sentence vector set to obtain a low-dimensional sentence vector set, and then performing clustering on the low-dimensional sentence vector set to obtain initial topic clustering results, specifically includes: Set dimensionality reduction parameters, and perform dimensionality reduction processing on the sentence vector set according to the dimensionality reduction parameters to obtain a low-dimensional sentence vector set. The dimensionality reduction parameters include the number of neighbors, output dimension, first distance metric, and minimum distance. Set clustering parameters, and perform clustering processing on the low-dimensional sentence vector set according to the clustering parameters to obtain initial topic clustering results. The clustering parameters include minimum cluster size, second distance metric, and clustering mode. The initial topic clustering results are optimized to obtain a topic set, and the topic set is then structured to obtain a target topic set. The optimization process for the initial topic clustering results to obtain a topic set specifically includes: For any two initial topics from the initial topic clustering results, topic similarity is calculated to obtain multiple first similarity calculation results; Keyword extraction is performed on all the initial topics to obtain multiple semantic identifier sets, and word sense similarity is calculated for any two semantic identifier sets to obtain multiple second similarity calculation results; Compare all the first similarity calculation results with the first preset threshold, and compare all the second similarity calculation results with the second preset threshold; If the first similarity calculation result of two initial topics is greater than or equal to the first preset threshold, and the second similarity calculation result of two initial topics is greater than or equal to the second preset threshold, then the two initial topics are aggregated to obtain an aggregation result. The topic numbers are updated based on the aggregation results to obtain multiple updated topics, and a topic set is obtained based on all the updated topics.
2. The method for extracting themes from short texts related to architectural design according to claim 1, characterized in that, The process of obtaining a short text dataset of architectural design data and preprocessing it to obtain a structured text set specifically includes: Obtain a short text dataset of architectural design, extract sentences from the short text dataset of architectural design, and obtain a set of sentence text corpora; The basic characters of all sentence texts in the sentence text corpus are denoised to obtain a denoised sentence text set, and the denoised sentence text set is then segmented to obtain the segmentation result. The initial segmentation result is obtained by removing stop words from the segmentation result based on the stop word list, and the target segmentation result is obtained by filtering high-frequency words from the initial segmentation result based on the high-frequency term filtering table. The target word segmentation results are subjected to synonym normalization to obtain a structured text set.
3. The method for extracting themes from short texts related to architectural design according to claim 1, characterized in that, The step of extracting keywords from all the initial topics to obtain multiple semantic identifier sets specifically includes: Obtain the topic sentence text of each initial topic, and construct a subset of all topic sentence texts of each initial topic to obtain multiple topic corpus subsets; For each word in each of the aforementioned topic corpus subsets, term frequency-inverse document frequency calculation is performed to obtain multiple calculation results. Based on all the calculation results, a keyword list for each of the aforementioned initial topics is obtained, and based on all the keyword lists, a semantic identifier set for each of the aforementioned initial topics is obtained.
4. The method for extracting themes from short texts related to architectural design according to claim 3, characterized in that, The step of performing term frequency-inverse document frequency calculation for each term in each of the aforementioned subject corpus subsets specifically involves: ; in, For words, As the initial topic, The term frequency-inverse document frequency (IF) of words in the initial topic. The frequency of words appearing in the initial topic, The total number of initial topics. The initial number of topics containing words. This represents the inverse document frequency of a word.
5. A topic extraction system for short texts in architectural design, characterized in that, The topic extraction system for short texts in architectural design is applied to the topic extraction method for short texts in architectural design as described in any one of claims 1-4, wherein the topic extraction system for short texts in architectural design includes: The data preprocessing module is used to acquire a short text dataset of architectural design, and to preprocess the short text dataset of architectural design to obtain a structured text dataset; The text processing module is used to construct sentence vector embeddings based on the structured text set to obtain a sentence vector set, perform dimensionality reduction processing on the sentence vector set to obtain a low-dimensional sentence vector set, and perform clustering processing on the low-dimensional sentence vector set to obtain an initial topic clustering result. The topic optimization module is used to optimize the initial topic clustering results to obtain a topic set, and to perform structuring processing on the topic set to obtain a target topic set.
6. A terminal, characterized in that, The terminal includes a memory, a processor, and a program stored in the memory and executable on the processor. When executed by the processor, the program implements the steps of the topic extraction method for short texts for architectural design as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program thereon, and the computer-readable storage medium stores a topic extraction program for short texts of architectural design, which, when executed by a processor, implements the steps of the topic extraction method for short texts of architectural design as described in any one of claims 1-4.
Citation Information
Patent Citations
Theme information-based text segmentation method
CN110110326A
Short text clustering method based on adaptive variational encoder
CN114625879A