A BIM semantic disambiguation method and system
By establishing a vector space in the BIM model and calculating the edit distance, the problem of semantic alignment of words with different synonyms and similar words in the BIM field is solved, and the efficiency and accuracy of vocabulary retrieval are improved.
Patent Information
- Application Number
- CN202111521517.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-12-13
AI Technical Summary
In the BIM domain model, it is difficult to effectively semantically align words with different synonyms and similar words, resulting in a lack of efficient and effective methods for vocabulary retrieval of similar words.
By establishing the vector space of the BIM vocabulary set, the pre-trained word vector model is used to extract word vectors, and the edit distance of the word vectors is calculated, and hybrid weighted sorting is performed to determine the most similar words.
This improves the calculation of similarity between phrases in the BIM model, significantly improves the comparison effect of similar words, and solves the shortcomings of vocabulary retrieval of similar words in the existing technology.
Smart Images

Figure CN114298028B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of BIM (Building Information Modeling) data processing, and in particular to a BIM semantic disambiguation method and system. Background Art
[0002] In BIM field model information, there are often problems with synonymous words. People can easily understand the difference between the two and know that the meanings they express are the same, but it is difficult for machines to align the semantics of the same components.
[0003] For example, "structural materials" can be split into two words, "structure" and "materials". In the BIM semantic environment, it is necessary to compare the similarity of phrases. In addition, there may be problems with similar words due to user input errors, such as "structure" and "hook". It is also necessary to identify the similarity between similar words in order to effectively distinguish them.
[0004] Therefore, it is necessary to propose a method for semantic disambiguation of BIM semantics. Summary of the invention
[0005] The present invention provides a BIM semantic disambiguation method and system, which are used to solve the defect of the prior art that there is a lack of efficient and effective method when searching for similar words in BIM model information.
[0006] In a first aspect, the present invention provides a BIM semantic disambiguation method, comprising:
[0007] Acquire a BIM vocabulary set and establish a vector space of the BIM vocabulary set;
[0008] Obtain a word to be queried, and determine a word vector of the word to be queried;
[0009] The edit distance of the vocabulary vector relative to the vector space is calculated, and the most similar vocabulary to the vocabulary to be queried is determined according to the edit distance.
[0010] According to a BIM semantic disambiguation method provided by the present invention, the step of obtaining a BIM vocabulary set and establishing a vector space of the BIM vocabulary set includes:
[0011] Extract any word or sentence in the BIM vocabulary set, and segment the any word or sentence based on a preset segmentation model to obtain a first segmentation result set;
[0012] Based on the pre-trained word vector model, obtain the word vector of each word in the first word segmentation result set to obtain a first word vector set;
[0013] Replace each word vector in the word vector set based on the pre-trained word vector model to obtain a second word vector set;
[0014] All word vectors in the second word vector set are combined to obtain a first comprehensive word vector, and the BIM vocabulary set is traversed until all first comprehensive word vectors of the BIM vocabulary set are obtained to obtain the vector space of the BIM vocabulary set.
[0015] According to a BIM semantic disambiguation method provided by the present invention, replacing each word vector in the word vector set based on the pre-trained word vector model to obtain a second word vector set includes:
[0016] Extracting several words closest to each word vector in the pre-trained word vector model;
[0017] An average value is taken for the plurality of words, and each word vector is replaced with the average value to obtain the second word vector set.
[0018] According to a BIM semantic disambiguation method provided by the present invention, the step of obtaining a vocabulary to be queried and determining a vocabulary vector of the vocabulary to be queried includes:
[0019] Segmenting the words to be queried based on a preset segmentation model to obtain a second segmentation result set;
[0020] Based on the pre-trained word vector model, the word vector of each word in the second word segmentation result set is obtained to obtain the word vector of the word to be queried.
[0021] According to a BIM semantic disambiguation method provided by the present invention, the step of calculating the edit distance of the vocabulary vector relative to the vector space and determining the most similar vocabulary to the query vocabulary according to the edit distance includes:
[0022] Combining all word vectors in the vocabulary vector to obtain a second comprehensive word vector;
[0023] Acquire real words corresponding to a plurality of vectors adjacent to the second comprehensive word vector in the vector space to obtain a real word set;
[0024] Perform word segmentation and deduplication on the real vocabulary set, obtain a word vector corresponding to each real vocabulary, and obtain a third word vector set;
[0025] Calculating the edit distance between each word vector in the vocabulary vector and each word vector in the third word vector set, and obtaining a first similarity corresponding to the edit distance;
[0026] Acquire a second similarity according to the to-be-queried vocabulary and the real vocabulary set;
[0027] Perform mixed weighting on the first similarity and the second similarity to obtain a final similarity;
[0028] The BIM vocabulary set is sorted based on the final similarity to obtain the most similar vocabulary.
[0029] According to a BIM semantic disambiguation method provided by the present invention, the obtaining of the first similarity corresponding to the edit distance includes:
[0030] The maximum score parameter of the edit distance is calculated and an average is taken to obtain the first similarity.
[0031] According to a BIM semantic disambiguation method provided by the present invention, obtaining a second similarity based on the query vocabulary and the real vocabulary set includes:
[0032] The cosine similarity between the query vocabulary and each word vector in the real vocabulary set is calculated to obtain the second similarity.
[0033] In a second aspect, the present invention further provides a BIM semantic disambiguation system, comprising:
[0034] A first processing module is used to obtain a BIM vocabulary set and establish a vector space of the BIM vocabulary set;
[0035] A second processing module is used to obtain a word to be queried and determine a word vector of the word to be queried;
[0036] The third processing module is used to calculate the edit distance of the vocabulary vector relative to the vector space, and determine the most similar vocabulary to the query vocabulary according to the edit distance.
[0037] In a third aspect, the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned BIM semantic disambiguation methods are implemented.
[0038] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described BIM semantic disambiguation methods.
[0039] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned BIM semantic disambiguation methods.
[0040] The BIM semantic disambiguation method and system provided by the present invention realizes similarity calculation between phrases by introducing vector space in the BIM model, and introduces edit distance for mixed weighting, so that better comparison effect can be achieved when comparing similar words. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 It is a flowchart of the BIM semantic disambiguation method provided by the present invention;
[0043] Figure 2 It is an overall framework diagram of the BIM semantic disambiguation method provided by the present invention;
[0044] Figure 3 It is a schematic diagram of establishing the vector space provided by the present invention;
[0045] Figure 4 It is a schematic diagram of similarity calculation using mixed weights provided by the present invention;
[0046] Figure 5 It is a structural schematic diagram of the BIM semantic disambiguation system provided by the present invention;
[0047] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] In the prior art, when processing BIM model information, the similarity of similar words cannot be properly distinguished, so that when searching and locating similar words, ideal results are often not obtained. The present invention proposes a BIM semantic disambiguation method. Figure 1 : is a flow chart of the BIM semantic disambiguation method provided by the present invention, such as Figure 1 As shown, including:
[0050] Step S1, obtaining a BIM vocabulary set and establishing a vector space of the BIM vocabulary set;
[0051] Step S2, obtaining a word to be queried, and determining a word vector of the word to be queried;
[0052] Step S3, calculating the edit distance of the vocabulary vector relative to the vector space, and determining the most similar vocabulary to the vocabulary to be queried according to the edit distance.
[0053] Specifically, Figure 2 This is the overall framework diagram of the algorithm of the present invention, which is based on the original BIM vocabulary. The number and scale of the vocabulary depend on the professional application field of the BIM model. Since BIM is a digital tool used in engineering design, construction, and management, it integrates the digital and information models of buildings and shares and transmits them throughout the entire life cycle of project planning, operation, and maintenance. Therefore, the vocabulary of the original BIM data needs to be of a certain scale to ensure the robustness of subsequent data processing.
[0054] The BIM vocabulary set is subjected to operations such as word segmentation training and mean replacement, and the corresponding vector space is established for the vectors corresponding to the multiple data processing; at this time, the vocabulary to be queried is input, and the vocabulary vector is generated for the vocabulary to be queried according to the same processing method.
[0055] The vocabulary vector corresponding to the query word is compared with the vector space corresponding to the BIM vocabulary set. By obtaining the edit distance between the vocabulary vector and the vector space, the similarity of all words in the BIM vocabulary set is further obtained. Finally, the word with the highest similarity is solved as the most similar word to the query word.
[0056] The present invention realizes the similarity calculation between word groups by introducing vector space in the BIM model, and introduces the edit distance for mixed weighting, so that a better comparison effect can be achieved when comparing similar words.
[0057] Based on the above embodiment, the step of obtaining a BIM vocabulary set and establishing a vector space of the BIM vocabulary set includes:
[0058] Extract any word or sentence in the BIM vocabulary set, and segment the any word or sentence based on a preset segmentation model to obtain a first segmentation result set;
[0059] Based on the pre-trained word vector model, obtain the word vector of each word in the first word segmentation result set to obtain a first word vector set;
[0060] Replace each word vector in the word vector set based on the pre-trained word vector model to obtain a second word vector set;
[0061] All word vectors in the second word vector set are combined to obtain a first comprehensive word vector, and the BIM vocabulary set is traversed until all first comprehensive word vectors of the BIM vocabulary set are obtained to obtain the vector space of the BIM vocabulary set.
[0062] The step of replacing each word vector in the word vector set based on the pre-trained word vector model to obtain a second word vector set includes:
[0063] Extracting several words closest to each word vector in the pre-trained word vector model;
[0064] An average value is taken for the plurality of words, and each word vector is replaced with the average value to obtain the second word vector set.
[0065] Specifically, for the process of establishing the vector space of the BIM original vocabulary, see Figure 3 Schematic diagram shown.
[0066] The BIM original vocabulary data is set as a set S, the set S is traversed, any word or sentence in S is extracted, and the selected word or sentence is segmented by a preset word segmentation model to obtain a segmentation result as a first word segmentation result set U. The preset word segmentation model here adopts a mainstream word segmentation model for processing, such as a word segmentation method based on a dictionary, a word segmentation method based on a statistical model, and a word segmentation method based on a sequence annotation, etc., and the present invention does not impose any limitation on this.
[0067] Then traverse the first word segmentation result set U, obtain the word vector of each word in the set U through the pre-trained word vector model M, and put it into the second word vector set O = {v1, v2, v3…v n}. Traverse the set O and extract v i The n nearest words in the pre-trained word vector model M, and take the average value v j , v j Replace the previous v i ,The mean replacement process here is used to enhance the accuracy and robustness of the word vector.
[0068] Combine all word vectors in set O to get the first comprehensive word vector v e , and v e Place it in the vector space P, return to the set S, traverse the data in S, and generate the final vector space P.
[0069] like Figure 3 For example, the original BIM data set "structure material" is segmented to obtain two segmented words "structure" and "material", and then two central vectors v1 and v2 are generated. V1 and v2 are combined to obtain a comprehensive vector ve , v e Put it into the vector space, further process the word segmentation of other words and sentences, and obtain multiple vectors v e , that is, establishing the vector space of BIM.
[0070] The present invention uses a preset word segmentation model and a pre-trained word vector model to process the BIM original vocabulary to obtain the vector space of BIM, which has the characteristics of fast processing speed and high robustness of the obtained data.
[0071] Based on the above embodiment, the step of obtaining the vocabulary to be queried and determining the vocabulary vector of the vocabulary to be queried includes:
[0072] Segmenting the words to be queried based on a preset segmentation model to obtain a second segmentation result set;
[0073] Based on the pre-trained word vector model, the word vector of each word in the second word segmentation result set is obtained to obtain the word vector of the word to be queried.
[0074] Specifically, after obtaining the vector space of BIM, the query vocabulary is passed through the pre-trained word vector model M to obtain the word vector after word segmentation, and the vocabulary vector T = {u1,u2,u3…u n}, the corresponding word segmentation is the second word segmentation result set.
[0075] The present invention adopts the same word segmentation and word vector processing algorithm for the vocabulary to be queried and the BIM original data set, so that when the edit distance is subsequently introduced to calculate the similarity between the two, they can be unified in the same vector space, which is convenient for comparison and calculation.
[0076] Based on the above embodiment, the step of calculating the edit distance of the vocabulary vector relative to the vector space and determining the most similar vocabulary to the query vocabulary according to the edit distance includes:
[0077] Combining all word vectors in the vocabulary vector to obtain a second comprehensive word vector;
[0078] Acquire real words corresponding to a plurality of vectors adjacent to the second comprehensive word vector in the vector space to obtain a real word set;
[0079] Perform word segmentation and deduplication on the real vocabulary set, obtain a word vector corresponding to each real vocabulary, and obtain a third word vector set;
[0080] Calculating the edit distance between each word vector in the vocabulary vector and each word vector in the third word vector set, and obtaining a first similarity corresponding to the edit distance;
[0081] Acquire a second similarity according to the to-be-queried vocabulary and the real vocabulary set;
[0082] Perform mixed weighting on the first similarity and the second similarity to obtain a final similarity;
[0083] The BIM vocabulary set is sorted based on the final similarity to obtain the most similar vocabulary.
[0084] The obtaining of the first similarity corresponding to the edit distance includes:
[0085] The maximum score parameter of the edit distance is calculated and an average is taken to obtain the first similarity.
[0086] The step of obtaining a second similarity based on the query vocabulary and the real vocabulary set includes:
[0087] The cosine similarity between the query vocabulary and each word vector in the real vocabulary set is calculated to obtain the second similarity.
[0088] Specifically, after obtaining the vocabulary vector T of the query vocabulary, the vector in T is generated into v w And query v in the vector space P w The real words corresponding to the m nearest vectors are used to obtain the second comprehensive word vector C.
[0089] Then, all the words in set C are segmented and deduplicated, and the word vector of each word is obtained and placed into the third word vector set L.
[0090] Furthermore, the edit distance between each word vector in the vocabulary vector set T and all word vectors in the third word vector set L is calculated, and the maximum score parameter (i.e., argmax function) of the edit distance corresponding to each word is obtained and the average is taken to obtain the edit distance weight:
[0091]
[0092] Then calculate the cosine similarity W between the query word w and each item in the set C c ;
[0093] W c With W l Perform mixed weighting to obtain the final similarity W, see Figure 4 shown.
[0094] Finally, sort the results according to W and get the maximum value W max As the most similar word to the query word.
[0095] The present invention realizes the similarity calculation between phrases by introducing vector space in BIM data processing, and introduces edit distance for mixed weighting to obtain better comparison effect.
[0096] The following is a complete example to illustrate the implementation of the present invention, which specifically includes:
[0097] Input: an input query word w, and a set of BIM original vocabulary data is set as set S.
[0098] Step 1: Traverse the set S, take a word or sentence in S, segment the vocabulary data through the word segmentation model, and obtain the word segmentation result as the set U;
[0099] Step 2: Traverse the set U, obtain the word vector of each word in the set through the pre-trained word vector model M, and put it into the set O = {v1,v2,v3…v n};
[0100] Step 3: Traverse the set O and take v i Take the average of the n nearest words in M to get v j , replace the previous v i ;
[0101] Step 4: Combine the vectors in O to generate vector v e , and v e Place it in the vector space P and return to step 1 until the S set is traversed and the vector space P is generated;
[0102] Step 5: Referring to Step 1 and Step 2, the input word w is segmented and the sub-vectors after segmentation are obtained through the word vector model M, and placed into the set T = {u1,u2,u3…u n}, the corresponding word segmentation results are placed in set J;
[0103] Step 6: Combine the vectors in T to generate vector v w And query v in the vector space P w The real words corresponding to the nearest m vectors are placed in set C;
[0104] Step 7: Segment all words in set C and remove duplicates to obtain the word vector of each word, and put it into set L;
[0105] Step 8: Calculate the edit distance between each word vector in the T set and all word vectors in L, and obtain the argmax of each word and take the average as the edit distance weight:
[0106]
[0107] Step 9: Calculate the cosine similarity W between w and each word vector in Cc ;
[0108] Step 10: W c With W l Perform mixed weighting to obtain the final similarity W;
[0109] Step 11: Sort the results by W and get W max as the most similar word.
[0110] On the basis of the above embodiments, the present invention verifies the implementation results of the scheme, and the test environment is: WIN10 system, 16G memory and i7-8750H CPU; the data sets used are the vocabulary data sets obtained by BIM model analysis and the single vocabulary input manually.
[0111] Using the existing similarity comparison method, the similarity results of the original word vector model are as follows:
[0112] First word: length;
[0113] Second word: long;
[0114] Similarity between two words: 0.45037568.
[0115] It can be seen that the existing similarity comparison method does not support the similarity comparison calculation of phrase-type words.
[0116] Using the optimized comparison method of the present invention, the similarity comparison results obtained are as follows:
[0117] (1) The first word: long;
[0118] Second word: length;
[0119] Similarity between two words: 0.887.
[0120] (2) The first word: the creation stage;
[0121] Second word: stage of deletion;
[0122] Similarity between two words: 0.411.
[0123] It can be seen that the BIM semantic disambiguation method proposed in the present invention gives priority to searching vectors within the range of the vector space and then calculating the edit distance, so there are still certain limitations in the recognition of individual similar words, but in most cases it has been greatly improved compared with the existing models.
[0124] The BIM semantic disambiguation system provided by the present invention is described below. The BIM semantic disambiguation system described below and the BIM semantic disambiguation method described above can be referenced to each other.
[0125] Figure 5 : is a schematic diagram of the structure of the BIM semantic disambiguation system provided by the present invention, such as Figure 5 As shown, it includes: a first processing module 51, a second processing module 52 and a third processing module 53, wherein:
[0126] The first processing module 51 is used to obtain a BIM vocabulary set and establish a vector space of the BIM vocabulary set; the second processing module 52 is used to obtain the vocabulary to be queried and determine the vocabulary vector of the vocabulary to be queried; the third processing module 53 is used to calculate the edit distance of the vocabulary vector relative to the vector space, and determine the most similar vocabulary to the vocabulary to be queried based on the edit distance.
[0127] The present invention realizes the similarity calculation between word groups by introducing vector space in the BIM model, and introduces the edit distance for mixed weighting, so that a better comparison effect can be achieved when comparing similar words.
[0128] Based on the above embodiment, the first processing module 51 is specifically used for:
[0129] Extract any word or sentence in the BIM vocabulary set, segment the any word or sentence based on a preset word segmentation model, and obtain a first word segmentation result set; obtain the word vector of each word segmentation in the first word segmentation result set based on a pre-trained word vector model, and obtain a first word vector set; replace each word vector in the word vector set based on the pre-trained word vector model to obtain a second word vector set; combine all word vectors in the second word vector set to obtain a first comprehensive word vector, traverse the BIM vocabulary set until all first comprehensive word vectors of the BIM vocabulary set are obtained, and obtain the vector space of the BIM vocabulary set.
[0130] The step of replacing each word vector in the word vector set based on the pre-trained word vector model to obtain a second word vector set includes:
[0131] Extracting several words closest to each word vector in the pre-trained word vector model;
[0132] An average value is taken for the plurality of words, and each word vector is replaced with the average value to obtain the second word vector set.
[0133] The present invention uses a preset word segmentation model and a pre-trained word vector model to process the BIM original vocabulary to obtain the vector space of BIM, which has the characteristics of fast processing speed and high robustness of the obtained data.
[0134] Based on the above embodiment, the second processing module 52 is specifically used for:
[0135] The to-be-queried vocabulary is segmented based on a preset segmentation model to obtain a second segmentation result set; based on a pre-trained word vector model, a word vector of each segmentation in the second segmentation result set is obtained to obtain a vocabulary vector of the to-be-queried vocabulary.
[0136] The present invention adopts the same word segmentation and word vector processing algorithm for the vocabulary to be queried and the BIM original data set, so that when the edit distance is subsequently introduced to calculate the similarity between the two, they can be unified in the same vector space, which is convenient for comparison and calculation.
[0137] Based on the above embodiment, the third processing module 53 is specifically used for:
[0138] Combine all word vectors in the vocabulary vector to obtain a second comprehensive word vector; obtain real words corresponding to several vectors adjacent to the second comprehensive word vector in the vector space to obtain a real word set; perform word segmentation and deduplication on the real word set to obtain the word vector corresponding to each real word to obtain a third word vector set; calculate the edit distance between each word vector in the vocabulary vector and each word vector in the third word vector set to obtain a first similarity corresponding to the edit distance; obtain a second similarity based on the vocabulary to be queried and the real word set; perform mixed weighting on the first similarity and the second similarity to obtain a final similarity; sort the BIM vocabulary set based on the final similarity to obtain the most similar vocabulary.
[0139] The obtaining of the first similarity corresponding to the edit distance includes:
[0140] The maximum score parameter of the edit distance is calculated and an average is taken to obtain the first similarity.
[0141] The step of obtaining a second similarity based on the query vocabulary and the real vocabulary set includes:
[0142] The cosine similarity between the query vocabulary and each word vector in the real vocabulary set is calculated to obtain the second similarity.
[0143] The present invention realizes the similarity calculation between phrases by introducing vector space in BIM data processing, and introduces edit distance for mixed weighting to obtain better comparison effect.
[0144] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the BIM semantic disambiguation method, which includes: obtaining a BIM vocabulary set and establishing a vector space of the BIM vocabulary set; obtaining a vocabulary to be queried and determining a vocabulary vector of the vocabulary to be queried; calculating the edit distance of the vocabulary vector relative to the vector space, and determining the most similar vocabulary to the vocabulary to be queried according to the edit distance.
[0145] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0146] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the BIM semantic disambiguation method provided by the above methods. The method includes obtaining a BIM vocabulary set and establishing a vector space of the BIM vocabulary set; obtaining a vocabulary to be queried and determining a vocabulary vector of the vocabulary to be queried; calculating the edit distance of the vocabulary vector relative to the vector space, and determining the most similar vocabulary to the vocabulary to be queried based on the edit distance.
[0147] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the BIM semantic disambiguation method provided by the above-mentioned methods. The method includes: obtaining a BIM vocabulary set and establishing a vector space of the BIM vocabulary set; obtaining a vocabulary to be queried and determining a vocabulary vector of the vocabulary to be queried; calculating the edit distance of the vocabulary vector relative to the vector space, and determining the most similar vocabulary to the vocabulary to be queried based on the edit distance.
[0148] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0149] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A BIM semantic disambiguation method, characterized in that: include: Acquire a BIM vocabulary set and establish a vector space of the BIM vocabulary set; Obtain a word to be queried, and determine a word vector of the word to be queried; The edit distance of the vocabulary vector relative to the vector space is calculated, and the most similar vocabulary to the vocabulary to be queried is determined according to the edit distance.
2. The BIM semantic disambiguation method according to claim 1, characterized in that: The obtaining of the BIM vocabulary set and establishing the vector space of the BIM vocabulary set includes: Extract any word or sentence in the BIM vocabulary set, and segment the any word or sentence based on a preset segmentation model to obtain a first segmentation result set; Based on the pre-trained word vector model, obtain the word vector of each word in the first word segmentation result set to obtain a first word vector set; Replace each word vector in the word vector set based on the pre-trained word vector model to obtain a second word vector set; All word vectors in the second word vector set are combined to obtain a first comprehensive word vector, and the BIM vocabulary set is traversed until all first comprehensive word vectors of the BIM vocabulary set are obtained to obtain a vector space of the BIM vocabulary set.
3. The BIM semantic disambiguation method according to claim 2, characterized in that: The replacing each word vector in the word vector set based on the pre-trained word vector model to obtain a second word vector set includes: Extracting several words closest to each word vector in the pre-trained word vector model; An average value is taken for the plurality of words, and each word vector is replaced with the average value to obtain the second word vector set.
4. The BIM semantic disambiguation method according to claim 1, characterized in that: The step of obtaining a word to be queried and determining a word vector of the word to be queried includes: Segmenting the words to be queried based on a preset segmentation model to obtain a second segmentation result set; Based on the pre-trained word vector model, the word vector of each word in the second word segmentation result set is obtained to obtain the word vector of the word to be queried.
5. The BIM semantic disambiguation method according to claim 1, characterized in that: The calculating the edit distance of the vocabulary vector relative to the vector space, and determining the most similar vocabulary to the query vocabulary according to the edit distance, comprises: Combining all word vectors in the vocabulary vector to obtain a second comprehensive word vector; Acquire real words corresponding to a plurality of vectors adjacent to the second comprehensive word vector in the vector space to obtain a real word set; Perform word segmentation and deduplication on the real vocabulary set, obtain a word vector corresponding to each real vocabulary, and obtain a third word vector set; Calculating the edit distance between each word vector in the vocabulary vector and each word vector in the third word vector set, and obtaining a first similarity corresponding to the edit distance; Acquire a second similarity according to the to-be-queried vocabulary and the real vocabulary set; Perform mixed weighting on the first similarity and the second similarity to obtain a final similarity; The BIM vocabulary set is sorted based on the final similarity to obtain the most similar vocabulary.
6. The BIM semantic disambiguation method according to claim 5, characterized in that: The obtaining the first similarity corresponding to the edit distance includes: The maximum score parameter of the edit distance is calculated and an average is taken to obtain the first similarity.
7. The BIM semantic disambiguation method according to claim 5, characterized in that: The obtaining a second similarity according to the to-be-queried vocabulary and the real vocabulary set includes: The cosine similarity between the query vocabulary and each word vector in the real vocabulary set is calculated to obtain the second similarity.
8. A BIM semantic disambiguation system, characterized in that: include: A first processing module is used to obtain a BIM vocabulary set and establish a vector space of the BIM vocabulary set; A second processing module is used to obtain a word to be queried and determine a word vector of the word to be queried; The third processing module is used to calculate the edit distance of the vocabulary vector relative to the vector space, and determine the most similar vocabulary to the query vocabulary according to the edit distance.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the BIM semantic disambiguation method according to any one of claims 1 to 7 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the BIM semantic disambiguation method according to any one of claims 1 to 7 are implemented.
