CN110543484A - prompt word recommendation method and device, storage medium and processor - Google Patents

prompt word recommendation method and device, storage medium and processor Download PDF

Info

Publication number
CN110543484A
CN110543484A CN201910828830.6A CN201910828830A CN110543484A CN 110543484 A CN110543484 A CN 110543484A CN 201910828830 A CN201910828830 A CN 201910828830A CN 110543484 A CN110543484 A CN 110543484A
Authority
CN
China
Prior art keywords
keyword
search
index
database
index information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910828830.6A
Other languages
Chinese (zh)
Inventor
胡启明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Shiyuan Electronics Thecnology Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201910828830.6A priority Critical patent/CN110543484A/en
Publication of CN110543484A publication Critical patent/CN110543484A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Abstract

The application discloses a prompt word recommendation method and device, a storage medium and a processor. Wherein, the method comprises the following steps: detecting an input keyword; searching index information corresponding to the key words from an index database, wherein the index information is determined based on source data in a source database corresponding to a search engine; searching the search prompt information associated with the keyword from the source database based on the index information; and displaying the search prompt information. The method and the device solve the technical problems that the prompt words in the related technology are low in accuracy and flexibility.

Description

prompt word recommendation method and device, storage medium and processor
Technical Field
The present application relates to the field of search, and in particular, to a method and an apparatus for recommending a cue word, a storage medium, and a processor.
Background
In the field of the current search engine, when a user inputs a specific keyword, the user can automatically associate with the prompt, so that redundant input of the user can be avoided, certain recommendation is provided, and a better interaction effect and a better content popularization effect are realized. In the related art, when a search prompt is performed, a query prompt word corresponding to an input keyword is often directly queried from a certain dictionary maintained by a search engine, and the accuracy is low because the vocabulary in the dictionary is generally manually configured according to experience; moreover, since the user can only inquire the related prompt vocabulary from a specific dictionary, the workload of configuring the related prompt vocabulary is large, and the method cannot be suitable for intelligent prompt of large-scale data, so that the flexibility is low.
in view of the above problems, no effective solution has been proposed.
Disclosure of Invention
the embodiment of the application provides a prompt word recommendation method and device, a storage medium and a processor, so as to at least solve the technical problems of low accuracy and low flexibility of prompt words in the related technology.
According to an aspect of an embodiment of the present application, there is provided a method for recommending a cue word, including: detecting an input keyword; searching index information corresponding to the key words from an index library; searching the search prompt information associated with the keyword from the source database based on the index information; and displaying the search prompt information.
Optionally, before searching the search prompt information associated with the keyword from the source database based on the index information, the method further includes: acquiring source data of a search engine; extracting at least one field relevant to the service scene from source data of a source database, and taking the extracted at least one field as a query field; determining index information according to the query field to obtain an index database; and establishing the association between the index database and the source database.
Optionally, detecting the input keyword includes: detecting whether the keywords in the input box change or not; when the change occurs, the changed keyword is taken as a target keyword; searching index information corresponding to the key words from an index database, wherein the index information comprises the following steps: and searching index information corresponding to the target key words from the index database.
optionally, before the changed keyword is taken as the target keyword, the method further includes: detecting a specified keyword input after the keyword is input; combining the specified keywords with the keywords to obtain combined words; and verifying the semantic completeness of the combined word, wherein the combined word is used as the target keyword when the verification is passed.
optionally, searching the search prompt information associated with the keyword from the source database based on the index information includes: searching the search prompt information corresponding to the index information from the source database; determining the similarity between the search prompt information and the keyword; and sequencing the search prompt information according to the similarity, and taking the search prompt information with the preset number in the front sequencing as the final search prompt information.
Optionally, searching for index information corresponding to the keyword from an index library, including: determining a business scene corresponding to the semantics of the keyword; determining the index information based on the business scenario and the semantics.
optionally, the database comprises a plurality of databases.
According to another aspect of the embodiments of the present application, there is provided a method for displaying a cue word, including: displaying an input box of a search engine; displaying the keywords input in the input box; and displaying search prompt information which is searched from the source database based on index information and is associated with the keyword, wherein the index information is index information which is searched from an index database and corresponds to the keyword.
according to another aspect of the embodiments of the present application, there is provided a device for recommending a cue word, including: the detection module is used for detecting the input keywords; the first query module is used for searching index information corresponding to the keyword from an index database, wherein the index information is determined based on source data in a source database corresponding to a search engine; the second query module is used for searching the search prompt information associated with the keyword from the source database based on the index information; and the display module is used for displaying the search prompt information.
optionally, the apparatus further comprises: the acquisition module is used for acquiring source data of a search engine; the extraction module is used for extracting at least one field relevant to the service scene from the source data of the source database, and taking the extracted at least one field as a query field; the determining module is used for determining index information according to the query field to obtain an index database; and the establishing module is used for establishing the association between the index database and the source database.
According to still another aspect of the embodiments of the present application, there is provided a non-volatile storage medium including a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the method for recommending a cue word described above.
According to still another aspect of the embodiments of the present application, there is provided a processor for executing a program, wherein the program executes the method for recommending a cue word described above.
in the embodiment of the application, when the keyword is detected, the corresponding search prompt information is inquired according to the index information corresponding to the keyword, since the corresponding search hint information (e.g. hints words etc.) can be searched based on the index corresponding to the keyword, the search prompt information corresponding to the keyword does not need to be directly inquired, so that the corresponding search prompt information can be inquired based on the source database corresponding to the search engine, the acquisition of the search prompt information is not limited to a specific dictionary, so that the recommendation accuracy of the prompt information can be improved, and, because the search range of the search prompt information is expanded, the method can adapt to the intelligent prompt of large-scale data, improves the flexibility of prompting word recommendation, and the technical problems of low accuracy and low flexibility of the cue words in the related technology are solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
Fig. 1 is a flowchart illustrating a method for recommending a cue word according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for recommending optional prompt words according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart of constructing a suggestion (survey) library according to an embodiment of the present application;
Fig. 4 is a block diagram of a device for recommending a cue word according to an embodiment of the present application;
Fig. 5 is a flowchart illustrating another method for displaying a cue word according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the Solr mentioned in the embodiments of the present application is an independent enterprise-level search application server, and it is a high-performance Lucene-based full-text search server developed by JAVA 5. Meanwhile, the method is expanded, a query language richer than Lucene is provided, configurability and expandability are realized, the query performance is optimized, a perfect function management interface is provided, an API (application program interface) similar to Web-service is provided externally, and a user can submit an XML (extensible markup language) file with a certain format to a search engine server through an http (hyper text transport protocol) request to generate an index; a search request can also be made through an HTTP get operation, and a return result in an XML format is obtained.
In the related art, some search engines have the function of intelligent association prompt, for example, the Solr search engine has packaged such a function, and can complete the function only by simple configuration, and the main steps are as follows:
Configuring a sunstest function point, opening a configuration file (solr-config.xml), finding a spelling check (Spellcheck) node, and configuring a spelling check device (Spellcheck) according to related configuration information, wherein the Spellcheck can be used for modifying the maximum intelligent prompt vocabulary. And 2, a positioning prompt component (solr. SuggestComponent) modifies a source positioning (sourceLocation) parameter, wherein the parameter is used for configuring a prompt dictionary path, namely a dictionary (di.txt) file in a sumggest folder under the current prompt path, of a file of the intelligent prompt pulled by the search engine. Adding the intelligent association vocabulary, as explained above, needs to create a sunsgee folder in the peer directory of the solr-config. And 4, changing the final interface into a comment to test the intelligent cue words.
However, the above-described scheme has the following problems: 1, low flexibility: when the search engine is used in a certain scene field, the owned related vocabulary is the vocabulary of the vertical field, and when the data volume rises to more than one million, the workload of configuring the related vocabulary in a single dictionary is very large, the flexibility is too low, and the intelligent prompt of the data of more than one million levels cannot be adaptively matched. 2, low accuracy: the vocabulary of the sunset intelligent prompt based on solr is manually configured in the dit, txt, so that a technician needs to know the service scene of the whole search engine well, and the related vocabulary of all data in the scene is familiar with and then the search prompt recommendation dictionary (dit) is configured, but the method is time-consuming and cannot configure all the service data, and the accuracy of the final search prompt is affected.
In order to solve the technical problem, in the embodiment of the present application, when a keyword is detected, corresponding search prompt information is queried according to index information corresponding to the keyword, instead of directly querying the search prompt information corresponding to the keyword, so that the corresponding search prompt information can be queried in a source database (or all history records) corresponding to a search engine, and since the acquisition of the search prompt information is not limited to a specific dictionary, the recommendation accuracy of the prompt information can be improved, and since the search range of the search prompt information is expanded, the method and the device can adapt to intelligent prompt of large-scale data, and improve the flexibility of recommending the prompt words. The details are as follows.
In accordance with an embodiment of the present application, there is provided a method embodiment of a method for prompting a word, it is noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
Fig. 1 is a method for recommending a cue word according to an embodiment of the present application, and as shown in fig. 1, the method includes steps S102 to S108, where:
step S102, detecting an input keyword;
In some embodiments of the present application, the keyword detection process may be represented by the following processes: detecting whether the keywords in the input box change or not; when the change occurs, the changed keyword is used as the target keyword.
specifically, detecting the change of the keyword input by the user may be detecting whether the existing keyword is replaced in advance, or detecting whether the existing search box with null value has the text input, for example, the keyword searched by the user before is a "computer game", but the keyword is changed into "computer configuration" by the user along with the change of the user requirement, and then the search engine performs the subsequent steps by using the change of the keyword as a condition for triggering the index matching function; as another example, the number of words in the input box may be changed, e.g., some characters may be added or subtracted.
Step S104, searching index information corresponding to the key words from an index database, wherein the index information is determined based on source data in a source database corresponding to a search engine;
In the related art, when a search operation of a certain service scene is executed, a prompt word dictionary (dct.txt) needs to be manually configured, and a technician needs to customize the content in the related prompt dictionary, so that the association relation of related prompt words in the dictionary is continuously enriched, the work is complicated and not necessarily accurate, and the prompt word recommendation scheme in the related art is difficult to meet the user requirements, so that the overall search experience is poor. In the embodiment of the application, a mode of searching the corresponding prompt words by using the index information is adopted, and the index in the index database is related to the source database corresponding to the search engine, so that the prompt words can be searched based on the whole database, and the acquisition of the search prompt words is not limited to a certain specific dictionary, therefore, the recommendation accuracy of the prompt information can be improved, and meanwhile, the manual maintenance cost is reduced. Moreover, the search engine is higher in text matching and efficiency, the recommendation result of the whole search prompt word can be returned quickly, real-time performance and relevance are well guaranteed, and user experience is improved and user stickiness is also improved.
in some embodiments of the present application, the index information includes, but is not limited to: for example, if the keyword is a computer game, the index information may be "game" or "electronic game". In other alternative embodiments, the index information may be determined by using numerical or letter identification. The index information may be created based on the MySQL database, and the created second exemplary keyword database and the corresponding index are used to call the information required by the embodiment of the present application.
When searching index information of the database, real-time detection may be performed (that is, whether the changed designated keyword or the semantics of the keyword are complete or not is not concerned, all the keywords currently detected in the input box are all detected), or when the designated keyword passes the semantic integrity verification, the corresponding index may be searched (for example, when a "computer game" is detected, because the semantics are incomplete, it is considered as an invalid keyword, and at this time, the corresponding index does not need to be searched).
In some optional embodiments of the present application, to save operating resources and improve search efficiency, before determining a search cue word, semantic integrity of characters input before and after the search cue word may be verified to reduce recommendation of unnecessary cue words, specifically: detecting a designated keyword input after the keyword is input before the changed keyword is taken as a target keyword; combining the specified keywords with the keywords to obtain combined words; and verifying the semantic integrity of the combined word, wherein the combined word is used as a target keyword when the verification is passed. For example, if the user inputs "i go to school with a schoolbag", but the content that the actual user wants to input is "i go to school with a schoolbag", then before determining the cue word, the embodiment verifies the integrity of the sentence input by the user, that is, detects that "the sentence is not the keyword to be prompted because of the incompleteness thereof, so that the process also reduces unnecessary cue word recommendation, and improves the search efficiency.
it should be noted that the semantic integrity verification may be to analyze the structure of a sentence or a word, and determine whether the whole semantics is complete according to different features of different types (e.g., subject and predicate) in the sentence structure, and in addition, the semantic integrity verification may specify a commonly used semantic model rule in a semantic modeling manner, so as to achieve the purpose of accurately determining whether the semantics is complete.
for another example, the step S104 can be expressed as the following implementation procedure: determining a business scene corresponding to the semantics of the keyword; index information is determined based on the business scenario and semantics. For example, the MySQL database index includes 100 pieces of index information relating to "computer" and 50 pieces of index information relating to "pet", so that when the keyword input by the user is "computer", it can be determined that the field that the user needs to search is computer, and then further index range division and determination are performed according to the specific semantics relating to computer.
In addition, it should be noted that the service scenario and the semantics are two levels for dividing the index information, and the service scenario may be a field related to the keyword, for example: the computer field, the pet field, the law field, and the like. The semantics is a description of the purpose that the user wants to achieve most after determining a specific field, for example, in the computer field, the semantics may be computer games, computer accessories, computer maintenance, or computer sales. It can be said that after the common and specific semantics of the business are combined, the index range of the keyword input by the user is determined, and the technical effect of increasing the accuracy and the searching efficiency is achieved. For example, an index database corresponding to a service scenario is predefined; then, before inputting keywords to carry out query operation, determining an index database corresponding to a target service scene, and establishing the association between the index database and a search engine; and finally, searching a corresponding index from the index database based on the input keyword, and further searching a corresponding prompt word based on the index.
step S106, searching the search prompt information associated with the keyword from the source database based on the index information;
Alternatively, this step S106 may be implemented by, for example: searching the search prompt information corresponding to the index information from the source database; determining the similarity between the search prompt information and the keyword; and sequencing the search prompt information according to the similarity, and taking the search prompt information with the preset number in the front sequencing as the final search prompt information.
Specifically, the index information may be a primary key or a foreign key in the MySQL database, and the corresponding data is a search hint related to a scene in a certain field, for example, when the index information is located at a position where the primary key is "computer", the search hint is in a range of all data where the primary key value is "computer" in the database, and then the data is sorted according to the similarity between the data where the primary key value is "computer" and a keyword or a designated keyword input by a user, and a word with a large similarity may be arranged at the top of the queue. The specified keyword may be a new keyword input again after the user inputs the keyword, and the content thereof may be associated with the content of the keyword or new content.
it should be noted that similarity is a measure for comprehensively evaluating the closeness between two things. The closer two things are, the greater their degree of similarity, while the further apart the two things are, the smaller their degree of similarity. The similarity calculation of the application can be a correlation coefficient calculation method, an euclidean distance calculation method, a cosine correlation degree calculation algorithm and the like, and is expressed as the size of the repetition degree of words and keywords or specified keywords in a database, for example, the keyword input by a user is 'computer accessory purchase', and the search cue words obtained through database data calling operation corresponding to index information are as follows: computer configuration, computer accessory acquisition, and computer accessory buying and selling. Then, the search prompt word closest to the keyword can be judged to be 'computer accessory buying and selling', then 'computer accessory obtaining', and finally 'computer configuration', based on the judgment process of the similarity, the size of the search prompt information is obtained and sequenced to be 1. 'computer accessory buying and selling', 2. 'computer accessory obtaining', and 3. 'computer configuration', and the preset number of search prompt information sequenced in the front is used as the final search prompt information. The preset number may be 2, and the preset number of search prompt information is set to display the closest search prompt information to a user and screen out unnecessary and useless information, for example, the search prompt information is ranked in size 1. "computer accessories are purchased and sold", 2. "computer accessories are obtained", and 3. "computer configuration", and then according to the setting that the preset number is 2, the final search prompt information determined by the present application is: "computer accessories buy and sell", 2 "computer accessories acquire".
And step S108, displaying the search prompt information.
Specifically, since the size of the interface generally used for presenting search prompt information is limited, in step S108, only part of the searched prompt information may be presented, for example: searching the search prompt information corresponding to the index information from the source database; determining the similarity between the search prompt information and the keyword; and sequencing the search prompt information according to the similarity, taking the search prompt information with the preset number in the front sequencing as final search prompt information, and finally displaying the final search prompt information to a user through display equipment. For example, the final search prompt information is 1. "computer accessories buy and sell", 2. "computer accessories acquire", then the search prompt information can be displayed in a pull-down form below the user input box, so that the user can select, and compared with the prior art, the user experience is increased.
By adopting the scheme provided by the embodiment of the application, the corresponding search prompt information (such as the prompt words and the like) can be searched based on the index corresponding to the keyword without directly inquiring the search prompt information corresponding to the keyword, so the corresponding search prompt information can be inquired based on all databases corresponding to the search engine, and the acquisition of the search prompt information is not limited to a certain specific dictionary, so the recommendation accuracy of the prompt information can be improved, and the search range of the search prompt information is expanded, so the method can adapt to the intelligent prompt of large-scale data, improve the recommendation flexibility of the prompt words, and further solve the technical problems of low accuracy and low flexibility of the prompt words in the related technology.
in some embodiments of the present application, in detecting the input keyword, it may be represented as detecting whether the keyword in an input box of a search engine is changed; when the change occurs, the changed keyword is taken as a target keyword; and after the target key words are determined, searching index information corresponding to the target key words in an index database. For example, the target keyword is sent to a background of the search engine, and the background searches for index information corresponding to the target keyword. For example, for real-time detection, taking "computer game" as an example, after "computer" is input in the input box, the search engine will search for the index corresponding to the computer, and search prompt information related to the computer is searched for from all records corresponding to the search engine based on the index, for example: computer games, computer accessories, etc.; after the game is input into the computer, the game input by the user is received, and because the semantic meaning of the computer game after the game and the computer are combined is not complete, the corresponding index information can not be inquired, and then the search prompt information can be inquired. After the computer game is detected, because the semantics of the current keywords are complete, the corresponding index can be searched based on the computer game, and then the corresponding search prompt information can be searched.
In some embodiments of the present application, the index information may correspond to all history records of the search engine, or a plurality of databases of the search engine, wherein the plurality of databases may include, but are not limited to: and a part or all of all databases corresponding to the search engine. The multiple databases may be databases corresponding to different service scenarios or databases of different data sources, but are not limited thereto.
In some embodiments of the present application, the index information may be index information searched from an index library, where the index information in the index library may be determined by extracting a field in the source data, for example: acquiring source data of a search engine before searching for search prompt information associated with the keyword from the source database based on the index information; extracting at least one field relevant to the service scene from source data of a source database, and taking the extracted at least one field as a query field; determining index information according to the query field to obtain an index database; and establishing association between the index database and the source database.
In order to further improve the recommendation accuracy of the search prompt information, corresponding index information may be determined according to a service scenario, specifically: determining a business scene corresponding to the semantics of the keyword; index information is determined based on the business scenario and semantics.
taking a solr search engine as an example, as shown in fig. 2 and fig. 3, in the scheme in the embodiment of the application, original data is extracted into a gather library of the solr search engine according to specified related fields, and in the query process, a front end calls a query interface of the search engine to query contents in the gather library, so that a returned result of a search intelligent prompt word which is in line with the expectation of a user is obtained. As described in detail below, first, the flow of creating the library is shown in fig. 3:
Step 302, obtaining source data (oracle, mysql, Hbase and the like) in a search engine service scene, and constructing a gather library of a search engine according to the source data.
step 304, a field or some fields are designated from the source data as the query field (i.e. index) of intelligent recommendation, and the technical staff consults with the business staff and judges according to the data analysis in the actual business scene, mainly meeting the business requirements and achieving the user experience of searching the cue word.
Step 306, firstly creating a suggest index library in the solr search engine, wherein the index library is mainly used for specially recommending search cue words, index data is not full-field data, and only data of one field or a plurality of fields specified by technical personnel in the step 304 is required to be recommended and sent, so that resources are not wasted, and specifically creating the suggest index library requires executing the following commands:
http://ip:port/solr/admin/collections?action=CREATE&name=suggest& numShards=4&replicationFactor=1&collection.configName=suggest。
In the related technology, when a cue word is determined, a sunlight folder is created in a solr-config.xml peer directory, and a dit.txt file is created below the sunlight folder, wherein the dit.txt file is stored in an intelligent associated vocabulary, namely a cue word list, and the corresponding cue word is recommended according to the cue word list; in the scheme in the embodiment of the application, part of fields in the source data of the search engine are directly utilized to form the index (namely, the query field), the index is used as the query word of the search engine, and the corresponding prompt word is queried from the source database corresponding to the search engine based on the query word.
And 308, performing entity association on the database of the source data and the gather index database, configuring a dataconfig.
adding the definition of the relevant fields and the mapping of the final query field in the schema file of the solr according to the one or more fields specified in the step 304 based on the gather index library in step 310, and configuring as follows:
The related search recommendation field defines:
<field name="name"type="text_ik"indexed="true"stored="true"/>
<field name="title"type="text_ik"indexed="true"stored="true"/>
<field name="suggestField"type="text_ik"indexed="true"stored=" false"multiValued="true"/>
The mapping field defines:
<copyField source="name"dest="suggestField"/>
<copyField source="title"dest="suggestField"/>
step 312, after the configuration is completed in the search engine, the extraction work can be directly executed, and the data in the source data is imported into the search engine to form the forward and reverse indexes, so that the query efficiency is improved. The steps are seemingly tedious but can be reused, and in one search engine, a plurality of index libraries can share one set of configuration.
Step 314, finally, the search engine background encapsulates the above configuration into a callable API service, and mainly specifies a search query index library (gather) and query fields (name, title — > gather file), so that the search intelligent cue word recommendation model is configured.
Next, the flow executed by the solr engine is shown in fig. 2:
Step 202, when a user inputs a keyword, the front end transmits the changed keyword to the background to obtain a search prompt word of the keyword input by the user in real time every time the search box changes once.
Step 204, after receiving the request, the search background sends the keyword to the search engine for keyword matching
and step 206, screening the documents meeting the requirements in the search engine according to the Boolean model, sending the documents to the space vector model, matching the text similarity through the cosine similarity, and further calculating the score of each result.
And 208, the search background acquires the first N search prompt words which most meet the requirements, returns the search prompt words to the front end according to the scores from high to low and displays the search prompt words to the user, so that the intelligent prompt words are searched, the user experience is increased, and the matching accuracy is improved.
based on the embodiment, the embodiment adopts search as recommendation to realize intelligent prompting, technicians do not need to configure a dictionary independently, only a certain field or a plurality of fields need to be specified as query, and the searched content is all records in the whole search engine; in the embodiment, technicians do not need to configure a dictionary independently, only need to designate a field or a plurality of fields as query fields in the process of establishing the search prompt, and need to designate a query index library to provide search intelligent prompt when writing an interface, so that the flexibility of intelligent prompt word recommendation of the whole search engine is improved; the method adopts search as recommendation to realize intelligent prompt, and mainly comprises the steps that when an input box changes in the process of inputting characters, a user can call an intelligent prompt interface once to realize intelligent prompt, and inquired contents are all records in the whole search engine, so that the adaptability of the search engine in a service scene is greatly improved, the final prompt effect is greatly improved, and the user experience is also improved.
The scheme provided by the embodiment of the application has the following characteristics: 1, using the search content of the whole library as the content of a cue word: in the past, the intelligent prompt of the search engine needs technicians to define a related prompt dictionary, the incidence relation of related prompt words in the dictionary is continuously enriched, the work is complicated and is not necessarily accurate, the user requirements are hardly met under the existing technical framework, and the integral search experience is not good. In the method, the data based on the whole database is used as the content of the cue words, so that the manual maintenance cost is reduced, and the related recall rate is greatly improved. 2. And (3) replacing cue word recommendation by search: the Solr search engine is based on a Boolean model and a VSM space vector model to realize search, the search is very high in text matching and efficiency, the recommendation result of the whole search prompt word is returned in millisecond level, the recommendation result is not suitable for being used as the recommendation of the prompt word, the real-time performance and the relevance are well guaranteed, the user experience is increased, and the user viscosity is also increased. 3. The adaptability is strong, and the method is suitable for searching under multiple scenes. When the search engine is used in multiple scenes, the multiple scenes mean that the incidence relation of related words is complex, the vocabulary and the dictionary content are enriched, and the conventional dictionary arrangement mode is difficult. According to the method, the entities of related multiple scenes are only configured in the configuration file, and finally, fields of the entities which need to be used as search prompt words are mapped to the gather, so that the search under the multiple scenes can be realized, and the adaptability is high.
It should be noted that the keywords in the embodiment of the present application may be expressed as a piece of text entered in an input box of a search engine or as keywords of a query condition.
an embodiment of the present application further provides a device for recommending a cue word, as shown in fig. 4, the device includes: a detection module 40 for detecting an input keyword; a first query module 42, configured to search an index database for index information corresponding to the keyword; a second query module 44, configured to search the source database for search prompt information associated with the keyword based on the index information; and a display module 46, configured to display the search prompt information.
Optionally, the apparatus further comprises: the acquisition module is used for acquiring source data of a search engine; the extraction module is used for extracting at least one field relevant to the service scene from the source data of the source database, and taking the extracted at least one field as a query field; the determining module is used for determining index information according to the query field to obtain an index database; and the establishing module is used for establishing the association between the index database and the source database.
Specifically, the detection module may detect the keyword by using a method of detecting a text generated by an input operation of a user in real time, or may collect input content of the user according to an input signal of an input device (such as a keyboard, a tablet, or the like), so as to obtain the keyword required by the technical scheme of the present application. The index information in the above embodiment may be created based on the MySQL database, and the created second exemplary keyword database and the corresponding index are used to call the information required by the application.
Optionally, before the changed keyword is taken as the target keyword, the method further includes: detecting a specified keyword input after the keyword is input; combining the specified keywords with the keywords to obtain combined words; and verifying the semantic integrity of the combined word, wherein the combined word is used as a target keyword when the verification is passed.
specifically, when searching the index information of the database, the index information may be detected in real time (that is, whether the changed designated keyword or the semantics of the keyword are complete or not is not concerned, all the keywords currently detected in the input box are all detected), or the index information may be searched when the designated keyword passes the semantic integrity verification. Wherein, for the latter, the following implementation processes can be represented: when the fact that the user inputs the appointed key words is detected, the appointed key words input by the user are used as data with the highest priority to replace the key words input by the user and serve as the basis of index information searching; for the specified keyword, searching the corresponding index when passing the semantic integrity verification, the following implementation process can be realized: detecting a specified keyword input after the keyword is input; combining the specified keywords with the keywords to obtain combined words; and verifying the semantic integrity of the combined word, wherein the combined word is used as the target keyword when the combined word passes the verification.
according to some embodiments of the present application, the first query module 42 is configured to search an index database for index information corresponding to the keyword; searching index information corresponding to the key words from an index database, wherein the index information comprises the following steps: determining a business scene corresponding to the semantics of the keyword; determining the index information based on the business scenario and the semantics. The database can be a database and an index based on MySQL, an index information range related to the keywords is determined by searching a plurality of index information, and the relevant positions of the database are indexed by the index information. For example, the MySQL database index includes 100 pieces of index information relating to "computer" and 50 pieces of index information relating to "pet", so that when the keyword input by the user is "computer", the scene can be determined as computer, and then further index range division and determination are performed according to the specific semantics relating to computer.
It should be noted that, the service scenario and the semantics are two levels for dividing the index information, and the service scenario may be a field where a keyword is involved, for example: the computer field, the pet field, the law field, and the like. The semantics is a description of the purpose that the user wants to achieve most after determining a specific field, for example, in the computer field, the semantics may be computer games, computer accessories, computer maintenance, or computer sales. After the common and specific semantics of the service are combined, the index range of the keyword input by the user is determined, so that the technical effect of greatly increasing the accuracy and the searching efficiency is achieved.
The second query module 44 is configured to search the source database for search prompt information associated with the keyword based on the index information;
Optionally, searching the search prompt information associated with the keyword from the source database based on the index information includes: searching the search prompt information corresponding to the index information from the source database; determining the similarity between the search prompt information and the keyword; and sequencing the search prompt information according to the similarity, and taking the search prompt information with the preset number in the front sequencing as the final search prompt information.
Specifically, the index information may be a primary key or a foreign key in the MySQL database, and the corresponding data is a search hint related to a scene in a certain field, for example, when the index information is located at a position where the primary key is "computer", the search hint is in a range of all data where the primary key value is "computer" in the database, and then the data is sorted according to the similarity between the data where the primary key value is "computer" and a keyword or a designated keyword input by a user, and a word with a large similarity may be arranged at the top of the queue.
it should be noted that the similarity may be a repetition degree of a word and a keyword or a specified keyword in the database, for example, the keyword input by the user is "computer accessory purchase", and the search cue obtained through the database data retrieval operation corresponding to the index information is: computer configuration, computer accessory acquisition, and computer accessory buying and selling. Then, the search prompt word closest to the keyword can be judged to be 'computer accessory buying and selling', then 'computer accessory obtaining', and finally 'computer configuration', based on the judgment process of the similarity, the size of the search prompt information is obtained and sequenced to be 1. 'computer accessory buying and selling', 2. 'computer accessory obtaining', and 3. 'computer configuration', and the preset number of search prompt information sequenced in the front is used as the final search prompt information. The preset number may be 2, and the preset number of search prompt information is set to display the closest search prompt information to a user and screen out unnecessary and useless information, for example, the search prompt information is ranked in size 1. "computer accessories are purchased and sold", 2. "computer accessories are obtained", and 3. "computer configuration", and then according to the setting that the preset number is 2, the final search prompt information determined by the present application is: "computer accessories buy and sell", 2 "computer accessories acquire".
and a display module 46 for displaying the search prompt information.
Specifically, since the size of the interface generally used for presenting search prompt information is limited, in step S108, only part of the searched prompt information may be presented, for example: searching the search prompt information corresponding to the index information from the source database; determining the similarity between the search prompt information and the keyword; and sequencing the search prompt information according to the similarity, taking the search prompt information with the preset number in the front sequencing as final search prompt information, and finally displaying the final search prompt information to a user through display equipment. For example, the final search prompt information is 1. "computer accessories buy and sell", 2. "computer accessories acquire", then the search prompt information can be displayed in a pull-down form below the user input box, so that the user can select, and compared with the prior art, the user experience is increased.
the embodiment of the present application further provides a method for displaying a cue word, as shown in fig. 5, including:
Step S502, displaying an input box of a search engine;
step S504, the keywords input in the input box are displayed;
step S506, displaying search prompt information associated with the keyword, which is searched from the source database based on index information, wherein the index information is index information corresponding to the keyword, which is searched from an index database.
Alternatively, this step S506 may be implemented by, for example: searching the search prompt information corresponding to the index information from the source database; determining the similarity between the search prompt information and the keyword; and sequencing the search prompt information according to the similarity, and taking the search prompt information with the preset number in the front sequencing as the final search prompt information.
specifically, the index information may be a primary key or a foreign key in the MySQL database, and the corresponding data is a search hint related to a scene in a certain field, for example, when the index information is located at a position where the primary key is "computer", the search hint is in a range of all data where the primary key value is "computer" in the database, and then the data is sorted according to the similarity between the data where the primary key value is "computer" and a keyword or a designated keyword input by a user, and a word with a large similarity may be arranged at the top of the queue.
It should be noted that similarity is a measure for comprehensively evaluating the closeness between two things. The closer two things are, the greater their degree of similarity, while the further apart the two things are, the smaller their degree of similarity. The similarity calculation of the application can be a correlation coefficient calculation method, an euclidean distance calculation method, a cosine correlation degree calculation algorithm and the like, and is expressed as the size of the repetition degree of words and keywords or specified keywords in a database, for example, the keyword input by a user is 'computer accessory purchase', and the search cue words obtained through database data calling operation corresponding to index information are as follows: computer configuration, computer accessory acquisition, and computer accessory buying and selling. Then, the search prompt word closest to the keyword can be judged to be 'computer accessory buying and selling', then 'computer accessory obtaining', and finally 'computer configuration', based on the judgment process of the similarity, the size of the search prompt information is obtained and sequenced to be 1. 'computer accessory buying and selling', 2. 'computer accessory obtaining', and 3. 'computer configuration', and the preset number of search prompt information sequenced in the front is used as the final search prompt information. The preset number may be 2, and the preset number of search prompt information is set to display the closest search prompt information to a user and screen out unnecessary and useless information, for example, the search prompt information is ranked in size 1. "computer accessories are purchased and sold", 2. "computer accessories are obtained", and 3. "computer configuration", and then according to the setting that the preset number is 2, the final search prompt information determined by the present application is: "computer accessories buy and sell", 2 "computer accessories acquire".
in some embodiments of the present application, the search box may be disposed below the cursor input by the user, for example, when the user inputs a keyword or specifies a keyword, the cursor is located at an (x, y) position in the search box, and based on the above coordinates, the search box display of the present application may perform search hint information and content display of the keyword in a range of (x, y-1) to (x +10, y-11). Since the size of the interface generally used for presenting search prompt information is limited, in steps S502 to S504, only part of the searched prompt information may be presented, for example: searching the search prompt information corresponding to the index information from the source database; determining the similarity between the search prompt information and the keyword; and sequencing the search prompt information according to the similarity, taking the search prompt information with the preset number in the front sequencing as final search prompt information, and finally displaying the final search prompt information to a user through display equipment. For example, the final search prompt information is 1. "computer accessories buy and sell", and 2. "computer accessories acquire", then the search prompt information can be displayed in a pull-down form below the user input box, so that the user can select, and compared with the prior art, the embodiment of the application increases the user experience.
An embodiment of the present application provides a storage medium, where the storage medium includes a stored program, where, when the program runs, a device where the storage medium is located is controlled to execute the method for recommending a cue word, for example, the method includes: detecting an input keyword; searching index information corresponding to the key words from an index database, wherein the index information is determined based on source data in a source database corresponding to a search engine; searching the search prompt information associated with the keyword from the source database based on the index information; and displaying the search prompt information.
the embodiment of the application further provides a processor, wherein the processor is used for running the program, and the method for recommending the cue words is executed when the program runs. For example, the method comprises: detecting an input keyword; searching index information corresponding to the key words from an index database, wherein the index information is determined based on source data in a source database corresponding to a search engine; searching the search prompt information associated with the keyword from the source database based on the index information; and displaying the search prompt information.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
in the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
in addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
the integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
the foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (11)

1. A method for recommending a cue word is characterized by comprising the following steps:
Detecting an input keyword;
Searching index information corresponding to the key words from an index database, wherein the index information is determined based on source data in a source database corresponding to a search engine;
Searching the search prompt information associated with the keyword from the source database based on the index information;
And displaying the search prompt information.
2. The method of claim 1, wherein before searching the source database for search prompt information associated with the keyword based on the index information, the method further comprises:
Acquiring source data of the search engine;
Extracting at least one field related to a service scene from the source data, and taking the extracted at least one field as a query field;
Determining index information according to the query field to obtain an index database;
And establishing the association between the index database and the source database.
3. The method of claim 1,
Detecting an input keyword, comprising: detecting whether the keywords in the input box change or not; when the change occurs, the changed keyword is taken as a target keyword;
Searching index information corresponding to the key words from an index database, wherein the index information comprises the following steps: and searching index information corresponding to the target key words from the index database.
4. The method of claim 3, wherein before the changed keyword is taken as the target keyword, the method further comprises:
detecting a specified keyword input after the keyword is input;
Combining the specified keywords with the keywords to obtain combined words;
And verifying the semantic completeness of the combined word, wherein the combined word is used as the target keyword when the verification is passed.
5. the method of claim 1, wherein searching the source database for search prompt information associated with the keyword based on the index information comprises:
searching the search prompt information corresponding to the index information from the source database;
Determining the similarity between the search prompt information and the keyword;
And sequencing the search prompt information according to the similarity, and taking the search prompt information with the preset number in the front sequencing as the final search prompt information.
6. the method of claim 1, wherein searching for index information corresponding to the keyword from an index database comprises:
Determining a business scene corresponding to the semantics of the keyword;
determining the index information based on the business scenario and the semantics.
7. A method for displaying a cue word, comprising:
Displaying an input box of a search engine;
Displaying the keywords input in the input box;
And displaying search prompt information related to the keyword, which is searched from a source database of a search engine based on index information, wherein the index information is index information corresponding to the keyword, which is searched from the index database, and the index information is determined based on source data in the source database corresponding to the search engine.
8. An apparatus for recommending a cue word, comprising:
the detection module is used for detecting the input keywords;
The first query module is used for searching index information corresponding to the keyword from an index database, wherein the index information is determined based on source data in a source database corresponding to a search engine;
The second query module is used for searching the search prompt information associated with the keyword from the source database based on the index information;
and the display module is used for displaying the search prompt information.
9. The apparatus of claim 8, further comprising:
the acquisition module is used for acquiring the source data of the search engine;
The extraction module is used for extracting at least one field relevant to the service scene from the source data and taking the extracted at least one field as a query field;
The determining module is used for determining index information according to the query field to obtain an index database;
And the establishing module is used for establishing the association between the index database and the source database.
10. A non-volatile storage medium, characterized in that the storage medium includes a stored program, and wherein when the program runs, the device on which the storage medium is located is controlled to execute the method for recommending a cue word according to any one of claims 1 to 6.
11. a processor, configured to execute a program, wherein the program executes a method for recommending a cue word according to any one of claims 1 to 6.
CN201910828830.6A 2019-09-03 2019-09-03 prompt word recommendation method and device, storage medium and processor Pending CN110543484A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910828830.6A CN110543484A (en) 2019-09-03 2019-09-03 prompt word recommendation method and device, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910828830.6A CN110543484A (en) 2019-09-03 2019-09-03 prompt word recommendation method and device, storage medium and processor

Publications (1)

Publication Number Publication Date
CN110543484A true CN110543484A (en) 2019-12-06

Family

ID=68712408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910828830.6A Pending CN110543484A (en) 2019-09-03 2019-09-03 prompt word recommendation method and device, storage medium and processor

Country Status (1)

Country Link
CN (1) CN110543484A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111653328A (en) * 2020-06-04 2020-09-11 医渡云(北京)技术有限公司 Medical record information pushing method and device, storage medium and electronic equipment
CN112749328A (en) * 2020-04-21 2021-05-04 腾讯科技(深圳)有限公司 Searching method and device and computer equipment
CN112749318A (en) * 2020-02-24 2021-05-04 云天弈(广州)智能科技有限公司 Intelligent writing system and method
CN113254808A (en) * 2021-06-02 2021-08-13 江苏豪杰测绘科技有限公司 GIS data screening method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103257969A (en) * 2012-02-17 2013-08-21 盛乐信息技术(上海)有限公司 Related search prompting method and system based on search word pairs
CN103544267A (en) * 2013-10-16 2014-01-29 北京奇虎科技有限公司 Search method and device based on search recommended words
CN103593371A (en) * 2012-08-16 2014-02-19 腾讯科技(深圳)有限公司 Method and device for recommending search keywords
CN104077392A (en) * 2014-06-30 2014-10-01 百度在线网络技术(北京)有限公司 Method and device for searching suggestion prompting

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103257969A (en) * 2012-02-17 2013-08-21 盛乐信息技术(上海)有限公司 Related search prompting method and system based on search word pairs
CN103593371A (en) * 2012-08-16 2014-02-19 腾讯科技(深圳)有限公司 Method and device for recommending search keywords
CN103544267A (en) * 2013-10-16 2014-01-29 北京奇虎科技有限公司 Search method and device based on search recommended words
CN104077392A (en) * 2014-06-30 2014-10-01 百度在线网络技术(北京)有限公司 Method and device for searching suggestion prompting

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112749318A (en) * 2020-02-24 2021-05-04 云天弈(广州)智能科技有限公司 Intelligent writing system and method
CN112749318B (en) * 2020-02-24 2024-03-26 云天弈(广州)智能科技有限公司 Intelligent writing system and method
CN112749328A (en) * 2020-04-21 2021-05-04 腾讯科技(深圳)有限公司 Searching method and device and computer equipment
CN112749328B (en) * 2020-04-21 2024-01-05 腾讯科技(深圳)有限公司 Searching method, searching device and computer equipment
CN111653328A (en) * 2020-06-04 2020-09-11 医渡云(北京)技术有限公司 Medical record information pushing method and device, storage medium and electronic equipment
CN111653328B (en) * 2020-06-04 2023-03-21 医渡云(北京)技术有限公司 Medical record information pushing method and device, storage medium and electronic equipment
CN113254808A (en) * 2021-06-02 2021-08-13 江苏豪杰测绘科技有限公司 GIS data screening method and system

Similar Documents

Publication Publication Date Title
US9846748B2 (en) Searching for information based on generic attributes of the query
US10268766B2 (en) Systems and methods for computation of a semantic representation
US9489401B1 (en) Methods and systems for object recognition
US8965872B2 (en) Identifying query formulation suggestions for low-match queries
CN110543484A (en) prompt word recommendation method and device, storage medium and processor
US9535911B2 (en) Processing a content item with regard to an event
JP5721818B2 (en) Use of model information group in search
JP2019507417A (en) User interface for multivariable search
US10482169B2 (en) Recommending form fragments
US10467265B2 (en) Method for extracting entries from a database
KR20160107187A (en) Coherent question answering in search results
US8606780B2 (en) Image re-rank based on image annotations
US20160283564A1 (en) Predictive visual search enginge
CN108304444A (en) Information query method and device
US20230222136A1 (en) Information providing device
CN113039539A (en) Extending search engine capabilities using AI model recommendations
JP2023066404A (en) Method and system for performing product matching on e-commerce platform
CN109934740B (en) patent monitoring method and device
CN108733848B (en) Knowledge searching method and system
JP2011018152A (en) Information presentation device, information presentation method, and program
TWI837541B (en) System and method for generating creative materials
TW201131399A (en) Indexing method and apparatus
CN115563170A (en) Data analysis method and device, electronic equipment and computer storage medium
US10423613B2 (en) Data search method and data search system
CN117708304A (en) Database question-answering method, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191206