Search method, device, electronic device and storage medium
By segmenting search statements and identifying repeated affixes, the problem of low search statement processing efficiency and accuracy in the prior art is solved, and more efficient and accurate search results are achieved.
Patent Information
- Application Number
- CN202211169968.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-09-23
AI Technical Summary
Existing natural language processing algorithms have low efficiency and accuracy in processing search statements, and it is difficult to effectively identify and remove repeated affixes.
By segmenting the search statement, obtaining the word's part-of-speech information and character set, identifying and removing repeated affixes, generating identification information to characterize whether the search statement contains repeated affixes, and performing repeated affix deduplication to improve search accuracy.
Improves the accuracy and efficiency of search statements and ensures the quality of search results.
Smart Images

Figure CN115438664B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a search method, device, electronic device, and storage medium. Background Art
[0002] In computer science, search refers to the process of finding a search object with specific characteristics in a set of search objects. In some search processes, natural language processing (NLP) is required for the search statement.
[0003] However, existing natural language processing algorithms have limited ways of processing search statements, resulting in low search efficiency and accuracy.
[0004] It can be seen that how to improve search efficiency and accuracy is an issue worthy of attention. Summary of the Invention
[0005] In view of this, in order to solve some or all of the above technical problems, the embodiments of the present disclosure provide a search method, device, electronic device and storage medium.
[0006] In a first aspect, an embodiment of the present disclosure provides a search method, the method comprising:
[0007] Get the search statement;
[0008] Segmenting the search statement to obtain a first multiset consisting of words in the search statement and part-of-speech information of the words in the first multiset;
[0009] For each word in the first multiset, determining a second multiset consisting of characters in the word to obtain a second multiset corresponding to the word;
[0010] determining whether the search statement contains repeated affixes based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the words;
[0011] generating identification information for indicating whether the search statement contains repeated affixes;
[0012] In the case where the identification information indicates that the search sentence contains repeated affixes, the search sentence is subjected to repeated affix removal processing to obtain a target sentence, and the target sentence is used for search.
[0013] In one possible implementation, determining whether the search statement contains repeated affixes based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the words includes:
[0014] For each word in the first multi-set, if the part-of-speech information of the word indicates that the part-of-speech of the word is not a target part-of-speech, determining the word as a target word, wherein the target part-of-speech includes a person's name and a proper noun;
[0015] determining repeated words included in the search statement;
[0016] determining repeated characters included in the search statement;
[0017] Determining the non-Chinese characters included in the search statement;
[0018] Based on the second multi-set of word correspondences, the target word, the repeated word, the repeated characters, and the non-Chinese characters, it is determined whether the search statement contains repeated affixes.
[0019] In one possible implementation, determining whether the search statement contains a repeated affix based on the second multiset corresponding to the word, the target word, the repeated word, the repeated character, and the non-Chinese character includes:
[0020] determining first feature data of the search statement based on each word in the first multi-set, the weight of each word, and the part-of-speech information of each word;
[0021] determining second feature data of the search statement based on the determined second multiple sets;
[0022] determining third feature data of the search sentence based on the target word;
[0023] determining fourth feature data of the search statement based on the repeated words and the repeated characters;
[0024] determining fifth feature data of the search statement based on the non-Chinese characters;
[0025] Based on the first feature data, the second feature data, the third feature data, the fourth feature data, and the fifth feature data, it is determined whether the search sentence contains a repeated affix.
[0026] In one possible implementation, determining the first feature data of the search statement based on each word in the first multi-set, the weight of each word, and the part-of-speech information of each word includes:
[0027] concatenating the word vectors of the words in the first multiset to obtain a first feature vector;
[0028] concatenating the weight vectors of the weights of the respective words in the first multiset to obtain a second feature vector;
[0029] Calculating the inner product of the first eigenvector and the second eigenvector to obtain a third eigenvector;
[0030] concatenating the part-of-speech vectors of the part-of-speech information of each word in the first multiset to obtain a fourth feature vector;
[0031] The third feature vector and the fourth feature vector are concatenated to obtain first feature data of the search statement.
[0032] In one possible implementation, determining the second feature data of the search statement based on the determined second multiple sets includes:
[0033] An average vector of the character vectors of the characters included in the search sentence is determined as the second feature data of the search sentence.
[0034] In one possible implementation, determining the third feature data of the search statement based on the target word includes:
[0035] Determining the number of first occurrences of the target word in the search statement;
[0036] The first number of times is converted into third feature data of the search statement.
[0037] In one possible implementation, determining the fourth characteristic data of the search statement based on the repeated words and the repeated characters includes:
[0038] determining a second number of occurrences of the repeated word in the search statement;
[0039] determining a first ratio of the second degree to the cardinality of the first multiset;
[0040] determining the third occurrence of the repeated character in the search statement;
[0041] determining a second ratio of the third multiplicity to the sum of the determined cardinalities of the second multisets;
[0042] The second number, the first ratio, the third number, and the second ratio are converted into fourth feature data of the search statement.
[0043] In one possible implementation, determining the fifth feature data of the search statement based on the non-Chinese characters includes:
[0044] Determining a fourth number of occurrences of the non-Chinese character in the search statement;
[0045] determining a third ratio of the fourth order to the sum of the determined cardinalities of the respective second multisets;
[0046] The fourth number and the third ratio are converted into fifth feature data of the search statement.
[0047] In a second aspect, an embodiment of the present disclosure provides a search device, comprising:
[0048] An acquisition unit, used to acquire a search statement;
[0049] a word segmentation unit, configured to segment the search statement to obtain a first multiset consisting of words in the search statement and part-of-speech information of the words in the first multiset;
[0050] a first determining unit, for each word in the first multiset, determining a second multiset consisting of characters in the word, to obtain a second multiset corresponding to the word;
[0051] a second determining unit, configured to determine whether the search statement contains a repeated affix based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the words;
[0052] a generating unit, configured to generate identification information indicating whether the search statement contains a repeated affix;
[0053] The deduplication unit is used to perform duplicate affix removal on the search sentence when the identification information indicates that the search sentence contains duplicate affixes, to obtain a target sentence, and to use the target sentence for search.
[0054] In one possible implementation, determining whether the search statement contains repeated affixes based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the words includes:
[0055] For each word in the first multi-set, if the part-of-speech information of the word indicates that the part-of-speech of the word is not a target part-of-speech, determining the word as a target word, wherein the target part-of-speech includes a person's name and a proper noun;
[0056] determining repeated words included in the search statement;
[0057] determining repeated characters included in the search statement;
[0058] Determining the non-Chinese characters included in the search statement;
[0059] Based on the second multi-set of word correspondences, the target word, the repeated word, the repeated characters, and the non-Chinese characters, it is determined whether the search statement contains repeated affixes.
[0060] In one possible implementation, determining whether the search statement contains a repeated affix based on the second multiset corresponding to the word, the target word, the repeated word, the repeated character, and the non-Chinese character includes:
[0061] determining first feature data of the search statement based on each word in the first multi-set, the weight of each word, and the part-of-speech information of each word;
[0062] determining second feature data of the search statement based on the determined second multiple sets;
[0063] determining third feature data of the search sentence based on the target word;
[0064] determining fourth feature data of the search statement based on the repeated words and the repeated characters;
[0065] determining fifth feature data of the search statement based on the non-Chinese characters;
[0066] Based on the first feature data, the second feature data, the third feature data, the fourth feature data, and the fifth feature data, it is determined whether the search sentence contains a repeated affix.
[0067] In one possible implementation, determining the first feature data of the search statement based on each word in the first multi-set, the weight of each word, and the part-of-speech information of each word includes:
[0068] concatenating the word vectors of the words in the first multiset to obtain a first feature vector;
[0069] concatenating the weight vectors of the weights of the respective words in the first multiset to obtain a second feature vector;
[0070] Calculating the inner product of the first eigenvector and the second eigenvector to obtain a third eigenvector;
[0071] concatenating the part-of-speech vectors of the part-of-speech information of each word in the first multiset to obtain a fourth feature vector;
[0072] The third feature vector and the fourth feature vector are concatenated to obtain first feature data of the search statement.
[0073] In one possible implementation, determining the second feature data of the search statement based on the determined second multiple sets includes:
[0074] An average vector of the character vectors of the characters included in the search sentence is determined as the second feature data of the search sentence.
[0075] In one possible implementation, determining the third feature data of the search statement based on the target word includes:
[0076] Determining the number of first occurrences of the target word in the search statement;
[0077] The first number of times is converted into third feature data of the search statement.
[0078] In one possible implementation, determining the fourth characteristic data of the search statement based on the repeated words and the repeated characters includes:
[0079] determining a second number of occurrences of the repeated word in the search statement;
[0080] determining a first ratio of the second degree to the cardinality of the first multiset;
[0081] determining the third occurrence of the repeated character in the search statement;
[0082] determining a second ratio of the third multiplicity to the sum of the determined cardinalities of the second multisets;
[0083] The second number, the first ratio, the third number, and the second ratio are converted into fourth feature data of the search statement.
[0084] In one possible implementation, determining the fifth feature data of the search statement based on the non-Chinese characters includes:
[0085] Determining a fourth number of occurrences of the non-Chinese character in the search statement;
[0086] determining a third ratio of the fourth order to the sum of the determined cardinalities of the respective second multisets;
[0087] The fourth number and the third ratio are converted into fifth feature data of the search statement.
[0088] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0089] memory for storing computer programs;
[0090] The processor is configured to execute the computer program stored in the memory, and when the computer program is executed, implements the method of any embodiment of the search method of the first aspect of the present disclosure.
[0091] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, which, when executed by a processor, implements a method as in any embodiment of the search method of the first aspect described above.
[0092] In a fifth aspect, an embodiment of the present disclosure provides a computer program comprising a computer-readable code, which, when executed on a device, enables a processor in the device to execute instructions for implementing the steps of a method according to any embodiment of the search method of the first aspect described above.
[0093] The search method provided by the embodiment of the present disclosure obtains a search statement, then performs word segmentation on the search statement to obtain a first multiset consisting of words in the search statement and part-of-speech information of the words in the first multiset. Then, for each word in the first multiset, a second multiset consisting of characters in the word is determined to obtain a second multiset corresponding to the word. Subsequently, based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the word, it is determined whether the search statement contains repeated affixes. Next, identification information for characterizing whether the search statement contains repeated affixes is generated. Finally, if the identification information indicates that the search statement contains repeated affixes, the search statement is subjected to repeated affix removal processing to obtain a target statement, which is then used for search. This method can more accurately determine whether the search statement contains repeated affixes, and then, if the search statement contains repeated affixes, the search statement is subjected to repeated affix removal processing to obtain a target statement, thereby improving search efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0094] Figure 1 A flowchart of a search method provided in an embodiment of the present disclosure;
[0095] Figure 2 A flowchart of another search method provided in an embodiment of the present disclosure;
[0096] Figure 3A A schematic diagram of a model structure of a discriminator involved in a search method provided in an embodiment of the present disclosure;
[0097] Figure 3B A flowchart of another search method provided in an embodiment of the present disclosure;
[0098] Figure 4 A schematic diagram of the structure of a search device provided in an embodiment of the present disclosure;
[0099] Figure 5 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0100] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure.
[0101] Those skilled in the art will understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish objects such as different steps, devices or modules, and neither represent any specific technical meaning nor indicate the logical order between them.
[0102] It should also be understood that in this embodiment, “a plurality of” may refer to two or more than two, and “at least one” may refer to one, two or more than two.
[0103] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0104] In addition, the term "and / or" in this disclosure is merely a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this disclosure generally indicates that the related objects are in an "or" relationship.
[0105] It should also be understood that the description of the various embodiments in this disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced with each other. For the sake of brevity, they will not be described one by one.
[0106] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0107] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the above-mentioned technologies, methods, and equipment should be considered part of the specification.
[0108] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0109] It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other. To facilitate understanding of the embodiments of the present disclosure, the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. Obviously, the embodiments described are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0110] Figure 1 A flowchart of a search method provided by an embodiment of the present disclosure. Figure 1 As shown, the method specifically includes:
[0111] 201. Get the search statement.
[0112] In this embodiment, the search statement can be any statement. The search statement can include one or more words. Each word included in the search statement can include one or more characters.
[0113] As an example, the search statement may be a query statement (query).
[0114] Search statements can come from graphs, operational data, or historical query statements that users have searched.
[0115] 202. Segment the search statement to obtain a first multiset consisting of words in the search statement and part-of-speech information of the words in the first multiset.
[0116] In this embodiment, a hidden Markov model, a negative maximum matching method, etc. can be used to segment the search statement, thereby obtaining a first multiset consisting of words in the search statement and part-of-speech information of the words in the first multiset.
[0117] The first multiset may be a multiset consisting of the words in the search statement. The multisets (including the first multiset) may contain the same elements. Here, the elements in the first multiset are the words in the search statement.
[0118] For example, if the search phrase is "TV series season 1 season 1", then word segmentation of the search phrase can yield a first multiset consisting of the following words: "TV series", "first", "season", "first", "season". The word parts of speech information in the first multiset are as follows: "TV series" has the part-of-speech information "nz", "first" has the part-of-speech information "m", "season" has the part-of-speech information "ng", "first" has the part-of-speech information "m", and "season" has the part-of-speech information "ng". "nz" represents a proper noun, "m" represents a numeral, and "ng" represents a single-word noun.
[0119] 203. For each word in the first multiset, determine a second multiset consisting of characters in the word to obtain a second multiset corresponding to the word.
[0120] In this embodiment, an affix can be a morpheme attached to a root. Affixes can include prefixes, suffixes, and infixes. An affix attached to the front of a root is called a prefix, an affix attached to the back of a root is called a suffix, and an affix inserted in the middle of a root is called an infix.
[0121] The second multiset may be a multiset consisting of characters in a word. The multisets (including the second multiset) may contain identical elements. Here, the elements in the second multiset are characters in a word.
[0122] As an example, if a word is "first", then a second multiset consisting of the following characters can be obtained: "first", "one".
[0123] In some optional implementations of this embodiment, step 203 may be performed only in the following circumstances:
[0124] First, for each word in the first multi-set, if the word's part-of-speech information indicates that the word's part-of-speech is not a target part-of-speech, the word is determined as a target word. The target part-of-speech includes names and proper nouns.
[0125] Then, it is determined whether the first multi-set includes repeated target words, that is, it is determined whether the first multi-set includes at least two identical target words.
[0126] Then, if the first multi-set does not include repeated target words, the above step 203 is performed.
[0127] 204. Determine whether the search statement contains repeated affixes based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the words.
[0128] In some optional implementations of this embodiment, the following method (including steps 1 to 5) may be used to perform step 204:
[0129] In the first step, for each word in the first multi-set, if the part-of-speech information of the word indicates that the part-of-speech of the word is not the target part-of-speech, the word is determined as a target word.
[0130] The target part of speech includes names and proper nouns. In other words, if the part of speech of a word is neither a name nor a proper noun, then the word is a target word.
[0131] The second step is to determine the repeated words included in the search statement.
[0132] Specifically, for each word in the first multiset, it can be determined whether the first multiset includes other words identical to the word (that is, whether the first multiset includes at least two of the words) to determine whether the search statement includes repeated words. If the search statement includes repeated words, the repeated words are determined to be repeated words included in the search statement.
[0133] The third step is to determine the repeated characters included in the search statement.
[0134] Specifically, for each character in the first multiset, it can be determined whether the first multiset includes other characters identical to the character (that is, whether the first multiset includes at least two of the characters) to determine whether the search statement includes repeated characters. If the search statement includes repeated characters, the repeated characters are determined to be repeated characters included in the search statement.
[0135] The fourth step is to determine the non-Chinese characters included in the search statement.
[0136] Specifically, for each character in the first multi-set, it can be determined whether the character belongs to Chinese. Thus, when it is determined that the character does not belong to Chinese, the non-Chinese characters included in the search statement can be obtained.
[0137] The fifth step is to determine whether the search statement contains repeated affixes based on the second multi-set corresponding to the words, the target word, the repeated words, the repeated characters and the non-Chinese characters.
[0138] Here, whether the search statement contains repeated affixes may be determined based on the second multiset corresponding to all or part of the words in the first multiset, the target word, the repeated word, the repeated characters, and the non-Chinese characters.
[0139] It can be understood that in the above optional implementation method, whether the search statement contains repeated affixes can be determined based on the second multiple set corresponding to the word, the target word, the repeated word, the repeated character and the non-Chinese character, thereby improving the accuracy of identifying whether the search statement contains repeated affixes.
[0140] In some application scenarios of the above optional implementation, the following method (including steps 1 to 6) can be used to perform the above fifth step:
[0141] Step 1: Determine first feature data of the search statement based on each word in the first multi-set, the weight of each word, and the part-of-speech information of each word.
[0142] Among them, the term frequency-inverse document frequency (TF-IDF) algorithm can be used to calculate the weight of the word.
[0143] Step 2: Determine second feature data of the search statement based on the determined second multiple sets.
[0144] Step three: determining the third feature data of the search statement based on the target word.
[0145] Step 4: Determine fourth feature data of the search statement based on the repeated words and the repeated characters.
[0146] Step five: determining fifth feature data of the search statement based on the non-Chinese characters.
[0147] Step six: determining whether the search statement contains a repeated affix based on the first feature data, the second feature data, the third feature data, the fourth feature data, and the fifth feature data.
[0148] It is understood that in the above application scenario, whether a search statement contains repeated affixes can be determined based on each word in the first multiset, each word's weight, each word's part-of-speech information, each second multiset, the target word, repeated words, repeated characters, and non-Chinese characters. This can further improve the accuracy of identifying whether a search statement contains repeated affixes.
[0149] In some cases of the above application scenarios, the following method can be used to perform the above step 1:
[0150] First, the word vectors of each word in the first multi-set are concatenated to obtain a first feature vector.
[0151] Afterwards, the weight vectors of the weights of the respective words in the first multi-set are concatenated to obtain a second feature vector.
[0152] Then, the inner product of the first eigenvector and the second eigenvector is calculated to obtain a third eigenvector.
[0153] Subsequently, the part-of-speech vectors of the part-of-speech information of each word in the first multi-set are concatenated to obtain a fourth feature vector.
[0154] Finally, the third feature vector and the fourth feature vector are concatenated to obtain the first feature data of the search statement.
[0155] It can be understood that adopting the method described in the above situation to obtain the first feature data and then determining whether the search statement contains repeated affixes based on the first feature data can further improve the accuracy of identifying whether the search statement contains repeated affixes.
[0156] In some cases of the above application scenarios, the following method can be used to perform the above step 2:
[0157] An average vector of the character vectors of the characters included in the search sentence is determined as the second feature data of the search sentence.
[0158] It can be understood that adopting the method described in the above situation to obtain the second feature data and then determining whether the search statement contains repeated affixes based on the second feature data can further improve the accuracy of identifying whether the search statement contains repeated affixes.
[0159] In some cases of the above application scenarios, the following method can be used to perform the above step 3:
[0160] First, the number of first occurrences of the target word in the search statement is determined.
[0161] The first number may be the number of times the target word appears in the search statement.
[0162] Afterwards, the first number of times is converted into third feature data of the search statement.
[0163] It can be understood that by adopting the method described in the above situation to obtain the third feature data and then determining whether the search statement contains repeated affixes based on the third feature data, the accuracy of identifying whether the search statement contains repeated affixes can be further improved.
[0164] In some cases of the above application scenarios, the following method can be used to perform the above step 4:
[0165] First, the second number of occurrences of the repeated word in the search statement is determined.
[0166] The second number may be the number of times the same repeated word appears in the search statement.
[0167] Thereafter, a first ratio of the second degree to the cardinality of the first multiset is determined.
[0168] The cardinality of the first multiset may be the number of elements (ie, words) included in the first multiset.
[0169] The first ratio may be a ratio of the second order number to the cardinality of the first multiset.
[0170] Then, the third number of times the repeated character appears in the search statement is determined.
[0171] The third number may be the number of times the same repeated character appears in the search statement.
[0172] Subsequently, a second ratio of the third cardinality to the sum of the determined cardinalities of the respective second multisets is determined.
[0173] The cardinality of the second multiset may be the number of elements (ie, characters) included in the second multiset.
[0174] The second ratio may be the ratio of the third tertiary number to the sum of the above-mentioned cardinal numbers.
[0175] Finally, the second number, the first ratio, the third number, and the second ratio are converted into fourth feature data of the search statement.
[0176] It can be understood that adopting the method described in the above situation to obtain the fourth feature data and then determining whether the search statement contains repeated affixes based on the fourth feature data can further improve the accuracy of identifying whether the search statement contains repeated affixes.
[0177] In some cases of the above application scenarios, the following method can be used to perform the above step 5:
[0178] First, the fourth number of occurrences of the non-Chinese character in the search statement is determined.
[0179] The fourth number may be the number of times the same non-Chinese character appears in the search statement.
[0180] Thereafter, a third ratio of the fourth order and the sum of the determined cardinalities of the respective second multisets is determined.
[0181] The cardinality of the second multiset may be the number of elements (ie, characters) included in the second multiset.
[0182] The third ratio may be a ratio of the fourth order and the sum of the base numbers.
[0183] Subsequently, the fourth number of times and the third ratio are converted into fifth feature data of the search statement.
[0184] It can be understood that adopting the method described in the above situation to obtain the fifth feature data and then determining whether the search statement contains repeated affixes based on the fifth feature data can further improve the accuracy of identifying whether the search statement contains repeated affixes.
[0185] It should be noted that, based on the disclosure, those skilled in the art may use methods other than those described in the disclosure to perform steps one to five in the above application scenario, which will not be described in detail here.
[0186] 205. Generate identification information for indicating whether the search statement contains repeated affixes.
[0187] 206. When the identification information indicates that the search statement contains repeated affixes, perform duplicate affix removal on the search statement to obtain a target statement, and use the target statement for search.
[0188] In this embodiment, the target sentence can be a sentence obtained by removing duplicate affixes from the search sentence. For example, if the search sentence is "X TV series season 1 season 1", then the target sentence obtained by removing duplicate affixes from the search sentence can be "X TV series season 1".
[0189] The search method provided by the embodiment of the present disclosure obtains a search statement, then performs word segmentation on the search statement to obtain a first multiset consisting of words in the search statement and part-of-speech information of the words in the first multiset. Then, for each word in the first multiset, a second multiset consisting of characters in the word is determined to obtain a second multiset corresponding to the word. Subsequently, based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the word, it is determined whether the search statement contains repeated affixes. Next, identification information for characterizing whether the search statement contains repeated affixes is generated. Finally, if the identification information indicates that the search statement contains repeated affixes, the search statement is subjected to repeated affix removal processing to obtain a target statement, which is then used for search. This method can more accurately determine whether the search statement contains repeated affixes, and then, if the search statement contains repeated affixes, the search statement is subjected to repeated affix removal processing to obtain a target statement, thereby improving search efficiency and accuracy.
[0190] Figure 2 A flow chart of another search method provided for an embodiment of the present disclosure. This method can be applied to one or more electronic devices such as smart phones, laptops, desktop computers, portable computers, servers, etc. In addition, the execution subject of this method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute this method, or multiple electronic devices can cooperate with each other to execute this method. When the above-mentioned execution subject is software, this method can be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is given here.
[0191] Specifically, if Figure 2 As shown, the method specifically includes:
[0192] 301. Get the search statement.
[0193] In this embodiment, step 301 and Figure 1 Step 201 in the corresponding embodiment is basically the same and will not be described again here.
[0194] 302. Segment the search statement to obtain a first multiset consisting of words in the search statement and part-of-speech information of the words in the first multiset.
[0195] In this embodiment, step 302 and Figure 1 Step 202 in the corresponding embodiment is basically the same and will not be described again here.
[0196] 303. For each word in the first multiset, determine a second multiset consisting of characters in the word to obtain a second multiset corresponding to the word.
[0197] In this embodiment, step 303 and Figure 1 Step 203 in the corresponding embodiment is basically the same and will not be described again here.
[0198] 304. For each word in the first multi-set, if the part-of-speech information of the word indicates that the part-of-speech of the word is not a target part-of-speech, determine the word as a target word, wherein the target part-of-speech includes names and proper nouns.
[0199] In this embodiment, the target parts of speech include names and proper nouns. In other words, if the part of speech of a word is neither a name nor a proper noun, then the word is a target word.
[0200] 305. Determine repeated words, repeated characters, and non-Chinese characters included in the search statement.
[0201] In this embodiment, for each word in the first multiset, it is determined whether the first multiset includes other words identical to the word (that is, whether the first multiset includes at least two of the words) to determine whether the search statement includes repeated words. If the search statement includes repeated words, the repeated words are determined to be repeated words included in the search statement.
[0202] Furthermore, for each character in the first multiset, it may be determined whether the first multiset includes other characters identical to the character (i.e., whether the first multiset includes at least two of the characters) to determine whether the search statement includes repeated characters. If the search statement includes repeated characters, the repeated characters are determined to be repeated characters included in the search statement.
[0203] In addition, for each character in the first multi-set, it can be determined whether the character belongs to Chinese. Thus, when it is determined that the character does not belong to Chinese, the non-Chinese characters included in the search statement can be obtained.
[0204] 306. Determine whether the search statement contains a repeated affix based on the second multi-set corresponding to the word, the target word, the repeated word, the repeated character, and the non-Chinese character.
[0205] In this embodiment, whether the search statement contains repeated affixes may be determined based on the second multiset corresponding to all or part of the words in the first multiset, the target word, the repeated word, the repeated characters, and the non-Chinese characters.
[0206] 307. Generate identification information for indicating whether the search statement contains repeated affixes.
[0207] 308. When the identification information indicates that the search statement contains repeated affixes, perform duplicate affix removal on the search statement to obtain a target statement, and use the target statement for search.
[0208] In this embodiment, step 308 and Figure 1 Step 206 in the corresponding embodiment is basically the same and will not be described again here.
[0209] The following combination Figure 3B The embodiments of the present disclosure are exemplarily described. Figure 3B A flowchart of another search method provided by an embodiment of the present disclosure. However, it should be noted that the embodiment of the present disclosure may have the features described below, but the following description does not constitute a limitation on the scope of protection of the embodiment of the present disclosure.
[0210] The first step is to segment the search statement (e.g., query) and retain the stems of terms with the parts of speech being names (nr) and proper nouns (nz). If terms with other parts of speech (i.e., terms other than names and proper nouns) appear repeatedly, the search statement is considered to contain repeated affixes. Otherwise, proceed to the next step.
[0211] In the second step, assuming that this search statement has a total of M characters and N words, extract the following features:
[0212] First, each word after segmentation, its weight (term weight), and part-of-speech information (pos) are converted into feature vectors (embedding). The dimension of the feature vector of each word and part-of-speech information is Dim_term. Thus, the feature data of the word, word weight, and part-of-speech information are E _term ∈R N×Dim_term (i.e., the first eigenvector mentioned above), W _term ∈R N (that is, the second eigenvector mentioned above) and E _pos ∈R N×Dim_term (That is, the fourth eigenvector mentioned above.) The weight of each word is greater than 0 and less than 1.
[0213] Here, the feature vector can be used to "represent" an object (the object here refers to all things that can be recommended, such as goods, movies, music, news, etc.) with a low-dimensional dense vector. At the same time, the word "representation" means that Embedding can express certain characteristics of the corresponding object, and the distance between vectors can also reflect the similarity between objects.
[0214] In the word vector space, even when the vector of a word is completely unknown, the word vector of this word can be recommended based solely on the semantic key plus word vector operation.
[0215] Specifically, each word or part-of-speech information is converted to a number, such as nz is 1 and nr is 2, and then replaced with a variable of length dim. For example, if nr is 2, the word vector can be obtained as [0.1, 0.2, 0.3, 0, 0.11].
[0216] For the word feature vector, use the following formula 1 to multiply the corresponding vector element and the corresponding word weight and sum them to obtain the third feature vector:
[0217] E term_sum =Sum(E _term ×W _term )∈R Dim_term
[0218] Formula 1
[0219] For the feature vector of part-of-speech information, the sum and average of N feature vectors are taken to obtain the fourth feature vector E of the search sentence pos_avg ∈R Dim_term .
[0220] Finally, the fourth eigenvector and the second eigenvector are concatenated using the following formula 2 to obtain the first eigenvector of the search statement:
[0221] E term_pos =[E term_sum , E pos_avg ]∈R Dim_term+Dim_term
[0222] After formula 2, the second feature data of the search statement is determined:
[0223] The dimension of the character vector for each character is Dim_char, and for M character vectors there are E _char ∈R M×Dim_char , then for E _char The M character vectors are added and averaged to obtain the second feature data E of the search statement char_avg ∈R Dim _char .
[0224] Then, the number of repeated words and characters (i.e., the second and third numbers mentioned above) and the proportion (i.e., the first and second ratios mentioned above) contained in the search statement are calculated, and the feature dimension is 4.
[0225] Then, the number of non-Chinese characters (ie, the fourth number) and the proportion (ie, the third ratio) are calculated, and the feature dimension is 2.
[0226] Next, the consecutive number of non-nr, nz words (that is, the target words mentioned above) has a feature dimension of 1.
[0227] Finally, the dimension of the obtained feature data is Dim=Dim_term+Dim_term+Dim_char+4+2+1.
[0228] The third step is to feed the feature data with the above dimension of Dim into the discriminator for training:
[0229] like Figure 3A As shown, Figure 3A This is a schematic diagram of the model structure of a discriminator involved in a search method provided in an embodiment of the present disclosure. The discriminator uses a two-layer fully connected neural network model and finally performs a binary classification to determine whether the search sentence contains repeated affixes. The following loss function (Formula 3) can be used to train the discriminator:
[0230]
[0231] Among them, in the above formula 3, y i is the label value, y i ' is the predicted value.
[0232] Assume that the feature data of the above dimension is Dim as Input=[feat1,…,feat dim ]∈R dim , after the first fully connected layer and activation function (sigmoid), Feat = sigmoid (Input × W1), Feat ∈ R dim , W1∈R dim×V is the trainable linear parameter of the first fully connected layer, V is the dimension of the input. After that, it passes through the second fully connected layer and the sigmoid function O = sigmoid (Input × W2), O∈R 2 , W2∈R V×1 If the score is above 0.5, the search statement is determined to contain repeated affixes; otherwise, the search statement is determined to not contain repeated affixes.
[0233] Therefore, the above example proposes a method that combines strategy and machine learning to identify whether a search statement contains repeated affixes.
[0234] It should be noted that, in addition to the above contents, this embodiment may also include Figure 1 and / or Figure 2 The technical features described in the corresponding embodiments are then realized Figure 1 and / or Figure 2For details on the technical effects of the search method shown, please refer to Figure 1 and / or Figure 2 For the sake of brevity, the relevant description will not be repeated here.
[0235] The search method provided by the embodiment of the present disclosure can determine whether the search statement contains repeated affixes based on the second multiple set corresponding to the word, the target word, the repeated word, the repeated character and the non-Chinese character, thereby improving the accuracy of identifying whether the search statement contains repeated affixes, and further improving the efficiency and accuracy of the search.
[0236] Figure 4 This is a schematic diagram of the structure of a search device provided in an embodiment of the present disclosure. Specifically comprising:
[0237] Acquisition unit 401, used to acquire a search statement;
[0238] A word segmentation unit 402 is configured to segment the search statement to obtain a first multiset consisting of words in the search statement and part-of-speech information of the words in the first multiset;
[0239] A first determining unit 403 is configured to determine, for each word in the first multiset, a second multiset consisting of characters in the word, to obtain a second multiset corresponding to the word;
[0240] A second determining unit 404 is configured to determine whether the search statement contains a repeated affix based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the words;
[0241] A generating unit 405 is configured to generate identification information indicating whether the search statement contains a repeated affix;
[0242] The deduplication unit 406 is configured to perform deduplication processing on the search sentence to obtain a target sentence when the identification information indicates that the search sentence contains repeated affixes, so as to use the target sentence for search.
[0243] In one possible implementation, determining whether the search statement contains repeated affixes based on the first multiset and part-of-speech information of words in the first multiset includes:
[0244] For each word in the first multiset, determining a second multiset consisting of characters in the word to obtain a second multiset corresponding to the word;
[0245] Based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the words, it is determined whether the search statement contains repeated affixes.
[0246] In one possible implementation, determining whether the search statement contains repeated affixes based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the words includes:
[0247] For each word in the first multi-set, if the part-of-speech information of the word indicates that the part-of-speech of the word is not a target part-of-speech, determining the word as a target word, wherein the target part-of-speech includes a person's name and a proper noun;
[0248] determining repeated words included in the search statement;
[0249] determining repeated characters included in the search statement;
[0250] Determining the non-Chinese characters included in the search statement;
[0251] Based on the second multi-set of word correspondences, the target word, the repeated word, the repeated characters, and the non-Chinese characters, it is determined whether the search statement contains repeated affixes.
[0252] In one possible implementation, determining whether the search statement contains a repeated affix based on the second multiset corresponding to the word, the target word, the repeated word, the repeated character, and the non-Chinese character includes:
[0253] determining first feature data of the search statement based on each word in the first multi-set, the weight of each word, and the part-of-speech information of each word;
[0254] determining second feature data of the search statement based on the determined second multiple sets;
[0255] determining third feature data of the search sentence based on the target word;
[0256] determining fourth feature data of the search statement based on the repeated words and the repeated characters;
[0257] determining fifth feature data of the search statement based on the non-Chinese characters;
[0258] Based on the first feature data, the second feature data, the third feature data, the fourth feature data, and the fifth feature data, it is determined whether the search sentence contains a repeated affix.
[0259] In one possible implementation, determining the first feature data of the search statement based on each word in the first multi-set, the weight of each word, and the part-of-speech information of each word includes:
[0260] concatenating the word vectors of the words in the first multiset to obtain a first feature vector;
[0261] concatenating the weight vectors of the weights of the respective words in the first multiset to obtain a second feature vector;
[0262] Calculating the inner product of the first eigenvector and the second eigenvector to obtain a third eigenvector;
[0263] concatenating the part-of-speech vectors of the part-of-speech information of each word in the first multiset to obtain a fourth feature vector;
[0264] The third feature vector and the fourth feature vector are concatenated to obtain first feature data of the search statement.
[0265] In one possible implementation, determining the second feature data of the search statement based on the determined second multiple sets includes:
[0266] An average vector of the character vectors of the characters included in the search sentence is determined as the second feature data of the search sentence.
[0267] In one possible implementation, determining the third feature data of the search statement based on the target word includes:
[0268] Determining the number of first occurrences of the target word in the search statement;
[0269] The first number of times is converted into third feature data of the search statement.
[0270] In one possible implementation, determining the fourth characteristic data of the search statement based on the repeated words and the repeated characters includes:
[0271] determining a second number of occurrences of the repeated word in the search statement;
[0272] determining a first ratio of the second degree to the cardinality of the first multiset;
[0273] determining the third occurrence of the repeated character in the search statement;
[0274] determining a second ratio of the third multiplicity to the sum of the determined cardinalities of the second multisets;
[0275] The second number, the first ratio, the third number, and the second ratio are converted into fourth feature data of the search statement.
[0276] In one possible implementation, determining the fifth feature data of the search statement based on the non-Chinese characters includes:
[0277] Determining a fourth number of occurrences of the non-Chinese character in the search statement;
[0278] determining a third ratio of the fourth order to the sum of the determined cardinalities of the respective second multisets;
[0279] The fourth number and the third ratio are converted into fifth feature data of the search statement.
[0280] The search device provided in this embodiment may be as follows Figure 4 The search device shown in , can perform as Figure 1-3B All steps of the search method are implemented Figure 1-3B For details on the technical effects of the search method shown, please refer to Figure 1-3B For the sake of brevity, the relevant description will not be repeated here.
[0281] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure is provided. Figure 5 The electronic device 500 shown includes: at least one processor 501, a memory 502, at least one network interface 504 and another user interface 503. The various components in the electronic device 500 are coupled together via a bus system 505. It is understood that the bus system 505 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 505 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 505 is not shown in FIG. Figure 5 Various buses are labeled as bus system 505.
[0282] The user interface 503 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touchpad, or a touch screen).
[0283] It is understood that the memory 502 in the embodiment of the present disclosure may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 502 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0284] In some embodiments, the memory 502 stores the following elements, executable units, or data structures, or a subset thereof, or an extended set thereof: an operating system 5021 and application programs 5022 .
[0285] The operating system 5021 includes various system programs, such as a framework layer, a core library layer, and a driver layer, for implementing various basic services and handling hardware-based tasks. Application programs 5022 include various application programs, such as a media player and a browser, for implementing various application services. Programs implementing the methods of the embodiments of the present disclosure may be included in application programs 5022.
[0286] In this embodiment, by calling a program or instruction stored in the memory 502, specifically, a program or instruction stored in the application 5022, the processor 501 is configured to execute the method steps provided in each method embodiment, for example, including:
[0287] Get the search statement;
[0288] Segmenting the search statement to obtain a first multiset consisting of words in the search statement and part-of-speech information of the words in the first multiset;
[0289] For each word in the first multiset, determining a second multiset consisting of characters in the word to obtain a second multiset corresponding to the word;
[0290] determining whether the search statement contains repeated affixes based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the words;
[0291] generating identification information for indicating whether the search statement contains repeated affixes;
[0292] In the case where the identification information indicates that the search sentence contains repeated affixes, the search sentence is subjected to repeated affix removal processing to obtain a target sentence, and the target sentence is used for search.
[0293] The methods disclosed in the above embodiments of the present disclosure can be applied to or implemented by processor 501. Processor 501 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in processor 501 or by software instructions. The above processor 501 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in conjunction with the embodiments of the present disclosure can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software units in the decoding processor. The software units can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory 502 , and the processor 501 reads the information in the memory 502 and completes the steps of the above method in combination with its hardware.
[0294] It is understood that the embodiments described herein may be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, or other electronic units or combinations thereof for performing the above-mentioned functions of the present disclosure.
[0295] For software implementation, the techniques described above can be implemented by a unit that performs the functions described above. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0296] The electronic device provided in this embodiment may be Figure 5 The electronic device shown in FIG. 1 can perform the following operations: Figure 1-3B All steps of the search method are implemented Figure 1-3B For details on the technical effects of the search method shown, please refer to Figure 1-3B For the sake of brevity, the relevant description will not be repeated here.
[0297] The present disclosure also provides a storage medium (computer-readable storage medium). The storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; and the memory may also include a combination of the aforementioned types of memory.
[0298] When one or more programs in the storage medium can be executed by one or more processors, the search method executed on the electronic device side can be implemented.
[0299] The processor is configured to execute the search program stored in the memory to implement the following steps of the search method performed on the electronic device side:
[0300] Get the search statement;
[0301] Segmenting the search statement to obtain a first multiset consisting of words in the search statement and part-of-speech information of the words in the first multiset;
[0302] For each word in the first multiset, determining a second multiset consisting of characters in the word to obtain a second multiset corresponding to the word;
[0303] determining whether the search statement contains repeated affixes based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the words;
[0304] generating identification information for indicating whether the search statement contains repeated affixes;
[0305] In the case where the identification information indicates that the search sentence contains repeated affixes, the search sentence is subjected to repeated affix removal processing to obtain a target sentence, and the target sentence is used for search.
[0306] Professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0307] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0308] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present disclosure in detail. It should be understood that the above description is only a specific implementation method of the present disclosure and is not intended to limit the scope of protection of the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the scope of protection of the present disclosure.
Claims
1. A search method, characterized in that: The method comprises: Get the search statement; Segmenting the search statement to obtain a first multiset consisting of words in the search statement and part-of-speech information of the words in the first multiset; For each word in the first multiset, determining a second multiset consisting of characters in the word to obtain a second multiset corresponding to the word; Determining whether the search statement contains repeated affixes based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the words, including: for each word in the first multiset, if the part-of-speech information of the word indicates that the part-of-speech of the word is not a target part-of-speech, determining the word as a target word, wherein the target part-of-speech includes names and proper nouns; determining repeated words, repeated characters, and non-Chinese characters included in the search statement; and determining whether the search statement contains repeated affixes based on the second multiset corresponding to the word, the target word, the repeated words, the repeated characters, and the non-Chinese characters; generating identification information for indicating whether the search statement contains repeated affixes; In the case where the identification information indicates that the search sentence contains repeated affixes, the search sentence is subjected to repeated affix removal processing to obtain a target sentence, and the target sentence is used for search.
2. The method according to claim 1, characterized in that The determining whether the search statement contains a repeated affix based on the second multi-set corresponding to the word, the target word, the repeated word, the repeated character, and the non-Chinese character includes: determining first feature data of the search statement based on each word in the first multi-set, the weight of each word, and the part-of-speech information of each word; determining second feature data of the search statement based on the determined second multiple sets; determining third feature data of the search sentence based on the target word; determining fourth feature data of the search statement based on the repeated words and the repeated characters; determining fifth feature data of the search statement based on the non-Chinese characters; Based on the first feature data, the second feature data, the third feature data, the fourth feature data, and the fifth feature data, it is determined whether the search sentence contains a repeated affix.
3. The method according to claim 2, characterized in that The determining of first feature data of the search statement based on each word in the first multi-set, the weight of each word, and the part-of-speech information of each word includes: concatenating the word vectors of the words in the first multiset to obtain a first feature vector; concatenating the weight vectors of the weights of the respective words in the first multiset to obtain a second feature vector; Calculating the inner product of the first eigenvector and the second eigenvector to obtain a third eigenvector; concatenating the part-of-speech vectors of the part-of-speech information of each word in the first multiset to obtain a fourth feature vector; The third feature vector and the fourth feature vector are concatenated to obtain first feature data of the search statement.
4. The method according to claim 2, characterized in that The determining of the second feature data of the search statement based on the determined second multiple sets includes: An average vector of the character vectors of the characters included in the search sentence is determined as the second feature data of the search sentence.
5. The method according to claim 2, characterized in that The determining, based on the target word, the third feature data of the search statement includes: Determining the number of first occurrences of the target word in the search statement; The first number of times is converted into third feature data of the search statement.
6. The method according to claim 2, characterized in that The determining of the fourth feature data of the search statement based on the repeated words and the repeated characters includes: determining a second number of occurrences of the repeated word in the search statement; determining a first ratio of the second degree to the cardinality of the first multiset; determining the third occurrence of the repeated character in the search statement; determining a second ratio of the third multiplicity to the sum of the determined cardinalities of the second multisets; The second number, the first ratio, the third number, and the second ratio are converted into fourth feature data of the search statement.
7. The method according to claim 2, characterized in that The determining, based on the non-Chinese characters, fifth feature data of the search statement includes: Determining a fourth number of occurrences of the non-Chinese character in the search statement; determining a third ratio of the fourth order to the sum of the determined cardinalities of the respective second multisets; The fourth number and the third ratio are converted into fifth feature data of the search statement.
8. A search device, characterized in that: The device comprises: An acquisition unit, used to acquire a search statement; a word segmentation unit, configured to segment the search statement to obtain a first multiset consisting of words in the search statement and part-of-speech information of the words in the first multiset; a first determining unit configured to determine, for each word in the first multiset, a second multiset consisting of characters in the word, to obtain a second multiset corresponding to the word; a second determining unit configured to determine whether the search statement contains repeated affixes based on the part-of-speech information of the words in the first multiset and the second multiset corresponding to the words, and specifically configured to determine, for each word in the first multiset, if the part-of-speech information of the word indicates that the part-of-speech of the word is not a target part-of-speech, the word as a target word, wherein the target part-of-speech includes names and proper nouns; determine repeated words, repeated characters, and non-Chinese characters included in the search statement; and determine whether the search statement contains repeated affixes based on the second multiset corresponding to the word, the target word, the repeated words, the repeated characters, and the non-Chinese characters; The generating unit is configured to generate identification information for indicating whether the search statement contains repeated affixes.
9. An electronic device, characterized in that: include: memory for storing computer programs; A processor is configured to execute a computer program stored in the memory, and when the computer program is executed, implements the method described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Keyword extracting method and device
CN105426360A
Artificial intelligence based search method and device
CN106503231A