Data retrieval method and device, electronic equipment and storage medium
Through natural language processing and semantic term matching, combined with target attribute lexicon, accurate data retrieval without understanding database rules is achieved, which solves the problem of low accuracy caused by inconsistent search rules in the existing technology, and improves the convenience and accuracy of search sex.
Patent Information
- Application Number
- CN202310868831.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-14
- Publication Date
- 2025-01-17
AI Technical Summary
In the existing data retrieval methods, if the search request entered by the user does not comply with the database search rules, or the search elements are inaccurate, it will lead to the accuracy of the search results being low, increasing the user's learning cost and search difficulty.
By performing natural language processing on the text to be retrieved input by the user, the first semantic entry is determined, and the target model type and the second semantic entry are determined, and the search parameters are determined in combination with the target attribute lexicon, providing keywords that are more in line with the user's intentions. , realize accurate retrieval without understanding database rules.
It improves the accuracy and convenience of data retrieval, reduces users' requirements for the organizational ability of retrieval elements, and improves user experience.
Smart Images

Figure CN119322782A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of database retrieval, and in particular to a data retrieval method, device, electronic equipment and storage medium. Background Art
[0002] With the popularization of cloud technology and data management, the amount of user data is increasing, and the upgrade of user search methods must also be close to accurately finding the data expected by users. In data retrieval technology, users need to search according to the corresponding search rules of the database, which requires users to learn the search rules of the corresponding database. This process will consume a lot of learning time and increase the difficulty of retrieval. Therefore, in the retrieval process, there are certain requirements for the user's ability to organize search elements. If the search request entered by the user does not meet the search rules of the database, or the search elements in the search request are inaccurate, the accuracy of the search results will be low. Summary of the invention
[0003] The embodiment of the present invention provides a data retrieval method, which aims to solve the problem that in the existing data retrieval process, if the retrieval request input by the user does not conform to the retrieval rules of the database, or the retrieval elements in the retrieval request are inaccurate, the accuracy of the retrieval results will be low. The first semantic term is determined according to the text to be retrieved, and the target model type and the second semantic term are determined through the first semantic term. The retrieval input parameter is then determined according to the second semantic term and the corresponding target attribute in the target attribute word library, and then the keyword that better meets the user's retrieval intention is provided through the retrieval input parameter for the user to search. The retrieval process does not require the user to understand the data retrieval rules corresponding to the database, nor does it require the user to organize the retrieval elements, which improves the convenience of data retrieval, and also improves the accuracy of data retrieval, thereby improving the user experience.
[0004] In a first aspect, an embodiment of the present invention provides a data retrieval method, the method comprising the following steps:
[0005] Performing natural language processing on the text to be searched input by the user to obtain a first semantic term corresponding to the text to be searched;
[0006] Determine, according to the first semantic term, a target model type corresponding to the text to be retrieved and a second semantic term corresponding to the target model type, wherein the target model type corresponds to a target attribute word library;
[0007] According to the second semantic term, the target attribute corresponding to the text to be retrieved is determined in the target attribute vocabulary, and the search input parameter corresponding to the text to be retrieved is determined according to the target attribute; according to the search input parameter, the search result corresponding to the text to be retrieved is determined, and the search result is returned to the user.
[0008] In a second aspect, an embodiment of the present invention further provides a data retrieval device, the data retrieval device comprising:
[0009] A processing module, used for performing natural language processing on the text to be searched input by the user to obtain a first semantic term corresponding to the text to be searched;
[0010] A first determination module, configured to determine, based on the first semantic term, a target model type corresponding to the text to be retrieved and a second semantic term corresponding to the target model type, wherein the target model type corresponds to a target attribute word library;
[0011] A second determination module is used to determine the target attribute corresponding to the text to be searched in the target attribute word library according to the second semantic term, and determine the search input parameter corresponding to the text to be searched according to the target attribute;
[0012] The third determination module is used to determine the search result corresponding to the text to be searched according to the search input parameter, and return the search result to the user.
[0013] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the data retrieval method provided in the embodiment of the present invention when executing the computer program.
[0014] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the data retrieval method provided in the embodiment of the invention are implemented.
[0015] In an embodiment of the present invention, natural language processing is performed on the text to be retrieved input by the user to obtain a first semantic term corresponding to the text to be retrieved, and the target model type corresponding to the text to be retrieved and the second semantic term corresponding to the target model type are determined according to the first semantic term, and the target attribute corresponding to the text to be retrieved is determined in the target attribute word library according to the second semantic term, and the search input parameter corresponding to the text to be retrieved is determined according to the target attribute, and the search result corresponding to the text to be retrieved is determined according to the search input parameter, and the search result is returned to the user. The first semantic term is obtained by extracting keywords from the text to be retrieved, and then the target type model is obtained through the first semantic term, and then the second semantic term is determined according to the target type model and the first semantic term, and the target attribute is determined according to the second semantic term and the target type model, and the user's search intention is determined through the target attribute, and finally the search input parameter is provided according to the search intention, and then the keyword that better meets the user's search intention is provided through the search input parameter for the user to search, thereby improving the accuracy of data retrieval. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 is a flow chart of a data retrieval method provided by an embodiment of the present invention;
[0018] Figure 2 is a structural schematic diagram of a data retrieval device provided in an embodiment of the present invention;
[0019] Figure 3 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] like Figure 1 As shown, Figure 1 : is a method flow chart of a data retrieval method provided by an embodiment of the present invention. The above data retrieval method steps include:
[0022] 101. Perform natural language processing on the text to be searched input by the user to obtain a first semantic term corresponding to the text to be searched.
[0023] In an embodiment of the present invention, the above data retrieval method can be deployed in a retrieval system, and the above retrieval system can include multiple system model types, different model types have different database types, and different databases correspond to different retrieval rules. Through the above data retrieval method, the above retrieval system can accurately locate the user's retrieval intention, provide users with more accurate retrieval services, and provide users with simpler retrieval operations.
[0024] Specifically, the user inputs the corresponding data to be searched through the search interface. When the data to be searched is text data, the data to be searched is directly determined as the text to be searched. When the data to be searched is non-text data, the data to be searched is converted into text data to obtain the text to be searched. Non-text data includes image data, audio data, etc. When the data to be searched is image data, the image data can be converted into text data through an image-to-text algorithm, and the image-to-text algorithm can be an OCR (Optical Character Recognition) algorithm, an Image Caption algorithm, a BeamSearch algorithm, etc.
[0025] The above-mentioned image-to-text conversion process can be achieved by recognizing the image and summarizing the image through the recognition result, or by directly recognizing the text in the image through the recognition result, extracting and outputting the text to obtain the text data corresponding to the image data. Specifically, a syntactic analysis algorithm can be used to generate and recognize text for a descriptive text, thereby obtaining keywords that can highly summarize the image. It is also possible to extract features from the text in the image through OCR, output the text in the image, and obtain the text data corresponding to the image data.
[0026] When the data to be retrieved is audio data, the audio data can be converted into corresponding text data through audio conversion. The above audio conversion can extract the characteristics of the sound through algorithms such as Mel Frequency Cepstral Coefficient (MFCC) or Linear Predictive Coding (LPC), and convert the voice signal into a digital signal through ADC (Analog-to-Digital Converter) to obtain the text data corresponding to the audio data. Or it can recognize the sound pattern through ASR (Automatic Speech Recognition) and convert it into text.
[0027] More specifically, the text to be searched is subjected to natural language processing to obtain keywords that can be independently matched in the text, and these keywords will be used as auxiliary features for the subsequent search system to analyze the user's search intention. This embodiment may use, but is not limited to, one or more of the following algorithms: word segmentation algorithm, part-of-speech tagging algorithm, named entity recognition algorithm, syntactic analysis algorithm, and sentiment analysis algorithm.
[0028] The above natural language processing may include word segmentation algorithm, part-of-speech tagging algorithm, named entity recognition algorithm, syntactic analysis algorithm, semantic recognition algorithm, etc. The first semantic terms corresponding to the text to be searched are obtained by performing word segmentation algorithm, part-of-speech tagging algorithm, named entity recognition algorithm, syntactic analysis algorithm, semantic recognition algorithm, etc. on the text to be searched. The number of the first semantic terms corresponding to the text to be searched is at least one.
[0029] It should be noted that the above keywords can be used as auxiliary features to better determine the first semantic terms. Specifically, after obtaining the first semantic terms, by comparing them with the semantics of the keywords, the first semantic terms with similar semantics to the keywords are retained, and then semantic analysis is performed on the first semantic terms with different semantics. This can further confirm the accuracy of the first semantic terms, reduce the analysis process, and increase the analysis efficiency.
[0030] Compared with the keywords obtained by segmenting the search text, the first semantic terms are obtained based on the semantics of the search text, and can better express the user's search intention than keywords. For example, if the search text is "a speeding red small steel gun", the keywords obtained by segmenting "a speeding red small steel gun" may be "speeding", "red", "small steel gun", while the first semantic terms obtained by natural language processing are "speeding", "red", "motor vehicle", "high performance", "hatchback", etc.
[0031] In a possible embodiment, the data to be retrieved is audio data, and the emotional semantics in the audio data can be extracted through the attention mechanism. When converting the audio data into text data, the corresponding attention mechanism is added to the text data according to the emotional semantics, so that the text to be retrieved has the attention mechanism corresponding to the emotional semantics. When the text to be retrieved is processed by natural language, the attention mechanism corresponding to the emotional semantics can be used to pay more attention to the semantic words with strong emotions in the text to be retrieved, and the first semantic terms corresponding to the user's emotions can be obtained, so that the first semantic terms are more accurate in expressing the user's search intention. The above-mentioned attention mechanism can be Soft Attention, Local Attention, ComponentAttention, Monotonic Attention and other attention mechanisms. When converting audio data into text data, speech emotion recognition based on the Attention-BLSTM-CNN algorithm can be used to convert audio data recognition into text data.
[0032] Furthermore, the above-mentioned natural language processing may include four steps of preprocessing the text to be retrieved, extracting text features, semantic analysis and optimizing results. The above-mentioned retrieval system is built with a preprocessing module, a feature extraction module, a semantic analysis module and a result optimization module. The preprocessing module is used to preprocess the text to be retrieved, the feature extraction module is used to extract the text features of the text to be retrieved, the semantic analysis module is used to analyze the semantics of the text to be retrieved, and the result optimization is used to optimize the semantic results of the text to be retrieved. The preprocessing module built into the retrieval system is used to remove punctuation marks, numbers and other identifiers that are irrelevant to the text to be retrieved, and obtain the preprocessed text to be retrieved. The feature extraction module extracts features from the preprocessed text to be retrieved to obtain the implicit features of the text to be retrieved. It should be noted that the feature extraction module can convert the preprocessed text to be retrieved into a higher-dimensional vector for representation, so as to train and predict the machine learning model.
[0033] After obtaining the implicit features of the text to be retrieved, the semantic analysis module can be used to perform semantic analysis on the implicit features, and then analyze the semantic information and emotional environment in the text to be retrieved to increase the accuracy of the first semantic term. Finally, the output result of the semantic analysis processing module is evaluated by the result optimization module, and the corresponding first semantic term is output. During the retrieval process, if there is a retrieval error reported by the user, the above-mentioned natural language processing can be adjusted by analyzing the text information of the corresponding retrieval error according to the retrieval error code reported by the user, thereby improving the accuracy of the natural language processing. The above-mentioned first semantic term can be an extracted word or phrase obtained after the text to be retrieved is processed through natural language processing.
[0034] For example, if the text to be retrieved is "the license plate information of a certain type of motor vehicle (SUV, sedan, truck...) of a certain color driving in a certain area within a certain time period and not wearing a seat belt or answering or making phone calls while driving", by performing natural language processing on "the license plate information of a certain type of motor vehicle (SUV, sedan, truck...) of a certain color driving in a certain area within a certain time period and not wearing a seat belt or making phone calls while driving", we can obtain words or phrases such as "time period", "area", "color", "type of vehicle", "seat belt", "answering or making phone calls", and "license plate" as the first semantic entry. For another example, if the text to be retrieved is "I often sweat easily on my feet, and my skin peels off a lot. After washing my feet, my toes are itchy, but my feet don't smell...", by performing natural language processing on "I often sweat easily on my feet, and my skin peels off a lot. After washing my feet, my toes are itchy, but my feet don't smell...", we can obtain words such as "feet", "sweating", "skin peeling" and "itching" as the first semantic entry.
[0035] 102. Determine, based on the first semantic term, a target model type corresponding to the text to be retrieved and a second semantic term corresponding to the target model type.
[0036] In an embodiment of the present invention, after natural language processing is performed on the text to be retrieved input by the user, a first semantic entry corresponding to the text to be retrieved is obtained, and the first semantic entry includes the user's search intent. Therefore, the target model type that is consistent with the user's search intent can be determined based on the first semantic entry.
[0037] It should be noted that the retrieval system includes multiple system model types, each system model type corresponds to a different business, and the above different businesses can be understood as different types of retrieval businesses. For example, the above business can be a vehicle retrieval business, a face retrieval business, a body retrieval business, an archive retrieval business, etc. The above system model type is used to represent the corresponding business type. In the existing retrieval system, the user needs to determine the target model type from multiple system model types, which requires the user to master the business scope description corresponding to each system model type, increasing the time cost of the user's data retrieval. In the embodiment of the present invention, the system model type corresponding to the user's retrieval intention is determined by the first semantic entry, and the user does not need to understand which system model types are in the retrieval system and the business scope of the system model types.
[0038] After obtaining the first semantic terms corresponding to the text to be retrieved, the first semantic terms can be clustered. In the clustering process, cluster centers corresponding to each system model type are set, and the clustering results of the first semantic terms for each cluster center are determined. Based on the clustering results of each cluster center, a target cluster center is determined, and the corresponding system model type is determined as the target system model type according to the target cluster center. The target cluster center can be determined according to the number of first semantic terms within a preset range of each cluster center. Specifically, the cluster center with the largest number of first semantic terms within the preset range can be determined as the target cluster center. The first semantic term within the preset range of the target cluster center can be determined as the second semantic term.
[0039] The above retrieval system includes multiple system model types, each of which can correspond to at least one hot word. After obtaining the first semantic term corresponding to the text to be retrieved, the first semantic term can be collided with the hot words corresponding to each system model type, and the target model type can be determined according to the hot word collision result. The first semantic term can be collided with the hot word corresponding to the target model type, and the first semantic term that successfully collided can be determined as the second semantic term.
[0040] Specifically, collision matching between phrases can be achieved based on semantics based on the word vector method. The first semantic term and the hot words in the hot word library are converted into corresponding word vectors respectively, and the similarity between the first semantic term and the hot words in the hot word library is determined by calculating the similarity between the word vectors. The above similarity can be Euclidean distance similarity or cosine similarity. If the similarity is greater than the set threshold, it is determined that the corresponding first semantic term and the hot word have collided successfully, and the target model type is determined based on the hot word that has collided successfully. If the number of the first semantic term is one, the system model type corresponding to the hot word that has collided successfully can be determined as the target model type.
[0041] In the retrieval system, each system model type corresponds to an attribute word library, and the above target model type corresponds to a target attribute word library. After the target model type is determined by the first semantic term, the attribute word library corresponding to the target model type can be determined as the target attribute word library.
[0042] The above-mentioned system model type corresponds to an attribute word library, and an attribute word library includes multiple attribute words related to the corresponding business. For example, the system model type is motor vehicle, and the attribute words in the attribute word library are attribute words that can describe motor vehicles. The attribute word library includes attribute words such as vehicle model, color, license plate, brand, speed, and number of violations. The attribute word library is not shared among multiple system model types.
[0043] The second semantic term may be a first semantic term that successfully collides with the target model type, obtained by performing collision matching between the first semantic term and the target model type according to the collision matching result. It should be noted that the second semantic term should have a smaller range than the first semantic term.
[0044] 103. According to the second semantic term, determine the target attribute corresponding to the text to be searched in the target attribute word library, and determine the search input parameter corresponding to the text to be searched according to the target attribute.
[0045] In the embodiment of the present invention, the target attribute word library is the attribute word library corresponding to the target model type, and the target attribute word library includes the attribute words corresponding to the target model type. The target attribute includes the target attribute words, and the target attribute words can be understood as the search elements corresponding to the text to be retrieved. Further, the target attribute words can be understood as the search elements based on the user's search intention.
[0046] After obtaining the second semantic term, the second semantic term can be matched with all attribute words in the target attribute word library to obtain the attribute word corresponding to the second semantic term, and the attribute word corresponding to the second semantic term is determined as the target attribute word corresponding to the text to be retrieved.
[0047] The second semantic term is matched with the attribute words in the target attribute word library to obtain a matching result, which may be at least one attribute word in the target attribute word library that has a similar or identical meaning to the second semantic term. The attribute words may be converted into search input parameters of the text to be searched input by the user.
[0048] The target attribute includes at least one target attribute word in the target attribute word library, and each target attribute word can be converted into a corresponding search input parameter according to the search rule of the corresponding business database. The search input parameter corresponding to the target attribute can be used to search and locate the user's search intention in the business database corresponding to the target model type to obtain the search result.
[0049] The above search input is the search parameter corresponding to the attribute word and its attribute value. For example, if the target model type is motor vehicle, the target attribute word is color, and the attribute value corresponding to the target attribute word is red, then the search input is "colour=red", indicating that the user's search intention is red motor vehicles. For another example, if the target model type is over-the-counter drugs, the target attribute word is foot, and the attribute value corresponding to the target attribute word is itch, then the search input is "foot=tickle", indicating that the user's search intention is over-the-counter drugs for treating itchy feet.
[0050] 104. Determine the search result corresponding to the text to be searched based on the search input parameter, and return the search result to the user.
[0051] In an embodiment of the present invention, after determining the search input parameter, the search input parameter can be input into a business database corresponding to the target model type, and a search is performed in the business database corresponding to the target model type through the search input parameter, and a search result corresponding to the search input parameter is output through the business database, and the search result corresponding to the user's search intent can be accurately located through the above search input parameter. Since the above search result corresponds to the user's search intent, the user can obtain the desired result based on the direct voice search.
[0052] For example, assuming that the target model type is a motor vehicle, the target model type is a motor vehicle database, the target attribute word is color, and the attribute value corresponding to the target attribute word is red, then the search input parameter is "colour = red", "colour = red" is input into the motor vehicle database, and red motor vehicles are retrieved from the motor vehicle database through "colour = red" as the search result and returned to the user. Alternatively, assuming that the target model type is an over-the-counter drug, the target model type is an over-the-counter drug database, the target attribute word is foot, and the attribute value corresponding to the target attribute word is itch, then the search input parameter is "foot = tickle", "foot = tickle" is input into the over-the-counter drug database, and over-the-counter drugs for itchy feet are retrieved from the over-the-counter drug database through "foot = tickle" as the search result and returned to the user.
[0053] In an embodiment of the present invention, natural language processing is performed on the text to be retrieved input by the user to obtain a first semantic term corresponding to the text to be retrieved, a target model type corresponding to the text to be retrieved and a second semantic term corresponding to the target model type are determined according to the first semantic term, a target attribute corresponding to the text to be retrieved is determined in a target attribute word library according to the second semantic term, and a search input parameter corresponding to the text to be retrieved is determined according to the target attribute, a search result corresponding to the text to be retrieved is determined according to the search input parameter, and the search result is returned to the user. The first semantic term is obtained by extracting keywords from the text to be retrieved, and then a target type model is obtained through the first semantic term, and then a second semantic term is determined according to the target type model and the first semantic term, and a target attribute is determined according to the second semantic term and the target type model, and the user's search intent is determined through the target attribute, and finally a search input parameter is provided according to the search intent, and then keywords that are more in line with the user's search intent are provided through the search input parameter for the user to search, thereby improving the accuracy of data retrieval.
[0054] Optionally, in the step of performing natural language processing on the text to be retrieved input by the user to obtain a first semantic entry corresponding to the text to be retrieved, a corresponding natural language processing model can be determined according to the user's business needs, and natural language processing can be performed on the text to be retrieved input by the user through the natural language processing model to obtain a first semantic entry corresponding to the text to be retrieved.
[0055] In an embodiment of the present invention, text input is provided to a natural language processing model of a corresponding function according to the user's business needs. The above natural language processing model may include functions such as opinion extraction, text classification, question answering, and text semantic comparison, and natural language processing models with different functions are selected according to business needs. The user's business needs can be determined based on the application or business module currently used by the user, and different applications or business modules correspond to different business needs.
[0056] For example, if the user's business needs are related to opinion extraction, you can choose a natural language processing model with an opinion extraction function; if the user's business needs are related to text classification, you can choose a natural language processing model with a text classification function; if the user's business needs are related to question answering, you can choose a natural language processing model with a question answering function; if the user's business needs are related to text semantic comparison, you can choose a natural language processing model with a text semantic comparison function. Select a natural language processing model with the corresponding function to process the user's text to be retrieved and obtain the first semantic entry.
[0057] The above-mentioned natural language processing model can be a natural language processing model based on natural language processing algorithms such as BERT, RNN, LSTM, etc. The above-mentioned natural language processing model is trained. In the process of training the natural language processing model, corpus texts related to each business can be collected, and semantic term labels corresponding to each business can be constructed. Each corpus text is annotated by the semantic term label to obtain training data. The above-mentioned training data includes corpus text and corresponding semantic term labels. The natural language processing model is trained by the training data. After the training is completed, a trained natural language processing model can be obtained. The text to be retrieved is input into the trained natural language processing model. The trained natural language processing model performs natural language processing on the text to be retrieved, and outputs the first semantic term corresponding to the text to be retrieved.
[0058] Furthermore, in the process of training the natural language processing model through training data, the corpus text is input into the natural language processing model, the corpus text is subjected to natural language processing through the natural language processing model, and the semantic term results corresponding to the corpus text are output, and the error loss function between the semantic term results corresponding to the corpus text and the semantic term labels corresponding to the corpus text is calculated. The error loss function is optimized by minimizing the error loss function, and the parameters of the natural language processing model are adjusted through the reflection propagation algorithm. The above parameter adjustment process is iterated until the error loss function converges to the minimum or the number of iterations reaches a preset number, and the training is stopped to obtain a trained natural language processing model.
[0059] Optionally, in the step of determining the target model type corresponding to the text to be retrieved and the second semantic term corresponding to the target model type based on the first semantic term, the first semantic term can be collided and matched with the hot words in the hot word library to obtain a hot word collision result, and the target hot word and the target model type are determined based on the hot word collision result. The target hot word corresponds to the target model type, and based on the first semantic term and the target hot word, the second semantic term corresponding to the target model type is determined.
[0060] In an embodiment of the present invention, a hot word library is provided in the above retrieval system, and the hot word library includes hot words corresponding to the system model type. The first semantic term can be collided and matched with the hot word library built into the retrieval system to obtain a hot word collision result, and the target hot word is determined according to the hot word collision result.
[0061] The above hot word collision result includes the number of successful collisions between each hot word and the first semantic term. The first semantic term is collided with the hot word in the hot word library for collision matching. The above collision area can be based on the collision area of the word vector, and the first semantic term and the hot word in the hot word library are converted into word vectors. The collision result between the first semantic term and the hot word is determined by calculating the similarity between the word vectors. During the collision process, the hot words that collide successfully and the number of successful collisions of each hot word are recorded. The target hot word can be determined in the hot word library according to the number of successful collisions with the first semantic term, and the system model type corresponding to the target hot word is the target model type.
[0062] It is also possible to determine the weight value of each system model type according to the number of successful collisions of each hot word, and determine the target model type according to the weight value of each system model type.
[0063] After determining the target hot word, the first semantic term corresponding to the target hot word can be determined as the second semantic term. It can be understood that the first semantic term that successfully collides with the target hot word is determined as the second semantic term, and the number of the above second semantic terms is less than or equal to the number of first semantic terms.
[0064] For example, in the first semantic terms, there are semantic terms such as "car", "tire", "wiper", and "daytime" corresponding to the text to be retrieved, and in the hot word library, there are hot words such as "car", "rubber", "bird", and "dark clouds" corresponding to the system model type. Then, after the first semantic term is collided and matched with the hot words in the hot word library, the hot word "car" in the hot word library successfully collides with the first semantic terms "car", "tire", and "wiper", and the number of successful collisions of the hot word "car" is recorded as 3 times, while the hot word "rubber" successfully collides with the first semantic term "tire", and the number of successful collisions of the hot word "rubber" is recorded as 1 time, the hot word "bird" fails to collide with all the first semantic terms, and the number of successful collisions of the hot word "bird" is recorded as 0 times, and the hot word "dark clouds" successfully collides with the first semantic terms "wiper" and "daytime", and the number of successful collisions of the hot word "dark clouds" is recorded as 2 times. The hot word "car" may be determined as a target hot word, and the system model type corresponding to the hot word "car" may be used as a target model type. The target model type may be "motor vehicle", corresponding to a vehicle search service.
[0065] After determining the hot word "car" as the target hot word, the first semantic terms "car", "tire" and "wiper" that successfully collide with "car" can be determined as second semantic terms.
[0066] The hot words in the hot word library correspond to each system model type. By performing collision matching with the first semantic entry and the hot words in the hot word library, the hot words that collide successfully are recorded and used as target hot words. The hot words can be understood as representative words of the system model type, and the meaning of the hot words is similar to the attributes of the system model type. The hot word library is a database for storing hot words. After adding a new system model type, the corresponding hot words can be added to the hot word library. When the business corresponding to the system model type is expanded, the hot words corresponding to the system model type can also be added according to the expanded business, thereby increasing the number of hot words in the hot library and improving the accuracy of the target model type.
[0067] Optionally, in the step of determining the target hot word and the target model type based on the hot word collision results, and the target hot word corresponds to the target model type, the number of successful collisions of each hot word can be determined based on the hot word collision results, and the hot word with the highest number of successful collisions can be determined as the target hot word, and then the system model type corresponding to the target hot word is determined as the target model type.
[0068] In the embodiment of the present invention, the hot word collision result includes the number of successful collisions of each hot word. The more successful collisions a hot word has, the closer the semantics of the hot word is to the text to be searched, and further, the closer the hot word is to the user's search intention. Specifically, the hot word with the highest number of successful collisions can be determined as the target hot word.
[0069] In a possible embodiment, one system model type corresponds to multiple hot words. The number of successful collisions of each system model type can be determined based on the number of successful collisions of each hot word. The number of successful collisions of the system model type is equal to the sum of the number of successful collisions of the hot words corresponding to the system model type. The system model type with the number of successful collisions can be determined as the target model type.
[0070] Optionally, in the step of determining the target hot word and the target model type based on the hot word collision results, and corresponding the target hot word to the target model type, the number of successful collisions of each hot word can be determined based on the hot word collision results, and the weight values of each system model type can be determined according to the number of successful collisions of each hot word, and the system model type with the highest weight value can be determined as the target model type.
[0071] In an embodiment of the present invention, the hot word collision result includes the number of successful collisions of each hot word. The weight value of each system model type can be calculated based on the number of successful collisions of each hot word. The number of successful collisions of each system model type can be determined based on the number of successful collisions of each hot word. The number of successful collisions of the system model type is equal to the sum of the number of successful collisions of the hot words corresponding to the system model type. The weight value of the system model type can be shown as the following formula:
[0072]
[0073] Where w represents the weight value of the system model type, n represents the number of successful collisions of the system model type, and t represents the number of system model types. It can be seen from the formula that when n is larger, w is larger; when t is smaller, w is larger. Therefore, the weight value of each system model type is calculated by the number of successful collisions of the system model type, and the system model type with the largest weight value is determined as the target model type.
[0074] Optionally, before colliding and matching the first semantic entry with the hot words in the hot word library, business information of each system model type can be obtained, and attribute information corresponding to each system model type can be determined based on the attribute word library corresponding to each system model type. Then, the hot words of each system model can be determined through the business information and attribute information, and finally a hot word library can be obtained based on the hot words of each system model.
[0075] In the embodiment of the present invention, the hot words that may be included in the system model are determined by determining the business information and the corresponding attribute word library of each system model type, and the hot word library is determined based on the set of these hot words. It should be noted that since the hot words that may be included in the system model are determined based on the business information and the attribute word library, the determined hot words are words that are more consistent with the system model and can be equivalent to the representative words of the system model.
[0076] The above system model types correspond to business types. For example, the above system model types may include vehicles, personnel, archives, etc. By analyzing the text to be retrieved, the system model type is extracted and matched with the user business information.
[0077] The above-mentioned attribute word library corresponds to the attribute information of the system model type. It should be noted that the words in the attribute word library should have the same or similar meaning or connotation as the attribute information of the system model type. For example, the above-mentioned attribute word library may contain words such as "itchy feet", "athlete's foot", and "medicine", then the corresponding attribute information of the system model type can be determined as "related drugs for treating athlete's foot".
[0078] More specifically, through the above business information and attribute information, hot words related to this type of information can be determined. For example, by analyzing and extracting "related drugs for treating athlete's foot", hot words related to this type of information can be obtained. Through the above information extraction, hot words that may be obtained include "Dakning Ointment", "Piyanping" and other related drugs as hot words of the above system model type. And these hot words are integrated to form a hot word library of the "related drugs for treating athlete's foot" system model type.
[0079] Optionally, in the step of determining the target attribute corresponding to the text to be retrieved in the target attribute vocabulary according to the second semantic entry, and determining the retrieval input parameter corresponding to the text to be retrieved according to the target attribute, the second semantic entry can also be traversed and matched with the attribute words in the target attribute vocabulary to obtain the attribute word matching result, and then the target attribute of the text to be retrieved is determined based on the attribute word matching result, and finally the retrieval input parameter corresponding to the text to be retrieved is determined based on the target attribute.
[0080] In an embodiment of the present invention, the target attribute of the search text can be determined by matching and colliding the second semantic term with the attribute words in the target attribute vocabulary, and the target attribute represents the user's search intention. Finally, the search input parameter that can represent the user's search intention is determined through the target attribute.
[0081] The above-mentioned target attribute vocabulary may contain attribute words with similar or related meanings to the target model type. For example, if the target model type is "motor vehicle model", the attribute words in the target attribute vocabulary may be vehicle type, vehicle color, vehicle violation, driver age, driver's top color, driver's license type, etc.
[0082] The above target attributes correspond to multiple input parameters, and the target attributes include the semantics, content, and emotional environment of the input words. The user's search can be located by the target attribute corresponding to the input parameter. The above input parameter corresponds to the user's search intent. The result content output according to the input parameter search has the user's search intent, that is, the result that the user wants to obtain based on the straightforward voice search. For example, when the target attribute is related to "motor vehicle", the corresponding input parameters can be vehicle type = SUV, vehicle color = RED, vehicle speeding = Y / N, driver age = 45, driver's top color = RED, driver's license type = 3 (3 represents a small vehicle driver's license), etc.
[0083] The above search input parameter corresponds to a target attribute, and the search input parameter can be a specific word or phrase. The user directly enters the word in the search system to obtain the content that he wants to search for according to his intention. For example, when the search input parameter is "vehicle type = SUV", the corresponding target attribute may be related to "motor vehicle".
[0084] In an embodiment of the present invention, a user enters a text to be retrieved in a search bar, and the retrieval system selects a corresponding natural language processing model according to the user's business needs to process the text to be processed input by the user, and obtains a first semantic entry. And by performing collision matching between the first semantic entry and the hot words in the hot word library, a retrieval system model corresponding to the hot word is obtained according to the collision matching result. Prior to this, the retrieval system determines the attribute information corresponding to each system model type according to the business information of each system type and the attribute word library corresponding to each system model type, determines the hot words of each system model based on the business information and attribute information, and forms a hot word library according to the hot words of each system model. According to the above hot word collision results, the number of successful collisions of each hot word is determined, and the hot word with the highest number of successful collisions is determined as the target hot word, and the target model type is determined by the system model type corresponding to the target hot word. Or the weight value of the system model type corresponding to each hot word is confirmed by the number of successful collisions of each hot word, and the highest weight value is used as the target model type. Then, the second semantic term is obtained by collision matching between the first semantic term and the target hot word, and the second semantic term is traversed and matched with the attribute words in the target attribute vocabulary to obtain the attribute word matching result, and the attribute word matching result is used to determine the target attribute of the text to be retrieved, and the corresponding search input parameter is obtained according to the target attribute of the text to be retrieved. Finally, according to the search input parameter, the search result of the text to be retrieved is determined and returned to the user.
[0085] For example, if a user enters "I often sweat easily on my feet, peel a lot, and my feet are itchy after washing my feet, but my feet don't smell" in the search bar, the search system will parse the text entered by the user. If the user enters "I often sweat easily on my feet, peel a lot, and my feet are itchy after washing my feet, but my feet don't smell." by voice, the corresponding algorithm will be used to convert language into text. By extracting the above text to be searched, the first semantic terms such as "feet", "sweating", "peeling", "foot seams", "not smelly" and "itchy" are obtained. After the first semantic terms such as "feet", "sweating", "peeling", "foot seams", "not smelly" and "itchy" collide with the system's built-in hot word library of built-in over-the-counter drug uses or applicable symptoms, such as "itch relief", "peeling treatment", "foot-related prescription drugs" and other hot words, the hot word collision weight is analyzed, and it can be basically analyzed that the user's search intention is foot-related drugs. Then, the first semantic terms such as "foot", "sweating", "peeling", "foot seams", "not smelly" and "itching" are collided and matched with the foot-related category model to obtain the second semantic terms such as "foot", "sweating", "peeling" and "itching". The second semantic terms such as "foot", "sweating", "peeling" and "itching" are matched with the attribute words of the target attribute vocabulary such as "skin", "itch relief" and "medicine", and "itch relief skin medicine" is obtained as the target attribute of the text to be retrieved, and then the matching is further performed in the sub-library. By converting the input parameters, over-the-counter drugs with relevant therapeutic effects can be accurately obtained. For example, "itch relief skin medicine" is matched with "sweating", "peeling" and "itching", and the search input parameter can be "medicine = Pi Yan Ping". By searching in the retrieval system, the relevant content of Pi Yan Ping is obtained.
[0086] like Figure 2 As shown, an embodiment of the present invention provides a data retrieval device, comprising:
[0087] The processing module 201 is used to perform natural language processing on the text to be searched input by the user to obtain a first semantic term corresponding to the text to be searched;
[0088] A first determination module 202 is used to determine, based on the first semantic term, a target model type corresponding to the text to be retrieved and a second semantic term corresponding to the target model type, wherein the target model type corresponds to a target attribute word library;
[0089] A second determination module 203 is used to determine the target attribute corresponding to the text to be searched in the target attribute word library according to the second semantic term, and determine the search input parameter corresponding to the text to be searched according to the target attribute;
[0090] The third determination module 204 is used to determine the search result corresponding to the text to be searched according to the search input parameter, and return the search result to the user.
[0091] Optionally, the processing module 201 includes:
[0092] A first determination module is used to determine a corresponding natural language processing model according to the user's business needs;
[0093] The first processing submodule is used to perform natural language processing on the text to be retrieved input by the user through the natural language processing model to obtain a first semantic entry corresponding to the text to be retrieved.
[0094] Optionally, the first determining module 202 includes:
[0095] A first matching submodule is used to perform collision matching between the first semantic entry and the hot words in the hot word library to obtain a hot word collision result, wherein each of the hot words corresponds to a system model;
[0096] A second determination submodule is used to determine a target hot word and a target model type based on the hot word collision result, wherein the target hot word corresponds to the target model type;
[0097] The third determination submodule is used to determine a second semantic term corresponding to the target model type based on the first semantic term and the target hot word.
[0098] Optionally, the second determining submodule further includes:
[0099] A first determination subunit is used to determine the number of successful collisions of each hot word based on the hot word collision result, and determine the hot word with the highest number of successful collisions as the target hot word;
[0100] The second determining subunit is used to determine the system model type corresponding to the target hot word as the target model type.
[0101] Optionally, the second determining submodule further includes:
[0102] A third determining subunit is used to determine the number of successful collisions of each hot word based on the hot word collision result;
[0103] A fourth determination subunit, used to determine the weight value of each system model type according to the number of successful collisions of each of the hot words;
[0104] The fifth determining subunit is used to determine the system model type with the highest weight value as the target model type.
[0105] Optionally, the first matching module includes:
[0106] The first acquisition submodule is used to acquire business information of each system model type;
[0107] A fourth determination submodule is used to determine the attribute information corresponding to each system model type according to the attribute word library corresponding to each system model type;
[0108] A fifth determination submodule, configured to determine the hot words of each system model based on the business information and the attribute information;
[0109] The second acquisition submodule is used to obtain a hot word library based on the hot words of each system model, and the hot word library includes the hot words of each system model.
[0110] Optionally, the first determining module 202 includes:
[0111] A second matching submodule is used to traverse and match the second semantic term with the attribute words in the target attribute word library to obtain an attribute word matching result;
[0112] A sixth determination submodule, configured to determine a target attribute of the text to be retrieved based on the attribute word matching result;
[0113] The seventh determination submodule is used to determine the search input parameter corresponding to the text to be searched based on the target attribute.
[0114] like Figure 3 As shown, an embodiment of the present invention further provides an electronic device, characterized in that it includes a processor, and the processor can execute any one of the above-mentioned data retrieval methods.
[0115] Specifically, it includes a processor 301 and a memory 302, and a computer program for executing the data retrieval method stored in the memory 302 and capable of running on the processor 301, wherein:
[0116] The processor 301 runs the computer program of the data retrieval method stored in the memory 302 to perform the following steps:
[0117] Performing natural language processing on the text to be searched input by the user to obtain a first semantic term corresponding to the text to be searched;
[0118] Determine, according to the first semantic term, a target model type corresponding to the text to be retrieved and a second semantic term corresponding to the target model type, wherein the target model type corresponds to a target attribute word library;
[0119] According to the second semantic term, determining the target attribute corresponding to the text to be searched in the target attribute word library, and determining the search input parameter corresponding to the text to be searched according to the target attribute;
[0120] According to the search input, the search result corresponding to the text to be searched is determined, and the search result is returned to the user.
[0121] Optionally, in the above data retrieval method, it is characterized in that the processor 301 performs the above step of performing natural language processing on the text to be retrieved input by the user to obtain the first semantic entry corresponding to the text to be retrieved, including:
[0122] Determine the corresponding natural language processing model based on the user's business needs;
[0123] The natural language processing model is used to perform natural language processing on the text to be retrieved input by the user to obtain a first semantic term corresponding to the text to be retrieved.
[0124] Optionally, in the data retrieval method, the processor 301 executes the step of determining, according to the first semantic term, the target model type corresponding to the text to be retrieved and the second semantic term corresponding to the target model type, including:
[0125] Perform collision matching on the first semantic entry and the hot words in the hot word library to obtain a hot word collision result, wherein each of the hot words corresponds to a system model;
[0126] Determine a target hot word and a target model type based on the hot word collision result, wherein the target hot word corresponds to the target model type;
[0127] Based on the first semantic term and the target hot word, a second semantic term corresponding to the target model type is determined.
[0128] Optionally, the data retrieval method is characterized in that the processor 301 executes the step of determining a target hot word and a target model type based on the hot word collision result, wherein the target hot word corresponds to the target model type, including:
[0129] Determine the number of successful collisions of each hot word based on the hot word collision result, and determine the hot word with the highest number of successful collisions as the target hot word;
[0130] The system model type corresponding to the target hot word is determined as the target model type.
[0131] Optionally, the data retrieval method is characterized in that the processor 301 executes the steps before the collision matching of the first semantic entry with the hot words in the hot word library, including:
[0132] Get business information of each system model type;
[0133] Determine the attribute information corresponding to each system model type according to the attribute word library corresponding to each system model type;
[0134] Determine the hot words of each system model based on the business information and the attribute information;
[0135] A hot word library is obtained based on the hot words of each system model, and the hot word library includes the hot words of each system model.
[0136] Optionally, the data retrieval method is characterized in that the processor 301 executes the step of determining, in the target attribute vocabulary, a target attribute corresponding to the text to be retrieved according to the second semantic term, and determining a retrieval input parameter corresponding to the text to be retrieved according to the target attribute, including:
[0137] Traversing and matching the second semantic term with the attribute words in the target attribute word library to obtain an attribute word matching result;
[0138] Determine the target attribute of the text to be retrieved based on the attribute word matching result;
[0139] Determine the search input parameter corresponding to the text to be searched based on the target attribute.
[0140] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the computer program implements the various processes of the data retrieval method or the application-side data retrieval method provided in the embodiment of the present invention, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0141] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0142] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A data retrieval method, characterized in that: The method comprises the following steps: Performing natural language processing on the text to be searched input by the user to obtain a first semantic term corresponding to the text to be searched; Determine, according to the first semantic term, a target model type corresponding to the text to be retrieved and a second semantic term corresponding to the target model type, wherein the target model type corresponds to a target attribute word library; According to the second semantic term, determining the target attribute corresponding to the text to be searched in the target attribute word library, and determining the search input parameter corresponding to the text to be searched according to the target attribute; According to the search input, the search result corresponding to the text to be searched is determined, and the search result is returned to the user.
2. The data retrieval method according to claim 1, characterized in that: The step of performing natural language processing on the text to be searched input by the user to obtain a first semantic term corresponding to the text to be searched includes: Determine the corresponding natural language processing model based on the user's business needs; The natural language processing model is used to perform natural language processing on the text to be retrieved input by the user to obtain a first semantic term corresponding to the text to be retrieved.
3. The data retrieval method according to claim 1 or 2, characterized in that: The step of determining, according to the first semantic term, a target model type corresponding to the text to be retrieved and a second semantic term corresponding to the target model type includes: Perform collision matching on the first semantic entry and the hot words in the hot word library to obtain a hot word collision result, wherein each of the hot words corresponds to a system model; Determine a target hot word and a target model type based on the hot word collision result, wherein the target hot word corresponds to the target model type; Based on the first semantic term and the target hot word, a second semantic term corresponding to the target model type is determined.
4. The data retrieval method according to claim 3, characterized in that: The determining of a target hot word and a target model type based on the hot word collision result, wherein the target hot word corresponds to the target model type, includes: Determine the number of successful collisions of each hot word based on the hot word collision result, and determine the hot word with the highest number of successful collisions as the target hot word; The system model type corresponding to the target hot word is determined as the target model type.
5. The data retrieval method according to claim 3, characterized in that: The determining of a target hot word and a target model type based on the hot word collision result, wherein the target hot word corresponds to the target model type, further includes: Determine the number of successful collisions of each hot word based on the hot word collision results; Determine the weight value of each system model type according to the number of successful collisions of each of the hot words; The system model type with the highest weight value is determined as the target model type; The hot word corresponding to the target model type is determined as the target hot word.
6. The data retrieval method according to any one of claims 3 to 5, characterized in that: Before the collision matching of the first semantic term with the hot word in the hot word library, the method further includes: Get business information of each system model type; Determine the attribute information corresponding to each system model type according to the attribute word library corresponding to each system model type; Determine the hot words of each system model based on the business information and the attribute information; A hot word library is obtained based on the hot words of each system model, and the hot word library includes the hot words of each system model.
7. The data retrieval method according to claim 1, characterized in that: The step of determining, in the target attribute word library, a target attribute corresponding to the text to be searched according to the second semantic term, and determining a search input parameter corresponding to the text to be searched according to the target attribute includes: Traversing and matching the second semantic term with the attribute words in the target attribute word library to obtain an attribute word matching result; Determine the target attribute of the text to be retrieved based on the attribute word matching result; Determine the search input parameter corresponding to the text to be searched based on the target attribute.
8. A data retrieval device, characterized in that: The data retrieval device comprises: A processing module, used for performing natural language processing on the text to be searched input by the user to obtain a first semantic term corresponding to the text to be searched; A first determination module, configured to determine, based on the first semantic term, a target model type corresponding to the text to be retrieved and a second semantic term corresponding to the target model type, wherein the target model type corresponds to a target attribute word library; A second determination module is used to determine the target attribute corresponding to the text to be searched in the target attribute word library according to the second semantic term, and determine the search input parameter corresponding to the text to be searched according to the target attribute; The third determination module is used to determine the search result corresponding to the text to be searched according to the search input parameter, and return the search result to the user.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps in the data retrieval method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the data retrieval method according to any one of claims 1 to 7 are implemented.