Search request response method and apparatus, computer device, and storage medium
Patent Information
- Application Number
- CN202211322683.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-27
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2042-10-27
AI Technical Summary
[0004]由于用户输入的搜索文本与作品的专有名词的表述方式不一致,使得搜索引擎解析出的搜索文本中的实体词不准确,在后续不能准确召回符合用户意图的内容,无法保障用户的搜索体验
[0044]相较于现有技术,本发明实施例提供的一种搜索请求响应方法、装置、计算机设备及存储介质,首先,获取用户搜索请求,用户搜索请求包括用户输入的搜索文本;然后,利用预先训练的实体识别模型和预先构建的词典,获得搜索文本中的有效实体词;接着,基于预先构建的标准实体词库,获得有效实体词对应的标准实体词;最后,根据标准实体词,确定推送内容,以响应用户搜索请求。由于本发明实施例通过预先构建的标准实体词库,获得搜索文本中有效实体词对应的标准实体词,再根据标准实体词,确定符合用户意图的推送内容,从而降低了用户非标准输入对搜索引擎解析用户意图的影响,提高了用户的搜索体验。
Smart Images

Figure CN115640445B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically, to a search request response method, apparatus, computer device, and storage medium. Background Technology
[0002] In search applications, especially in search engines for books, audio, and video, there are a large number of proper nouns in the works. When users enter search text, their expression may not be consistent with proper nouns, such as extra words, missing words, inconsistent punctuation, inconsistent capitalization of English words, and inconsistencies between numbers and Chinese characters.
[0003] For example, if the proper noun of the work is "Xiao Ming's School Diary Grades 1-3", the user's search text might be "Xiao Ming's School Diary Grades 1-3". Similarly, if the proper noun of the work is "Xia Ke Wu-Liu-Qi", the user's search text might be "Xia Ke Wu-Liu-Qi".
[0004] Because the search text entered by the user is inconsistent with the proper nouns in the work, the entity words in the search text parsed by the search engine are inaccurate. As a result, the search engine cannot accurately retrieve content that matches the user's intent, and the user's search experience cannot be guaranteed. Summary of the Invention
[0005] To overcome the shortcomings of the prior art, embodiments of the present invention provide a search request response method, apparatus, computer device, and storage medium.
[0006] The technical solution of this invention can be implemented as follows:
[0007] In a first aspect, embodiments of the present invention provide a search request response method, the method comprising:
[0008] Obtain the user's search request, which includes the search text entered by the user;
[0009] By using a pre-trained entity recognition model and a pre-built dictionary, valid entity words in the search text are obtained;
[0010] Based on a pre-built standard entity lexicon, obtain the standard entity words corresponding to the effective entity words;
[0011] Based on the standard entity words, determine the push content to respond to the user's search request.
[0012] Optionally, the step of obtaining valid entity words in the search text using a pre-trained entity recognition model and a pre-built dictionary includes:
[0013] The search text is input into the entity recognition model to obtain the first entity word;
[0014] Input the search text into the dictionary to obtain the second entity word;
[0015] The first entity word and the second entity word are fused and deduplicated to obtain the effective entity word.
[0016] Optionally, the standard entity lexicon includes multiple candidate entity words, and the step of obtaining the standard entity words corresponding to the valid entity words based on the pre-built standard entity lexicon includes:
[0017] Calculate the similarity between the effective entity word and each of the candidate entity words, and take the candidate entity word with the highest similarity to the effective entity word as the undetermined entity word;
[0018] If the similarity between the undetermined entity word and the valid entity word is greater than a preset threshold, then the undetermined entity word is used as the standard entity word corresponding to the valid entity word.
[0019] Optionally, the step of calculating the similarity between the effective entity word and each of the candidate entity words includes:
[0020] For each candidate entity word, the number of target characters in the candidate entity word is counted, where the target character is a character that exists in both the candidate entity word and the valid entity word;
[0021] If the total number of characters in the candidate entity words is less than the total number of characters in the effective entity words, then the ratio of the number of target characters to the total number of characters in the candidate entity words is used as the similarity between the candidate entity words and the effective entity words.
[0022] If the total number of characters in the candidate entity words is not less than the total number of characters in the valid entity words, then the ratio of the number of target characters to the total number of characters in the valid entity words is taken as the similarity between the candidate entity words and the valid entity words.
[0023] Optionally, the step of obtaining the standard entity words corresponding to the effective entity words based on a pre-built standard entity lexicon further includes:
[0024] If the similarity between the undetermined entity word and the effective entity word is not greater than a preset threshold, and there is a string of Arabic numerals in the effective entity word, then the string is taken as the string to be converted;
[0025] The conversion method of the string to be converted is determined by using a pre-trained conversion method prediction model;
[0026] According to the conversion method, the string to be converted is converted from Arabic numerals to Chinese numerals to obtain the converted valid entity words;
[0027] Calculate the similarity between the converted effective entity word and each of the candidate entity words, and determine the standard entity word corresponding to the effective entity word based on the similarity between the converted effective entity word and each of the candidate entity words.
[0028] Optionally, the step of converting the string to be converted from Arabic numerals to Chinese numerals according to the conversion method includes:
[0029] If the conversion method is a single-character conversion, then for each character in the string to be converted, the character is converted from Arabic numerals to Chinese numerals according to the value of the character;
[0030] If the conversion method is the overall conversion, then the string to be converted will be converted from Arabic numerals to Chinese numerals according to the numerical value of the string to be converted.
[0031] Optionally, the step of obtaining the standard entity words corresponding to the effective entity words based on a pre-built standard entity lexicon further includes:
[0032] If the similarity between the undetermined entity word and the effective entity word is not greater than a preset threshold, and the effective entity word contains a string of Chinese numerals, then the string is taken as the string to be converted;
[0033] If the string to be converted contains a preset character, then the string to be converted is converted from Chinese numerals to Arabic numerals according to the value of the string to be converted, and the converted valid entity words are obtained. The preset character represents a counting unit.
[0034] If the preset character does not exist in the string to be converted, then for each character in the string to be converted, the character is converted from Chinese numerals to Arabic numerals according to the value of the character, and the converted valid entity word is obtained;
[0035] Calculate the similarity between the converted effective entity word and each of the candidate entity words, and determine the standard entity word corresponding to the effective entity word based on the similarity between the converted effective entity word and each of the candidate entity words.
[0036] Secondly, embodiments of the present invention provide a search request response device, the device comprising:
[0037] The acquisition module is used to acquire user search requests, which include search text input by the user.
[0038] Processing module, used for:
[0039] By using a pre-trained entity recognition model and a pre-built dictionary, valid entity words in the search text are obtained;
[0040] Based on a pre-built standard entity lexicon, obtain the standard entity words corresponding to the effective entity words;
[0041] The response module is used to determine the push content based on the standard entity words in response to the user's search request.
[0042] Thirdly, embodiments of the present invention provide a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the search request response method as described in the first aspect.
[0043] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the search request response method as described in the first aspect.
[0044] Compared to existing technologies, the search request response method, apparatus, computer device, and storage medium provided in this embodiment of the invention first acquire a user search request, which includes search text input by the user; then, using a pre-trained entity recognition model and a pre-built dictionary, valid entity words in the search text are obtained; next, based on a pre-built standard entity lexicon, standard entity words corresponding to the valid entity words are obtained; finally, based on the standard entity words, push content is determined to respond to the user search request. Because this embodiment of the invention obtains standard entity words corresponding to the valid entity words in the search text through a pre-built standard entity lexicon, and then determines push content that matches the user's intent based on the standard entity words, it reduces the impact of non-standard user input on the search engine's interpretation of user intent, thereby improving the user's search experience. Attached Figure Description
[0045] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 A flowchart illustrating a search request response method provided in an embodiment of the present invention. Figure 1 ;
[0047] Figure 2 A flowchart illustrating a search request response method provided in an embodiment of the present invention. Figure 2 ;
[0048] Figure 3 A flowchart illustrating a search request response method provided in an embodiment of the present invention. Figure 3 ;
[0049] Figure 4 A functional unit block diagram of a search request response device provided in an embodiment of the present invention;
[0050] Figure 5 This is a schematic block diagram of a computer device provided in an embodiment of the present invention.
[0051] Icons: 100 - Search request response device; 101 - Acquisition module; 102 - Processing module; 103 - Response module; 200 - Computer equipment; 210 - Memory; 220 - Processor. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0053] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0054] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0055] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0056] It should be noted that, where there is no conflict, the features in the embodiments of the present invention can be combined with each other.
[0057] To reduce the impact of non-standard user input on the search engine's interpretation of user intent and to ensure a better user search experience, this invention provides a search request response method, which will be described in detail below.
[0058] Please refer to Figure 1 The search request response method includes steps S101 to S104.
[0059] S101, acquiring a user's search request.
[0060] Wherein, the user's search request includes search text input by the user.
[0061] S102, obtaining valid entity words in the search text by using a pre-trained entity recognition model and a pre-constructed dictionary.
[0062] Wherein, valid entity words refer to entity words that can reflect the user's real intention in the search text, and in search scenarios such as books, audio and video, valid entity words are usually work names.
[0063] The training process of the entity recognition model can be as follows: first, manually annotate the historical search text input by the user, annotate the work names therein to obtain training corpora; then input the training corpora into a pre-constructed BERT model to obtain the entity recognition model.
[0064] The construction process of the dictionary can be as follows: first, construct an initial dictionary offline; then mine entity words from off-site knowledge graphs and user logs; then, after cleaning the mined entity words, add them to the initial dictionary to obtain the dictionary for acquiring valid entity words.
[0065] As a possible implementation, the implementation process of step S102 can be as follows:
[0066] First, input the search text into the entity recognition model to obtain first entity words.
[0067] Then, input the search text into the dictionary to obtain second entity words.
[0068] Next, perform fusion and deduplication processing on the first entity words and the second entity words to obtain valid entity words.
[0069] For example, assuming that the search text input by the user is "Fun Reading Xia Ke 567", input it into the entity recognition model and the dictionary respectively, the first entity word output by the entity recognition model is "Xia Ke 567", and the second entity word output by the dictionary is "Xia Ke 567". Through fusion and deduplication processing of the first entity word and the second entity word, the obtained valid entity word is "Xia Ke 567".
[0070] S103, acquiring a standard entity word corresponding to the valid entity word based on a pre-constructed standard entity word bank.
[0071] Wherein, the pre-constructed standard entity word bank includes a plurality of candidate entity words, and each candidate entity word is a proprietary name of books, audio and video acquired from publication information or copyright information of books, audio and video.
[0072] As a possible implementation, please refer to Figure 2 , step S103 may include sub-steps S103-1 to S103-2.
[0073] S103-1: calculating the similarity between the valid entity word and each candidate entity word, and taking the candidate entity word with the highest similarity to the valid entity word as the pending entity word.
[0074] In the embodiment of the present invention, the process of "calculating the similarity between the valid entity word and each candidate entity word" can be as follows:
[0075] First, for each candidate entity word, counting the number of target characters in the candidate entity word;
[0076] wherein the target characters are characters that exist in both the candidate entity word and the valid entity word.
[0077] If the total number of characters of the candidate entity word is less than the total number of characters of the valid entity word, the ratio of the number of target characters to the total number of characters of the candidate entity word is taken as the similarity between the candidate entity word and the valid entity word;
[0078] If the total number of characters of the candidate entity word is not less than the total number of characters of the valid entity word, the ratio of the number of target characters to the total number of characters of the valid entity word is taken as the similarity between the candidate entity word and the valid entity word.
[0079] For example, assuming the valid entity word is "Xia Ke 5678", and a candidate entity word is "Xia Ke Wu Liu Qi", since the characters "Xia" and "Ke" exist in both the valid entity word and the candidate entity word, the characters "Xia" and "Ke" are target characters, that is, the number of target characters in the valid entity word is 2.
[0080] The total number of characters of the valid entity word is 6, and the total number of characters of the candidate entity word is 5. Since the total number of characters of the candidate entity word is less than the total number of characters of the valid entity word, the similarity between the candidate entity word and the valid entity word is the ratio of the number of target characters to the total number of characters of the candidate entity word, that is 2 / 5 = 0.4.
[0081] S103-2: if the similarity between the pending entity word and the valid entity word is greater than a preset threshold, taking the pending entity word as the standard entity word corresponding to the valid entity word.
[0082] wherein the preset threshold can be set according to actual requirements.
[0083] For example, it is assumed that the similarity between candidate entity word 1 and the valid entity word is 0.75, the similarity between candidate entity word 2 and the valid entity word is 0.88, and the similarity between candidate entity word 3 and the valid entity word is 0.91. Since candidate entity word 3 has the highest similarity with the valid entity word, candidate entity word 3 is taken as the pending entity word.
[0084] Assuming that the preset threshold is 0.90, since the similarity between the pending entity word and the valid entity word is 0.91, which is greater than 0.90, the pending entity word, that is, candidate entity word 3, can be used as the standard entity word corresponding to the valid entity word.
[0085] When the similarity between the pending entity word and the valid entity word is not greater than the preset threshold, please refer to Figure 3 , step S103 further comprises sub-steps S103-3 to S103-6 that are parallel to sub-step S103-2.
[0086] S103-3: if the similarity between the pending entity word and the valid entity word is not greater than the preset threshold, and there is a character string that is Arabic numerals in the valid entity word, then taking the character string as a character string to be converted.
[0087] For example, assuming that the valid entity word is "Xia Ke 567", for this valid entity word, since the similarity between the pending entity word obtained through steps S103-1 to S103-2 and the valid entity word is not greater than the preset threshold, and there exists the character string "567" which is Arabic numerals in the valid entity word, therefore, the character string "567" is taken as the character string to be converted.
[0088] S103-4: determining a conversion mode of the character string to be converted by using a pre-trained conversion mode prediction model.
[0089] wherein the conversion modes include single-character conversion and overall conversion.
[0090] It can be understood that single-character conversion refers to converting each character in the character string individually according to the numerical value, while overall conversion refers to regarding the character string as a whole and performing conversion according to the overall numerical value. For example, for the character string "567", according to single-character conversion, it is required to sequentially convert the character "5" into the character "five", the character "6" into the character "six", and the character "7" into the character "seven", and the obtained final result is the character string "five six seven", while according to overall conversion, the obtained final result is "five hundred and sixty-seven".
[0091] In this embodiment of the invention, the conversion method of the string to be converted is determined by a pre-trained conversion method prediction model. The training process of the conversion method prediction model can be as follows: First, extract the search text containing Arabic numerals from the user input from the user log, manually annotate the conversion method of the Arabic numeral part, and obtain the training corpus; then, input the training corpus into the pre-built BERT model for training to obtain the conversion method prediction model.
[0092] S103-5, according to the conversion method, convert the string to be converted from Arabic numerals to Chinese numerals to obtain the converted valid entity words.
[0093] In this embodiment of the invention, the implementation process of step S103-5 can be as follows:
[0094] If the conversion method is single-character conversion, then for each character in the string to be converted, the character will be converted from Arabic numerals to Chinese numerals according to the character's numerical value.
[0095] If the conversion method is a complete conversion, then the string to be converted will be converted from Arabic numerals to Chinese numerals according to the numerical value of the string to be converted.
[0096] For example, assuming the string to be converted in the effective entity word "1001 Nights" is "1001", the conversion method prediction model determines that the conversion method of "1001" is a whole conversion. Therefore, "1001" is converted into "one thousand and one", and the converted effective entity word is "one thousand and one nights".
[0097] S103-6 Calculate the similarity between the converted effective entity words and each candidate entity word, and determine the standard entity words corresponding to the effective entity words based on the similarity between the converted effective entity words and each candidate entity word.
[0098] The implementation principle of "calculating the similarity between the converted effective entity words and each candidate entity word" in step S103-6 is the same as that of "calculating the similarity between the effective entity words and each candidate entity word" in step S103-1, and will not be repeated here.
[0099] The implementation process of "determining the standard entity word corresponding to the effective entity word based on the similarity between the converted effective entity word and each candidate entity word" in step S103-6 can be as follows:
[0100] First, determine whether there are candidate entity words whose similarity to the converted effective entity words is greater than a preset threshold;
[0101] If a candidate entity word has a similarity greater than a preset threshold with the converted effective entity word, then the candidate entity word is taken as the standard entity word corresponding to the effective entity word.
[0102] If there are a plurality of candidate entity words whose similarity to the converted valid entity word is greater than a preset threshold, the candidate entity word with the highest similarity to the converted valid entity word among the plurality of candidate entity words is taken as the standard entity word corresponding to the valid entity word;
[0103] If there is no candidate entity word whose similarity to the converted valid entity word is greater than the preset threshold, the valid entity word itself is taken as the corresponding standard entity word.
[0104] Please refer again to Figure 3 , step S103 further comprises sub-steps S103-7 to S103-10 which are juxtaposed with sub-step S103-2 and sub-steps S103-3 to S103-6.
[0105] S103-7, if the similarity between the undetermined entity word and the valid entity word is not greater than the preset threshold, and there is a character string that is a Chinese numeral in the valid entity word, taking the character string as a character string to be converted.
[0106] By way of example, assuming the valid entity word is "Xiao Ming's Record of Schooling Yi Er San Nian Ji", for this valid entity word, since the similarity between the undetermined entity word obtained through steps S103-1 to S103-2 and the valid entity word is not greater than the preset threshold, and there is the character string "Yi Er San" that is a Chinese numeral in the valid entity word, the character string "Yi Er San" is therefore taken as the character string to be converted.
[0107] S103-8, if there is a preset character in the character string to be converted, converting the character string to be converted from Chinese numerals to Arabic numerals according to the numerical value of the character string to be converted, so as to obtain a converted valid entity word.
[0108] wherein the preset character represents a counting unit, such as ten, hundred, thousand, ten thousand, hundred million and the like.
[0109] By way of example, assuming the valid entity word is "The 101st Confession", the character string to be converted thereof is "yi bai ling yi", since there is the preset character "bai" in "yi bai ling yi", the conversion result obtained according to the overall numerical value of the character string to be converted is "101", and then the converted valid entity word "The 101st Confession" is obtained.
[0110] S103-9, if there is no preset character in the character string to be converted, for each character in the character string to be converted, converting the character from a Chinese numeral to an Arabic numeral according to the numerical value of the character, so as to obtain a converted valid entity word.
[0111] For example, assuming the valid entity word is "大内密探零零九" and its string to be converted is "零零九", since there is no preset character in "零零九", each character in "零零九" is converted in sequence according to its numerical value, that is, the character "零" is converted to the character "0", the character "零" is converted to "0", and the character "九" is converted to the character "9".
[0112] S103-10, calculating the similarity between the converted valid entity word and each candidate entity word, and determining the standard entity word corresponding to the valid entity word according to the similarity between the converted valid entity word and each candidate entity word.
[0113] Wherein, the implementation principle of step S103-10 is the same as that of step S103-6, and will not be repeated herein.
[0114] It can be understood that for the pending entity word determined through step S103-1, if the similarity between the pending entity word and the valid entity word is not greater than a preset threshold, and there is no character string that is Arabic numerals or Chinese numerals in the valid entity word, the valid entity word itself is directly used as its standard entity word.
[0115] S104, determining push content according to the standard entity word, so as to respond to the user's search request.
[0116] In the embodiment of the present invention, the standard entity word corresponding to the valid entity word in the search text is used to perform push content matching, and after the determined push content is sorted according to the matching degree with the real user intention reflected by the standard entity word, it is sequentially pushed to the user.
[0117] Compared with the prior art, the technical effect of the embodiment of the present invention is that the standard entity word corresponding to the valid entity word in the search text is obtained through a pre-constructed standard entity word database, and the push content is determined according to the standard entity word, thereby reducing the influence of the user's non-standard input on the search engine's analysis of the user's intention, enabling the search engine to recall more push content that conforms to the user's intention in the search recall stage, and the sorting of the push content is more accurate, thereby improving the user's search experience.
[0118] In order to implement the corresponding steps in the above method embodiments and various possible implementations, an implementation of a search request response apparatus 100 is provided below.
[0119] Please refer Figure 4 , the search request response apparatus 100 includes an acquisition module 101, a processing module 102 and a response module 103.
[0120] The acquisition module 103 is configured to acquire a user search request, where the user search request includes search text input by the user.
[0121] The processing module 102 is used to obtain effective entity words in the search text by using a pre-trained entity recognition model and a pre-built dictionary; and to obtain standard entity words corresponding to the effective entity words based on a pre-built standard entity lexicon.
[0122] The response module 103 is used to determine the push content based on standard entity words in response to user search requests.
[0123] Optionally, the processing module 102 is specifically used to input the search text into the entity recognition model to obtain a first entity word; input the search text into a dictionary to obtain a second entity word; and perform fusion and deduplication processing on the first entity word and the second entity word to obtain a valid entity word.
[0124] Optionally, the processing module 102 is further configured to calculate the similarity between the effective entity word and each candidate entity word, and to take the candidate entity word with the highest similarity to the effective entity word as the pending entity word; if the similarity between the pending entity word and the effective entity word is greater than a preset threshold, then the pending entity word is taken as the standard entity word corresponding to the effective entity word.
[0125] Optionally, when calculating the similarity between a valid entity word and each candidate entity word, the processing module 102 specifically counts the number of target characters in each candidate entity word. Target characters are characters that exist in both the candidate entity word and the valid entity word. If the total number of characters in the candidate entity word is less than the total number of characters in the valid entity word, the ratio of the number of target characters to the total number of characters in the candidate entity word is used as the similarity between the candidate entity word and the valid entity word. If the total number of characters in the candidate entity word is not less than the total number of characters in the valid entity word, the ratio of the number of target characters to the total number of characters in the valid entity word is used as the similarity between the candidate entity word and the valid entity word.
[0126] Optionally, the processing module 102 is further configured to: if the similarity between the pending entity word and the valid entity word is not greater than a preset threshold, and there is a string in the valid entity word that is an Arabic numeral, then take the string as the string to be converted; use a pre-built conversion method prediction model to determine the conversion method of the string to be converted; convert the string to be converted from Arabic numerals to Chinese numerals according to the conversion method to obtain the converted valid entity word; calculate the similarity between the converted valid entity word and each candidate entity word, and determine the standard entity word corresponding to the valid entity word based on the similarity between the converted valid entity word and each candidate entity word.
[0127] Optionally, when processing module 102 converts the string to be converted from Arabic numerals to Chinese numerals according to the conversion method, it specifically converts each character in the string to be converted from Arabic numerals to Chinese numerals according to the character's value if the conversion method is single-character conversion; and converts the string to be converted from Arabic numerals to Chinese numerals according to the value of the character if the conversion method is overall conversion.
[0128] Optionally, the processing module 102 is further configured to: if the similarity between the candidate entity word and the valid entity word is no greater than a preset threshold, and the valid entity word contains a string of Chinese numerals, then use the string as the string to be converted; if the string to be converted contains a preset character, then convert the string from Chinese numerals to Arabic numerals according to the numerical value of the string to be converted, to obtain the converted valid entity word, where the preset character represents the counting unit; if the string to be converted does not contain a preset character, then for each character in the string to be converted, convert the character from Chinese numerals to Arabic numerals according to the numerical value of the character, to obtain the converted valid entity word; calculate the similarity between the converted valid entity word and each candidate entity word, and determine the standard entity word corresponding to the valid entity word based on the similarity between the converted valid entity word and each candidate entity word.
[0129] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the search request response device 100 described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0130] Furthermore, this embodiment of the invention also provides a computer device 200, please refer to... Figure 5 The computer device 200 may include a memory 210 and a processor 220.
[0131] The processor 220 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of a program for controlling the search request response method provided in the above method embodiments.
[0132] The memory 210 may be a ROM or other type of static storage device capable of storing static information and instructions, RAM or other type of dynamic storage device capable of storing information and instructions, or an electrically erasable programmable-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 210 may exist independently and be connected to the processor 220 via a communication bus. The memory 210 may also be integrated with the processor 220. The memory 210 is used to store machine-executable instructions for executing the scheme of this application. The processor 220 is used to execute the machine-executable instructions stored in the memory 210 to implement the above-described method embodiments.
[0133] This invention also provides a computer-readable storage medium containing a computer program, which, when executed, can be used to perform related operations in the search request response method provided in the above-described method embodiments.
[0134] In summary, the search request response method, apparatus, computer device, and storage medium provided by this invention first acquire a user search request, which includes search text input by the user; then, using a pre-trained entity recognition model and a pre-built dictionary, valid entity words in the search text are obtained; next, based on a pre-built standard entity lexicon, standard entity words corresponding to the valid entity words are obtained; finally, based on the standard entity words, push content is determined to respond to the user search request. Because this invention obtains standard entity words corresponding to the valid entity words in the search text through a pre-built standard entity lexicon, and then determines push content that matches the user's intent based on the standard entity words, it reduces the impact of non-standard user input on the search engine's interpretation of user intent, thereby improving the user's search experience.
[0135] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A search request response method, characterized in that, The method includes: Obtain the user's search request, which includes the search text entered by the user; By using a pre-trained entity recognition model and a pre-built dictionary, valid entity words in the search text are obtained; Based on a pre-built standard entity lexicon, standard entity words corresponding to the effective entity words are obtained. The candidate entity words in the standard entity lexicon are derived from the publication information or copyright information of books, audio, or video. Based on the standard entity words, determine the push content to respond to the user's search request; The steps for obtaining the standard entity words corresponding to the effective entity words based on the pre-built standard entity lexicon include: Calculate the similarity between the effective entity word and each of the candidate entity words, and take the candidate entity word with the highest similarity to the effective entity word as the undetermined entity word; If the similarity between the undetermined entity word and the effective entity word is greater than a preset threshold, then the undetermined entity word is used as the standard entity word corresponding to the effective entity word. If the similarity between the undetermined entity word and the effective entity word is not greater than a preset threshold, and there is a string of Arabic numerals in the effective entity word, then the string is taken as the string to be converted; The conversion method of the string to be converted is determined by using a pre-trained conversion prediction model; If the conversion method is a single-character conversion, then for each character in the string to be converted, according to the value of the character, the character is converted from Arabic numerals to Chinese numerals to obtain the converted valid entity word; If the conversion method is a complete conversion, then according to the numerical value of the string to be converted, the string to be converted is converted from Arabic numerals to Chinese numerals to obtain the converted valid entity words; Calculate the similarity between the converted effective entity word and each of the candidate entity words, and determine the standard entity word corresponding to the effective entity word based on the similarity between the converted effective entity word and each of the candidate entity words.
2. The method as described in claim 1, characterized in that, The step of obtaining valid entity words in the search text using a pre-trained entity recognition model and a pre-built dictionary includes: The search text is input into the entity recognition model to obtain the first entity word; Input the search text into the dictionary to obtain the second entity word; The first entity word and the second entity word are fused and deduplicated to obtain the effective entity word.
3. The method as described in claim 1, characterized in that, The step of calculating the similarity between the effective entity word and each candidate entity word includes: For each candidate entity word, the number of target characters in the candidate entity word is counted, where the target character is a character that exists in both the candidate entity word and the valid entity word; If the total number of characters in the candidate entity words is less than the total number of characters in the effective entity words, then the ratio of the number of target characters to the total number of characters in the candidate entity words is used as the similarity between the candidate entity words and the effective entity words. If the total number of characters in the candidate entity words is not less than the total number of characters in the valid entity words, then the ratio of the number of target characters to the total number of characters in the valid entity words is taken as the similarity between the candidate entity words and the valid entity words.
4. The method as described in claim 1, characterized in that, The step of obtaining the standard entity words corresponding to the effective entity words based on the pre-built standard entity lexicon further includes: If the similarity between the undetermined entity word and the effective entity word is not greater than a preset threshold, and the effective entity word contains a string of Chinese numerals, then the string is taken as the string to be converted; If the string to be converted contains a preset character, then the string to be converted is converted from Chinese numerals to Arabic numerals according to the value of the string to be converted, and the converted valid entity words are obtained. The preset character represents a counting unit. If the preset character does not exist in the string to be converted, then for each character in the string to be converted, the character is converted from Chinese numerals to Arabic numerals according to the value of the character, and the converted valid entity word is obtained; Calculate the similarity between the converted effective entity word and each of the candidate entity words, and determine the standard entity word corresponding to the effective entity word based on the similarity between the converted effective entity word and each of the candidate entity words.
5. A search request response device, characterized in that, The device includes: The acquisition module is used to acquire user search requests, which include search text input by the user. Processing module, used for: By using a pre-trained entity recognition model and a pre-built dictionary, valid entity words in the search text are obtained; Based on a pre-built standard entity lexicon, standard entity words corresponding to the effective entity words are obtained. The candidate entity words in the standard entity lexicon are derived from the publication information or copyright information of books, audio, or video. The response module is used to determine the push content based on the standard entity words in response to the user's search request; The processing module is specifically used to calculate the similarity between the effective entity word and each candidate entity word, and to designate the candidate entity word with the highest similarity to the effective entity word as a pending entity word; if the similarity between the pending entity word and the effective entity word is greater than a preset threshold, then the pending entity word is designated as the standard entity word corresponding to the effective entity word; if the similarity between the pending entity word and the effective entity word is not greater than a preset threshold, and the effective entity word contains a string of Arabic numerals, then that string is designated as the string to be converted; and using a pre-trained conversion method prediction model, the string to be converted is determined. The conversion method is as follows: If the conversion method is a single-character conversion, then for each character in the string to be converted, the character is converted from Arabic numerals to Chinese numerals according to the numerical value of the character, to obtain the converted effective entity word; if the conversion method is a whole-string conversion, then the string to be converted is converted from Arabic numerals to Chinese numerals according to the numerical value of the string to be converted, to obtain the converted effective entity word; the similarity between the converted effective entity word and each candidate entity word is calculated, and the standard entity word corresponding to the effective entity word is determined based on the similarity between the converted effective entity word and each candidate entity word.
6. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the search request response method as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the search request response method as described in any one of claims 1-4.
Citation Information
Patent Citations
Entity recommendation method and device, storage medium and equipment
CN110516260A
Data query method and device and computer readable medium
CN112307184A