Word meaning recognition method, device and equipment and computer storage medium
By obtaining the target synonyms of polysemy words in the corpus database and constructing feature vectors, combined with word frequency influence for identification, the problem of inaccurate polysemy word recognition in the existing technology is solved, and the recognition accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202311524495.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-15
- Publication Date
- 2024-10-18
AI Technical Summary
Existing natural language recognition technology has the problem of inaccurate recognition when identifying polysemy words. Especially when the corpus data quality is poor, word meanings cannot be accurately identified.
By obtaining the target synonyms of polysemy words in the corpus database, constructing their feature vectors, and determining the word frequency influence in the sentence to be recognized, determining the meaning of the word to be recognized according to preset conditions, using the corpus database to introduce authoritative data sources, based on the high similarity between words Construct target synonyms and feature vectors, and combine the influence of word frequency to accurately classify and identify polysemy words.
It improves the accuracy and efficiency of word meaning recognition, reduces manual classification, and improves the accuracy of corpus recognition.
Smart Images

Figure CN118798202A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of language recognition, and in particular relates to a word meaning recognition method, device, equipment and computer storage medium. Background Art
[0002] Natural language processing is the use of computers to process, understand, and use human languages (such as Chinese, English, Japanese, etc.). It is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics, also known as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and paragraph understanding. From an application perspective, natural language processing has broad application prospects. Especially in the information age, the application of natural language processing is all-encompassing. China Mobile is also actively deploying in the field of artificial intelligence, building Jiutian artificial intelligence as the core engine of integration intelligence, and a deep learning platform built around the Jiutian platform to enable various application scenarios.
[0003] Most existing natural language recognition technologies use machine learning algorithms to train data in the corpus to form a model, and then accurately identify polysemous words based on the formed model. However, this method is highly dependent on existing corpus data. If the data quality of the corpus is very high, the recognition of word meanings will be relatively accurate. If the corpus data quality is poor, the recognition of word meanings will be very inaccurate. For example, the corpus data samples are insufficient. The word "apple" in the corpus data only has corpus about the meaning of fruit, and no corpus about the meaning of mobile phone. The model trained based on such data samples cannot recognize other meanings such as mobile phone and movie at all, and there is a problem of inaccurate word meaning recognition. Summary of the invention
[0004] The embodiments of the present application provide a word sense recognition method, device, equipment and computer storage medium to solve the problem of inaccurate word sense recognition in existing word sense recognition methods.
[0005] In a first aspect, an embodiment of the present application provides a word meaning recognition method, comprising:
[0006] In a corpus database, a target synonym corresponding to the meaning of a first content word is obtained, wherein the first content word is a polysemous word;
[0007] Obtaining multiple sentences containing the target synonyms;
[0008] Determining a feature vector corresponding to the word meaning of the first content word in the plurality of sentences, wherein the feature vector is used to represent a word meaning feature of the word meaning;
[0009] Determining the word frequency influence of each second content word in the sentence to be recognized in the vector file, the sentence to be recognized includes the first content word, the sentence to be recognized includes the content word to be recognized, and the vector file includes the feature vector;
[0010] The word meaning corresponding to the target feature vector whose word frequency influence satisfies the preset first condition is determined as the target word meaning of the content word to be recognized.
[0011] In a second aspect, an embodiment of the present application provides a word meaning recognition device, the device comprising:
[0012] A first acquisition module is used to acquire a target synonym corresponding to the meaning of a first content word in a corpus database, wherein the first content word is a polysemous word;
[0013] A second acquisition module, used for acquiring a plurality of sentences containing the target synonyms;
[0014] A first determination module is used to determine a feature vector corresponding to the meaning of the first content word in the plurality of sentences, wherein the feature vector is used to represent a semantic feature of the meaning of the word;
[0015] A second determination module is used to determine the word frequency influence of each second content word in the sentence to be recognized in the vector file, the sentence to be recognized includes the first content word, the sentence to be recognized includes the content word to be recognized, and the vector file includes the feature vector;
[0016] The third determination module is used to determine the word meaning corresponding to the target feature vector whose word frequency influence satisfies the preset first condition as the target word meaning of the content word to be identified.
[0017] In a third aspect, an embodiment of the present application provides a terminal device, the device comprising: a processor and a memory storing computer program instructions;
[0018] When the processor executes the computer program instructions, the word meaning recognition method of the first aspect is implemented.
[0019] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the word meaning recognition method of the first aspect is implemented.
[0020] In a fifth aspect, an embodiment of the present application provides a computer program product, characterized in that when instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the word meaning recognition method as in the first aspect.
[0021] The word meaning recognition method, device, equipment and computer storage medium of the embodiment of the present invention obtains a target synonym corresponding to the meaning of a first content word in a corpus database, wherein the first content word is a polysemous word; obtains a feature vector corresponding to the target synonym, wherein the feature vector is used to represent the word meaning feature of the target synonym; determines the word frequency influence of each second content word in a sentence to be recognized in a vector file, wherein the sentence to be recognized includes the first content word, the sentence to be recognized includes the content word to be recognized, and the vector file includes the feature vector; determines the word meaning corresponding to the target feature vector whose word frequency influence satisfies a preset first condition as the target word meaning of the content word to be recognized. Through the above steps, an authoritative data source can be introduced through a corpus database, and target synonyms and feature vectors corresponding to the target synonyms can be constructed based on high similarity between words, thereby solving the problem of low recognition accuracy due to low quality of corpus data. At the same time, the method of accurately classifying and identifying polysemous words through word frequency influence calculates the word frequency influence of the context words of the polysemous words to be identified and each polysemous word feature vector, and divides the content words to be identified into word meaning categories with large word frequency influence. This can reduce manual classification and greatly improve the efficiency and accuracy of corpus recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0023] Figure 1 It is a flowchart of a word meaning recognition method provided in an embodiment of the present application;
[0024] Figure 2 It is a schematic diagram of the overall process of the word meaning recognition method provided in the embodiment of the present application;
[0025] Figure 3 is a structural diagram of a word meaning recognition device provided in an embodiment of the present application;
[0026] Figure 4 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0028] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0029] In order to solve the problems in the prior art, the embodiments of the present application provide a word meaning recognition method, device, equipment and computer storage medium. The following first describes an example of the word meaning recognition method provided by the embodiments of the present application.
[0030] Figure 1 FIG. 1 is a flow chart of a word meaning recognition method provided by an embodiment of the present application. Figure 1 As shown, the method includes:
[0031] Step 101, obtaining a target synonym corresponding to the meaning of a first content word in a corpus database, wherein the first content word is a polysemous word;
[0032] Step 102, obtaining multiple sentences containing the target synonyms;
[0033] Step 103, determining a feature vector corresponding to the meaning of the first content word in the plurality of sentences, wherein the feature vector is used to represent a semantic feature of the meaning of the word;
[0034] Step 104, determining the word frequency influence of each second content word in the sentence to be recognized in the vector file, the sentence to be recognized includes the first content word, the sentence to be recognized includes the content word to be recognized, and the vector file includes the feature vector;
[0035] Step 105 , determining the word meaning corresponding to the target feature vector whose word frequency influence satisfies the preset first condition as the target word meaning of the content word to be recognized.
[0036] In step 101, a target synonym corresponding to the meaning of a first content word is obtained from a corpus database, where the first content word is a polysemous word;
[0037] The above-mentioned corpus database may be an external authoritative data source, for example, core news websites such as People's Daily Online, Baidu Encyclopedia, and Sina. The first content word may also be obtained from the corpus database.
[0038] Specifically, in one embodiment, before step 101, the method further includes:
[0039] Collecting corpus data from the corpus database;
[0040] Performing word segmentation processing on the corpus data to obtain a first content word;
[0041] Vectorize the first content word to obtain a word vector of the first content word;
[0042] Correspondingly, the step of acquiring a target synonym corresponding to the meaning of the first content word includes:
[0043] Based on the word vector, a target synonym corresponding to the meaning of the first content word is obtained.
[0044] In this implementation, the corpus data may be crawled from core news websites such as People's Daily Online, Baidu Encyclopedia, and Sina, for example, sentences in articles.
[0045] After obtaining the corpus data, the corpus data is segmented. Specifically, segmentation tools such as jieba, snowNLP, and thulac can be used to segment the corpus data. After removing the function words, each word is separated by a "space" to form the first content word.
[0046] Each first real word can be vectorized using the word2vec open source framework CBOW model or Skip-gram model. For example, assuming that any word can be represented by a w-dimensional vector, then any word can be represented as (a1, a2..., a w ), it should be noted that the distance between any two word vectors can represent the similarity between words. The closer the distance, the higher the similarity between words and the greater the probability of words being synonyms.
[0047] Thus, the target synonym corresponding to the meaning of the first content word can be searched in the corpus database through the word vector of the first content word. For details, please refer to the following embodiments of the present application.
[0048] In one embodiment, the step of obtaining a target synonym corresponding to the meaning of the first content word includes:
[0049] Acquire the word meaning corresponding to the first content word in the corpus database;
[0050] Searching the corpus database for a plurality of first synonyms corresponding to the word meaning;
[0051] Calculating the cosine similarity between the first content word and the plurality of first synonyms;
[0052] Among the plurality of first synonyms, the words whose cosine similarity satisfies a preset second condition are determined as target synonyms corresponding to the word meaning.
[0053] In this embodiment, the meaning of the first content word can be obtained through Baidu Encyclopedia. For example, the first content word is "apple", and the two meanings of "fruit" and "mobile phone" can be obtained through Baidu Encyclopedia. Then, based on the meaning, the first synonym corresponding to the meaning can be found. For example, the first synonym corresponding to "fruit" can be "orange", "banana", etc.; the first synonym corresponding to "mobile phone" can be "Xiaomi", "Huawei", etc. It should be noted that the first content word can represent words and sentences on the entire network.
[0054] In order to improve the accuracy of the first synonym found, after the first synonym is found, a cosine similarity calculation method is used to screen out a target synonym from the first synonym. The target synonym may be a first synonym whose similarity is within 100.
[0055] Before calculating the cosine similarity between the first content word and the plurality of first synonyms, the first content word and the first synonym may be vectorized and then the cosine similarity may be calculated, wherein the cosine similarity may be calculated using the following expression:
[0056]
[0057] Among them, a i is the word vector of the first content word, b i is the word vector of the first synonym, and m is the number of first synonyms.
[0058] The closer the cosine similarity is to 1, the higher the similarity with the first content word. Preferably, words within 100 can be taken as target synonyms, and the number of first synonyms can be 120 or 150, etc., which is not limited in this embodiment.
[0059] The searched word meanings and target synonyms can be represented by Table 1, taking "apple" as an example:
[0060]
[0061] Table 1
[0062] The polysemous words in Table 1 are the first content words, the semantic words are the meanings corresponding to the first content words, and the top 100 words with high similarity are the target synonyms corresponding to the meanings.
[0063] After obtaining the target synonyms, an "apple_fruit.txt" file, an "apple_mobile phone.txt" file, etc. can be generated based on the target synonyms to form a final synonym list.
[0064] In step 102, a plurality of sentences containing the target synonyms are obtained;
[0065] In this embodiment, multiple sentences containing the target synonyms can be obtained through a corpus database, or multiple sentences can be obtained through a database other than the corpus database. In one example, the multiple sentences can be sentences such as "I like to eat oranges" or "I like to use Huawei phones".
[0066] In addition, sentences containing words such as "orange" and "peach" can be put into the "apple fruit_corpus.txt" file, so that the different meanings of each first content word will form files such as "Apple mobile phone_corpus.txt" and "Apple movie_corpus.txt".
[0067] In step 103, a feature vector corresponding to the meaning of the first content word is determined in the plurality of sentences, wherein the feature vector is used to represent the meaning feature of the meaning of the word.
[0068] In one embodiment, step 103 includes:
[0069] Calculating the relevance between each third content word in the plurality of sentences and the first content word;
[0070] In each of the third content words, the content word whose association degree satisfies the preset third condition is determined as the feature vector of the meaning of the first content word.
[0071] The third content word mentioned above is a content word obtained after word segmentation processing is performed on multiple sentences. For example, the above-mentioned "apple fruit_corpus.txt" file is subjected to word segmentation processing, and the file includes sentences such as "I like to eat oranges". After word segmentation processing, the third content word obtained includes words such as "I", "like", "eat", and "oranges". In this way, the correlation between the above-mentioned words and the first content word, that is, "apple", is calculated, and the content word with the largest correlation is determined as the feature vector of the first content word. Among them, the number of feature vectors can be multiple. Preferably, in this embodiment, the number of features can be selected as 1000.
[0072] Therefore, from this perspective, the more times words closely related to "apple" appear in the content words to be recognized, the greater the probability that the word is recognized as fruit, which can improve the recognition accuracy.
[0073] In step 104, the frequency influence of each second content word in the sentence to be recognized in the vector file is determined;
[0074] In this embodiment, the sentence to be recognized includes content words to be recognized, and the vector file includes the feature vector; wherein the number of vector files corresponds one-to-one to the number of word senses, that is, each word sense of the first content word corresponds to multiple feature vectors, and each type of feature vector is stored in the form of a vector file.
[0075] The above-mentioned sentences to be recognized are sentences including content words to be recognized, for example, "I like to eat apples, apples are very sweet" is a sentence to be recognized, in which "apple" is a content word to be recognized. It is necessary to accurately recognize the specific meaning of "apple" in the sentence.
[0076] The second content words mentioned above are content words obtained by performing word segmentation processing on the sentence to be recognized and removing the content words to be recognized. For example, the second content words obtained by performing word segmentation processing on the sentence to be recognized and removing words other than function words include: "I", "like", "eat", and "sweet". The frequency influence of each second content word in the vector file is calculated respectively.
[0077] In step 105, the word meaning corresponding to the target feature vector whose word frequency influence satisfies a preset first condition is determined as the target word meaning of the content word to be recognized.
[0078] In this embodiment, since each word sense has a corresponding feature vector, the feature vector with the greatest frequency influence on the content word to be identified can be determined as the target feature vector, and then the content word to be identified can be classified into the target word sense corresponding to the target feature vector.
[0079] In this embodiment, by obtaining a target synonym corresponding to the meaning of a first content word in a corpus database, the first content word is a polysemous word; obtaining a feature vector corresponding to the target synonym, the feature vector is used to represent the semantic features of the target synonym; determining the frequency influence of each second content word in the sentence to be recognized in the vector file, the sentence to be recognized includes the first content word, the sentence to be recognized includes the content word to be recognized, and the vector file includes the feature vector; the meaning corresponding to the target feature vector whose frequency influence satisfies the preset first condition is determined as the target meaning of the content word to be recognized. Through the above steps, it is possible to introduce an authoritative data source through a corpus database, construct a target synonym and a feature vector corresponding to the target synonym based on the high similarity between words, and solve the problem of low recognition accuracy caused by low corpus data quality. At the same time, the method of accurately classifying and identifying polysemous words through the frequency influence calculates the frequency influence of the context content word of the polysemous word to be recognized and each polysemous word feature vector, and divides the content word to be recognized into the meaning classification with large frequency influence, which can reduce manual classification and greatly improve the efficiency and accuracy of corpus recognition.
[0080] In one embodiment of the present application, the calculating the relevance between each third content word and the first content word in the plurality of sentences includes:
[0081] Perform word segmentation on the plurality of sentences to obtain a plurality of third content words;
[0082] Determine a target sentence from the plurality of sentences, the target sentence being a sentence including the first content word and a fourth content word, the fourth content word being any content word among the plurality of third content words;
[0083] Acquire a first quantity of the target sentence, a second quantity of the first content word in the target sentence, a third quantity of the fourth content word in the target sentence, and a fourth quantity of the third content word;
[0084] Calculation is performed based on the first number, the second number, the third number, and the fourth number to determine a mutual performance verification index between each of the third content words and the first content word, wherein the mutual performance verification index represents a correlation between each of the third content words and the first content word.
[0085] In this embodiment, multiple sentences can be segmented using segmentation tools such as jieba, snowNLP, and thulac to obtain multiple third content words. For example, "I like to eat apples, and apples are sweet" in the above embodiment can be segmented to obtain words such as "I", "like", "eat", and "sweet".
[0086] It should be noted that since sentences corresponding to different word meanings will form different corpus files, i.e., the files "apple fruit_corpus.txt", "apple phone_corpus.txt", "apple movie_corpus.txt" and so on in the above embodiment, the above corpus files can be directly segmented to obtain the third content word.
[0087] The fourth content word mentioned above refers to any content word among the multiple third content words, such as "I" or "like" or "eat" or "sweet"; the target sentence refers to the sentence in which the first content word and the fourth content word appear at the same time. For example, if a sentence contains "apple" and "like" at the same time, it can be determined as the target sentence, in which the fourth content word is "like". Correspondingly, among the multiple sentences, the sentences containing "apple" and "like" are all target sentences.
[0088] The first quantity is represented by the number of times the first content word and the fourth content word appear simultaneously in multiple sentences, the second quantity is represented by the number of times the first content word appears, the third quantity is represented by the number of times the fourth content word appears, and the fourth quantity is represented by the total number of the third content words.
[0089] Among them, the performance mutual verification index PMI(w1,w2) is calculated by the following expression
[0090]
[0091] Among them, f(w1,w2) represents the first quantity, f w1 is the second quantity, f w2 is the third quantity, and N is the fourth quantity. The larger the value of the mutual performance verification index is, the higher the correlation between the two words is.
[0092] In this embodiment, by calculating the energy efficiency mutual verification index between the third content word and the fourth content word, the degree of association between the two words can be determined, thereby improving the accuracy of word meaning recognition.
[0093] In one embodiment of the present application, determining the word frequency influence of each second content word in the sentence to be recognized in the vector file includes:
[0094] Performing word segmentation processing on the sentence to be recognized to obtain a plurality of second content words except the first content word;
[0095] Obtaining an occurrence frequency and an inverse file frequency of each second content word in the plurality of second content words in the vector file, wherein the inverse file frequency indicates a degree of difference in the number of occurrences of the second content word in the plurality of vector files;
[0096] The word frequency influence of each second content word in the vector file is determined based on the occurrence frequency and the inverse file frequency.
[0097] In this embodiment, the sentence to be recognized contains content words to be recognized, which are polysemous words and need to be accurately recognized in terms of meaning. The sentence to be recognized is segmented to obtain multiple second content words in addition to the first content word, where the content word to be recognized is the first content word. For example, the sentence to be recognized is "I like to eat apples, and apples are sweet", where "apple" is the content word to be recognized, and accordingly, apple is also the first content word. "I", "like", "eat", and "sweet" are the second content words.
[0098] The occurrence frequency and the reverse file frequency of the second content word in the vector file are obtained in sequence, for example, the occurrence frequency and the reverse file frequency of "I", "like", "eat", and "sweet" in the vector file are obtained in sequence.
[0099] The above-mentioned frequency of occurrence can be determined by the quotient of the number of times each second content word appears in the vector file and the total number of feature vectors included in the vector file. Specifically, the frequency of occurrence tf w It can be calculated by the following expression
[0100]
[0101] Among them, n w is the number of times the second content word appears in the vector file, n tota l is the total number of feature vectors contained in the vector file.
[0102] The above-mentioned inverse file frequency can be determined by the total number of vector files and the number of vector files containing the second implementation. Specifically, the inverse file frequency idf is calculated by the following expression:
[0103]
[0104] Where D is the total number of vector files, D w is the number of vector files including the second content word.
[0105] For example, to calculate the inverse file frequency of "like", the number of vector files containing "like" and the total number of vector files are obtained, and then the calculation is performed using the above expression.
[0106] It should be noted that the inverse document frequency (IDF) is: the more times a certain word to be classified appears in a certain classification feature vector file, and the fewer times it appears in other feature vector files, the larger the IDF is, which means that the term has a good ability to distinguish categories.
[0107] In one embodiment, determining the word frequency influence of each second content word in the vector file based on the occurrence frequency and the inverse file frequency includes:
[0108] Determine the first influence of each second content word in the vector file by multiplying the occurrence frequency by the inverse file frequency;
[0109] Based on the first influence, the word frequency influence of each second content word in the vector file is determined.
[0110] The first influential factor tf-idf can be calculated by the following expression:
[0111] tf-idf=tf*idf
[0112] Among them, tf represents the frequency of occurrence and idf represents the inverse document frequency.
[0113] In this embodiment, the influence of each word "I", "like", "eat", and "sweet" is calculated in turn, the average influence of all words is calculated, and the words to be classified are divided into categories with large average word frequency influence. Through this automatic classification, manual classification can be reduced, which can greatly improve the efficiency and accuracy of corpus recognition.
[0114] In one embodiment, if Figure 2 As shown, this embodiment provides an overall process of a word meaning recognition method, including:
[0115] 1. Corpus data collection, i.e. collecting corpus data from the corpus database;
[0116] 2. Use Jieba to segment the article, perform segmentation on the corpus data, and obtain the first content word;
[0117] 3. Form a word vector for each word, that is, vectorize the first content word to obtain the word vector of the first content word;
[0118] 4. Complete the synonym list of each meaning of the polysemous word, that is, obtain the target synonym corresponding to the meaning of the first content word in the corpus database;
[0119] 5. Calculate the feature vector of each word meaning and polysemous word of each word, that is, determine the feature vector corresponding to the meaning of the first content word in the plurality of sentences;
[0120] 6. Input a sentence corpus of a polysemous word, and classify the polysemous word corpus through the recognition model, that is, determine the word frequency influence of each second content word in the sentence to be recognized in the vector file, the sentence to be recognized includes the first content word, the sentence to be recognized includes the content word to be recognized, and the vector file includes the feature vector; determine the word meaning corresponding to the target feature vector whose word frequency influence satisfies the preset first condition as the target word meaning of the content word to be recognized;
[0121] 7. Re-form the word vector of each word according to step 1 and identify the word.
[0122] like Figure 3 As shown, the embodiment of the present application further provides a word meaning recognition device 400, which is applied to an electronic device. The word meaning recognition device 400 includes:
[0123] A first acquisition module 401 is used to acquire a target synonym corresponding to the meaning of a first content word in a corpus database, wherein the first content word is a polysemous word;
[0124] A second acquisition module 402 is used to acquire multiple sentences containing the target synonyms;
[0125] A first determination module 403 is used to determine a feature vector corresponding to the meaning of the first content word in the plurality of sentences, wherein the feature vector is used to represent a semantic feature of the meaning of the word;
[0126] A second determination module 404 is used to determine the word frequency influence of each second content word in the sentence to be recognized in the vector file, the sentence to be recognized includes the first content word, the sentence to be recognized includes the content word to be recognized, and the vector file includes the feature vector;
[0127] The third determination module 405 is used to determine the word meaning corresponding to the target feature vector whose word frequency influence satisfies the preset first condition as the target word meaning of the content word to be identified.
[0128] Optionally, the first acquisition module 401 includes:
[0129] A first acquisition submodule, used to acquire the meaning corresponding to the first content word in the corpus database;
[0130] A search submodule, used for searching in the corpus database for a plurality of first synonyms corresponding to the word meaning;
[0131] A first calculation submodule, configured to calculate the cosine similarity between the first content word and the plurality of first synonyms;
[0132] The first determination submodule is used to determine, among the plurality of first synonyms, a word whose cosine similarity satisfies a preset second condition as a target synonym corresponding to the word meaning.
[0133] Optionally, the first determining module 403 includes:
[0134] A second calculation submodule, configured to calculate the relevance between each third content word in the plurality of sentences and the first content word;
[0135] The second determination submodule is used to determine, among each of the third content words, a content word whose association degree satisfies a preset third condition as a feature vector of the meaning of the first content word.
[0136] Optionally, the second computing submodule includes:
[0137] A first processing unit is used to perform word segmentation processing on the plurality of sentences to obtain a plurality of third content words;
[0138] A first determining unit is used to determine a target sentence from the plurality of sentences, wherein the target sentence is a sentence including the first content word and a fourth content word, and the fourth content word is any content word among the plurality of third content words;
[0139] A first acquiring unit, configured to acquire a first quantity of the target sentence, a second quantity of the first content word in the target sentence, a third quantity of the fourth content word in the target sentence, and a fourth quantity of the third content word;
[0140] The second determination unit is used to calculate based on the first number, the second number, the third number and the fourth number to determine the effectiveness mutual verification index between each third noun and the first noun, and the effectiveness mutual verification index represents the correlation between each third noun and the first noun.
[0141] Optionally, the second determining module 404 further includes:
[0142] A processing submodule, configured to perform word segmentation processing on the sentence to be recognized to obtain a plurality of second content words in addition to the first content word;
[0143] A second acquisition submodule, configured to acquire an occurrence frequency and an inverse file frequency of each of the plurality of second content words in the vector file, wherein the inverse file frequency indicates a degree of difference in the number of occurrences of the second content word in the plurality of vector files;
[0144] The third determination submodule is used to determine the word frequency influence of each second content word in the vector file based on the occurrence frequency and the reverse file frequency.
[0145] Optionally, the third determining submodule further includes:
[0146] A third determining unit, configured to determine a first influence of each second content word in the vector file by multiplying the occurrence frequency by the reverse file frequency;
[0147] The fourth determining unit is used to determine the word frequency influence of each second content word in the vector file based on the first influence.
[0148] Optionally, the word meaning recognition device 400 further includes:
[0149] A collection module, used for collecting corpus data from the corpus database;
[0150] A first processing module, used for performing word segmentation processing on the corpus data to obtain a first content word;
[0151] A second processing module, configured to vectorize the first content word to obtain a word vector of the first content word;
[0152] The first acquisition module 401 is specifically used for:
[0153] Based on the word vector, a target synonym corresponding to the meaning of the first content word is obtained.
[0154] It should be noted that the word meaning recognition device 400 is a device corresponding to the above-mentioned word meaning recognition method. All implementation methods in the above-mentioned method embodiment are applicable to the embodiment of the device and can achieve the same technical effect.
[0155] Figure 4 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application is shown.
[0156] The terminal device may include a processor 501 and a memory 502 storing computer program instructions.
[0157] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0158] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 502 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 502 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 502 is a non-volatile solid-state memory.
[0159] In certain embodiments, the memory 502 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0160] The processor 501 implements any one of the word meaning recognition methods in the above embodiments by reading and executing computer program instructions stored in the memory 502 .
[0161] In one example, the terminal device may further include a communication interface 503 and a bus 510. Figure 4 As shown, the processor 501, the memory 502, and the communication interface 503 are connected via a bus 510 and communicate with each other.
[0162] The communication interface 503 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0163] Bus 510 includes hardware, software or both, and the components of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, first video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 510 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0164] In addition, in combination with the word meaning recognition method in the above embodiments, the present application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any word meaning recognition method in the above embodiments is implemented.
[0165] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0166] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0167] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0168] Aspects of the present disclosure are described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable word sense recognition device to produce a machine so that these instructions executed by the processor of the computer or other programmable word sense recognition device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0169] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A word meaning recognition method, characterized in that: The method comprises: In a corpus database, a target synonym corresponding to the meaning of a first content word is obtained, wherein the first content word is a polysemous word; Obtaining multiple sentences containing the target synonyms; Determining a feature vector corresponding to the word meaning of the first content word in the plurality of sentences, wherein the feature vector is used to represent a word meaning feature of the word meaning; Determining the word frequency influence of each second content word in the sentence to be recognized in the vector file, the sentence to be recognized includes the first content word, the sentence to be recognized includes the content word to be recognized, and the vector file includes the feature vector; The word meaning corresponding to the target feature vector whose word frequency influence satisfies the preset first condition is determined as the target word meaning of the content word to be recognized.
2. The word meaning recognition method according to claim 1, characterized in that: The step of acquiring a target synonym corresponding to the meaning of the first content word includes: Acquire the word meaning corresponding to the first content word in the corpus database; Searching the corpus database for a plurality of first synonyms corresponding to the word meaning; Calculating the cosine similarity between the first content word and the plurality of first synonyms; Among the plurality of first synonyms, the words whose cosine similarity satisfies a preset second condition are determined as target synonyms corresponding to the word meaning.
3. The word meaning recognition method according to claim 1, characterized in that: The step of determining the feature vector corresponding to the meaning of the first content word in the plurality of sentences includes: Calculating the relevance between each third content word in the plurality of sentences and the first content word; In each of the third content words, the content word whose association degree satisfies the preset third condition is determined as the feature vector of the meaning of the first content word.
4. The word meaning recognition method according to claim 3, characterized in that: The calculating the relevance between each third content word and the first content word in the plurality of sentences comprises: Perform word segmentation on the plurality of sentences to obtain a plurality of third content words; Determine a target sentence from the plurality of sentences, the target sentence being a sentence including the first content word and a fourth content word, the fourth content word being any content word among the plurality of third content words; Acquire a first quantity of the target sentence, a second quantity of the first content word in the target sentence, a third quantity of the fourth content word in the target sentence, and a fourth quantity of the third content word; Calculation is performed based on the first number, the second number, the third number, and the fourth number to determine a mutual performance verification index between each of the third content words and the first content word, wherein the mutual performance verification index represents a correlation between each of the third content words and the first content word.
5. The word meaning recognition method according to claim 1, characterized in that: The number of the vector files is multiple; The step of determining the word frequency influence of each second content word in the sentence to be recognized in the vector file includes: Performing word segmentation processing on the sentence to be recognized to obtain a plurality of second content words except the first content word; Obtaining an occurrence frequency and an inverse file frequency of each second content word in the plurality of second content words in the vector file, wherein the inverse file frequency indicates a degree of difference in the number of occurrences of the second content word in the plurality of vector files; The word frequency influence of each second content word in the vector file is determined based on the occurrence frequency and the inverse file frequency.
6. The word meaning recognition method according to claim 5, characterized in that: The determining the word frequency influence of each second content word in the vector file based on the occurrence frequency and the inverse file frequency includes: Determine the first influence of each second content word in the vector file by multiplying the occurrence frequency by the inverse file frequency; Based on the first influence, the word frequency influence of each second content word in the vector file is determined.
7. The word meaning recognition method according to claim 1, characterized in that: Before acquiring the target synonym corresponding to the meaning of the first content word, the method further includes: Collecting corpus data from the corpus database; Performing word segmentation processing on the corpus data to obtain a first content word; Vectorize the first content word to obtain a word vector of the first content word; The step of acquiring a target synonym corresponding to the meaning of the first content word includes: Based on the word vector, a target synonym corresponding to the meaning of the first content word is obtained.
8. A word meaning recognition device, characterized in that: The device comprises: A first acquisition module is used to acquire a target synonym corresponding to the meaning of a first content word in a corpus database, wherein the first content word is a polysemous word; A second acquisition module, used for acquiring a plurality of sentences containing the target synonyms; A first determination module, configured to determine a feature vector corresponding to the meaning of the first content word in the plurality of sentences, wherein the feature vector is used to represent a semantic feature of the meaning of the word; A second determination module is used to determine the word frequency influence of each second content word in the sentence to be recognized in the vector file, the sentence to be recognized includes the first content word, the sentence to be recognized includes the content word to be recognized, and the vector file includes the feature vector; The third determination module is used to determine the word meaning corresponding to the target feature vector whose word frequency influence satisfies the preset first condition as the target word meaning of the content word to be identified.
9. A terminal device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the word meaning recognition method as described in any one of claims 1-7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the word meaning recognition method according to any one of claims 1 to 7 is implemented.
