Search-based synonym database updating method, device, equipment and storage medium

Through a search-based synonym database updating method, a sentence set is generated and network search results are used to determine synonyms, which solves the problem of low accuracy in mining emerging words and background words in the existing technology and improves the accuracy of synonym mining.

CN114491215BActive Publication Date: 2024-08-30SHENZHEN YOUMI TIANXIA TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111621342.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2024-08-30
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

Existing synonym mining methods cannot effectively mine emerging words or background words, and manual mining has a high error rate, resulting in low mining accuracy.

Method used

A search-based synonym database update method is used to obtain the target words to be compared, generate a sentence set, and calculate the feature similarity. If it exceeds the threshold, the network search results are used to determine whether the word is a synonym and bind it to the synonym database.

Benefits of technology

It improves the accuracy of synonym mining, can effectively identify synonyms of emerging words and background words, and reduces the manual error rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114491215B
    Figure CN114491215B
Patent Text Reader

Abstract

The invention discloses a search-based synonym library updating method, device, equipment and storage medium, and relates to the field of natural language processing. The method comprises: obtaining a first target word and a second target word to be compared, generating a first sentence set containing the first target word, and a second sentence set containing the second target word; calculating the feature similarity of the first target word and the second target word based on the first sentence set and the second sentence set; if the feature similarity is greater than a target preset threshold, obtaining a first network search result of the first target word and a second network search result of the second target word, and judging whether the first target word and the second target word are synonyms according to the first network search result and the second network search result; if the first target word and the second target word are synonyms, binding the first target word and the second target word to a preset synonym library, and the invention improves the accuracy of synonym mining.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing, and in particular to a search-based synonym library updating method, device, equipment and storage medium. Background Art

[0002] In the field of NLP (Natural Language Processing), preprocessing of the language data to be recognized is very important. The preprocessing process of language data includes word segmentation, synonym replacement and noise word cleaning. Among them, synonym replacement is of great significance to the calculation of the similarity between two sentences. By replacing synonyms, the reliability of sentence similarity calculation can be improved.

[0003] Existing synonym replacement methods require maintaining a synonym database, which stores synonyms mined by technicians. However, existing synonym mining solutions are based on mature dictionary data or rely solely on manual mining, and are unable to mine emerging words or words with backgrounds. In addition, in the existing synonym mining process, manual mining has a large error rate, resulting in low accuracy in synonym mining. Summary of the invention

[0004] The main purpose of the present invention is to provide a search-based synonym database updating method, device, equipment and storage medium, aiming to solve the technical problem of low mining accuracy due to the small number of data sources in the existing synonym mining process.

[0005] In addition, to achieve the above purpose, the present invention also provides a search-based synonym library update method, the search-based synonym library update method comprising the following steps:

[0006] Acquire a first target word and a second target word to be compared, and generate a first sentence set including the first target word and a second sentence set including the second target word;

[0007] Based on the first sentence set and the second sentence set, calculating the feature similarity between the first target word and the second target word;

[0008] If the feature similarity is greater than a target preset threshold, obtaining a first network search result of the first target word and a second network search result of the second target word, and determining whether the first target word and the second target word are synonyms based on the first network search result and the second network search result;

[0009] If the first target word and the second target word are synonyms, the first target word and the second target word are bound to a preset synonym library to update the preset synonym library.

[0010] Optionally, before the step of obtaining the first target word and the second target word to be compared, and generating a first sentence set including the first target word, and a second sentence set including the second target word, the following steps are included:

[0011] Receiving a first word to be compared and a second word to be compared, and acquiring a first part of speech and a first component morpheme of the first word to be compared, and a second part of speech and a second component morpheme of the second word to be compared;

[0012] The first part of speech is matched with the second part of speech to obtain a first matching result, and the first component morpheme is matched with the second component morpheme to obtain a second matching result;

[0013] According to the first matching result and the second matching result, it is determined that the first word to be compared is a first target word, and the second word to be compared is a second target word.

[0014] Optionally, the step of obtaining a first target word and a second target word to be compared, and generating a first sentence set including the first target word, and a second sentence set including the second target word comprises:

[0015] Acquire a first target word and a second target word to be compared, and generate a first target sentence including the first target word and a second target sentence including the second target word;

[0016] Determining whether the first target sentence and the second target sentence have grammatical errors according to preset grammatical rules;

[0017] If there is no grammatical error in the first target sentence and the second target sentence, determining first attribute information of the first target word based on the first target sentence, and determining second attribute information of the second target word based on the second target sentence;

[0018] If the first attribute information matches the second attribute information, the first target sentence is added to the first sentence set, and the second target sentence is added to the second sentence set.

[0019] Optionally, the step of calculating the feature similarity between the first target word and the second target word based on the first sentence set and the second sentence set includes:

[0020] Randomly selecting a first sentence to be compared from the first sentence set, and selecting a second sentence to be compared from the second sentence set based on the first sentence to be compared, wherein first attribute information of the first target word determined based on the first sentence to be compared matches second attribute information of the second target word determined based on the second sentence to be compared;

[0021] Comparing the semantics of the first sentence to be compared with the semantics of the second sentence to be compared, returning to the step of randomly selecting the first sentence to be compared from the first sentence set, and selecting the second sentence to be compared from the second sentence set based on the first sentence to be compared, until there are no sentences to be compared that have not been semantically compared in the first sentence set and the second sentence set, and obtaining a total comparison result;

[0022] The feature similarity between the first target word and the second target word is calculated according to the total comparison result.

[0023] Optionally, the step of judging whether the first target word and the second target word are synonyms according to the first network search result and the second network search result includes:

[0024] Comparing the first network address in the first network search result with the second network address in the second network search to obtain a first comparison result;

[0025] Comparing the first URL display information in the first network search result with the second URL display information in the second network search result to obtain a second comparison result;

[0026] According to the first comparison result and the second comparison result, it is determined whether the first target word and the second target word are synonyms.

[0027] Optionally, the number of the first network addresses is the same as the number of the second network addresses, and the step of determining whether the first target word and the second target word are synonyms according to the first comparison result and the second comparison result includes:

[0028] Taking a network address included in both the first network address and the second network address as a target network address, and calculating a first ratio of the target network address to the first network address;

[0029] Filter out network addresses with similar website address display information from the first network address and the second network address, and calculate a second ratio of the network addresses with similar website address display information to the first network address;

[0030] According to the first ratio and the second ratio, it is determined whether the first target word and the second target word are synonyms.

[0031] Optionally, the search-based synonym library updating method comprises the following steps:

[0032] Filter out identical characters from the first URL display information and the second URL display information;

[0033] If the ratio of the same characters to the total number of characters in the first URL display information is greater than a first preset threshold, and the ratio of the same characters to the total number of characters in the second URL display information is greater than a second preset threshold, it is determined that the first URL display information is similar to the second URL display information.

[0034] In addition, to achieve the above-mentioned purpose, the present invention also provides a search-based synonym library updating device, the search-based synonym library updating device comprising:

[0035] A sentence set generation module, used to obtain a first target word and a second target word to be compared, and generate a first sentence set including the first target word, and a second sentence set including the second target word;

[0036] A feature similarity calculation module, used for calculating the feature similarity between the first target word and the second target word based on the first sentence set and the second sentence set;

[0037] a judgment module, configured to obtain a first network search result of the first target word and a second network search result of the second target word if the feature similarity is greater than a target preset threshold, and judge whether the first target word and the second target word are synonyms according to the first network search result and the second network search result;

[0038] The synonym library updating module is used for binding the first target word and the second target word to a preset synonym library if the first target word and the second target word are synonyms, so as to update the preset synonym library.

[0039] In addition, to achieve the above-mentioned purpose, the present invention also provides a search-based synonym library updating device, which includes: a memory, a processor, and a search-based synonym library updating program stored in the memory and executable on the processor, and the search-based synonym library updating program, when executed by the processor, implements the steps of the search-based synonym library updating method as described above.

[0040] In addition, to achieve the above-mentioned purpose, the present invention also provides a storage medium, on which a search-based synonym library update program is stored. When the search-based synonym library update program is executed by a processor, the steps of the search-based synonym library update method as described above are implemented.

[0041] The embodiment of the present invention proposes a search-based synonym library update method, device, equipment and storage medium. In the embodiment of the present invention, a first target word and a second target word to be compared for synonyms are obtained, a first sentence set containing the first target word and a second sentence set containing the second target word are generated, and the feature similarity of the first target word and the second target word is calculated based on the first sentence set and the second sentence set. If the feature similarity is greater than the target preset threshold, a first network search result of the first target word and a second network search result of the second target word are obtained, and according to the first network search result and the second network search result, it is judged whether the first target word and the second target word are synonyms. If the first target word and the second target word are synonyms, the first target word and the second target word are bound to a preset synonym library to update the preset synonym library. The present invention improves the accuracy of synonym mining by searching the network and judging the synonyms according to the results of the network search. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of the hardware structure of an implementation of a search-based synonym database updating device provided in an embodiment of the present invention;

[0043] Figure 2 It is a flowchart of the first embodiment of the search-based synonym database updating method of the present invention;

[0044] Figure 3 It is a flow chart of a second embodiment of a search-based synonym database updating method of the present invention;

[0045] Figure 4 The figure is a functional module diagram of an embodiment of a search-based synonym database updating device of the present invention.

[0046] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0047] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0048] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.

[0049] The terminal (also called terminal, device or terminal device) for updating the synonym database based on search in the embodiment of the present invention may be a PC, or a device with the function such as a smart phone, a tablet computer and a portable computer.

[0050] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU (Central Processing Unit), a communication bus 1002, and a memory 1003. The communication bus 1002 is used to realize the connection and communication between these components. The memory 1003 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1003 may also be a storage device independent of the aforementioned processor 1001.

[0051] Those skilled in the art will understand that Figure 1 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0052] like Figure 1 As shown, the memory 1003 as a computer storage medium may include a search-based synonym database update program.

[0053] exist Figure 1 In the terminal shown, the processor 1001 can be used to call the search-based synonym library update program stored in the memory 1003, and perform the following operations:

[0054] Acquire a first target word and a second target word to be compared, and generate a first sentence set including the first target word and a second sentence set including the second target word;

[0055] Based on the first sentence set and the second sentence set, calculating the feature similarity between the first target word and the second target word;

[0056] If the feature similarity is greater than a target preset threshold, obtaining a first network search result of the first target word and a second network search result of the second target word, and determining whether the first target word and the second target word are synonyms based on the first network search result and the second network search result;

[0057] If the first target word and the second target word are synonyms, the first target word and the second target word are bound to a preset synonym library to update the preset synonym library.

[0058] exist Figure 1 In the terminal shown, the processor 1001 can be used to call the search-based synonym library update program stored in the memory 1003, and perform the following operations:

[0059] Receiving a first word to be compared and a second word to be compared, and acquiring a first part of speech and a first component morpheme of the first word to be compared, and a second part of speech and a second component morpheme of the second word to be compared;

[0060] The first part of speech is matched with the second part of speech to obtain a first matching result, and the first component morpheme is matched with the second component morpheme to obtain a second matching result;

[0061] According to the first matching result and the second matching result, it is determined that the first word to be compared is a first target word, and the second word to be compared is a second target word.

[0062] exist Figure 1 In the terminal shown, the processor 1001 can be used to call the search-based synonym library update program stored in the memory 1003, and perform the following operations:

[0063] Acquire a first target word and a second target word to be compared, and generate a first target sentence including the first target word and a second target sentence including the second target word;

[0064] Determining whether the first target sentence and the second target sentence have grammatical errors according to preset grammatical rules;

[0065] If there is no grammatical error in the first target sentence and the second target sentence, determining first attribute information of the first target word based on the first target sentence, and determining second attribute information of the second target word based on the second target sentence;

[0066] If the first attribute information matches the second attribute information, the first target sentence is added to the first sentence set, and the second target sentence is added to the second sentence set.

[0067] exist Figure 1 In the terminal shown, the processor 1001 can be used to call the search-based synonym library update program stored in the memory 1003, and perform the following operations:

[0068] Randomly selecting a first sentence to be compared from the first sentence set, and selecting a second sentence to be compared from the second sentence set based on the first sentence to be compared, wherein first attribute information of the first target word determined based on the first sentence to be compared matches second attribute information of the second target word determined based on the second sentence to be compared;

[0069] Comparing the semantics of the first sentence to be compared with the semantics of the second sentence to be compared, returning to the step of randomly selecting the first sentence to be compared from the first sentence set, and selecting the second sentence to be compared from the second sentence set based on the first sentence to be compared, until there are no sentences to be compared that have not been semantically compared in the first sentence set and the second sentence set, and obtaining a total comparison result;

[0070] The feature similarity between the first target word and the second target word is calculated according to the total comparison result.

[0071] exist Figure 1 In the terminal shown, the processor 1001 can be used to call the search-based synonym library update program stored in the memory 1003, and perform the following operations:

[0072] Comparing the first network address in the first network search result with the second network address in the second network search to obtain a first comparison result;

[0073] Comparing the first URL display information in the first network search result with the second URL display information in the second network search result to obtain a second comparison result;

[0074] According to the first comparison result and the second comparison result, it is determined whether the first target word and the second target word are synonyms.

[0075] exist Figure 1 In the terminal shown, the processor 1001 can be used to call the search-based synonym library update program stored in the memory 1003, and perform the following operations:

[0076] Taking a network address included in both the first network address and the second network address as a target network address, and calculating a first ratio of the target network address to the first network address;

[0077] Filter out network addresses with similar website address display information from the first network address and the second network address, and calculate a second ratio of the network addresses with similar website address display information to the first network address;

[0078] According to the first ratio and the second ratio, it is determined whether the first target word and the second target word are synonyms.

[0079] exist Figure 1 In the terminal shown, the processor 1001 can be used to call the search-based synonym library update program stored in the memory 1003, and perform the following operations:

[0080] Filter out identical characters from the first URL display information and the second URL display information;

[0081] If the ratio of the same characters to the total number of characters in the first URL display information is greater than a first preset threshold, and the ratio of the same characters to the total number of characters in the second URL display information is greater than a second preset threshold, it is determined that the first URL display information is similar to the second URL display information.

[0082] Based on the above-mentioned device hardware structure, an embodiment of the search-based synonym database updating method of the present invention is proposed.

[0083] Reference Figure 2 In a first embodiment of the search-based synonym library updating method of the present invention, the search-based synonym library updating method includes:

[0084] Step S10, obtaining a first target word and a second target word to be compared, generating a first sentence set including the first target word, and a second sentence set including the second target word;

[0085] In the field of NLP, synonym replacement is very important. The premise of synonym replacement is to determine whether two words are synonyms. The embodiment of the present invention first obtains the words to be compared with synonyms (that is, the first target words and the second target words in this embodiment). The first target words and the second target words in this embodiment are preliminarily screened. Specifically, the purpose of the preliminary screening is to obtain words that can be compared with synonyms and to filter out words that obviously cannot be compared with synonyms, for example, "light" and "darkness" which are antonyms, the unrelated name "Lu Xun" and the name "table", etc. The method of preliminary automatic screening will be described in detail below.

[0086] Whether the first target word and the second target word are synonyms still needs to be judged in combination with examples. Specifically, the first target word and the second target word are grouped into sentences respectively, and the generated sentences containing the first target word are added to one set (i.e., the first sentence set in this embodiment), and the generated sentences containing the second target word are added to another set (i.e., the second sentence set in this embodiment).

[0087] Step S20, calculating feature similarity between the first target word and the second target word based on the first sentence set and the second sentence set;

[0088] It can be seen that both the first sentence set and the second sentence set contain multiple sentences. In order to facilitate sentence comparison, the number of sentences contained in the first sentence set and the number of sentences contained in the second sentence set are the same. This embodiment provides a method for calculating the feature similarity of the first target word and the second target word based on the first sentence set and the second sentence set. Specifically, a sentence to be compared (hereinafter referred to as the first sentence to be compared) is selected from the first sentence set, and a sentence to be compared (hereinafter referred to as the second sentence to be compared) is selected from the second sentence set. It should be noted that the attribute information of the first sentence to be compared and the second sentence to be compared is matched, wherein the attribute information refers to the composition information of the sentences to be compared. For example, the first target word is "understand" and the first sentence to be compared is "I understand this sentence", the second target word is "understand" and the first sentence to be compared is "I understand the principle of this thing", in the first sentence to be compared The first target word "understand" is the predicate, and the grammatical structure of the first sentence to be compared is subject, predicate, attributive, object, and auxiliary word; the second target word "understand" is the predicate in the second sentence to be compared, and the grammatical structure of the second sentence to be compared is subject, predicate, attributive, object, and auxiliary word. The attributes of the first target word in the first sentence to be compared are the same as the attributes of the second target word in the second sentence to be compared, and the attributes of the first sentence to be compared (that is, grammatical structure) are also the same as the attributes of the second sentence to be compared. In this case, the comparison result is obtained by comparing the semantics of the first sentence to be compared with the semantics of the second sentence to be compared, and then the sentences to be compared are selected in pairs from the first sentence set and the second sentence set for semantic comparison in a loop until the semantic comparison of the sentences to be compared in the first sentence set and the second sentence set is completed, and finally the total comparison result is obtained, and then the feature similarity of the first target word and the second target word is calculated according to the total comparison result.

[0089] Step S30, if the feature similarity is greater than a target preset threshold, obtaining a first network search result of the first target word and a second network search result of the second target word, and determining whether the first target word and the second target word are synonyms based on the first network search result and the second network search result;

[0090] When the feature similarity between the first target word and the second target word is greater than a certain value (i.e., the target preset threshold in this embodiment), it can be preliminarily determined that the first target word and the second target word meet the basic features of being synonyms. On this basis, this embodiment further obtains a first network search result for the first target word and a second network search result for the second target word, and determines whether the first target word and the second target word are synonyms based on the first network search result and the second network search result. Specifically, this embodiment provides a method for determining whether the first target word and the second target word are synonyms based on the network search results, and inputs the first target word and the second target word into the search engine respectively to obtain the first network search result and the second network search result, wherein the network search results include URL (Uniform Resource Locator). Locator, that is, a URL, also includes the displayed content under each URL (expressed in the form of characters). It should be noted that when the URL in the first search result (hereinafter referred to as the first URL) is the same as the URL in the second search result (hereinafter referred to as the second URL), the content displayed in the first URL is the same as the content displayed in the second URL. The search-based synonym library updating method proposed in the present invention pre-sets that the number of the first URL and the second URL is the same. Therefore, the greater the proportion of the number of the same URLs in the first URL and the second URL, the higher the probability that the first target word and the second target word are synonyms.

[0091] It should be noted that there are also situations where the URLs are different but the displayed contents are the same or similar. The greater the proportion of URLs with the same displayed contents in the first URL and the second URL, the higher the probability that the first target word and the second target word are synonyms. Whether the first target word and the second target word are synonyms is determined based on the URL and the URL display information.

[0092] Step S40: If the first target word and the second target word are synonyms, the first target word and the second target word are bound to a preset synonym library to update the preset synonym library.

[0093] If the first target word and the second target word are synonyms, the first target word and the second target word are bound to a preset synonym library in the form of synonyms. By continuously binding synonyms and adding them to the preset synonym library, the preset synonym library is expanded to achieve the purpose of updating the preset synonym library. When the number of synonyms in the preset synonym library reaches a certain level, the preset synonym library can be used in the data preprocessing (synonym replacement) stage in natural language processing.

[0094] Further, in a feasible embodiment, in the above step S10, the first target word and the second target word to be compared are obtained, and a first sentence set including the first target word and a second sentence set including the second target word are generated, and the previous steps include:

[0095] Step a1, receiving a first word to be compared and a second word to be compared, and obtaining a first part of speech and a first component morpheme of the first word to be compared, and a second part of speech and a second component morpheme of the second word to be compared;

[0096] Step a2, matching the first part of speech with the second part of speech to obtain a first matching result, and matching the first component morphemes with the second component morphemes to obtain a second matching result;

[0097] Step a3: determining, based on the first matching result and the second matching result, that the first word to be compared is a first target word, and the second word to be compared is a second target word.

[0098] It should be noted that the search-based synonym database updating method proposed in the present invention is automatically completed based on a computer program, and requires a preliminary screening of the words to be compared input by the user to screen out words that are obviously not synonyms, for example, "know" and "confused", which are antonyms to each other, and "strange" and "book", which are irrelevant. These words cannot be judged as synonyms. The method for determining whether the words input by the user can be judged as synonyms is based on the part of speech and constituent morphemes of the words, wherein the part of speech of a word refers to whether the word can be used as a noun, verb or adjective, etc., and the morpheme of a word refers to the smallest combination of phonetics and semantics, which is the smallest meaningful language unit, including monosyllabic morphemes, disyllabic morphemes and polysyllabic morphemes.

[0099] After receiving the first word to be compared and the second word to be compared input by the user, the search-based synonym library update program first obtains the first part of speech and the first morpheme of the first word to be compared, as well as the second part of speech and the second morpheme of the second word to be compared, and then matches the first part of speech and the second part of speech to obtain a first matching result, and matches the first morpheme and the second morpheme to obtain a second matching result. Specifically, the first matching result reflects the similarity between the first part of speech and the second part of speech. Similarly, the second matching result reflects the similarity between the first morpheme and the second morpheme. Finally, according to the first matching result and the second matching result, the first word to be compared is determined to be the first target word, and the second word to be compared is determined to be the second target word. It can be seen that if the similarity between the first part of speech and the second part of speech is high, and the similarity between the first morpheme and the second morpheme is high, then the first word to be compared can be determined to be the first target word, and the second word to be compared can be determined to be the second target word, that is, the words that can be judged as synonyms.

[0100] Further, in a feasible embodiment, the above step S10, obtaining the first target word and the second target word to be compared, generating a first sentence set including the first target word, and a second sentence set including the second target word, the refinement steps include:

[0101] Step S11, obtaining a first target word and a second target word to be compared, generating a first target sentence including the first target word, and a second target sentence including the second target word;

[0102] Step S12, judging whether there are grammatical errors in the first target sentence and the second target sentence according to preset grammatical rules;

[0103] Step S13, if there is no grammatical error in the first target sentence and the second target sentence, determining first attribute information of the first target word based on the first target sentence, and determining second attribute information of the second target word based on the second target sentence;

[0104] Step S14: if the first attribute information matches the second attribute information, the first target sentence is added to a first sentence set, and the second target sentence is added to a second sentence set.

[0105] It should be noted that the method for generating sentences based on words proposed in this embodiment is automatically completed by a computer program. Therefore, it is necessary to perform preliminary screening on the generated first target sentence containing the first target word and the second target sentence containing the second target word. Specifically, firstly, it is determined whether there are grammatical errors in the first target sentence and the second target sentence according to the preset grammatical rules. Since the method for generating sentences based on words proposed in this embodiment is completed by a computer program, it is impossible to recognize inverted sentences and disordered sentences that can only be recognized by the human brain, such as "Have you eaten in the morning?" and "Have you eaten in the morning?", etc. The human brain can easily recognize that the above sentence is "Have you eaten in the morning?", but the computer program cannot recognize it. Therefore, it is necessary to first determine whether there are grammatical errors in the first target sentence and the second target sentence based on the preset grammatical rules. Then, if there are no grammatical errors in the first target sentence and the second target sentence, the first attribute information of the first target word is determined based on the first target sentence, and the second attribute information of the second target word is determined based on the second target sentence. The first attribute information refers to information such as the part of speech and position of the first target word in the first target sentence, and the second attribute information is the same as above. If the first attribute information matches the second attribute information, the first target sentence is added to the first sentence set, and the second target sentence is added to the second sentence set.

[0106] Further, in a feasible embodiment, the above step S20, based on the first sentence set and the second sentence set, calculates the feature similarity between the first target word and the second target word, and the detailed steps include:

[0107] Step S21, randomly selecting a first sentence to be compared from the first sentence set, and selecting a second sentence to be compared from the second sentence set based on the first sentence to be compared, wherein the first attribute information of the first target word determined based on the first sentence to be compared matches the second attribute information of the second target word determined based on the second sentence to be compared;

[0108] Step S22, comparing the semantics of the first sentence to be compared with the semantics of the second sentence to be compared, returning to the step of randomly selecting a first sentence to be compared from the first sentence set, and selecting a second sentence to be compared from the second sentence set based on the first sentence to be compared, until there are no sentences to be compared that have not been semantically compared in the first sentence set and the second sentence set, and obtaining a total comparison result;

[0109] Step S23: calculating the feature similarity between the first target word and the second target word according to the total comparison result.

[0110] It should be noted that comparing sentences with matching attribute information can better reflect the feature similarity of two words. First, a first sentence to be compared is randomly selected from the first sentence set, and a second sentence to be compared is selected from the second sentence set based on the first sentence to be compared, wherein the first attribute information of the first target word determined based on the first sentence to be compared is matched with the second attribute information of the second target word determined based on the second sentence to be compared. Then, the semantics of the first sentence to be compared is compared with the semantics of the second sentence to be compared, and the process returns to the step of randomly selecting the first sentence to be compared from the first sentence set and selecting the second sentence to be compared from the second sentence set based on the first sentence to be compared, until there are no sentences to be compared that have not been semantically compared in the first sentence set and the second sentence set, and finally the total comparison result is obtained. The greater the proportion of sentences with matching attribute information in the first sentence set and the second sentence set, the higher the feature similarity of the first target word and the second target word.

[0111] The present embodiment provides a method for calculating the feature similarity of a first target word and a second target word based on a first sentence set and a second sentence set. Specifically, a sentence to be compared is selected from the first sentence set (i.e., the first sentence to be compared in the present embodiment), and a sentence to be compared is selected from the second sentence set (i.e., the second sentence to be compared in the present embodiment). It should be noted that the attribute information of the first sentence to be compared and the second sentence to be compared are matched, wherein the attribute information refers to the composition information of the sentences to be compared. For example, the first target word is "experience" and the first sentence to be compared is "Do you experience this feeling?" The second target word is "recognize" and the first sentence to be compared is "Do you recognize it wrongly?" In the first sentence to be compared, the first target word "experience" is the predicate, and the grammatical structure of the first sentence to be compared is subject, predicate, attributive, object, and auxiliary word; in the second sentence to be compared, the second target word "knowledge" is the predicate, the grammatical structure of the second sentence to be compared is subject, predicate, object, and auxiliary word, the attribute of the first target word in the first sentence to be compared is the same as the attribute of the second target word in the second sentence to be compared, and the attribute (i.e., grammatical structure) of the first sentence to be compared is also the same as the attribute of the second sentence to be compared. In this case, by comparing the semantics of the first sentence to be compared with the semantics of the second sentence to be compared, the comparison result is obtained, and then the sentences to be compared are selected in pairs from the first sentence set and the second sentence set for semantic comparison in a loop until the semantic comparison of the sentences to be compared in the first sentence set and the second sentence set is completed, and finally the total comparison result is obtained, and then the feature similarity of the first target word and the second target word is calculated according to the total comparison result. Specifically, semantics refers to the meaning contained in language. By comparing multiple groups of sentences with different grammatical structures, the feature similarity of the first target word and the second target word can be calculated.

[0112] In this embodiment, a first target word and a second target word to be compared as synonyms are obtained, a first sentence set including the first target word and a second sentence set including the second target word are generated, and based on the first sentence set and the second sentence set, the feature similarity of the first target word and the second target word is calculated. If the feature similarity is greater than a target preset threshold, a first network search result of the first target word and a second network search result of the second target word are obtained, and based on the first network search result and the second network search result, it is determined whether the first target word and the second target word are synonyms. If the first target word and the second target word are synonyms, the first target word and the second target word are bound to a preset synonym library to update the preset synonym library. The present invention improves the accuracy of synonym mining by searching the network and performing synonym judgment based on the results of the network search.

[0113] Further, refer to Figure 3 Based on the above-mentioned embodiments of the present invention, a second embodiment of the search-based synonym library updating method of the present invention is proposed.

[0114] This embodiment is step S30 in the first embodiment, which is to determine whether the first target word and the second target word are synonyms according to the first network search result and the second network search result. The difference between this embodiment and the above-mentioned embodiment of the present invention is that:

[0115] Step S31, comparing the first network address in the first network search result with the second network address in the second network search to obtain a first comparison result;

[0116] It should be noted that the search-based synonym library updating method proposed in the present invention pre-sets that the number of the first network addresses and the second network addresses obtained by the search are the same. This embodiment provides a specific application scenario. The first network search results obtained by inputting the first target word into the search engine include 100 first network addresses, and the second network search results obtained by inputting the second target word into the search engine include 100 second network addresses. The 100 first network addresses are compared with the 100 second network addresses, and the number of identical network addresses in the first network address and the second network address is counted, and the proportion of the number of identical network addresses is calculated. If the number of identical network addresses in the first network address and the second network address is 5, the proportion of the number of identical network addresses is 5%. The first comparison result in this embodiment includes the proportion of the number of identical network addresses.

[0117] Step S32, comparing the first website address display information in the first network search result with the second website address display information in the second network search to obtain a second comparison result;

[0118] It can be known that if two network addresses are the same, the URL display information of the two network addresses is the same. It should be noted that there are also situations where the two network addresses are not the same, but the URL display information of the two network addresses is the same (or similar). Therefore, the number of URLs with the same URL display information in the first network address and the second network address is greater than or equal to the proportion of the number of the same network addresses in the above-mentioned first comparison result. The first URL display information in the first network search result and the second URL display information in the second network search are compared. The second comparison result obtained contains the proportion of the number of URLs with the same URL display information. If the number of network addresses with the same URL display information in the first network address and the second network address is 7, the proportion of the number of URLs with the same URL display information is 7%.

[0119] Step S33: judging whether the first target word and the second target word are synonyms according to the first comparison result and the second comparison result.

[0120] After obtaining the first comparison result and the second comparison result, it is determined whether the first target word and the second target word are synonyms according to the first comparison result and the second comparison result. Specifically, for example, if the proportion of the number of identical network addresses in the first comparison result is greater than a value (a first preset threshold), and the proportion of the number of web addresses with identical web address display information in the second comparison result is greater than another value (a second preset threshold), then the probability that the first target word and the second target word are synonyms is higher.

[0121] Further, in a feasible embodiment, the number of the first network addresses is the same as the number of the second network addresses, and the above step S33, based on the first comparison result and the second comparison result, determines whether the first target word and the second target word are synonyms, and the detailed steps include:

[0122] Step S331, taking a network address included in both the first network address and the second network address as a target network address, and calculating a first ratio of the target network address to the first network address;

[0123] Step S332, filtering out network addresses with similar website address display information from the first network address and the second network address, and calculating a second ratio of the network addresses with similar website address display information to the first network address;

[0124] Step S333: judging whether the first target word and the second target word are synonyms according to the first ratio and the second ratio.

[0125] It can be seen that the search-based synonym library updating method proposed in the present invention pre-sets that the number of the first network addresses and the second network addresses obtained by the search are the same. This embodiment provides a specific application scenario. The first network search results obtained by inputting the first target word into the search engine include 100 first network addresses, and the second network search results obtained by inputting the second target word into the search engine include 100 second network addresses. The 100 first network addresses are compared with the 100 second network addresses, and the number of the same network addresses in the first network address and the second network address is counted, and the proportion of the number of the same network addresses is calculated. If the number of the same network addresses in the first network address and the second network address is 5, the proportion of the number of the same network addresses is 5%, that is, the first proportion in this embodiment. If the two network addresses are the same, the URL display information of the two network addresses is the same. It should be noted that there is also a situation where the two network addresses are not the same, but the URL display information of the two network addresses is the same (or similar). Therefore, the number of URLs with the same URL display information in the first network address and the second network address is greater than or equal to the proportion of the number of the same network addresses in the above-mentioned first comparison result. The first URL display information in the first network search result and the second URL display information in the second network search are compared. The second comparison result obtained contains the proportion of the number of URLs with the same URL display information. If there are 7 network addresses with the same URL display information in the first network address and the second network address, the proportion of the number of URLs with the same URL display information is 7%, that is, the second proportion in this embodiment. According to the first proportion and the second proportion, it is determined whether the first target word and the second target word are synonyms.

[0126] Furthermore, in a feasible embodiment, the above-mentioned search-based synonym database updating method further includes the following steps:

[0127] Step b1, filtering out identical characters from the first website display information and the second website display information;

[0128] Step b2: If the ratio of the same characters to the total number of characters in the first URL display information is greater than a first preset threshold, and the ratio of the same characters to the total number of characters in the second URL display information is greater than a second preset threshold, it is determined that the first URL display information is similar to the second URL display information.

[0129] It can be seen that this embodiment provides a method for determining whether the URL display information of two network addresses is the same or similar. It should be noted that the URL display information is composed of characters. First, the same characters are screened out from the first URL display information and the second URL display information. If the ratio of the same characters screened out from the first URL display information and the second URL display information to the total number of characters in the first URL display information is greater than a first preset threshold, and the ratio of the same characters screened out from the first URL display information and the second URL display information to the total number of characters in the second URL display information is greater than a second preset threshold, it is determined that the first URL display information is similar to the second URL display information, wherein the first preset threshold and the second preset threshold may be the same or different.

[0130] In this embodiment, the search results of the words are obtained through the search engine, and then the first target word and the second target word are judged whether they are synonyms based on the proportion of the same URLs in the search results and the proportion of the URLs with the same URL display information, thereby improving the accuracy of synonym mining.

[0131] In addition, refer to Figure 4 The embodiment of the present invention further provides a search-based synonym library updating device, the search-based synonym library updating device comprising:

[0132] A sentence set generating module 10 is used to obtain a first target word and a second target word to be compared, and generate a first sentence set including the first target word and a second sentence set including the second target word;

[0133] A feature similarity calculation module 20, configured to calculate feature similarities between the first target word and the second target word based on the first sentence set and the second sentence set;

[0134] A judgment module 30 is used to obtain a first network search result of the first target word and a second network search result of the second target word if the feature similarity is greater than a target preset threshold, and judge whether the first target word and the second target word are synonyms according to the first network search result and the second network search result;

[0135] The synonym library updating module 40 is configured to bind the first target word and the second target word to a preset synonym library if the first target word and the second target word are synonyms, so as to update the preset synonym library.

[0136] Optionally, the search-based synonym library updating device further includes:

[0137] A component morpheme acquisition module, used for receiving a first word to be compared and a second word to be compared, and acquiring a first part of speech and a first component morpheme of the first word to be compared, and a second part of speech and a second component morpheme of the second word to be compared;

[0138] A matching result acquisition module, configured to match the first part of speech with the second part of speech to obtain a first matching result, and to match the first component morphemes with the second component morphemes to obtain a second matching result;

[0139] The target word determination module is used to determine the first to-be-compared word as a first target word and the second to-be-compared word as a second target word according to the first matching result and the second matching result.

[0140] Optionally, the statement set generating module 10 includes:

[0141] a target sentence generating unit, configured to obtain a first target word and a second target word to be compared, and generate a first target sentence including the first target word, and a second target sentence including the second target word;

[0142] A first judging unit, configured to judge whether the first target sentence and the second target sentence have grammatical errors according to preset grammatical rules;

[0143] an attribute information determining unit, configured to determine first attribute information of the first target word based on the first target sentence, and determine second attribute information of the second target word based on the second target sentence, if there is no grammatical error in the first target sentence and the second target sentence;

[0144] A sentence set adding unit is used to add the first target sentence to a first sentence set and the second target sentence to a second sentence set if the first attribute information matches the second attribute information.

[0145] Optionally, the feature similarity calculation module 20 includes:

[0146] a random selection unit, configured to randomly select a first sentence to be compared from the first sentence set, and select a second sentence to be compared from the second sentence set based on the first sentence to be compared, wherein the first attribute information of the first target word determined based on the first sentence to be compared matches the second attribute information of the second target word determined based on the second sentence to be compared;

[0147] a total comparison result acquisition unit, configured to compare the semantics of the first sentence to be compared with the semantics of the second sentence to be compared, return to the step of randomly selecting the first sentence to be compared from the first sentence set, and selecting the second sentence to be compared from the second sentence set based on the first sentence to be compared, until there are no sentences to be compared that have not been semantically compared in the first sentence set and the second sentence set, and obtain a total comparison result;

[0148] A feature similarity calculation unit is used to calculate the feature similarity between the first target word and the second target word according to the total comparison result.

[0149] Optionally, the judging module 30 includes:

[0150] A first comparison unit, configured to compare a first network address in the first network search result with a second network address in the second network search to obtain a first comparison result;

[0151] A second comparison unit, configured to compare the first URL display information in the first network search result with the second URL display information in the second network search result to obtain a second comparison result;

[0152] The second judgment unit is used to judge whether the first target word and the second target word are synonyms according to the first comparison result and the second comparison result.

[0153] Optionally, the number of the first network addresses is the same as the number of the second network addresses, and the second determining unit includes:

[0154] A first ratio calculation unit, configured to take a network address included in both the first network address and the second network address as a target network address, and calculate a first ratio between the target network address and the first network address;

[0155] A network address screening unit, configured to screen network addresses with similar website address display information from the first network address and the second network address, and calculate a second ratio of the network addresses with similar website address display information to the first network address;

[0156] The third judgment unit is used to judge whether the first target word and the second target word are synonyms according to the first ratio and the second ratio.

[0157] Optionally, the search-based synonym library updating device further includes:

[0158] A character screening module, used for screening out identical characters from the first website display information and the second website display information;

[0159] The similarity determination module is used to determine that the first URL display information is similar to the second URL display information if the ratio of the same characters to the total number of characters in the first URL display information is greater than a first preset threshold, and the ratio of the same characters to the total number of characters in the second URL display information is greater than a second preset threshold.

[0160] In addition, an embodiment of the present invention further provides a storage medium on which a search-based synonym library update program is stored. When the search-based synonym library update program is executed by a processor, the operations in the search-based synonym library update method provided in the above embodiment are implemented.

[0161] The methods executed by the above-mentioned program modules can refer to the various embodiments of the search-based synonym database updating method of the present invention, which will not be described in detail here.

[0162] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such actual relationship or order between these entities / operations / objects; the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system 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 system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0163] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiment. The device embodiment described above is only illustrative, and the units described as separate components may or may not be physically separated. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the present invention. Those of ordinary skill in the art can understand and implement it without paying creative work.

[0164] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0165] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, including a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the search-based synonym library update method described in each embodiment of the present invention.

[0166] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A search-based synonym database updating method, characterized in that: The search-based synonym library updating method comprises the following steps: Acquire a first target word and a second target word to be compared, and generate a first sentence set including the first target word and a second sentence set including the second target word; Based on the first sentence set and the second sentence set, calculating the feature similarity between the first target word and the second target word; If the feature similarity is greater than a target preset threshold, obtaining a first network search result of the first target word and a second network search result of the second target word, and determining whether the first target word and the second target word are synonyms based on the first network search result and the second network search result; If the first target word and the second target word are synonyms, the first target word and the second target word are bound to a preset synonym library to update the preset synonym library; Before the step of obtaining the first target word and the second target word to be compared, and generating a first sentence set including the first target word, and a second sentence set including the second target word, the method includes: Receiving a first word to be compared and a second word to be compared, and acquiring a first part of speech and a first component morpheme of the first word to be compared, and a second part of speech and a second component morpheme of the second word to be compared; The first part of speech is matched with the second part of speech to obtain a first matching result, and the first component morpheme is matched with the second component morpheme to obtain a second matching result; According to the first matching result and the second matching result, it is determined that the first word to be compared is a first target word, and the second word to be compared is a second target word.

2. The search-based synonym database updating method according to claim 1, characterized in that: The steps of obtaining a first target word and a second target word to be compared, and generating a first sentence set including the first target word, and a second sentence set including the second target word include: Acquire a first target word and a second target word to be compared, and generate a first target sentence including the first target word and a second target sentence including the second target word; Determining whether the first target sentence and the second target sentence have grammatical errors according to preset grammatical rules; If there is no grammatical error in the first target sentence and the second target sentence, determining first attribute information of the first target word based on the first target sentence, and determining second attribute information of the second target word based on the second target sentence; If the first attribute information matches the second attribute information, the first target sentence is added to the first sentence set, and the second target sentence is added to the second sentence set.

3. The search-based synonym database updating method according to claim 2, characterized in that: The step of calculating the feature similarity between the first target word and the second target word based on the first sentence set and the second sentence set comprises: Randomly selecting a first sentence to be compared from the first sentence set, and selecting a second sentence to be compared from the second sentence set based on the first sentence to be compared, wherein first attribute information of the first target word determined based on the first sentence to be compared matches second attribute information of the second target word determined based on the second sentence to be compared; Comparing the semantics of the first sentence to be compared with the semantics of the second sentence to be compared, returning to the step of randomly selecting the first sentence to be compared from the first sentence set, and selecting the second sentence to be compared from the second sentence set based on the first sentence to be compared, until there are no sentences to be compared that have not been semantically compared in the first sentence set and the second sentence set, and obtaining a total comparison result; The feature similarity between the first target word and the second target word is calculated according to the total comparison result.

4. The search-based synonym database updating method according to claim 1, characterized in that: The step of judging whether the first target word and the second target word are synonyms according to the first network search result and the second network search result comprises: Comparing the first network address in the first network search result with the second network address in the second network search to obtain a first comparison result; Comparing the first website address display information in the first network search result with the second website address display information in the second network search to obtain a second comparison result; According to the first comparison result and the second comparison result, it is determined whether the first target word and the second target word are synonyms.

5. The search-based synonym database updating method according to claim 4, characterized in that: The number of the first network addresses is the same as the number of the second network addresses, and the step of judging whether the first target word and the second target word are synonyms according to the first comparison result and the second comparison result comprises: Taking a network address included in both the first network address and the second network address as a target network address, and calculating a first ratio of the target network address to the first network address; Filter out network addresses with similar website address display information from the first network address and the second network address, and calculate a second ratio of the network addresses with similar website address display information to the first network address; According to the first ratio and the second ratio, it is determined whether the first target word and the second target word are synonyms.

6. The search-based synonym database updating method according to claim 5, characterized in that: The search-based synonym library updating method comprises the following steps: Filter out identical characters from the first URL display information and the second URL display information; If the ratio of the same characters to the total number of characters in the first URL display information is greater than a first preset threshold, and the ratio of the same characters to the total number of characters in the second URL display information is greater than a second preset threshold, it is determined that the first URL display information is similar to the second URL display information.

7. A search-based synonym database updating device, characterized in that: The search-based synonym library updating device comprises: A sentence set generation module, used to obtain a first target word and a second target word to be compared, and generate a first sentence set including the first target word, and a second sentence set including the second target word; A feature similarity calculation module, used for calculating the feature similarity between the first target word and the second target word based on the first sentence set and the second sentence set; a judgment module, configured to obtain a first network search result of the first target word and a second network search result of the second target word if the feature similarity is greater than a target preset threshold, and judge whether the first target word and the second target word are synonyms according to the first network search result and the second network search result; a synonym library updating module, configured to bind the first target word and the second target word to a preset synonym library if the first target word and the second target word are synonyms, so as to update the preset synonym library; Before obtaining the first target word and the second target word to be compared and generating a first sentence set including the first target word and a second sentence set including the second target word, the method includes: Receiving a first word to be compared and a second word to be compared, and acquiring a first part of speech and a first component morpheme of the first word to be compared, and a second part of speech and a second component morpheme of the second word to be compared; The first part of speech is matched with the second part of speech to obtain a first matching result, and the first component morpheme is matched with the second component morpheme to obtain a second matching result; According to the first matching result and the second matching result, it is determined that the first word to be compared is a first target word, and the second word to be compared is a second target word.

8. A search-based synonym database updating device, characterized in that: The search-based synonym library update device includes: a memory, a processor, and a search-based synonym library update program stored in the memory and executable on the processor. When the search-based synonym library update program is executed by the processor, the steps of the search-based synonym library update method as described in any one of claims 1 to 6 are implemented.

9. A storage medium, characterized in that: The storage medium stores a search-based synonym library update program, which, when executed by a processor, implements the steps of the search-based synonym library update method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Synonym screening method and system

    CN107451126A

  • Near-synonym mining method and device based on network search, equipment and storage medium

    CN112417003A

  • Text sentence search device, method, and program

    JP2006065387A

  • Method and apparatus for information processing

    US20190065507A1