CN103020052B - A kind of method and apparatus identifying search need - Google Patents

A kind of method and apparatus identifying search need Download PDF

Info

Publication number
CN103020052B
CN103020052B CN201110279434.6A CN201110279434A CN103020052B CN 103020052 B CN103020052 B CN 103020052B CN 201110279434 A CN201110279434 A CN 201110279434A CN 103020052 B CN103020052 B CN 103020052B
Authority
CN
China
Prior art keywords
template
word
dictionary
currently
matched
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.)
Active
Application number
CN201110279434.6A
Other languages
Chinese (zh)
Other versions
CN103020052A (en
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201110279434.6A priority Critical patent/CN103020052B/en
Publication of CN103020052A publication Critical patent/CN103020052A/en
Application granted granted Critical
Publication of CN103020052B publication Critical patent/CN103020052B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a kind of method and apparatus identifying search need, the form storage dictionary set with trie (Trie) respectively in data base and demand recognition template, respectively obtain dictionary Trie tree and template Trie tree;The method includes: after receiving user search request (query), mates user query in conjunction with dictionary Trie tree and template Trie tree, determines the demand type corresponding to the template matched.The efficiency identifying search need can be improved by the present invention, reduce and search for the calculating pressure that the performance to search engine is brought.

Description

Method and device for identifying search requirement
[ technical field ] A method for producing a semiconductor device
The invention relates to the technical field of computers, in particular to a method and a device for identifying search requirements.
[ background of the invention ]
In the search technology, in order to return an accurate search result to a user, a search engine needs to perform requirement identification on a user search request (query), so that a search result of a corresponding data resource can be returned according to an identified requirement, or the search result can be displayed in a corresponding form according to the identified requirement.
In the existing search requirement recognition technology, the queries with the same requirement are generally summarized to form one or more template forms, and the corresponding relation between the template and the search requirement is established in advance. After receiving the user query, firstly matching the user query with the dictionary, determining the attributes of each word in the user query according to the matching result of the dictionary, matching the determined attributes of each word with the templates one by one, and identifying the search requirement corresponding to the matched templates as the search requirement of the user query.
However, in the existing search requirement, the dictionaries and templates in the database need to be matched one by one in the matching process, and the number of the dictionaries and the templates in the database is usually large, which causes low efficiency in identifying the search requirement of the query of the user, and the daily massive search brings great computational stress on the performance of the search engine.
[ summary of the invention ]
In view of the above, the present invention provides a method and an apparatus for identifying search requirements, so as to improve the efficiency of identifying search requirements and reduce the pressure on the performance of a search engine caused by search.
The specific technical scheme is as follows:
a method for identifying search requirements comprises the steps of respectively storing a dictionary and a requirement identification template in a Trie tree form in a database to respectively obtain a dictionary Trie tree and a template Trie tree; the method comprises the following steps:
after a user search request query is received, matching the user query by combining the dictionary Trie tree and the template Trie tree, and determining a requirement type corresponding to the matched template.
The root node in the dictionary Trie tree indicates an initial state, leaf nodes and partial intermediate nodes indicate matched word attributes, and transfer conditions among the nodes are characters;
the root node in the template Trie tree indicates an initial state, the leaf node indicates that the template matching is successful, and the transfer conditions between the nodes comprise: specific words, word attributes, wildcards, or functions.
Specifically, the step of storing the dictionary in the form of the Trie tree in the database to obtain the dictionary Trie tree comprises the following steps:
a1, establishing a root node of a dictionary Trie tree in a database, wherein the root node indicates an initial state;
a2, acquiring a word which is not added into a dictionary Trie tree from the dictionary, reading a first character in the currently acquired word, and taking a root node of the dictionary Trie tree as a current adding position;
a3, judging whether the currently read character exists in the transition condition from the current adding position, if yes, executing step A4; otherwise, go to step A6;
a4, in a dictionary Trie tree, taking the next-level node corresponding to the transfer condition of the currently read character as the current adding position;
a5, judging whether the next character exists in the currently read word, if so, reading the next character of the currently acquired word, and turning to the step A3; otherwise, go to step A9;
a6, adding the currently read character as a transition condition from the current adding position;
a7, judging whether the next character exists in the currently acquired words, if so, executing the step A8; otherwise, adding the attribute of the currently acquired word into the next-level node corresponding to the added transfer condition in the step A6, and executing the step A9;
a8, taking the next-level node corresponding to the transfer condition added in the step A6 as the current adding position, reading the next character in the currently acquired word, and turning to the step A3;
a9, ending the adding process of the currently obtained words, if the words which are not added into the Trie tree of the dictionary exist in the dictionary, turning to the step A2; otherwise, obtaining a dictionary Trie tree.
Specifically, the step of storing the template in the form of the Trie tree in the database to obtain the template Trie tree comprises the following steps:
b1, establishing a root node of the template Trie tree in the database, wherein the root node indicates an initial state;
b2, acquiring a template which is not added into the template Trie tree, reading the content of a first template slot in the currently acquired template, and taking the root node of the template Trie tree as the current adding position;
b3, judging whether the content of the template slot read currently exists in the transfer condition starting from the current adding position, if so, executing the step B4; otherwise, executing step B7;
b4, taking the next-level node corresponding to the transfer condition where the currently read content of the template slot is located as the current adding position in the template Trie tree;
b5, judging whether the next template slot exists in the currently read template slot, if so, reading the content of the next template slot, and turning to the step B3; otherwise, go to step B6;
b6, adding an indication that the template matching is successful in the current adding position, and executing the step B8;
b7, adding the currently read contents of the template slot into a transfer condition starting from the current adding position, taking the next-level node corresponding to the transfer condition as the current adding position, and turning to the step B5;
b8, ending the adding process of the currently obtained template, and if the template which is not added to the template Trie tree exists, turning to the step B2; otherwise, obtaining the template Trie tree.
Further, the step B6 may further include: and adding an outlet of the requirement type information corresponding to the currently acquired template in the current adding position, or adding the requirement type information corresponding to the currently acquired template.
Matching the user query by combining the dictionary Trie tree and the template Trie tree, and determining the requirement type corresponding to the matched template specifically comprises:
c1, starting to match the first character of the user query with the dictionary Trie tree, recording each item of content matched by each round of dictionary Trie tree to obtain all kinds of word full segmentation results of the user query, wherein the word full segmentation results comprise words and word attributes, and the words in all kinds of word full segmentation results form the user query;
and C2, respectively matching the full segmentation results of each word on the template Trie tree one by one, and determining the requirement type corresponding to the matched template.
Specifically, the step C1 may include:
c11, after receiving the user query, the dictionary pointer points to the first character of the user query;
c12, taking the root node of the Trie tree of the dictionary as the current matching position;
c13, judging whether the current read character is matched with the transition condition from the current matching position, if yes, executing step C14; otherwise, go to step C17;
c14, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates the word attribute, if so, executing the step C15; otherwise, go to step C16;
c15, acquiring and recording the word attributes indicated by the currently determined nodes and words formed by the matched characters;
c16; judging whether the currently read character has a next character in the user query, if so, reading the next character and transferring to the step C13; otherwise, end step C1;
c17, determining the shortest word in the recorded words when the position of the current dictionary pointer is determined, judging whether the shortest word has the next character in the user query, if so, pointing the dictionary pointer to the next character of the shortest word in the user query, reading the character pointed by the dictionary pointer, and turning to the step C12.
Specifically, the following steps are respectively performed in the step C2 for each word full-segmentation result:
c21, pointing the template pointer to the first character of the user query, and taking the root node of the template Trie tree as the currently matched node;
c22, determining the word beginning with the character pointed by the current template pointer in the current word full segmentation result;
c23, judging whether the currently read words or the attributes of the words are matched with the transfer conditions starting from the currently matched nodes in the template Trie tree, if so, executing the step C24; otherwise, ending the template matching of the current word full segmentation result;
c24, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates that the template matching is successful, if so, executing the step C25; otherwise, go to step C26;
c25, acquiring the search requirement indicated by the currently determined node, and ending the step C2;
c26, judging whether the current read word has the next character in the user query, if so, executing the step C27; otherwise, end step C2;
c27, pointing the template pointer to the next character of the currently read word in the user query, and turning to the step C22.
In addition, matching the user query by combining the dictionary Trie and the template Trie, and determining the requirement type corresponding to the matched template specifically comprises:
d1, pointing the dictionary pointer to the first character of the user query;
d2, matching the characters pointed by the dictionary pointer with the dictionary Trie tree;
d3, after one round of matching of the Trie trees of the dictionary is finished, matching each item of content matched by the Trie trees of the dictionary from the matched position when the matching of the Trie trees of the previous round of the template is finished, wherein each item of content comprises words and the attributes of the words, after the matching of the Trie trees of the template is finished, pointing a dictionary pointer to the next character of the words used by the Trie trees of the template matching in the user query, and turning to the step D2 to start the matching of the Trie trees of the next round of the dictionary until the matching of the Trie trees of the template or the template is failed; and determining the requirement type corresponding to the matched template.
The step D2 specifically includes:
d21, taking the root node of the Trie tree of the dictionary as the current matching position;
d22, reading the character pointed by the pointer of the current dictionary, judging whether the current read character is matched with the transfer condition from the current matching position, if not, finishing the matching of the Trie tree of the dictionary of the current round, and recording each content matched by the Trie tree of the dictionary of the current round; if so, go to step D23;
d23, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates the word attribute, if so, executing the step D24; otherwise, go to step D25;
d24, acquiring and recording the word attributes indicated by the currently determined nodes and the words formed by the matched characters, and executing the step D25;
d25, judging whether the current read character has the next character in the user query, if so, reading the next character, taking the current determined node as the current matching position, and turning to the step D22; otherwise, go to the step D3.
In step D3, the items of content matched by the Trie of the current round of dictionary are read respectively, and the following matching process is performed on the read items of content respectively:
d31, judging whether the currently read words or the attributes of the words are matched with transfer conditions starting from the currently matched nodes in the template Trie tree, wherein the initial positions of the currently matched nodes are the root nodes of the template Trie tree; if so, go to step D32; otherwise, ending the template Trie tree matching aiming at the currently read content;
d32, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates that the template matching is successful, if so, executing the step D33; otherwise, taking the currently determined node as the current matching position, pointing the dictionary pointer to the next character of the word in the user query in the currently read content, and turning to the step D2;
d33, determining the search requirement corresponding to the matched template, and ending the template Trie tree matching aiming at the currently read content.
Specifically, the step of judging whether the currently read word or the attribute of the word is matched with the transfer condition starting from the currently matched node in the template Trie includes:
if the transfer condition from the currently matched node is the word attribute, determining that the attribute of the currently read word is matched with the word attribute in the transfer condition if the attribute of the currently read word is consistent with the word attribute in the transfer condition; or,
if the transfer condition from the currently matched node is a specific word, determining that the currently read word is matched with the specific word in the transfer condition if the currently read word is consistent with the specific word in the transfer condition; or,
if the transfer condition from the currently matched node is a wildcard character, confirming that the two are matched, intercepting the length indicated by the wildcard character from the currently read word in the query, and taking the intercepted content as the currently read word; or,
and if the transfer condition from the currently matched node is a function, calling the function to identify in the user query from the read words, if the identification result meets the preset function requirement, confirming that the two words are matched, and taking the words corresponding to the identification result meeting the preset function requirement as the currently read words.
A device for identifying search requirements stores a dictionary and a requirement identification template in a database in a Trie tree form respectively to obtain a dictionary Trie tree and a template Trie tree respectively; the device includes:
the request receiving unit is used for receiving a user search request query;
and the requirement matching unit is used for matching the user query by combining the dictionary Trie tree and the template Trie tree and determining the requirement type corresponding to the matched template.
The root node in the dictionary Trie tree indicates an initial state, leaf nodes and partial intermediate nodes indicate matched word attributes, and transfer conditions among the nodes are characters;
the root node in the template Trie tree indicates an initial state, the leaf node indicates that the template matching is successful, and the transfer conditions between the nodes comprise: specific words, word attributes, wildcards, or functions.
Still further, the apparatus may further comprise: a dictionary tree building unit for performing the following operations:
a1, establishing a root node of a dictionary Trie tree in a database, wherein the root node indicates an initial state;
a2, acquiring a word which is not added into a dictionary Trie tree from the dictionary, reading a first character in the currently acquired word, and taking a root node of the dictionary Trie tree as a current adding position;
a3, judging whether the currently read character exists in the transition condition from the current adding position, if yes, executing operation A4; otherwise, operation a6 is performed;
a4, in a dictionary Trie tree, taking the next-level node corresponding to the transfer condition of the currently read character as the current adding position;
a5, judging whether the next character exists in the currently read word, if so, reading the next character of the currently acquired word, and turning to operation A3; otherwise, operation a9 is performed;
a6, adding the currently read character as a transition condition from the current adding position;
a7, judging whether the next character exists in the currently acquired words, and if so, executing operation A8; otherwise, adding the attribute of the currently acquired word into the next-level node corresponding to the added transfer condition of the operation A6, and executing an operation A9;
a8, taking the next-level node corresponding to the transfer condition added in the operation A6 as the current adding position, reading the next character in the currently acquired word, and turning to the operation A3;
a9, ending the adding process of the currently acquired words, if the words which are not added into the Trie tree of the dictionary exist in the dictionary, turning to operation A2; otherwise, obtaining a dictionary Trie tree.
The device also includes: a template tree building unit for performing the following operations:
b1, establishing a root node of the template Trie tree in the database, wherein the root node indicates an initial state;
b2, acquiring a template which is not added into the template Trie tree, reading the content of a first template slot in the currently acquired template, and taking the root node of the template Trie tree as the current adding position;
b3, judging whether the content of the template slot read currently exists in the transfer condition starting from the current adding position, if so, executing operation B4; otherwise, operation B7 is performed;
b4, taking the next-level node corresponding to the transfer condition where the currently read content of the template slot is located as the current adding position in the template Trie tree;
b5, judging whether the next template slot exists in the currently read template slot, if so, reading the content of the next template slot, and turning to operation B3; otherwise, operation B6 is performed;
b6, adding an indication that the template matching is successful in the current adding position, and executing operation B8;
b7, adding the currently read contents of the template slot as a transition condition from the current adding position, taking the next-level node corresponding to the transition condition as the current adding position, and going to operation B5;
b8, ending the adding process of the currently acquired template, and if the template which is not added to the template Trie tree exists, turning to operation B2; otherwise, obtaining the template Trie tree.
Further, when performing the operation B6, the template tree creating unit is further configured to add an outlet of the requirement type information corresponding to the currently obtained template in the current adding position, or add the requirement type information corresponding to the currently obtained template.
Wherein, the requirement matching unit specifically comprises: a first dictionary tree matching module and a first template tree matching module;
the first dictionary tree matching module is used for matching a first character of the user query with the dictionary Trie trees, recording various contents matched by each round of dictionary Trie trees to obtain various word full-segmentation results of the user query, wherein the word full-segmentation results comprise words and word attributes, and the words in each word full-segmentation result form the user query;
and the first template tree matching module is used for respectively matching the full segmentation results of each word on the template Trie tree one by one and determining the requirement type corresponding to the matched template.
The first dictionary tree matching module specifically performs the following operations:
c11, after receiving the user query, the dictionary pointer points to the first character of the user query;
c12, taking the root node of the Trie tree of the dictionary as the current matching position;
c13, judging whether the currently read character is matched with the transition condition from the current matching position, if yes, executing operation C14; otherwise, operation C17 is performed;
c14, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates the word attribute, if so, executing operation C15; otherwise, operation C16 is performed;
c15, acquiring and recording the word attributes indicated by the currently determined nodes and words formed by the matched characters;
c16; judging whether the currently read character has a next character in the user query, if so, reading the next character and turning to the operation C13; otherwise, ending the operation;
c17, determining the shortest word in the recorded words when the position of the current dictionary pointer is determined, judging whether the shortest word has the next character in the user query, if so, pointing the dictionary pointer to the next character of the shortest word in the user query, reading the character pointed by the dictionary pointer, and turning to operation C12.
The first template tree matching module specifically executes the following operations:
c21, pointing the template pointer to the first character of the user query, and taking the root node of the template Trie tree as the currently matched node;
c22, determining the word beginning with the character pointed by the current template pointer in the current word full segmentation result;
c23, judging whether the currently read word or the attribute of the word is matched with the transfer condition starting from the currently matched node in the template Trie tree, if so, executing operation C24; otherwise, ending the template matching of the current word full segmentation result;
c24, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates that the template matching is successful, if so, executing operation C25; otherwise, operation C26 is performed;
c25, acquiring the search requirement indicated by the currently determined node, and ending the operation;
c26, judging whether the currently read word has the next character in the user query, if so, executing operation C27; otherwise, ending the operation;
c27, point the template pointer to the next character of the currently read word in the user query, and go to operation C22.
Specifically, the requirement matching unit may include: the dictionary pointer setting module, the second dictionary tree matching module and the second template tree matching module;
the dictionary pointer setting module is used for pointing the dictionary pointer to the first character of the query of the user;
the second dictionary tree matching module is used for matching the characters pointed by the dictionary pointer with the dictionary Trie tree;
the second template tree matching module is used for matching contents matched by the second dictionary tree matching module in the current round of the template tree from the position matched by the Trie tree of the previous round of the template tree after the Trie tree of the first round of the template tree is matched, wherein the contents comprise words and the attributes of the words; and determining the requirement type corresponding to the matched template.
Wherein the second dictionary tree matching module specifically performs the following operations:
d21, taking the root node of the Trie tree of the dictionary as the current matching position;
d22, reading the character pointed by the pointer of the current dictionary, judging whether the current read character is matched with the transfer condition from the current matching position, if not, finishing the matching of the Trie tree of the dictionary of the current round, and recording each content matched by the Trie tree of the dictionary of the current round; if so, perform operation D23;
d23, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates the word attribute, if so, executing operation D24; otherwise, operation D25 is performed;
d24, acquiring and recording the word attributes indicated by the currently determined nodes and the words formed by the matched characters, and executing operation D25;
d25, judging whether the current read character has the next character in the user query, if so, reading the next character, taking the current determined node as the current matching position, and turning to the operation D22; otherwise, the matching of the dictionary Trie tree of the current round is finished.
Specifically, the second template tree matching module respectively reads each item of content matched by the second dictionary tree matching module in the round of the dictionary tree, and respectively performs the following matching operations on each item of content read:
d31, judging whether the currently read words or the attributes of the words are matched with transfer conditions starting from the currently matched nodes in the template Trie tree, wherein the initial positions of the currently matched nodes are the root nodes of the template Trie tree; if so, perform operation D32; otherwise, ending the template Trie tree matching aiming at the currently read content;
d32, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates that the template matching is successful, if so, executing operation D33; otherwise, taking the currently determined node as the current matching position, pointing the dictionary pointer to the next character of the word in the user query in the currently read content, and turning to the operation D2;
d33, determining the search requirement corresponding to the matched template, and ending the template Trie tree matching aiming at the currently read content.
Judging whether the currently read word or the attribute of the word is matched with a transfer condition starting from the currently matched node in the template Trie tree or not comprises the following steps:
if the transfer condition from the currently matched node is the word attribute, determining that the attribute of the currently read word is matched with the word attribute in the transfer condition if the attribute of the currently read word is consistent with the word attribute in the transfer condition; or,
if the transfer condition from the currently matched node is a specific word, determining that the currently read word is matched with the specific word in the transfer condition if the currently read word is consistent with the specific word in the transfer condition; or,
if the transfer condition from the currently matched node is a wildcard character, confirming that the two are matched, intercepting the length indicated by the wildcard character from the currently read word in the query, and taking the intercepted content as the currently read word; or,
and if the transfer condition from the currently matched node is a function, calling the function to identify in the user query from the read words, if the identification result meets the preset function requirement, confirming that the two words are matched, and taking the words corresponding to the identification result meeting the preset function requirement as the currently read words.
According to the technical scheme, the dictionary and the requirement recognition template are stored in the Trie tree form, so that after a user query is received, the requirement type corresponding to the matched template can be determined by combining the dictionary Trie tree and the template Trie tree, and compared with a mode of matching the dictionary and each template in the database one by one, the efficiency of recognizing the search requirement is greatly improved, and the calculation pressure of the search on the performance of a search engine is reduced.
[ description of the drawings ]
Fig. 1 is a flowchart of establishing a dictionary Trie according to an embodiment of the present invention;
fig. 2 is an example diagram of a dictionary Trie according to an embodiment of the present invention;
fig. 3 is a flowchart of establishing a template Trie according to a second embodiment of the present invention;
FIG. 4 is a diagram of an example of a template Tire tree according to a second embodiment of the present invention;
fig. 5 is a flowchart of a method for determining a type of a demand according to a third embodiment of the present invention;
FIG. 6 is a flowchart of another method for determining a type of demand according to a fourth embodiment of the present invention;
fig. 7 is a structural diagram of an apparatus according to a fifth embodiment of the present invention;
fig. 8 is a structural diagram of another apparatus according to a fifth embodiment of the present invention.
[ detailed description ] embodiments
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
The method provided by the invention mainly comprises the following steps: storing a dictionary and a demand recognition template in a database in a Trie (Trie) tree form respectively to obtain a dictionary Trie tree and a template Trie tree respectively; after receiving the user query, matching the user query by using the dictionary Trie tree and the template Trie tree, and determining the requirement type corresponding to the matched template.
The Trie includes nodes of a hierarchical structure and transfer conditions between the nodes, wherein each node indicates state information, and a root node indicates an initial state.
In the dictionary Trie, the root node indicates the initial state and the leaf nodes indicate the matched word attributes. The intermediate node indicates an intermediate state and possibly also indicates the matched word attribute, and the transition condition between the nodes is a character.
In the template Trie tree, a root node indicates an initial state, a leaf node indicates that template matching is successful, and transfer conditions between the nodes comprise: word attributes, specific words, wildcards, or functions. Word attributes may include, but are not limited to: part of speech, named entity type, etc. Specific terms may include: common entity words or auxiliary words, fictional words and the like can be ignored.
First, a process of building a dictionary Trie and a process of building a template Trie are described in the first embodiment and the second embodiment, respectively.
The first embodiment,
Fig. 1 is a flowchart of establishing a dictionary Trie according to an embodiment of the present invention, as shown in fig. 1, including the following steps:
step 101: a root node of a dictionary Trie is established, the root node indicating an initial state.
In the dictionary Trie, the root node is only the starting position of one match, and thus indicates the initial state. The establishment of the root node need only be performed when initially reading the first word in the dictionary.
Step 102: and acquiring a word which is not added into the dictionary Trie tree from the dictionary, reading a first character in the currently acquired word, and taking a root node of the dictionary Trie tree as a current adding position.
Step 103: judging whether the currently read character exists in a transfer condition from the current adding position, if so, executing step 104; otherwise, step 106 is performed.
Step 104: and in the dictionary Trie tree, taking the next-level node corresponding to the transfer condition of the currently read character as the current adding position.
Step 105: judging whether the next character exists in the currently acquired words or not, if so, reading the next character in the currently acquired words, and turning to the step 103; otherwise, the adding process of the currently acquired word is ended, and the step 102 is proceeded to.
Actually, when the adding process of the currently obtained word is finished, if a word which is not added to the dictionary Trie exists in the dictionary, the step 102 is carried out; otherwise, ending the process of establishing the dictionary Trie tree to obtain the dictionary Trie tree.
Step 106: the currently read character is added as a branch condition from the currently added position.
Step 107: judging whether the next character exists in the currently acquired words or not, if so, executing step 108; otherwise, adding the word attribute of the currently acquired word to the next-level node corresponding to the transfer condition added in step 106, ending the adding process of the currently acquired word, and going to step 102.
In fact, when the adding process of the currently obtained word is ended, if a word which is not added to the dictionary Trie exists in the dictionary, the step 102 is carried out; otherwise, ending the process of establishing the dictionary Trie tree to obtain the dictionary Trie tree.
Step 108: and taking the next-level node corresponding to the transfer condition added in the step 106 as the current adding position, reading the next character in the currently acquired word, and turning to the step 103.
Taking a specific example, three words of "three rivers", "three estuaries" and "three counties" existing in the dictionary are added to the Trie tree of the dictionary, and the word attributes of the three words in the dictionary are all address names.
As shown in fig. 2, after a root node (node 1 in fig. 2) of a dictionary Trie is established, a word "three river" is acquired, a character "three" is read first, and if no "three" exists in a transfer condition from the root node, the character "three" is added as a transfer condition from the root node, and a next-level node (node 2 in fig. 2) corresponding to the transfer condition is used as a current adding position. Reading the next character 'river' continuously, and if no 'river' exists in the transfer conditions starting from the node 2, adding the 'river' as one transfer condition starting from the node 2, adding a word attribute place name in the next-level node (namely the node 3 in the figure 2) corresponding to the transfer condition, and finishing the addition of the word 'three rivers'.
And continuing to acquire the word "three jiangkou", firstly reading the character "three", and taking the next-level node (namely the node 2 in the figure 2) corresponding to the transfer condition as the current adding position if the transfer condition from the root node has the character "three". And reading the next character 'jiang', wherein the transition condition starting from the node 2 already contains the character 'jiang', and taking the next-level node (namely, the node 3 in fig. 2) corresponding to the transition condition as the current adding position. Reading the next character port, adding the port as the transfer condition from the node 3 when the character port does not exist in the transfer condition from the node 3, and adding the word attribute place name in the next level node (namely the node 4 in the figure 2) corresponding to the transfer condition, so that the adding process of the three jiangkou is finished.
The adding process of "san jiang county" is similar to that of "san jiang kou", and is not described herein again, and finally the states of the three words in the dictionary Trie tree are shown in fig. 2. By the method, all words in the dictionary can be displayed in a dictionary Trie tree, and all words share one root node. Subsequently, when the dictionary Trie tree is used for word matching, the root node of the dictionary Trie tree is started.
The process shown in this embodiment is completed.
Example II,
Fig. 3 is a flowchart of establishing a template Trie according to the second embodiment of the present invention, where the process forms a template Trie by using a pre-existing correspondence between each template and the requirement type information, and as shown in fig. 3, the process includes the following steps:
step 301: a root node of the template Trie is established, the root node indicating an initial state.
In the template Trie, the root node is only the starting position of a match, and thus indicates an initial state. The establishment of the root node need only be performed when initially reading the first of the templates.
Step 302: and acquiring a template which is not added into the template Trie tree, reading the content of a first template slot in the currently acquired template, and taking the root node of the template Trie tree as the current adding position.
The contents of each template slot in the template may include, but are not limited to: word attributes, specific words, wildcards, or functions. In the case of wildcards, the length of the wildcard can also be indicated at the same time.
Step 303: judging whether the content of the currently read template slot exists in a transfer condition from the current adding position, if so, executing a step 304; otherwise, step 307 is executed.
Step 304: and in the template Trie tree, taking the next-level node corresponding to the transfer condition where the currently read contents of the template slot are located as the current adding position.
Step 305: judging whether the next template slot exists in the currently acquired template slot, if so, reading the content of the next template slot, and turning to the step 303; otherwise, step 306 is performed.
Step 306: and adding an indication that the template matching is successful in the current adding position, ending the adding process of the currently acquired template, and turning to the step 302.
Actually, after the adding process of the currently obtained template is finished, if there is a template that has not been added to the template Trie tree, go to step 302; otherwise, ending the building process of the template Trie tree to obtain the template Trie tree.
Step 307: the content of the template slot obtained at present is added as a transition condition from the current addition position, and the next-level node corresponding to the transition condition is taken as the current addition position, and the process goes to step 305.
In step 306, in addition to the indication that the template matching is successful, an exit pointing to the requirement type information corresponding to the template may be further added, or the requirement type information corresponding to the template may be directly added.
To take a specific example, assume that a template is to be: and adding the [ place name ] [ to ] [ place name ] and the [ mechanism name ] [ to ] [ mechanism name ] into the Trie tree, wherein the two templates respectively correspond to the train query requirement and the map route query requirement.
As shown in fig. 4, after the root node (node 1 in fig. 4) of the template Trie is established, the template is obtained: [ place name ] [ to ] [ place name ], first, the content "place name" (which is a word attribute) of the first template slot is read, and assuming that the word attribute "place name" does not exist in the transition condition from the root node, "place name" is added as one transition condition from the root node, and the next-level node (node 2 in fig. 4) corresponding to the transition condition is set as the current addition position. The content of the next template slot "to" is continuously read, and if the specific word "to" does not exist in the transition condition starting from the node 2, the "to" is added as the transition condition starting from the node 2, and the next-level node (i.e., the node 4 in fig. 4) corresponding to the transition condition is taken as the current adding position. Continuing to read the content "place name" of the next template slot, assuming that the word attribute "place name" does not exist in the transition condition from the node 4, adding "place name" as one transition condition from the node 4, indicating that the template matching is successful in the next level node (node 6 in fig. 4) of the transition condition, and adding the requirement type information as follows: and inquiring the type of the demand by the train.
Continue to obtain the next template: first, the content "structure name" (which is a term attribute) of the first template slot is read, and if the term attribute "structure name" does not exist in the transition condition from the root node, the "structure name" is added as a transition condition from the root node, and the next-level node (node 3 in fig. 4) corresponding to the transition condition is set as the current addition position. The content "to" of the next template slot is continuously read, and if no specific word "to" exists in the transition condition starting from the node 3, the "to" is added as the transition condition starting from the node 3, and the next-level node (i.e., the node 5 in fig. 4) corresponding to the transition condition is taken as the current adding position. Continuing to read the content of the next template slot, namely the mechanism name, assuming that the word attribute, namely the mechanism name, does not exist in the transition condition starting from the node 5, adding the mechanism name into the transition condition starting from the node 5, indicating that the template matching is successful in the next-level node (the node 7 in fig. 4) of the transition condition, and adding the requirement type information as follows: and inquiring the type of the demand by the map route.
The process of this embodiment two ends.
When the dictionary Trie tree and the template Trie tree are used for matching the user query, the dictionary Trie tree is actually used for carrying out word full segmentation processing on the user query, the result of the word full segmentation processing on the user query is matched with the template Trie tree, so that a template matched with the user query is obtained, and the requirement type corresponding to the matched template is determined.
The matching by utilizing the dictionary Trie tree and the matching by utilizing the template Trie tree can be carried out in sequence, namely, after the word full segmentation processing of the query of the user is finished by utilizing the dictionary Trie tree, the matching of the template Trie tree is carried out; or alternatively, namely, when each round of matching of the dictionary Trie tree is executed, the words segmented in the round are matched with the next node in the template Trie tree, and after the words are matched with the next node of the template Trie tree, the words are returned to the dictionary Trie tree for the next round of matching. The above two matching modes are described in detail by the third embodiment and the fourth embodiment.
Example III,
In the embodiment, a mode of matching the dictionary Trie tree of the user query to determine the type of the requirement is adopted after the word full segmentation processing is finished, and then the template Trie tree is used for matching. Fig. 5 is a flowchart of a method for determining a requirement type according to a third embodiment of the present invention, as shown in fig. 5, the method may include the following steps:
step 501: receiving the user query, pointing the dictionary pointer to the first character of the user query, and reading the character pointed by the current dictionary pointer.
Step 502: and taking the root node of the dictionary Trie tree as the current matching position.
Step 503: judging whether the currently read character is matched with a transfer condition starting from the current matching position, if not, executing a step 507; if so, step 504 is performed.
Step 504: determining the next-level node corresponding to the matched transfer condition, judging whether the currently determined node indicates word attributes, and if so, executing step 505; otherwise, step 506 is performed.
Step 505: and acquiring and recording the word attributes indicated by the currently determined nodes and the words formed by the matched characters, and executing step 506.
Step 506: judging whether the current read character has the next character in the user query, if so, reading the next character, taking the current determined node as the current matching position, and turning to step 503; otherwise, step 508 is performed.
Step 507: determining the shortest word in the recorded words when the current dictionary pointer is located, judging whether the shortest word has the next character in the user query, if so, pointing the dictionary pointer to the next character of the shortest word in the user query, reading the character pointed by the dictionary pointer, and turning to step 502; otherwise, step 508 is performed.
Step 508: and finishing the matching process of the dictionary Trie tree, and obtaining all word segmentation results of the user query by using the words and the attributes thereof recorded in the user query, wherein the words in all word segmentation results form the whole user query.
And respectively executing the following matching process of the template Trie tree aiming at all word full segmentation results one by one.
Step 509: and directing the template pointer to the first character of the query of the user, and taking the root node of the template Trie tree as the currently matched node.
Step 510: and determining the words starting from the character pointed by the current template pointer in the current word full segmentation result.
Step 511: judging whether the currently read words or the attributes thereof are matched with the transfer conditions starting from the currently matched nodes in the template Trie tree, if so, executing step 512; otherwise, ending the template matching process of the current word full segmentation result.
In this step, when determining whether the currently read content matches a transition condition from the currently matched node in the template wire tree, there may be the following situations:
and if the transition condition from the currently matched node is the word attribute, determining that the word attribute in the currently read content is matched with the word attribute in the transition condition if the word attribute is consistent with the word attribute in the transition condition.
If the transition condition from the currently matched node is a specific word, determining that the words in the currently read content are matched with the specific words in the transition condition if the words in the currently read content are consistent with the specific words in the transition condition.
If the transfer condition from the currently matched node is wildcard, the two are confirmed to be matched, in this case, the length indicated by the wildcard may be intercepted from the currently read word in the query, and the intercepted content is taken as the currently read word, and then step 512 is executed.
Assuming that the query of the user is 'train from three rivers to three rivers', if the currently read word 'three rivers' is a wildcard with the length of 4 words, the user directly confirms that the two words are matched, but the word 'three rivers to' is taken as the currently read word, and then the template Trie tree is matched from 'three rivers'.
If the transfer condition from the currently matched node is a function, calling the function to identify in the query from the read word, if the identification result meets the preset function requirement, determining that the two are matched, taking the word corresponding to the identification result meeting the preset function requirement as the currently read word, and then executing step 512.
Taking the function of the identification number as a transfer condition, if the query of the user is "13100000000 attribution", if the currently read word starts from the number "1", calling the function to start identification from "1", identifying the function requirement meeting the number, returning the length of the number as an identification result, after the identification is completed, 13100000000 is used as the currently read word, and then matching is started from "the" of ".
Step 512: determining the next-level node corresponding to the matched transfer condition, judging whether the currently determined node indicates that the template matching is successful, if so, executing step 513; otherwise, step 514 is performed.
Step 513: and acquiring the search requirement indicated by the currently determined node, and ending the process.
Step 514: judging whether the current read word has the next character in the user query, if so, executing step 515; otherwise, the flow ends.
Step 515: the template pointer is pointed to the next character of the currently read word in the user query, and the process goes to step 510.
As a specific example, assume that the received user query is "train from three rivers.
First, matching is performed using the dictionary Trie shown in fig. 2, where the dictionary pointer points to the first character of the user query, i.e., "three", and "three" is read. Characters which are not matched in the user query are read in sequence from the root node 1, namely from three, the transition condition from the root node 1 can be matched, and then the transition condition from the node 2 can be matched, and then the node 3 can be matched after the reading of the three. Since the node 3 has the word attribute, the "three rivers" and the corresponding word attribute (i.e., place name) thereof are acquired and recorded. And continuously reading the port, matching the port with a transfer condition from the node 3 to the node 4, and acquiring and recording the three river mouths and the corresponding word attributes (namely the place names) of the three river mouths because the node 4 has the word attributes.
The shortest word in the words recorded when the current dictionary pointer is at the position is 'three rivers', so that the dictionary pointer points to the next character of 'three rivers' in the user query, namely 'mouth', after the process is repeatedly carried out and the dictionary Trie tree is matched, the result of the full segmentation of various segmented words obtained after the user query is segmented is as follows: three rivers (place names), mouth (noun), go (verb), three rivers (place names), go (assistant word), train (noun); three rivers mouth (place name), go (verb), three rivers (place name), go (help word), train (noun) mouth (noun), go (verb), three rivers (place name), go (help word), train (noun).
Matching various full segmentation results with a template Trie tree, and firstly aiming at a first word full segmentation result: pointing a template pointer to the first character 'three' of a query of a user, determining a word 'three rivers' starting from the character pointed by the current template pointer in a word full segmentation result, firstly matching transfer conditions for the 'three rivers' from a root node, namely a node 1, matching the 'three rivers' to the transfer conditions, then entering a node 2, then pointing the template pointer to the next character 'mouth' of the 'three rivers', determining a word taking the 'mouth' as a first character in the word full segmentation result and attributes thereof, starting to match with the transfer conditions starting from the node 2, and failing to match.
And matching the second word full-segmentation result with the template Trie tree, matching the transfer condition of the three-river junction from the root node, namely the node 1, to the rear turning node 2, pointing the template pointer to the next character of the three-river junction to determine the character of the word full-segmentation result, namely the character of the word full-segmentation result, to the transfer condition of the node 2, and turning to the node 4. And (3) pointing the template pointer to the next character 'three' from 'to', determining the word 'three river' with the character as the head, matching the transfer conditions from the node 4, entering the node 6 after the match, successfully matching the template, and determining the requirement type as train query.
Example four,
In the embodiment, a mode that the dictionary Trie tree and the template Trie tree are alternately matched to determine the type of the requirement is adopted. Fig. 6 is a flowchart of another method for determining a requirement type according to a fourth embodiment of the present invention, as shown in fig. 6, the method may include the following steps:
step 601: and after receiving the user query, taking a root node of the template Trie tree as a currently matched node, and pointing a dictionary pointer to the first character of the user query.
Step 602: and taking the root node of the dictionary Trie tree as the current matching position.
Step 603: reading the character pointed by the current dictionary pointer, judging whether the currently read character is matched with a transfer condition starting from the current matching position, if not, executing step 607; if so, step 604 is performed.
Step 604: determining the next-level node corresponding to the matched transfer condition, judging whether the currently determined node indicates word attributes, and if so, executing step 605; otherwise, step 606 is performed.
Step 605: and acquiring and recording the word attributes indicated by the currently determined nodes and the words formed by the matched characters, and executing step 606.
Step 606: judging whether the current read character has a next character in the user query, if so, reading the next character, taking the current determined node as the current matching position, and turning to the step 603; otherwise, go to step 608.
Step 607: exiting the matching of the present dictionary Trie, obtaining the contents recorded by the present dictionary Trie, wherein the contents include words and word attributes thereof, respectively reading the contents of the record and respectively executing the following matching process of the template tree aiming at the read contents, namely, starting to execute step 608.
Step 608: matching the template Trie tree, judging whether the currently read words and the word attributes thereof are matched with the transfer conditions starting from the currently matched nodes in the template Trie tree, if so, executing step 609; if not, finishing the template Trie tree matching of the currently read words.
In this step, when determining whether the latest obtained word or word attribute matches a transfer condition from the currently matched node in the template Trie, the following situations may exist:
and if the transfer condition from the currently matched node is the word attribute, determining that the currently acquired word attribute is matched with the word attribute in the transfer condition if the currently acquired word attribute is consistent with the word attribute in the transfer condition.
And if the transfer condition from the currently matched node is a specific word, determining that the currently acquired word is matched with the specific word in the transfer condition if the currently acquired word is consistent with the specific word in the transfer condition.
If the transfer condition from the currently matched node is wildcard, the matching between the two nodes is directly confirmed, in this case, the length indicated by the wildcard may be intercepted from the currently read word in the query, and after the intercepted content is taken as the currently read word, step 609 is executed.
Similarly, if the query of the user is "train from three rivers to three rivers", if the currently read word "three rivers" indicates wildcard characters with 4 words in length, the user directly confirms that the two words are matched, but the word "three rivers to" is taken as the currently read word, and if the next-level node in the template Trie tree does not indicate that the template matching is successful, the user starts to be matched with the dictionary Trie tree from the next-level node after the word "three rivers to" next.
If the transfer condition from the currently matched node is a function, calling the function to identify in the query from the read word, if the identification result meets the preset function requirement, determining that the two are matched, taking the word corresponding to the identification result meeting the preset function requirement as the currently read word, and then executing step 609.
Step 609: determining the next-level node corresponding to the matched transfer condition, judging whether the currently determined node indicates that the template matching is successful, and if so, executing step 610; otherwise, the currently determined node is taken as the current matching position, the dictionary pointer points to the next character of the currently read word in the user query, and the process goes to step 602.
Step 610: and determining the search requirement corresponding to the matched template, and finishing the template Trie tree matching aiming at the currently read words.
Still taking the received user query as a train from the mouth of three rivers to three rivers as an example, the user query firstly enters the root node of the template Trie tree. The root node entering the dictionary Trie is first matched by using the dictionary Trie shown in fig. 2, and characters which are not matched in the user query are sequentially read from the root node 1, namely from three, the transfer condition from the root node 1 can be matched, and then the transfer condition from the node 2 can be matched, and finally the transfer condition from the node 3 can be matched. Since the node 3 has the word attribute, the "three rivers" and the corresponding word attribute (i.e., place name) thereof are acquired and recorded. And continuously reading the port, matching the port with a transfer condition from the node 3 to the node 4, and acquiring and recording the three river mouths and the corresponding word attributes (namely the place names) of the three river mouths because the node 4 has the word attributes. And when the matching is finished, the dictionary Trie tree can not be matched continuously, the matching process of the dictionary Trie tree is exited, and the template Trie tree is entered.
Because the matching of the dictionary Trie tree obtains two contents: "three rivers (place names)" and "three rivers (place names)", and therefore, there is a matching process of the template Trie tree of two branches for entering the template Trie tree for "three rivers (place names)" and "three rivers (place names)", respectively.
In the matching process of the template Trie tree of the first branch, matching the 'three rivers (place names)' with the transfer conditions starting from the root node of the template Trie tree, entering the node 2, and after the node 2 is taken as the current matching position because the node 2 does not indicate that the template matching is successful, pointing the dictionary pointer to the next character of the currently read word in the user query, and returning to the root node of the dictionary Trie tree. Reading the character pointed by the pointer of the current dictionary, namely 'mouth', judging whether the current read character is matched with the transfer condition starting from the root node of the dictionary Trie tree, and exiting the matching of the dictionary Trie tree after the character is matched out of the 'mouth'.
And in the template Trie tree matching process of the second branch, matching the 'three-river mouth (place name)' with the transfer condition starting from the root node of the template Trie tree, entering the node 2, and after the node 2 is taken as the current matching position because the node 2 does not indicate that the template matching is successful, pointing the dictionary pointer to the next character of the currently read word in the user query and returning to the root node of the dictionary Trie tree. Reading the character pointed by the pointer of the current dictionary, namely 'arrival', judging whether the current read character is matched with the transfer condition starting from the root node of the dictionary Trie tree, and after the 'arrival' is matched, quitting the matching of the dictionary Trie tree, and transferring into the template Trie tree because the content recorded by the dictionary Trie tree is 'arrival', and entering into the node 4 because the current matched node is the node 2 and the 'arrival' is matched with the transfer condition starting from the node 2. And taking the node 4 as a currently matched node, pointing the dictionary pointer to the next character, namely 'three', of the currently read word in the user query, and returning to the root node of the dictionary Trie tree. The dictionary Trie tree can be matched to obtain 'Sanjiang (place name)', the transformation is carried out on the template Trie tree, the transformation conditions starting from the node 4 can be matched, and the node 6 is entered. And determining the requirement type of the query of the user as a train query because the node 6 indicates that the template matching is successful.
The above is a description of the method provided by the present invention, and the following is a detailed description of the apparatus for identifying search requirements provided by the present invention with reference to the fifth embodiment.
Example V,
Fig. 7 is a diagram of a device structure according to the fifth embodiment of the present invention, in which a dictionary and a demand recognition template are stored in a database in a Trie form in advance, and a dictionary Trie tree and a template Trie tree are obtained respectively; as shown in fig. 7, the apparatus may include: a request receiving unit 710 and a requirement matching unit 720.
The request receiving unit 710 receives a user query.
The requirement matching unit 720 matches the query of the user by combining the dictionary Trie and the template Trie, and determines the requirement type corresponding to the matched template.
The root node in the dictionary Trie tree indicates an initial state, the leaf nodes and part of intermediate nodes indicate matched word attributes, and transfer conditions between the nodes are characters.
The root node in the template Trie indicates the initial state, the leaf node indicates the success of template matching, and the transfer conditions between the nodes may include but are not limited to: specific words, word attributes, wildcards, or functions.
In order to implement the establishment of the dictionary Trie, the apparatus may further include: a dictionary tree building unit 730, configured to perform the following operations:
operation a1, establishes a root node of a dictionary Trie in the database, the root node indicating an initial state.
Operation a2, obtaining a word from the dictionary that has not been added to the dictionary Trie, reading the first character in the currently obtained word, and using the root node of the dictionary Trie as the current adding position.
Operation A3, determining whether the currently read character already exists in the transition condition from the current adding position, if yes, performing operation a 4; otherwise, operation a6 is performed.
In operation a4, in the dictionary Trie, the next-level node corresponding to the branch condition where the currently read character exists is set as the current addition position.
Operation A5, judging whether the next character exists in the currently read word, if so, reading the next character of the currently acquired word, and turning to operation A3; otherwise, operation a9 is performed.
Operation a6, add the currently read character as a branch condition starting from the current add position.
Operation A7, judging whether the next character exists in the currently acquired words, if so, executing operation A8; otherwise, adding the attribute of the currently acquired word to the next level node corresponding to the transition condition added by the operation a6, and executing an operation a 9.
Operation A8, taking the next-level node corresponding to the transition condition added in operation a6 as the current adding position, reading the next character in the currently acquired word, and going to operation A3.
Operation A9, ending the adding process of the currently obtained words, if the words which are not added into the Trie tree of the dictionary exist in the dictionary, turning to operation A2; otherwise, obtaining a dictionary Trie tree.
In order to implement the building of the template tree, the apparatus may further include: a template tree building unit 740 configured to perform the following operations:
operation B1, a root node of the template Trie is established in the database, the root node indicating an initial state.
Operation B2, obtaining a template that is not yet added to the template Trie, reading the content of the first template slot in the currently obtained template, and taking the root node of the template Trie as the current adding position.
Operation B3, determining whether the content of the template slot currently read exists in the transition condition starting at the current adding position, if yes, executing operation B4; otherwise, operation B7 is performed.
And operation B4, in the template Trie tree, taking the next-level node corresponding to the transfer condition where the content of the currently read template slot is located as the current adding position.
Operation B5, judging whether the next template slot exists in the currently read template slot, if so, reading the content of the next template slot, and turning to operation B3; otherwise, operation B6 is performed.
Operation B6, adding an indication that the template matching was successful in the current add position, performs operation B8.
Operation B7 is to add the contents of the currently read template slot as a transition condition from the current addition position, and go to operation B5 with the next-level node corresponding to the transition condition as the current addition position.
Operation B8, ending the adding process of the currently obtained template, if there is a template that has not been added to the template Trie tree, going to operation B2; otherwise, obtaining the template Trie tree.
In the embodiment of the invention, after the matched template is determined by searching the template Trie tree, the requirement type of the query of the user can be identified through the pre-established corresponding relation between the template and the requirement type. Preferably, the template tree establishing unit may also add, when performing operation B6, an outlet of the requirement type information corresponding to the currently acquired template in the current adding position, or add the requirement type information corresponding to the currently acquired template, so that the corresponding requirement type can be directly determined by searching the template Trie tree.
Therein, the requirement matching unit 720 may have two structures:
in the first structure, the requirement matching unit 720 may first determine the matched template through the matching template Trie after completing the word segmentation of the user query through the matching dictionary Trie. At this time, the requirement matching unit 720 may specifically include: a first lexicon tree matching module 721 and a first template tree matching module 722.
The first dictionary tree matching module 721 matches the dictionary Trie from the first character of the user query, records each item of content matched by each round of dictionary Trie to obtain all kinds of word full segmentation results of the user query, the word full segmentation results include words and word attributes, and the words in each kind of word full segmentation results form the user query.
The first template tree matching module 722 performs matching on the template Trie trees for each word full segmentation result one by one, and determines a requirement type corresponding to the matched template.
The first dictionary tree matching module 721 specifically performs the following operations:
in operation C11, after the user query is received, the dictionary pointer points to the first character of the user query.
Operation C12, the root node of the dictionary Trie is taken as the current matching position.
Operation C13, determining whether the currently read character matches the transition condition from the currently matched position, if yes, performing operation C14; otherwise, operation C17 is performed.
Operation C14, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates the word attribute, if so, executing operation C15; otherwise, operation C16 is performed.
Operation C15, obtaining and recording the word attribute indicated by the currently determined node and the word formed by the matched characters.
Operation C16; judging whether the current read character has a next character in the user query, if so, reading the next character and turning to operation C13; otherwise, the operation is ended.
Operation C17, determine the shortest word among the words recorded at the current position of the dictionary pointer, determine whether the shortest word has the next character in the user query, if so, point the dictionary pointer to the next character of the shortest word in the user query, read the character pointed by the dictionary pointer, and go to operation C12.
In addition, the first template tree matching module 722 specifically performs the following operations:
operation C21, point the template pointer to the first character of the query of the user, and take the root node of the template Trie as the currently matched node.
Operation C22 determines the word in the current word full segmentation result that begins with the character pointed to by the current template pointer.
Operation C23, determining whether the currently read word or the attribute of the word matches the transfer condition from the currently matched node in the template Trie, if so, executing operation C24; otherwise, ending the template matching of the current word full segmentation result.
Operation C24, determining the next-level node corresponding to the matched transfer condition, determining whether the currently determined node indicates that the template matching is successful, if so, executing operation C25; otherwise, operation C26 is performed.
Operation C25, obtaining the search requirement indicated by the currently determined node, and ending the operation.
Operation C26, judging whether the current read word has the next character in the user query, if so, executing operation C27; otherwise, the operation is ended.
Operation C27, point the template pointer to the next character of the currently read word in the user query, proceed to operation C22.
The second structure is as follows: the requirement matching unit 720 may alternatively match the dictionary Trie tree and the template Trie tree, that is, each time a round of matching of the dictionary Trie tree is performed, the words segmented in the round are matched with the next node in the template Trie tree, and after the next node of the template Trie tree is matched, the next round of matching is performed by returning to the dictionary Trie tree. At this time, as shown in fig. 8, the requirement matching unit 720 may specifically include: a dictionary pointer setting module 821, a second dictionary tree matching module 822, and a second template tree matching module 823.
The dictionary pointer setting module 821 points the dictionary pointer to the first character of the user query.
The second lexicon tree matching module 822 matches the lexicon Trie starting from the character pointed to by the lexicon pointer.
After the matching of the template Trie of the current round is finished, the second template tree matching module 823 starts matching the contents of the second dictionary tree matching module 822 of the current round at the position where the contents of the dictionary Trie matched from the template Trie of the previous round are matched from the position where the matching of the template Trie of the previous round is finished, wherein the contents comprise words and the attributes of the words, and after the matching of the template Trie of the current round is finished, the second template tree matching module 822 is triggered to start the matching of the next dictionary Trie of the next round until the matching of the template or the template Trie fails; and determining the requirement type corresponding to the matched template.
The second dictionary tree matching module 822 may specifically perform the following operations:
operation D21, regarding the root node of the dictionary Trie as the current matching position.
Operation D22, reading the character pointed by the pointer of the current dictionary, judging whether the current read character is matched with the transfer condition from the current matching position, if not, finishing the matching of the Trie tree of the dictionary of the current round, and recording each item of content matched by the Trie tree of the dictionary of the current round; if so, operation D23 is performed.
Operation D23, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates the word attribute, if so, executing operation D24; otherwise, operation D25 is performed.
Operation D24, obtaining and recording the word attributes indicated by the currently determined node and the word formed by the matched characters, and performing operation D25.
Operation D25, judging whether the current read character has the next character in the user query, if so, reading the next character, taking the current determined node as the current matching position, and turning to operation D22; otherwise, the matching of the dictionary Trie tree of the current round is finished.
In addition, the second template tree matching module 823 respectively reads the contents matched by the second dictionary tree matching module 822 in the round of the dictionary tree, and respectively performs the following matching operations on the read contents:
operation D31, determining whether the currently read word or the attribute of the word matches a transfer condition from the currently matched node in the template Trie, where the initial position of the currently matched node is a root node of the template Trie; if so, perform operation D32; otherwise, ending the template Trie tree matching aiming at the currently read content.
Operation D32, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates that the template matching is successful, if so, executing operation D33; otherwise, the currently determined node is taken as the current matching position, and the dictionary pointer points to the next character of the word in the user query in the currently read content, and the operation goes to operation D2.
And D33, determining the search requirement corresponding to the matched template, and ending the template Trie tree matching aiming at the currently read content.
When determining whether the currently read word or the attribute of the word matches the transfer condition from the currently matched node in the template Trie tree, the first template tree matching module 722 in the first structure and the second template tree matching module 823 in the second structure include at least one of the following cases:
if the transition condition from the currently matched node is a word attribute, determining that the currently read word attribute is matched with the word attribute in the transition condition if the attribute of the currently read word is consistent with the word attribute in the transition condition.
If the transition condition from the currently matched node is a specific word, determining that the currently read word is matched with the specific word in the transition condition if the currently read word is consistent with the specific word in the transition condition.
And if the transfer condition from the currently matched node is a wildcard character, confirming that the two are matched, intercepting the length indicated by the wildcard character from the currently read word in the query, and taking the intercepted content as the currently read word.
And if the transfer condition from the currently matched node is a function, calling the function to identify in the user query from the read words, if the identification result meets the preset function requirement, confirming that the two words are matched, and taking the words corresponding to the identification result meeting the preset function requirement as the currently read words.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (24)

1. A method for identifying search requirements is characterized in that a dictionary and a requirement identification template are respectively stored in a database in a Trie tree form, and a dictionary Trie tree and a template Trie tree are respectively obtained; the method comprises the following steps:
after a user search request query is received, matching the user query by combining the dictionary Trie tree and the template Trie tree, and determining a requirement type corresponding to the matched template.
2. The method of claim 1, wherein a root node in the dictionary Trie indicates an initial state, leaf nodes and partial intermediate nodes indicate matched word attributes, and transition conditions between nodes are characters;
the root node in the template Trie tree indicates an initial state, the leaf node indicates that the template matching is successful, and the transfer conditions between the nodes comprise: specific words, word attributes, wildcards, or functions.
3. The method according to claim 1 or 2, wherein storing the dictionary in the database in the form of a Trie tree to obtain a dictionary Trie specifically comprises:
a1, establishing a root node of a dictionary Trie tree in a database, wherein the root node indicates an initial state;
a2, acquiring a word which is not added into a dictionary Trie tree from the dictionary, reading a first character in the currently acquired word, and taking a root node of the dictionary Trie tree as a current adding position;
a3, judging whether the currently read character exists in the transition condition from the current adding position, if yes, executing step A4; otherwise, go to step A6;
a4, in a dictionary Trie tree, taking the next-level node corresponding to the transfer condition of the currently read character as the current adding position;
a5, judging whether the next character exists in the currently read word, if so, reading the next character of the currently acquired word, and turning to the step A3; otherwise, go to step A9;
a6, adding the currently read character as a transition condition from the current adding position;
a7, judging whether the next character exists in the currently acquired words, if so, executing the step A8; otherwise, adding the attribute of the currently acquired word into the next-level node corresponding to the added transfer condition in the step A6, and executing the step A9;
a8, taking the next-level node corresponding to the transfer condition added in the step A6 as the current adding position, reading the next character in the currently acquired word, and turning to the step A3;
a9, ending the adding process of the currently obtained words, if the words which are not added into the Trie tree of the dictionary exist in the dictionary, turning to the step A2; otherwise, obtaining a dictionary Trie tree.
4. The method according to claim 1 or 2, wherein storing the template in the form of a Trie in the database to obtain the template Trie specifically comprises:
b1, establishing a root node of the template Trie tree in the database, wherein the root node indicates an initial state;
b2, acquiring a template which is not added into the template Trie tree, reading the content of a first template slot in the currently acquired template, and taking the root node of the template Trie tree as the current adding position;
b3, judging whether the content of the template slot read currently exists in the transfer condition starting from the current adding position, if so, executing the step B4; otherwise, executing step B7;
b4, taking the next-level node corresponding to the transfer condition where the currently read content of the template slot is located as the current adding position in the template Trie tree;
b5, judging whether the next template slot exists in the currently read template slot, if so, reading the content of the next template slot, and turning to the step B3; otherwise, go to step B6;
b6, adding an indication that the template matching is successful in the current adding position, and executing the step B8;
b7, adding the currently read contents of the template slot into a transfer condition starting from the current adding position, taking the next-level node corresponding to the transfer condition as the current adding position, and turning to the step B5;
b8, ending the adding process of the currently obtained template, and if the template which is not added to the template Trie tree exists, turning to the step B2; otherwise, obtaining the template Trie tree.
5. The method according to claim 4, further comprising, in step B6: and adding an outlet of the requirement type information corresponding to the currently acquired template in the current adding position, or adding the requirement type information corresponding to the currently acquired template.
6. The method of claim 1, wherein the matching of the user query is performed in combination with the dictionary Trie and the template Trie, and the determining of the requirement type corresponding to the matched template specifically comprises:
c1, starting to match the first character of the user query with the dictionary Trie tree, recording each item of content matched by each round of dictionary Trie tree to obtain all kinds of word full segmentation results of the user query, wherein the word full segmentation results comprise words and word attributes, and the words in all kinds of word full segmentation results form the user query;
and C2, respectively matching the full segmentation results of each word on the template Trie tree one by one, and determining the requirement type corresponding to the matched template.
7. The method according to claim 6, wherein the step C1 specifically comprises:
c11, after receiving the user query, the dictionary pointer points to the first character of the user query;
c12, taking the root node of the Trie tree of the dictionary as the current matching position;
c13, judging whether the current read character is matched with the transition condition from the current matching position, if yes, executing step C14; otherwise, go to step C17;
c14, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates the word attribute, if so, executing the step C15; otherwise, go to step C16;
c15, acquiring and recording the word attributes indicated by the currently determined nodes and words formed by the matched characters;
c16; judging whether the currently read character has a next character in the user query, if so, reading the next character and transferring to the step C13; otherwise, end step C1;
c17, determining the shortest word in the recorded words when the position of the current dictionary pointer is determined, judging whether the shortest word has the next character in the user query, if so, pointing the dictionary pointer to the next character of the shortest word in the user query, reading the character pointed by the dictionary pointer, and turning to the step C12.
8. The method according to claim 6, wherein the following steps are respectively performed in the step C2 for each word full segmentation result:
c21, pointing the template pointer to the first character of the user query, and taking the root node of the template Trie tree as the currently matched node;
c22, determining the word beginning with the character pointed by the current template pointer in the current word full segmentation result;
c23, judging whether the currently read words or the attributes of the words are matched with the transfer conditions starting from the currently matched nodes in the template Trie tree, if so, executing the step C24; otherwise, ending the template matching of the current word full segmentation result;
c24, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates that the template matching is successful, if so, executing the step C25; otherwise, go to step C26;
c25, acquiring the search requirement indicated by the currently determined node, and ending the step C2;
c26, judging whether the current read word has the next character in the user query, if so, executing the step C27; otherwise, end step C2;
c27, pointing the template pointer to the next character of the currently read word in the user query, and turning to the step C22.
9. The method of claim 1, wherein the matching of the user query is performed in combination with the dictionary Trie and the template Trie, and the determining of the requirement type corresponding to the matched template specifically comprises:
d1, pointing the dictionary pointer to the first character of the user query;
d2, matching the characters pointed by the dictionary pointer with the dictionary Trie tree;
d3, after one round of matching of the Trie trees of the dictionary is finished, matching each item of content matched by the Trie trees of the dictionary from the matched position when the matching of the Trie trees of the previous round of the template is finished, wherein each item of content comprises words and the attributes of the words, after the matching of the Trie trees of the template is finished, pointing a dictionary pointer to the next character of the words used by the Trie trees of the template matching in the user query, and turning to the step D2 to start the matching of the Trie trees of the next round of the dictionary until the matching of the Trie trees of the template or the template is failed; and determining the requirement type corresponding to the matched template.
10. The method according to claim 9, wherein the step D2 specifically comprises:
d21, taking the root node of the Trie tree of the dictionary as the current matching position;
d22, reading the character pointed by the pointer of the current dictionary, judging whether the current read character is matched with the transfer condition from the current matching position, if not, finishing the matching of the Trie tree of the dictionary of the current round, and recording each content matched by the Trie tree of the dictionary of the current round; if so, go to step D23;
d23, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates the word attribute, if so, executing the step D24; otherwise, go to step D25;
d24, acquiring and recording the word attributes indicated by the currently determined nodes and the words formed by the matched characters, and executing the step D25;
d25, judging whether the current read character has the next character in the user query, if so, reading the next character, taking the current determined node as the current matching position, and turning to the step D22; otherwise, go to the step D3.
11. The method according to claim 9, wherein in step D3, the contents matched by the Trie of the current round dictionary are respectively read, and the following matching procedure is respectively performed on the read contents:
d31, judging whether the currently read words or the attributes of the words are matched with transfer conditions starting from the currently matched nodes in the template Trie tree, wherein the initial positions of the currently matched nodes are the root nodes of the template Trie tree; if so, go to step D32; otherwise, ending the template Trie tree matching aiming at the currently read content;
d32, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates that the template matching is successful, if so, executing the step D33; otherwise, taking the currently determined node as the current matching position, pointing the dictionary pointer to the next character of the word in the user query in the currently read content, and turning to the step D2;
d33, determining the search requirement corresponding to the matched template, and ending the template Trie tree matching aiming at the currently read content.
12. The method according to claim 8 or 11, wherein the determining whether the currently read word or the attribute of the word matches the transfer condition from the currently matched node in the template Trie comprises:
if the transfer condition from the currently matched node is the word attribute, determining that the attribute of the currently read word is matched with the word attribute in the transfer condition if the attribute of the currently read word is consistent with the word attribute in the transfer condition; or,
if the transfer condition from the currently matched node is a specific word, determining that the currently read word is matched with the specific word in the transfer condition if the currently read word is consistent with the specific word in the transfer condition; or,
if the transfer condition from the currently matched node is a wildcard character, confirming that the two are matched, intercepting the length indicated by the wildcard character from the currently read word in the query, and taking the intercepted content as the currently read word; or,
and if the transfer condition from the currently matched node is a function, calling the function to identify in the user query from the read words, if the identification result meets the preset function requirement, confirming that the two words are matched, and taking the words corresponding to the identification result meeting the preset function requirement as the currently read words.
13. A device for identifying search requirements is characterized in that a dictionary and a requirement identification template are respectively stored in a database in a Trie tree form, and a dictionary Trie tree and a template Trie tree are respectively obtained; the device includes:
the request receiving unit is used for receiving a user search request query;
and the requirement matching unit is used for matching the user query by combining the dictionary Trie tree and the template Trie tree and determining the requirement type corresponding to the matched template.
14. The apparatus according to claim 13, wherein a root node in the dictionary Trie indicates an initial state, leaf nodes and partial intermediate nodes indicate matched word attributes, and transition conditions between nodes are characters;
the root node in the template Trie tree indicates an initial state, the leaf node indicates that the template matching is successful, and the transfer conditions between the nodes comprise: specific words, word attributes, wildcards, or functions.
15. The apparatus of claim 13 or 14, further comprising: a dictionary tree building unit for performing the following operations:
a1, establishing a root node of a dictionary Trie tree in a database, wherein the root node indicates an initial state;
a2, acquiring a word which is not added into a dictionary Trie tree from the dictionary, reading a first character in the currently acquired word, and taking a root node of the dictionary Trie tree as a current adding position;
a3, judging whether the currently read character exists in the transition condition from the current adding position, if yes, executing operation A4; otherwise, operation a6 is performed;
a4, in a dictionary Trie tree, taking the next-level node corresponding to the transfer condition of the currently read character as the current adding position;
a5, judging whether the next character exists in the currently read word, if so, reading the next character of the currently acquired word, and turning to operation A3; otherwise, operation a9 is performed;
a6, adding the currently read character as a transition condition from the current adding position;
a7, judging whether the next character exists in the currently acquired words, and if so, executing operation A8; otherwise, adding the attribute of the currently acquired word into the next-level node corresponding to the added transfer condition of the operation A6, and executing an operation A9;
a8, taking the next-level node corresponding to the transfer condition added in the operation A6 as the current adding position, reading the next character in the currently acquired word, and turning to the operation A3;
a9, ending the adding process of the currently acquired words, if the words which are not added into the Trie tree of the dictionary exist in the dictionary, turning to operation A2; otherwise, obtaining a dictionary Trie tree.
16. The apparatus of claim 13 or 14, further comprising: a template tree building unit for performing the following operations:
b1, establishing a root node of the template Trie tree in the database, wherein the root node indicates an initial state;
b2, acquiring a template which is not added into the template Trie tree, reading the content of a first template slot in the currently acquired template, and taking the root node of the template Trie tree as the current adding position;
b3, judging whether the content of the template slot read currently exists in the transfer condition starting from the current adding position, if so, executing operation B4; otherwise, operation B7 is performed;
b4, taking the next-level node corresponding to the transfer condition where the currently read content of the template slot is located as the current adding position in the template Trie tree;
b5, judging whether the next template slot exists in the currently read template slot, if so, reading the content of the next template slot, and turning to operation B3; otherwise, operation B6 is performed;
b6, adding an indication that the template matching is successful in the current adding position, and executing operation B8;
b7, adding the currently read contents of the template slot as a transition condition from the current adding position, taking the next-level node corresponding to the transition condition as the current adding position, and going to operation B5;
b8, ending the adding process of the currently acquired template, and if the template which is not added to the template Trie tree exists, turning to operation B2; otherwise, obtaining the template Trie tree.
17. The apparatus according to claim 16, wherein the template tree building unit, when performing the operation B6, is further configured to add an exit of the requirement type information corresponding to the currently obtained template in the current adding position, or add the requirement type information corresponding to the currently obtained template.
18. The apparatus according to claim 13, wherein the requirement matching unit specifically comprises: a first dictionary tree matching module and a first template tree matching module;
the first dictionary tree matching module is used for matching a first character of the user query with the dictionary Trie trees, recording various contents matched by each round of dictionary Trie trees to obtain various word full-segmentation results of the user query, wherein the word full-segmentation results comprise words and word attributes, and the words in each word full-segmentation result form the user query;
and the first template tree matching module is used for respectively matching the full segmentation results of each word on the template Trie tree one by one and determining the requirement type corresponding to the matched template.
19. The apparatus of claim 18, wherein the first dictionary tree matching module is to perform the following:
c11, after receiving the user query, the dictionary pointer points to the first character of the user query;
c12, taking the root node of the Trie tree of the dictionary as the current matching position;
c13, judging whether the currently read character is matched with the transition condition from the current matching position, if yes, executing operation C14; otherwise, operation C17 is performed;
c14, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates the word attribute, if so, executing operation C15; otherwise, operation C16 is performed;
c15, acquiring and recording the word attributes indicated by the currently determined nodes and words formed by the matched characters;
c16; judging whether the currently read character has a next character in the user query, if so, reading the next character and turning to the operation C13; otherwise, ending the operation;
c17, determining the shortest word in the recorded words when the position of the current dictionary pointer is determined, judging whether the shortest word has the next character in the user query, if so, pointing the dictionary pointer to the next character of the shortest word in the user query, reading the character pointed by the dictionary pointer, and turning to operation C12.
20. The apparatus of claim 18, wherein the first template tree matching module specifically performs the following operations:
c21, pointing the template pointer to the first character of the user query, and taking the root node of the template Trie tree as the currently matched node;
c22, determining the word beginning with the character pointed by the current template pointer in the current word full segmentation result;
c23, judging whether the currently read word or the attribute of the word is matched with the transfer condition starting from the currently matched node in the template Trie tree, if so, executing operation C24; otherwise, ending the template matching of the current word full segmentation result;
c24, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates that the template matching is successful, if so, executing operation C25; otherwise, operation C26 is performed;
c25, acquiring the search requirement indicated by the currently determined node, and ending the operation;
c26, judging whether the currently read word has the next character in the user query, if so, executing operation C27; otherwise, ending the operation;
c27, point the template pointer to the next character of the currently read word in the user query, and go to operation C22.
21. The apparatus according to claim 13, wherein the requirement matching unit specifically comprises: the dictionary pointer setting module, the second dictionary tree matching module and the second template tree matching module;
the dictionary pointer setting module is used for pointing the dictionary pointer to the first character of the query of the user;
the second dictionary tree matching module is used for matching the characters pointed by the dictionary pointer with the dictionary Trie tree;
the second template tree matching module is used for matching contents matched by the second dictionary tree matching module in the current round of the template tree from the position matched by the Trie tree of the previous round of the template tree after the Trie tree of the first round of the template tree is matched, wherein the contents comprise words and the attributes of the words; and determining the requirement type corresponding to the matched template.
22. The apparatus of claim 21, wherein the second dictionary tree matching module is to perform the following:
d21, taking the root node of the Trie tree of the dictionary as the current matching position;
d22, reading the character pointed by the pointer of the current dictionary, judging whether the current read character is matched with the transfer condition from the current matching position, if not, finishing the matching of the Trie tree of the dictionary of the current round, and recording each content matched by the Trie tree of the dictionary of the current round; if so, perform operation D23;
d23, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates the word attribute, if so, executing operation D24; otherwise, operation D25 is performed;
d24, acquiring and recording the word attributes indicated by the currently determined nodes and the words formed by the matched characters, and executing operation D25;
d25, judging whether the current read character has the next character in the user query, if so, reading the next character, taking the current determined node as the current matching position, and turning to the operation D22; otherwise, the matching of the dictionary Trie tree of the current round is finished.
23. The apparatus of claim 21, wherein the second template tree matching module respectively reads items of contents matched by the second dictionary tree matching module local dictionary tree, and respectively performs the following matching operations on the read items of contents:
d31, judging whether the currently read words or the attributes of the words are matched with transfer conditions starting from the currently matched nodes in the template Trie tree, wherein the initial positions of the currently matched nodes are the root nodes of the template Trie tree; if so, perform operation D32; otherwise, ending the template Trie tree matching aiming at the currently read content;
d32, determining the next level node corresponding to the matched transfer condition, judging whether the currently determined node indicates that the template matching is successful, if so, executing operation D33; otherwise, taking the currently determined node as the current matching position, pointing the dictionary pointer to the next character of the word in the user query in the currently read content, and turning to the operation D2;
d33, determining the search requirement corresponding to the matched template, and ending the template Trie tree matching aiming at the currently read content.
24. The apparatus according to claim 20 or 23, wherein the determining whether the currently read word or the attribute of the word matches the transfer condition starting from the currently matched node in the template Trie comprises:
if the transfer condition from the currently matched node is the word attribute, determining that the attribute of the currently read word is matched with the word attribute in the transfer condition if the attribute of the currently read word is consistent with the word attribute in the transfer condition; or,
if the transfer condition from the currently matched node is a specific word, determining that the currently read word is matched with the specific word in the transfer condition if the currently read word is consistent with the specific word in the transfer condition; or,
if the transfer condition from the currently matched node is a wildcard character, confirming that the two are matched, intercepting the length indicated by the wildcard character from the currently read word in the query, and taking the intercepted content as the currently read word; or,
and if the transfer condition from the currently matched node is a function, calling the function to identify in the user query from the read words, if the identification result meets the preset function requirement, confirming that the two words are matched, and taking the words corresponding to the identification result meeting the preset function requirement as the currently read words.
CN201110279434.6A 2011-09-20 A kind of method and apparatus identifying search need Active CN103020052B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110279434.6A CN103020052B (en) 2011-09-20 A kind of method and apparatus identifying search need

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110279434.6A CN103020052B (en) 2011-09-20 A kind of method and apparatus identifying search need

Publications (2)

Publication Number Publication Date
CN103020052A CN103020052A (en) 2013-04-03
CN103020052B true CN103020052B (en) 2016-11-30

Family

ID=

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1153356A (en) * 1995-11-10 1997-07-02 富士通株式会社 Apparatus and method for retrieving dictionary based on lattice as key
CN1294454A (en) * 1999-10-21 2001-05-09 索尼国际(欧洲)股份有限公司 SOVA Turbo decoder having normalization complexity lowered
CN101013420A (en) * 2006-12-31 2007-08-08 中国科学院计算技术研究所 Method for identifying coding form of Chinese text

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1153356A (en) * 1995-11-10 1997-07-02 富士通株式会社 Apparatus and method for retrieving dictionary based on lattice as key
CN1294454A (en) * 1999-10-21 2001-05-09 索尼国际(欧洲)股份有限公司 SOVA Turbo decoder having normalization complexity lowered
CN101013420A (en) * 2006-12-31 2007-08-08 中国科学院计算技术研究所 Method for identifying coding form of Chinese text

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"大规模中文文本检索中的高性能索引研究";米嘉;《中国优秀博硕士学位论文全文数据库 (硕士) 信息科技辑》;20070215(第2期);第五章34-35页 *

Similar Documents

Publication Publication Date Title
TWI638274B (en) Semantic matching method and intelligent device
JP5002751B2 (en) Two-step data validation and mapping for database access
CN108170859B (en) Voice query method, device, storage medium and terminal equipment
JP2957375B2 (en) Data processing system and method for correcting character recognition errors in digital images of document format
JP3152871B2 (en) Dictionary search apparatus and method for performing a search using a lattice as a key
CN116483973B (en) Text processing method and device and related equipment
CN108052547A (en) Natural language question-answering method and system based on question sentence and knowledge graph structural analysis
WO2021143299A1 (en) Semantic error correction method, electronic device and storage medium
CN100449542C (en) Method and apparatus for matching associated person information
JPH08194719A (en) Retrieval device and dictionary and text retrieval method
CN111428494A (en) Intelligent error correction method, device and equipment for proper nouns and storage medium
WO2014040536A1 (en) Method, system, and storage medium for information search
WO2015043318A1 (en) Automatic reply method and device
CN112800769A (en) Named entity recognition method and device, computer equipment and storage medium
JP5897718B2 (en) Voice search device, computer-readable storage medium, and voice search method
CN113836950A (en) Commodity title text translation method and device, equipment and medium thereof
CN113961768A (en) Sensitive word detection method and device, computer equipment and storage medium
CN103020052B (en) A kind of method and apparatus identifying search need
JP5844375B2 (en) Object search system and object search method
CN103020052A (en) Method and device for recognizing search demand
JP2001188678A (en) Language case inferring device, language case inferring method, and storage medium on which language case inference program is described
JP3589007B2 (en) Document filing system and document filing method
CN107368525B (en) Method and device for searching related words, storage medium and terminal equipment
CN110795425B (en) Customs data cleaning and merging method, device, equipment and medium
JPH05257982A (en) Character string recognizing method

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant