A method and device for constructing a domain modeling vocabulary

Through clustering and screening of word vectors of word segmentation through clustering algorithms and effective distances, combined with automatic supplementary information, the problem of low efficiency in modeling vocabulary modeling in the existing technology is solved, and efficient and accurate vocabulary generation is achieved.

CN113761905BActive Publication Date: 2025-02-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010622894.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-01
Publication Date
2025-02-21
Estimated Expiration
2040-07-01

AI Technical Summary

Technical Problem

In the prior art, the construction of field modeling vocabulary is inefficient, word segmentation and semantic analysis rely too much on manual discussion, and English naming and word interpretation supplementation take a lot of time.

Method used

The word vectors of word segmentation are clustered and screened based on clustering algorithm and effective distances, thereby obtaining multiple clusters. The word segmentation in each cluster is used as a group of synonyms, and supplementary information is added to each group of synonyms, and the domain construction is generated. Modal vocabulary.

Benefits of technology

Minimize manual operations through automated processes, improve the efficiency of building vocabulary, avoid human interference, and ensure the accuracy and consistency of vocabulary.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113761905B_ABST
    Figure CN113761905B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for constructing a domain modeling vocabulary, and relates to the field of computer technology. A specific implementation of the method includes: performing word segmentation on a use case text used for domain modeling, and filtering out word segmentations with verbs and / or nouns from the word segmentation results, thereby obtaining an original vocabulary; converting each word segmentation in the original vocabulary into a word vector; clustering and filtering the word vectors of each word segmentation based on a clustering algorithm and an effective distance, thereby obtaining a plurality of clusters; treating the word segmentation in each cluster as a group of synonymous word groups, and adding supplementary information to each group of synonymous word groups, thereby obtaining a domain modeling vocabulary. This implementation can solve the technical problem of low efficiency in constructing a vocabulary.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for constructing a domain modeling vocabulary. Background Art

[0002] With the popularity of microservice architecture, domain-driven design (DDD) has been sought after by various companies because its domain division is naturally compatible with microservice division. They have tried to use DDD thinking to guide new application development or existing code reconstruction.

[0003] In the process of DDD, it is very important to build a unified vocabulary. Technical personnel, domain experts, product managers, project managers, business parties, etc. have different knowledge reserves and understandings of applications. A unified vocabulary can help all parties communicate requirements and problems more smoothly and reduce information loss.

[0004] At present, the commonly used method for constructing a unified vocabulary is to build a use case text based on domain modeling (including a certain functional purpose, prerequisites, input parameters, basic process, exception handling process, verification rules, etc.). First, each use case is described in detail in text, and then the entire team discusses and completes word segmentation, keyword extraction, part of speech classification, synonym integration and refinement, English name (for encoding) supplement, and word explanation supplement.

[0005] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0006] Word segmentation and semantic analysis rely too much on manual discussion, and English naming and word explanation supplementation also take up a lot of time, resulting in very low efficiency in vocabulary construction. Summary of the invention

[0007] In view of this, an embodiment of the present invention provides a method and device for constructing a domain modeling vocabulary to solve the technical problem of low efficiency in constructing a vocabulary.

[0008] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for constructing a domain modeling vocabulary is provided, comprising:

[0009] Perform word segmentation on the use case text used for domain modeling, and filter out the words with verb and / or noun parts of speech from the word segmentation results to obtain the original vocabulary;

[0010] Convert each word in the original vocabulary into a word vector;

[0011] Clustering and screening the word vectors of each of the word segments based on a clustering algorithm and an effective distance, thereby obtaining a plurality of clusters;

[0012] The words in each cluster are regarded as a group of synonymous words, and supplementary information is added to each group of synonymous words to obtain a domain modeling vocabulary.

[0013] Optionally, clustering and screening the word vectors of each word segmentation based on a clustering algorithm and an effective distance to obtain a plurality of clusters, including:

[0014] Clustering step: clustering the word vectors of each of the word segments based on a clustering algorithm to obtain multiple clusters;

[0015] Screening step: screening out the pending participles whose distance from the centroid participle is greater than the effective distance from each cluster;

[0016] The clustering step and the screening step are repeatedly performed on each of the pending segmented words until there is only one segmented word in each cluster in the clustering result.

[0017] Optionally, before clustering the word vectors of each of the word segments based on the clustering algorithm and the effective distance, the method further includes:

[0018] Using crawler programs to crawl several groups of known synonymous words in Chinese dictionaries;

[0019] Calculating the intra-group distance of each group of known synonym groups respectively;

[0020] The arithmetic mean of the intra-group distances of each group of the known synonymous words is calculated to obtain the effective distance.

[0021] Optionally, for each group of the known synonymous words, the intra-group distance of the known synonymous words is calculated using the following method:

[0022] Calculating the distance between two words in the known synonymous word group;

[0023] The arithmetic mean of the distances between the two words is calculated to obtain the intra-group distance of the known synonymous word group.

[0024] Optionally, the method adds supplementary information to each group of synonymous words to obtain a domain modeling vocabulary, including:

[0025] By calling the interface, the meaning information and translation information of each group of synonymous words are obtained;

[0026] The word meaning information and the translation information are added to each group of the synonymous words, thereby obtaining a domain modeling vocabulary.

[0027] Optionally, converting each word in the original vocabulary into a word vector includes:

[0028] The word2vec model is used to convert each word in the original vocabulary into a word vector.

[0029] Optionally, the clustering algorithm is a k-means algorithm.

[0030] In addition, according to another aspect of an embodiment of the present invention, a device for constructing a domain modeling vocabulary is provided, comprising:

[0031] The word segmentation module is used to segment the use case text used for domain modeling, and filter out the words with verb and / or noun parts of speech from the word segmentation results to obtain the original vocabulary;

[0032] A conversion module, used to convert each word in the original vocabulary into a word vector;

[0033] A clustering module, used for clustering and screening the word vectors of each of the word segments based on a clustering algorithm and an effective distance, so as to obtain a plurality of clusters;

[0034] The supplement module is used to treat the segmented words in each cluster as a group of synonymous words, and add supplementary information to each group of synonymous words, so as to obtain a domain modeling vocabulary.

[0035] Optionally, the clustering module is further used for:

[0036] Clustering step: clustering the word vectors of each of the word segments based on a clustering algorithm to obtain multiple clusters;

[0037] Screening step: screening out the pending participles whose distance from the centroid participle is greater than the effective distance from each cluster;

[0038] The clustering step and the screening step are repeatedly performed on each of the pending segmented words until there is only one segmented word in each cluster in the clustering result.

[0039] Optionally, the clustering module is further used for:

[0040] Before clustering the word vectors of each of the word segments based on the clustering algorithm and the effective distance, a crawler program is used to crawl several groups of known synonymous words in the Chinese dictionary;

[0041] Calculating the intra-group distance of each group of known synonym groups respectively;

[0042] The arithmetic mean of the intra-group distances of each group of the known synonymous words is calculated to obtain the effective distance.

[0043] Optionally, the clustering module is further used to: for each group of the known synonymous words, calculate the intra-group distance of the known synonymous words using the following method:

[0044] Calculating the distance between two words in the known synonymous word group;

[0045] The arithmetic mean of the distances between the two words is calculated to obtain the intra-group distance of the known synonymous word group.

[0046] Optionally, the supplementing module is further used to: add supplementary information to each group of synonymous words, so as to obtain a domain modeling vocabulary, including:

[0047] By calling the interface, the meaning information and translation information of each group of synonymous words are obtained;

[0048] The word meaning information and the translation information are added to each group of the synonymous words, thereby obtaining a domain modeling vocabulary.

[0049] Optionally, the conversion module is further used for:

[0050] The word2vec model is used to convert each word in the original vocabulary into a word vector.

[0051] Optionally, the clustering algorithm is a k-means algorithm.

[0052] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, including:

[0053] one or more processors;

[0054] a storage device for storing one or more programs,

[0055] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any one of the above embodiments.

[0056] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in any one of the above embodiments is implemented.

[0057] An embodiment of the above invention has the following advantages or beneficial effects: because the word vectors of each word segmentation are clustered and screened based on a clustering algorithm and an effective distance, thereby obtaining multiple clusters, the word segmentation in each cluster is used as a group of synonymous word groups, and supplementary information is added to each group of synonymous word groups, thereby obtaining a technical means of a domain modeling vocabulary, so the technical problem of low efficiency in constructing a vocabulary in the prior art is overcome. The embodiment of the present invention, through a combination of technical means such as text word segmentation, word vector conversion, and clustering, automates the process of generating a unified vocabulary using use case text in domain modeling to the maximum extent, reduces complex and repetitive manual operations, effectively improves the efficiency of constructing a vocabulary, and can also avoid interference from human factors.

[0058] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0060] Figure 1 is a schematic diagram of the main process of a method for constructing a domain modeling vocabulary according to an embodiment of the present invention;

[0061] Figure 2 is a schematic diagram of a use case text for domain modeling according to an embodiment of the present invention;

[0062] Figure 3 is a schematic diagram of a clustering result according to an embodiment of the present invention;

[0063] Figure 4 is a schematic diagram of a domain modeling vocabulary according to an embodiment of the present invention;

[0064] Figure 5 It is a schematic diagram of the main process of a method for constructing a domain modeling vocabulary according to a reference embodiment of the present invention;

[0065] Figure 6 is a schematic diagram of main modules of a device for constructing a domain modeling vocabulary according to an embodiment of the present invention;

[0066] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0067] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0068] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0069] Figure 1 FIG. 1 is a schematic diagram of the main process of the method for constructing a domain modeling vocabulary according to an embodiment of the present invention. As an embodiment of the present invention, Figure 1 As shown, the method for constructing the domain modeling vocabulary may include:

[0070] Step 101 , segment the use case text used for domain modeling, and select the segmented words whose part of speech is verb and / or noun from the segmented results, so as to obtain an original vocabulary.

[0071] First, use the word segmentation tool to segment the use case text used for domain modeling. For example, the use case text used for domain modeling can be segmented as follows: Figure 2 As shown, the participles are then classified according to their parts of speech, the participles whose parts of speech are nouns and verbs are retained, and adjectives, adverbs, etc. that have no actual business meanings are removed, thereby constructing the original vocabulary.

[0072] Commonly used word segmentation methods include string matching-based word segmentation, understanding-based word segmentation, and statistics-based word segmentation.

[0073] Word segmentation based on string matching is to match the Chinese character string to be analyzed with the entries in a "sufficiently large" machine dictionary according to a certain strategy. If a certain string is found in the dictionary, the match is successful and a word segmentation is identified. It can be divided into forward matching and reverse matching according to the scanning direction, maximum matching and minimum matching according to the priority matching string length, and simple word segmentation and word segmentation integrated with part-of-speech tagging according to whether it is combined with the part-of-speech tagging process. The advantages of string matching word segmentation are fast speed and simple implementation, but it is not effective in processing ambiguous words and words that are not in the machine dictionary.

[0074] Understanding-based word segmentation achieves the effect of word recognition by letting the computer simulate human understanding of sentences. The basic idea is to perform syntactic and semantic analysis while segmenting words to deal with ambiguous phenomena. It usually includes a word segmentation subsystem, a syntactic and semantic subsystem, and a general control part. Under the coordination of the general control part, the word segmentation subsystem can obtain semantic and syntactic information about words, sentences, etc. to deal with word segmentation ambiguity. This method requires a large amount of quantitative language knowledge and information. Due to the complexity of the Chinese language system, there is currently no mature Chinese word segmenter based on understanding.

[0075] Statistical word segmentation is to learn the word segmentation rules by using statistical machine learning, model learning and other methods given a large number of segmented texts. This process is called training. As the number of samples and the number of training times increase, more accurate word segmentation of unknown texts can be achieved. Commonly used statistical models include N-gram grammar model, hidden Markov model, maximum entropy model, etc.

[0076] Currently, the more mainstream and mature Chinese word segmentation method is based on statistics. The embodiment of the present invention also selects this type of word segmentation tool to segment the use case text. Since the unified vocabulary generated by the domain modeling process is usually verbs and nouns with clear business meanings, after the word segmentation is completed, it is necessary to filter out verbs and nouns according to the part of speech, remove adjectives and adverbs without business meanings, and put words with the same part of speech together to form the original vocabulary.

[0077] Step 102: Convert each word in the original vocabulary into a word vector.

[0078] In this step, a word vector model can be used to calculate the word vectors of each word in the original vocabulary. For example, the word vector model can be a word2vec model. Through the word2vec model, each word in the original vocabulary can be converted into a corresponding word vector. The word vector calculated for a word can be expressed as:

[0079] Word vector: VEC1 = [v 11 , v 12 …v 1n ]

[0080] The word vector model needs to be trained in advance, and the training corpus can be taken from Google News, Wikipedia, literary works, professional documents, etc. On the basis of the existing model, the error descriptions of the existing business system can be collected as expected information for retraining to further improve the accuracy of the model in identifying error information.

[0081] Step 103: clustering and screening the word vectors of each of the word segments based on a clustering algorithm and an effective distance, thereby obtaining a plurality of clusters.

[0082] After calculating the word vectors of each word in the original vocabulary, the word vectors of each word are clustered and screened based on the clustering algorithm and effective distance, so as to classify words with similar meanings and obtain a classified vocabulary divided by word meaning, which is convenient for final manual intervention to delete and integrate. It should be pointed out that the word vectors with similar meanings in the classified vocabulary will be retained by product managers, business experts, etc. according to the business scenario, and one word that best expresses the current business semantics will be retained. The ultimate goal of deletion and integration is to establish a unified vocabulary. As a reference for subsequent team communication, the vocabulary needs to be as refined and accurate as possible. If it is not deleted and integrated, multiple synonyms are prone to misleading information or information loss when communicating between teams, reducing the accuracy and efficiency of communication.

[0083] Optionally, step 103 may include: a clustering step: clustering the word vectors of each of the word segments based on a clustering algorithm to obtain multiple clusters; a screening step: screening out the pending word segments whose distance from the centroid word is greater than the effective distance from each of the clusters; and repeating the clustering step and the screening step for each of the pending word segments until there is only one word in each cluster in the clustering result.

[0084] Optionally, the clustering algorithm is a k-means algorithm. First, you need to select a k value, that is, how many categories we want to divide the data into. The choice of k value here has a great impact on the result. There are usually two selection methods: one is the elbow method, which simply means judging the best value of k based on the functional relationship between the clustering result and k; the other is determined according to specific needs. Then you need to select the initial centroid, which is generally selected randomly. Next, you need to calculate the distance from these centroids to all the word segments in the original vocabulary and divide them into the category closest to their centroids. After completion, calculate the average value for each cluster and use this point as the new centroid. Repeat these two steps until the new centroid is exactly the same as the old centroid to get the final result. The distance calculated here can be understood as the semantic similarity between the two word segments. The word vector of the word segment is required for calculation. The cosine distance formula is usually used for semantic similarity calculation:

[0085]

[0086] After clustering is completed, the segmented words that fall into a certain cluster cannot be determined to be synonyms with the centroid segmented words of the cluster. It may just be that the similarity with the centroid segmented words of the cluster is higher than the similarity with other centroid segmented words. Therefore, it is necessary to determine a valid cluster to filter the clustering results. Only the segmented words that fall into the valid distance range can be retained as synonyms of the current cluster. The segmented words that do not fall into the valid distance range need to be clustered and filtered again until there is only one segmented word in each cluster in the clustering results.

[0087] like Figure 3 As shown in the figure, assume that after the first round of clustering, all segmented words are divided into 4 categories, A, B, C, and D are the centroid segmented words of each cluster respectively. With each centroid segmented word as the center and the effective distance as the radius, a valid interval can be obtained, as shown by the four dotted circles in the figure. The segmented words that fall within the effective distance range are retained as synonyms of the centroid segmented words, such as word 1, word 3, word 5, and word 7 in the figure, and the other words (word 2, word 6, word 4, and word 8) are subjected to the next round of clustering step - screening step.

[0088] For the quantitative decision of the effective distance, the present invention obtains it based on known synonyms. Optionally, before step 103, it also includes: using a crawler program to crawl several groups of known synonym groups in the Chinese dictionary; calculating the intra-group distance of each group of the known synonym groups respectively; calculating the arithmetic mean of the intra-group distance of each group of the known synonym groups, so as to obtain the effective distance. Optionally, for each group of the known synonym groups, the intra-group distance of the known synonym groups is calculated by the following method: calculating the distance between two words in the known synonym groups; calculating the arithmetic mean of the distance between two words, so as to obtain the intra-group distance of the known synonym groups.

[0089] For example, the word2vec model can be used to convert known synonyms into word vectors, and then the similarity of each group of known synonyms is calculated pairwise, and the average value is the intra-group distance of the group.

[0090] Assuming there are m synonyms in a group of known synonyms, the intra-group distance of the group is:

[0091]

[0092] Assuming there are n groups of known synonyms, the final effective distance is the sum of the distances within each group and the average value:

[0093]

[0094] Step 104 , the segmented words in each cluster are taken as a group of synonymous word groups, and supplementary information is added to each group of synonymous word groups, so as to obtain a domain modeling vocabulary.

[0095] Optionally, supplementary information is added to each group of synonymous words to obtain a domain modeling vocabulary, including: obtaining the meaning information and translation information of each group of synonymous words by calling an interface; adding the meaning information and the translation information to each group of the synonymous words to obtain a domain modeling vocabulary.

[0096] This step is mainly to automatically supplement the meaning of the words in the classification vocabulary, such as the English translation, etc. At present, various Chinese and English dictionary query tools are relatively complete, and you can write code to directly traverse the classification vocabulary and call related interfaces for query and supplement. The English translation is to maintain the uniformity of naming in the subsequent code development process, and at the same time improve the communication efficiency between technical and non-technical personnel in the team.

[0097] According to the various embodiments described above, it can be seen that the embodiment of the present invention obtains multiple clusters by clustering and screening the word vectors of each word segmentation based on a clustering algorithm and an effective distance, and regards the word segmentation in each cluster as a group of synonymous word groups, and adds supplementary information to each group of synonymous word groups, thereby obtaining a technical means of a domain modeling vocabulary, which solves the technical problem of low efficiency in constructing a vocabulary in the prior art. The embodiment of the present invention automates the process of generating a unified vocabulary using use case text in domain modeling to the maximum extent through a combination of technical means such as text word segmentation, word vector conversion, and clustering, reduces complex and repetitive manual operations, effectively improves the efficiency of constructing a vocabulary, and can also avoid interference from human factors.

[0098] Figure 5 is a schematic diagram of the main process of a method for constructing a domain modeling vocabulary table according to a reference embodiment of the present invention. As another embodiment of the present invention, Figure 5 As shown, the method for constructing the domain modeling vocabulary may include:

[0099] Step 501, calculating the effective distance of the known synonymous word groups.

[0100] Specifically, a crawler program is used to crawl several groups of known synonymous word groups in a Chinese dictionary; the intra-group distance of each group of the known synonymous word groups is calculated respectively; and the arithmetic mean of the intra-group distance of each group of the known synonymous word groups is calculated to obtain the effective distance.

[0101] Optionally, for each group of the known synonymous word groups, the intra-group distance of the known synonymous word groups is calculated by the following method: calculating the distance between each pair of words in the known synonymous word groups; calculating the arithmetic mean of the distance between each pair of words, thereby obtaining the intra-group distance of the known synonymous word groups.

[0102] Step 502 , segment the use case text used for domain modeling, and filter out the segmented words whose part of speech is verb and / or noun from the segmented results, so as to obtain an original vocabulary.

[0103] Step 503: Use the word2vec model to convert each word in the original vocabulary into a word vector.

[0104] Step 504: cluster the word vectors of each of the word segments based on a clustering algorithm to obtain a plurality of clusters.

[0105] Step 505 , determining whether there is only one word segment in each cluster in the clustering result; if so, executing step 507 ; if not, executing step 506 .

[0106] Step 506: Filter out the pending segmentations whose distances from the centroid segmentation are greater than the effective distance from each of the clusters.

[0107] Step 507, obtaining the meaning information and translation information of each group of synonymous words by calling the interface.

[0108] Step 508: adding the word meaning information and the translation information to each group of the synonymous words, thereby obtaining a domain modeling vocabulary.

[0109] In addition, the specific implementation content of the method for constructing a domain modeling vocabulary in a reference embodiment of the present invention has been described in detail in the method for constructing a domain modeling vocabulary described above, so the repeated content will not be described here.

[0110] Figure 6 is a schematic diagram of the main modules of the device for constructing a domain modeling vocabulary according to an embodiment of the present invention, such as Figure 6 As shown, the construction device 600 of the domain modeling vocabulary includes a segmentation module 601, a conversion module 602, a clustering module 603 and a supplementing module 604; wherein the segmentation module 601 is used to segment the use case text used for domain modeling, and filter out the segmentations with verbs and / or nouns from the segmentation results, so as to obtain the original vocabulary; the conversion module 602 is used to convert each segmentation in the original vocabulary into a word vector; the clustering module 603 is used to cluster and filter the word vectors of each segmentation based on a clustering algorithm and an effective distance, so as to obtain a plurality of clusters; the supplementing module 604 is used to treat the segmentations in each cluster as a group of synonymous word groups, and add supplementary information to each group of synonymous word groups, so as to obtain the domain modeling vocabulary.

[0111] Optionally, the clustering module 603 is further used for:

[0112] Clustering step: clustering the word vectors of each of the word segments based on a clustering algorithm to obtain multiple clusters;

[0113] Screening step: screening out the pending participles whose distance from the centroid participle is greater than the effective distance from each cluster;

[0114] The clustering step and the screening step are repeatedly performed on each of the pending segmented words until there is only one segmented word in each cluster in the clustering result.

[0115] Optionally, the clustering module 603 is further used for:

[0116] Before clustering the word vectors of each of the word segments based on the clustering algorithm and the effective distance, a crawler program is used to crawl several groups of known synonymous words in the Chinese dictionary;

[0117] Calculating the intra-group distance of each group of known synonym groups respectively;

[0118] The arithmetic mean of the intra-group distances of each group of the known synonymous words is calculated to obtain the effective distance.

[0119] Optionally, the clustering module 603 is further configured to: for each group of the known synonymous words, calculate the intra-group distance of the known synonymous words by using the following method:

[0120] Calculating the distance between two words in the known synonymous word group;

[0121] The arithmetic mean of the distances between the two words is calculated to obtain the intra-group distance of the known synonymous word group.

[0122] Optionally, the supplementing module 604 is further used to add supplementary information to each group of synonymous words, thereby obtaining a domain modeling vocabulary, including:

[0123] By calling the interface, the meaning information and translation information of each group of synonymous words are obtained;

[0124] The word meaning information and the translation information are added to each group of the synonymous words, thereby obtaining a domain modeling vocabulary.

[0125] Optionally, the conversion module 602 is further used for:

[0126] The word2vec model is used to convert each word in the original vocabulary into a word vector.

[0127] Optionally, the clustering algorithm is a k-means algorithm.

[0128] According to the various embodiments described above, it can be seen that the embodiment of the present invention obtains multiple clusters by clustering and screening the word vectors of each word segmentation based on a clustering algorithm and an effective distance, and regards the word segmentation in each cluster as a group of synonymous word groups, and adds supplementary information to each group of synonymous word groups, thereby obtaining a technical means of a domain modeling vocabulary, which solves the technical problem of low efficiency in constructing a vocabulary in the prior art. The embodiment of the present invention automates the process of generating a unified vocabulary using use case text in domain modeling to the maximum extent through a combination of technical means such as text word segmentation, word vector conversion, and clustering, reduces complex and repetitive manual operations, effectively improves the efficiency of constructing a vocabulary, and can also avoid interference from human factors.

[0129] It should be noted that the specific implementation content of the device for constructing the domain modeling vocabulary described in the present invention has been described in detail in the method for constructing the domain modeling vocabulary described above, so the repeated content will not be described again here.

[0130] Figure 7An exemplary system architecture 700 is shown to which the method for constructing a domain modeling vocabulary or the apparatus for constructing a domain modeling vocabulary according to the embodiments of the present invention can be applied.

[0131] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0132] Users can use terminal devices 701, 702, and 703 to interact with server 705 through network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

[0133] The terminal devices 701 , 702 , and 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0134] The server 705 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 701, 702, and 703. The backend management server may analyze and process the received data such as the item information query request, and feed back the processing results (such as target push information, item information - only an example) to the terminal device.

[0135] It should be noted that the method for constructing the domain modeling vocabulary provided in the embodiment of the present invention is generally executed by the server 705, and accordingly, the device for constructing the domain modeling vocabulary is generally set in the server 705. The method for constructing the domain modeling vocabulary provided in the embodiment of the present invention can also be executed by the terminal devices 701, 702, and 703, and accordingly, the device for constructing the domain modeling vocabulary can be set in the terminal devices 701, 702, and 703.

[0136] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0137] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device suitable for implementing an embodiment of the present invention. Figure 8The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0138] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0139] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.

[0140] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.

[0141] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0142] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0143] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a word segmentation module, a conversion module, a clustering module and a supplementary module, wherein the names of these modules do not constitute a limitation on the modules themselves in some cases.

[0144] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device implements the following method: segmenting the use case text used for domain modeling, filtering out the segmentation words with verb and / or noun parts of speech from the segmentation results, thereby obtaining an original vocabulary; converting each segmentation word in the original vocabulary into a word vector; clustering and filtering the word vectors of each segmentation word based on a clustering algorithm and an effective distance, thereby obtaining multiple clusters; treating the segmentation words in each cluster as a group of synonymous word groups, and adding supplementary information to each group of synonymous word groups, thereby obtaining a domain modeling vocabulary.

[0145] According to the technical solution of the embodiment of the present invention, the word vectors of each word segmentation are clustered and screened based on a clustering algorithm and an effective distance to obtain multiple clusters, and the word segmentation in each cluster is used as a group of synonymous word groups, and supplementary information is added to each group of synonymous word groups to obtain a technical means of domain modeling vocabulary, so the technical problem of low efficiency in constructing vocabulary in the prior art is overcome. The embodiment of the present invention, through a combination of technical means such as text word segmentation, word vector conversion, and clustering, automates the process of generating a unified vocabulary using use case text in domain modeling to the maximum extent, reduces complex and repetitive manual operations, effectively improves the efficiency of constructing vocabulary, and can also avoid interference from human factors.

[0146] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for constructing a domain modeling vocabulary, characterized in that: include: Perform word segmentation on the use case text used for domain modeling, and filter out the words with verb and / or noun parts of speech from the word segmentation results to obtain the original vocabulary; Convert each word in the original vocabulary into a word vector; Clustering and screening the word vectors of each of the word segments based on a clustering algorithm and an effective distance, thereby obtaining a plurality of clusters; The segmented words in each cluster are regarded as a group of synonymous word groups, and the meaning information and translation information of each group of synonymous word groups are obtained by calling an interface, and the meaning information and translation information are added to each group of the synonymous word groups, so as to obtain a domain modeling vocabulary; The word vectors of each word segment are clustered and screened based on the clustering algorithm and the effective distance, thereby obtaining multiple clusters, including: Clustering step: clustering the word vectors of each of the word segments based on a clustering algorithm to obtain multiple clusters; Screening step: screening out the pending participles whose distance from the centroid participle is greater than the effective distance from each cluster; The clustering step and the screening step are repeatedly performed on each of the pending segmented words until there is only one segmented word in each cluster in the clustering result.

2. The method according to claim 1, characterized in that Before clustering the word vectors of each of the word segments based on the clustering algorithm and the effective distance, the method further includes: Using crawler programs to crawl several groups of known synonymous words in Chinese dictionaries; Calculating the intra-group distance of each group of known synonym groups respectively; The arithmetic mean of the intra-group distances of each group of the known synonymous words is calculated to obtain the effective distance.

3. The method according to claim 2, characterized in that For each group of the known synonymous words, the intra-group distance of the known synonymous words is calculated using the following method: Calculating the distance between two words in the known synonymous word group; The arithmetic mean of the distances between the two words is calculated to obtain the intra-group distance of the known synonymous word group.

4. The method according to claim 1, characterized in that: The step of converting each word in the original vocabulary into a word vector comprises: The word2vec model is used to convert each word in the original vocabulary into a word vector.

5. The method according to claim 1, characterized in that The clustering algorithm is the k-means algorithm.

6. A device for constructing a domain modeling vocabulary, characterized in that: include: The word segmentation module is used to segment the use case text used for domain modeling, and filter out the words with verb and / or noun parts of speech from the word segmentation results to obtain the original vocabulary; A conversion module, used to convert each word in the original vocabulary into a word vector; A clustering module, used for clustering and screening the word vectors of each of the word segments based on a clustering algorithm and an effective distance, so as to obtain a plurality of clusters; A supplementing module is used to take the segmented words in each cluster as a group of synonymous word groups, obtain the meaning information and translation information of each group of synonymous word groups by calling the interface, and add the meaning information and translation information to each group of the synonymous word groups, so as to obtain a domain modeling vocabulary; The clustering module is also used to: Clustering step: clustering the word vectors of each of the word segments based on a clustering algorithm to obtain multiple clusters; Screening step: screening out the pending participles whose distance from the centroid participle is greater than the effective distance from each cluster; The clustering step and the screening step are repeatedly performed on each of the pending segmented words until there is only one segmented word in each cluster in the clustering result.

7. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Synonym mining method and apparatus

    CN106649783A

  • Word bank construction method for a telecom customer service vertical field

    CN111353050A