Information query method and device
By using the target dictionary tree and neural network model in information query, the problems of low efficiency and low accuracy in the prior art are solved, and more efficient and accurate information query is achieved, especially when processing abbreviated query.
Patent Information
- Application Number
- CN202210313454.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-03-28
AI Technical Summary
In the prior art, information query efficiency is low and the accuracy rate is low, especially when processing abbreviation query, it is difficult to accurately determine whether the query results meet user needs.
By constructing a target dictionary tree, quickly query the abbreviation information in the text to be queried, and combined with the preset neural network model, the probability value of the abbreviation corresponding to the full reference name in the text segment is determined, thereby generating processing results and improving query accuracy.
It improves the efficiency and accuracy of information query, reduces the comparison of unnecessary strings, enhances support for abbreviated query, and ensures that the query results are more in line with user needs.
Smart Images

Figure CN114691829B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to an information query method and device. Background Art
[0002] With the advent of the big data era, people are facing and need to process more and more information. It has become an urgent need for people to efficiently and accurately obtain the required information from the massive information. In some cases, the same information may appear in the text in the form of full name or abbreviation. Therefore, when searching for information, the abbreviation query should also be considered.
[0003] In the prior art, when searching for abbreviations in a text, methods such as rule extraction, correlation calculation or sequence labeling can generally be used. Among them, the rule extraction method is to query the corresponding abbreviation by setting different rules, but this method is difficult to enumerate all abbreviations, and the query effect is poor. In addition, the rule extraction method only queries all abbreviations that meet the rules, and cannot determine whether the queried abbreviations are the abbreviations required by the user, so the query accuracy is relatively low. For the correlation calculation method and the sequence labeling method, there are problems such as large calculation amount, long query time and low query efficiency during the query process.
[0004] In summary, the information query method in the prior art has the problems of low information query efficiency and low accuracy. Summary of the invention
[0005] The embodiments of the present invention provide an information query method and device to solve the problems of low information query efficiency and low accuracy in the prior art.
[0006] In a first aspect, an embodiment of the present invention discloses an information query method, the method comprising:
[0007] Receiving a query request sent by a terminal device;
[0008] According to at least one target dictionary tree, a reference abbreviation corresponding to the query request and a reference full name corresponding to the reference abbreviation in the query text are determined; wherein each of the target dictionary trees includes: at least one abbreviation corresponding to a full name, and an association relationship is established between each of the target dictionary trees and the full name corresponding to the included abbreviation; wherein the target dictionary tree is determined according to the query request;
[0009] Acquire a first text segment including the reference abbreviation in the text to be queried;
[0010] Inputting the first text segment and the reference full name into a preset neural network model to obtain an output result of the preset neural network model; wherein the output result at least includes: a probability value that the reference abbreviation in the first text segment is the abbreviation of the corresponding reference full name, and position information of the reference abbreviation in the first text segment;
[0011] According to the output result, a processing result corresponding to the query request is generated, and the processing result is sent to the terminal device.
[0012] In a second aspect, an embodiment of the present invention discloses an information query device, the information query device comprising:
[0013] A receiving module, used for receiving a query request sent by a terminal device;
[0014] A first determination module is used to determine, according to at least one target dictionary tree, a reference abbreviation corresponding to the query request in the query text and a reference full name corresponding to the reference abbreviation; wherein each of the target dictionary trees includes: at least one abbreviation corresponding to a full name, and an association relationship is established between each of the target dictionary trees and the full name corresponding to the included abbreviation; wherein the target dictionary tree is determined according to the query request;
[0015] A first acquisition module, used for acquiring a first text segment including the reference abbreviation in the text to be queried;
[0016] A second acquisition module is used to input the first text segment and the reference full name into a preset neural network model to obtain an output result of the preset neural network model; wherein the output result at least includes: a probability value that the reference abbreviation in the first text segment is the abbreviation of the corresponding reference full name, and position information of the reference abbreviation in the first text segment;
[0017] The first generating module is used to generate a processing result corresponding to the query request according to the output result, and send the processing result to the terminal device.
[0018] In a third aspect, an embodiment of the present invention discloses an electronic device, including a memory and a processor, wherein the memory stores programs or instructions that can be executed on the processor, and when the programs or instructions are executed by the processor, the information query method as described above is implemented.
[0019] In a fourth aspect, an embodiment of the present invention discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for implementing the information query method as described above.
[0020] In an embodiment of the present invention, the server can preliminarily search for the abbreviation information and full name information corresponding to the query request in the text to be queried based on at least one target dictionary tree. Each target dictionary tree is composed of at least one abbreviation information of a full name. Since the target dictionary tree can use common prefixes to reduce query time and minimize unnecessary character string comparisons, information query can be performed quickly to improve query efficiency. After completing the preliminary query, the server can also determine the probability value of the abbreviation corresponding to the reference full name in the text segment through a preset neural network model. The abbreviations in the text segment can be further screened based on the probability value, and the accuracy of the information query can also be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flowchart of steps of an information query method embodiment of the present invention;
[0022] Figure 2 A schematic diagram of the structure of a dictionary tree of the present invention;
[0023] Figure 3 It is a structural block diagram of an information query device embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] Reference Figure 1 , shows a flow chart of the steps of an information query method provided by an embodiment of the present invention, the information query method can be applied to a server, and specifically may include the following steps:
[0026] Step 101: Receive a query request sent by a terminal device.
[0027] In the embodiment of the present invention, the server may receive a query request sent by a terminal device, and determine the information that the user wants to query based on the query request.
[0028] Step 102: Determine, based on at least one target dictionary tree, a reference abbreviation corresponding to the query request in the text to be queried and a reference full name corresponding to the reference abbreviation.
[0029] In the embodiment of the present invention, after the server determines the information to be queried by the user according to the query request, it can query the corresponding information in the to-be-queried text according to the target dictionary tree, that is, the reference abbreviation corresponding to the query request and the reference full name corresponding to the reference abbreviation. Among them, the reference abbreviation corresponding to the query request is the abbreviation included in the target dictionary tree, and the reference full name corresponding to the reference abbreviation is the full name that has an associated relationship with the target dictionary tree.
[0030] Therein, at least one preset dictionary tree is stored in the server, and the target dictionary tree is determined in the at least one preset dictionary tree according to the query request.
[0031] Each preset dictionary tree includes at least one abbreviation corresponding to a full name, and each preset dictionary tree has an association relationship with the full name corresponding to the abbreviation. The abbreviation mentioned here can be a Chinese abbreviation or an English abbreviation. For example, the full name is: Application, and its abbreviation can be: Application, or: App.
[0032] Each preset dictionary tree includes a root node and child nodes, each child node can contain at least one character, and in the case of the abbreviation being a Chinese abbreviation, each child node can contain at least one Chinese character. All characters contained in the node path formed from the root node to any child node with an end attribute constitute an abbreviation. In the case of the abbreviation being a Chinese abbreviation, the child node with an end attribute contains the last character of an abbreviation; in the case of the abbreviation being a Chinese abbreviation, the child node with an end attribute contains the last Chinese character of an abbreviation.
[0033] In an embodiment of the present invention, a failure pointer (i.e., fail pointer) is pre-constructed for each preset dictionary tree. Therefore, the server can perform a word-by-word traversal query on the query text based on at least one target dictionary tree and the pre-constructed failure pointer, and determine whether the query text includes the abbreviation in the target dictionary tree, thereby querying the information the user wants to query in the query text through the target dictionary tree.
[0034] After determining that the text to be queried includes the abbreviation in the target dictionary tree, the full name corresponding to the target dictionary tree can be determined as the reference full name corresponding to the abbreviation in the text to be queried based on the association relationship between the target dictionary tree and the full name. For example, the text to be queried includes the following paragraph: Apply technology x to various image processing applications. By traversing the query word by word, it is determined that this paragraph of the text to be queried includes an abbreviation "application" in the target dictionary tree, and an association relationship is established between the target dictionary tree and the full name "application", then the full name "application" is determined as the reference full name of the abbreviation "application" in the text to be queried.
[0035] Step 103: Obtain the first text segment including the reference abbreviation in the text to be queried.
[0036] In the embodiment of the present invention, after determining the reference abbreviation included in the query text, the text segment including the reference abbreviation can be extracted. For example, in the example described in step 102, the text segment "applying technology x to various image processing applications" including the abbreviation "application" in the query text is extracted.
[0037] When extracting text segments, the extraction can be performed based on punctuation marks, such as extracting the text segment between two adjacent punctuation marks used for sentence segmentation. For example, extract the text segment between two adjacent periods, or extract the text segment between two adjacent commas, etc. Of course, this is only an example, and the specific situation can be set according to actual needs.
[0038] Step 104: Input the first text segment and the reference full name corresponding to the reference abbreviation included in the first text segment into a preset neural network model to obtain an output result of the preset neural network model.
[0039] The output result at least includes: a probability value that the reference abbreviation in the first text segment is the abbreviation of the corresponding reference full name, and position information of the reference abbreviation in the first text segment.
[0040] In an embodiment of the present invention, after obtaining the first text segment including the reference abbreviation in the text to be queried, the server can combine the first text segment and the reference full name corresponding to the reference abbreviation included in the first text segment into the format required by the preset neural network model, input it into the preset neural network model for further reasoning and judgment, and output the result.
[0041] In the embodiment of the present invention, the reference full name corresponding to the reference abbreviation is the possible full name of the reference abbreviation. Continuing to use the example in step 102 as an example for explanation, for the abbreviation "application" included in the text segment "applying technology x to various image processing applications", its reference full name is determined to be "application program". Based on semantic judgment, for the second "application" in the text segment, it should be the abbreviation of "application program", but for the first "application" in the text segment, it is obviously not the abbreviation of "application program". Therefore, in the implementation of the present invention, the probability value of the reference abbreviation in the first text segment being the abbreviation of the corresponding reference full name can also be determined by presetting a neural network model, so as to further screen the information, which can also improve the accuracy of information query.
[0042] It should be noted that the preset neural network model is pre-trained.
[0043] Step 105: Generate a processing result corresponding to the query request according to the output result, and send the processing result to the terminal device.
[0044] In an embodiment of the present invention, a processing result matching the query request can be generated according to the output result of a preset neural network model, and the generated processing result can be sent to a terminal device for viewing by a user.
[0045] In an embodiment of the present invention, the server can preliminarily search for the abbreviation information and full name information corresponding to the query request in the text to be queried based on at least one dictionary tree. Among them, each target dictionary tree is composed of at least one abbreviation information of a full name. Since the dictionary tree can use common prefixes to reduce the query time and minimize the comparison of unnecessary character strings, it is possible to quickly perform information query and improve query efficiency. After completing the preliminary query, the server can also determine the probability value of the abbreviation of the corresponding reference full name in the text segment through a preset neural network model. According to the probability value, the abbreviations in the text segment can be further screened, and the accuracy of the information query can also be improved.
[0046] As an optional embodiment, before step 101: receiving a query request sent by a terminal device, the information query method may further include: constructing a target dictionary tree. Specifically, the following steps may be included:
[0047] Step A1: Generate an abbreviation corresponding to the preset full name according to the preset full name.
[0048] In an embodiment of the present invention, when constructing a target dictionary tree, the server may first segment the preset full name to obtain a segmentation result, wherein the segmentation result includes at least one word. The stop words included in the segmentation result may then be removed according to a stop word list. Among them, the stop words are pre-set manually, and the specific content may be set according to actual needs. Then, according to the order of each word in the preset full name and the preset length in the remaining segmentation results, the words in the remaining segmentation results are arranged and combined to generate at least one abbreviation corresponding to the preset full name. Among them, the preset length is the maximum character length of the abbreviation corresponding to the preset full name, and the specific value may be set according to actual needs.
[0049] The above scheme is illustrated below with reference to a specific embodiment. For example, the preset full name is "Jiangnan Miju Mobile Technology Co., Ltd.". The server can first segment "Jiangnan Miju Mobile Technology Co., Ltd." and obtain the segmentation results of "Jiangnan", "Nan", "Mi", "Ju", "Mobile", "Technology", "Limited" and "Company". Then, the "Mobile", "Technology", "Limited" and "Company" in the segmentation results will be removed according to the stop word list (i.e., the part of the segmentation results containing stop words will be removed). Then, according to the order of "Jiangnan", "Nan", "Mi" and "Ju" in "Jiangnan Miju Mobile Technology Co., Ltd." and the preset length, the remaining segmentation results of "Jiangnan", "Nan", "Mi" and "Ju" are arranged and combined, and finally the abbreviations corresponding to the preset full name are obtained as "Jiangnan Miju", "Jiangnan Ju", "Jiangju" and "Miju".
[0050] Step A2: Generate a target dictionary tree based on the abbreviation corresponding to the preset full name.
[0051] In the embodiment of the present invention, a target dictionary tree can be generated according to the abbreviation corresponding to the preset full name. The specific generation method can refer to the existing technology. This is not the solution to be protected by the embodiment of the present invention, so it will not be described in detail here.
[0052] The generated target dictionary tree includes a root node and child nodes. The root node does not contain any characters. Each child node can contain at least one character, and the characters contained in all child nodes of each node are different. All characters contained in the node path formed from the root node to any child node with an end attribute constitute an abbreviation. The child node with an end attribute contains the last character of an abbreviation.
[0053] Combine the following Figure 2 The above embodiments are described in detail with examples. Figure 2 As shown, the target dictionary tree can be generated according to the abbreviations corresponding to the preset full name: "Jiangnan Honey Orange", "Jiangnan Orange", "Jiang Orange" and "Honey Orange". The target dictionary tree includes a root node and 8 child nodes, and the root node does not include characters. Among them, node a is the root node of the target dictionary tree, child node b contains the character "Jiang", child node c contains the character "Orange", child node d contains the character "Nan", child node e contains the character "Orange", child node f contains the character "Mi", child node g contains the character "Orange", child node j contains the character "Honey", and child node k contains the character "Orange". Child nodes c, e, g and k are child nodes with end attributes. Child nodes b and c constitute the abbreviation "Jiangnan Orange"; child nodes b, d and e constitute the abbreviation "Jiangnan Orange"; child nodes b, d, f and g constitute the abbreviation "Jiangnan Honey Orange"; child nodes j and k constitute the abbreviation "Honey Orange".
[0054] Optionally, generally for the convenience of query, after the dictionary tree is generated, a fail pointer may be set for the dictionary tree. The specific setting method may refer to the prior art, which is not the solution to be protected by the embodiment of the present invention, and therefore, will not be described in detail here.
[0055] In the embodiment of the present invention, a dictionary tree is pre-set for information query. Since the dictionary tree can use common prefixes to reduce query time and minimize unnecessary character string comparisons, information query can be performed quickly, thereby improving query efficiency.
[0056] As an optional embodiment, step 102: obtaining the first text segment including the reference abbreviation in the text to be queried may include:
[0057] A third text segment including the reference abbreviation in the query text is obtained. The abbreviation of the third text segment is preliminarily checked, and text segments in which some reference abbreviations in the third text segment are not the abbreviations of the corresponding reference full names are removed to obtain the first text segment.
[0058] In the embodiment of the present invention, the abbreviations in the third text segment can also be preliminarily checked according to a preset method, and the text segments in which some reference abbreviations in the third text segment are not the abbreviations of the corresponding reference full names are removed, and the remaining text segments in the third text segment are confirmed as the first text segment. The preset method may include, but is not limited to: any one of a regular method, a word segmentation method, a Chinese information processing model method, and a context verification method.
[0059] The above scheme is illustrated below with reference to specific embodiments. For example, the third text segment includes two text segments, "Jiangnan Miju mobile phone brand is selling hot in the global market in 2020" and "xx region is known as the hometown of Miju". For the "Miju" included in the text segment "xx region is known as the hometown of Miju", its reference full name is determined to be "Jiangnan Miju Mobile Phone Technology Co., Ltd.". Based on the "hometown" below after "Miju", it can be known that "Miju" is not the abbreviation of the corresponding "Jiangnan Miju Mobile Phone Technology Co., Ltd.", so the text segment "xx region is known as the hometown of Miju" is removed; for the "Jiangnan Miju mobile phone brand is selling hot in the global market in 2020", its reference full name is determined to be "Jiangnan Miju Mobile Phone Technology Co., Ltd.". Based on the "mobile phone" below after "Jiangnan Miju", it can be known that "Jiangnan Miju" is the abbreviation of the corresponding "Jiangnan Miju Mobile Phone Technology Co., Ltd.", so it can be confirmed that the text segment "Jiangnan Miju mobile phone brand is selling hot in the global market in 2020" is the first text segment.
[0060] In the embodiment of the present invention, after obtaining the third text segment including the reference abbreviation in the text to be queried, the server can perform a preliminary check on the third text segment, and remove the text segment in which some of the reference abbreviations in the third text segment are not the abbreviations of the corresponding reference full names. Since the first text segment has been screened once before being input into the preset neural network model, the workload of the preset neural network model is reduced, and the efficiency of information query is improved.
[0061] As an optional embodiment, the text to be queried may be at least one text stored in the server or a text input by a user. The following further explains these two situations.
[0062] (1) In the case where the to-be-queried text is at least one text stored in the server, the processing result may be: the to-be-queried text includes the target text of the second text segment and the position information of the reference abbreviation in the second text segment. The second text segment is a text segment in which the probability value of the abbreviation of the reference full name corresponding to the reference abbreviation in the first text segment is greater than or equal to a preset probability value.
[0063] Among them, in the case that the text to be queried is at least one text stored in the server, before determining the reference abbreviation corresponding to the query request and the reference full name corresponding to the reference abbreviation in the text to be queried according to at least one target dictionary tree, the method may also include: determining the first information included in the query request according to at least one preset dictionary tree; and determining the preset dictionary tree including the first information in at least one preset dictionary tree as the target dictionary tree.
[0064] The query request is the information input by the user in the query input box; the first information is the abbreviation information and / or the full name information.
[0065] In order to better understand the above content, an example is given below to illustrate.
[0066] For example, if the information to be queried is input in the query input box of the mobile browser application, such as inputting "what is the mobile application", the mobile phone can send the query request to the server. After receiving the query request, the server can first determine that the query request includes the abbreviation "application" according to the preset dictionary tree, and determine the preset dictionary tree including the abbreviation as the target dictionary tree, and obtain the full name information "application" associated with the target dictionary tree. Then, the server can search for the text including the abbreviation of the application in at least one stored text through the information query method described in steps 102 to 105. Finally, the server can obtain the target text including the second text segment (i.e., the text segment in which the probability value of the abbreviation of the reference full name corresponding to the reference abbreviation in the first text segment is greater than or equal to the preset probability value) in the text to be queried, and the location information of the reference abbreviation in the second text segment according to the output result of the preset neural network model, and generate a processing result based on this information and send it to the mobile phone so that the mobile phone displays the processing result for the user to view.
[0067] (2) In the case where the text to be queried is text input by the user, the processing result may be: the target abbreviation whose probability value of the abbreviation of the reference full name corresponding to the reference abbreviation in the first text segment is greater than or equal to a preset probability value, and the position information of the target abbreviation in the first text segment.
[0068] In order to better understand the above content, an example is given below to illustrate.
[0069] For example, in a scenario where sensitive words are searched through a computer, a user can input a piece of text into the text input box of the sensitive word search page, and the computer can send a query request to the server based on the text entered by the user. The query request includes the text entered by the user and the purpose of the sensitive word search. After the server receives the query request sent by the computer, it can perform a sensitive word search on the text entered by the user (i.e., the text to be searched) through the information query method described in steps 102 to 105. Finally, the server can generate a processing result based on the output result of the preset neural network model, and send it to the computer so that the computer displays the processing result for the user to view.
[0070] In this case, since the query request is to query sensitive words, the target dictionary tree is a dictionary tree including the abbreviations of sensitive words.
[0071] As an optional embodiment, before step 101: receiving the query request sent by the terminal device, the method may further include: training a preset neural network model, which may specifically include the following steps:
[0072] Step B1: Obtain at least two training samples.
[0073] Each training sample includes at least one abbreviation, and the corresponding full name is marked for each abbreviation.
[0074] Step B2: Input the first training sample into a preset neural network model in a preset format to obtain a second output result corresponding to the first training sample.
[0075] The second output result is: the probability value that the abbreviation in the first training sample is the abbreviation of the corresponding full name, and the position of the abbreviation in the first training sample.
[0076] Step B3: Determine whether the second output result meets the expected result, and obtain a first determination result.
[0077] The expected result is a preset probability value and the actual position of the abbreviation in the first training sample.
[0078] Step B4: Adjust model parameters according to the first judgment result.
[0079] Step B5: Input the second training sample in a preset format into the preset neural network model after adjusting the model parameters, and obtain a third output result corresponding to the second training sample.
[0080] The third output result is: the probability value that the abbreviation in the second training sample is the abbreviation of the corresponding full name, and the position of the abbreviation in the second training sample.
[0081] Step B6: Determine whether the third output result meets the expected result, and obtain a second determination result.
[0082] The expected result is a preset probability value and the actual position of the abbreviation in the second training sample.
[0083] Step B7: Adjust the model parameters according to the second judgment result.
[0084] The above iterative process is repeated until all training samples are trained or the output results of the preset neural network model meet the expected results.
[0085] In an embodiment of the present invention, a neural network model is pre-trained to predict the probability value of a reference abbreviation in a text segment being the abbreviation of its corresponding reference full name. The abbreviation information can be further screened based on the probability value, thereby reducing the occurrence of situations where the reference abbreviation is not the abbreviation of the corresponding reference full name, solving the problem of low accuracy in information query, improving the accuracy of information query, and enhancing the user's query experience.
[0086] In summary, in an embodiment of the present invention, the server can preliminarily search for the abbreviation information and full name information corresponding to the query request in the text to be queried based on at least one dictionary tree. Among them, each target dictionary tree is composed of at least one abbreviation information of a full name. Since the dictionary tree can use common prefixes to reduce the query time and minimize the comparison of unnecessary character strings, it is possible to quickly perform information query and improve query efficiency. After completing the preliminary query, the server can also determine the probability value of the abbreviation of the corresponding reference full name in the text segment through a preset neural network model. According to the probability value, the abbreviations in the text segment can be further screened, and the accuracy of the information query can also be improved.
[0087] Reference Figure 3 , shows a structural block diagram of an information query device embodiment of the present invention, the information query device can be applied to a server, and specifically can include the following modules:
[0088] The receiving module 301 is used to receive a query request sent by a terminal device.
[0089] The first determination module 302 is used to determine the reference abbreviation corresponding to the query request and the reference full name corresponding to the reference abbreviation in the query text according to at least one target dictionary tree.
[0090] Each target dictionary tree includes: at least one abbreviation corresponding to a full name, and an association relationship is established between each target dictionary tree and the full name corresponding to the included abbreviation; wherein the target dictionary tree is determined according to the query request.
[0091] The first acquisition module 303 is used to acquire a first text segment including a reference abbreviation in the text to be queried.
[0092] The second acquisition module 304 is used to input the first text segment and the reference full name into the preset neural network model to obtain the output result of the preset neural network model.
[0093] The output result at least includes: a probability value that the reference abbreviation in the first text segment is the abbreviation of the corresponding reference full name, and position information of the reference abbreviation in the first text segment.
[0094] The first generating module 305 is used to generate a processing result corresponding to the query request according to the output result, and send the processing result to the terminal device.
[0095] As an optional embodiment, the information query device may further include:
[0096] The second generating module is used to generate the abbreviation corresponding to the preset full name according to the preset full name.
[0097] The third generation module is used to generate a target dictionary tree according to the abbreviation corresponding to the preset full name.
[0098] The target dictionary tree includes a root node and child nodes, each child node contains at least one character, and the characters on the node path formed from the root node to any child node with an end attribute constitute an abbreviation.
[0099] Optionally, the information query device may further include:
[0100] The setting module is used to set the fail pointer for the target dictionary tree.
[0101] As an optional embodiment, the first obtaining module 303 may include:
[0102] The first acquisition submodule is used to acquire a third text segment including the reference abbreviation in the text to be queried.
[0103] The second acquisition submodule is used to perform preliminary verification on the abbreviations in the third text segment, remove text segments in which some reference abbreviations in the third text segment are not the abbreviations of the corresponding reference full names, and obtain the first text segment.
[0104] As an optional embodiment, the text to be queried is at least one text stored in the server or a text input by a user.
[0105] In the case where the to-be-queried text is at least one text stored in the server, the processing result is: the to-be-queried text includes the target text of the second text segment and the position information of the reference abbreviation in the second text segment; wherein the second text segment is a text segment in which the probability value of the abbreviation of the reference abbreviation corresponding to the reference full name in the first text segment is greater than or equal to a preset probability value;
[0106] When the text to be queried is text input by the user, the processing result is: the probability value of the abbreviation of the reference abbreviation corresponding to the reference full name in the first text segment is greater than or equal to the preset probability value of the target abbreviation, and the position information of the target abbreviation in the first text segment.
[0107] As an optional embodiment, the information query device may further include:
[0108] The second determination module is used to determine the first information included in the query request according to at least one preset dictionary tree.
[0109] The query request is the information entered by the user in the query input box.
[0110] The third determining module is used to determine a preset dictionary tree including the first information in at least one preset dictionary tree as a target dictionary tree.
[0111] The first information is the abbreviation information and / or the full name information.
[0112] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0113] In an embodiment of the present invention, the server can preliminarily search for the abbreviation information and full name information corresponding to the query request in the text to be queried based on at least one dictionary tree. Among them, each target dictionary tree is composed of at least one abbreviation information of a full name. Since the dictionary tree can use common prefixes to reduce the query time and minimize the comparison of unnecessary character strings, it is possible to quickly perform information query and improve query efficiency. After completing the preliminary query, the server can also determine the probability value of the abbreviation of the corresponding reference full name in the text segment through a preset neural network model. According to the probability value, the abbreviations in the text segment can be further screened, and the accuracy of the information query can also be improved.
[0114] An embodiment of the present invention further discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the information query method described in any of the above embodiments when executing the computer program.
[0115] An embodiment of the present invention further discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the information query method described in any of the above embodiments.
[0116] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0117] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0118] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0119] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0120] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1A step that specifies a function in one or more boxes.
[0121] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0122] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
Claims
1. An information query method, applied to a server, characterized in that: The method comprises: Receiving a query request sent by a terminal device; According to at least one target dictionary tree, a reference abbreviation corresponding to the query request and a reference full name corresponding to the reference abbreviation in the query text are determined; wherein each of the target dictionary trees includes: at least one abbreviation corresponding to a full name, and an association relationship is established between each of the target dictionary trees and the full name corresponding to the included abbreviation; wherein the target dictionary tree is determined according to the query request; Acquire a first text segment including the reference abbreviation in the text to be queried; Inputting the first text segment and the reference full name into a preset neural network model to obtain an output result of the preset neural network model; wherein the output result at least includes: a probability value that the reference abbreviation in the first text segment is the abbreviation of the corresponding reference full name, and position information of the reference abbreviation in the first text segment; According to the output result, a processing result corresponding to the query request is generated, and the processing result is sent to the terminal device.
2. The information query method according to claim 1, characterized in that: Before receiving the query request sent by the terminal device, the method further includes: According to the preset full name, generate the abbreviation corresponding to the preset full name; A target dictionary tree is generated according to the abbreviation corresponding to the preset full name; wherein the target dictionary tree includes a root node and child nodes, each of the child nodes contains at least one character, and the characters on the node path formed from the root node to any child node with an end attribute constitute an abbreviation.
3. The information query method according to claim 1, characterized in that: The step of obtaining the first text segment including the reference abbreviation in the text to be queried includes: Acquire a third text segment including the reference abbreviation in the text to be queried; A preliminary check is performed on the abbreviations in the third text segment, and text segments in which some reference abbreviations in the third text segment are not abbreviations of corresponding reference full names are removed to obtain the first text segment.
4. The information query method according to claim 1, characterized in that: The text to be queried is at least one text stored in the server or a text input by a user; In the case where the text to be queried is at least one text stored in the server, the processing result is: the text to be queried includes the target text of the second text segment and the position information of the reference abbreviation in the second text segment; wherein the second text segment is a text segment in which the probability value of the reference abbreviation being the abbreviation of the corresponding reference full name in the first text segment is greater than or equal to a preset probability value; In the case where the text to be queried is the text input by the user, the processing result is: the target abbreviation whose probability value of the abbreviation of the reference full name corresponding to the reference abbreviation in the first text segment is greater than or equal to the preset probability value, and the position information of the target abbreviation in the first text segment.
5. The information query method according to claim 4, characterized in that: In the case where the text to be queried is at least one text stored in the server, before determining the reference abbreviation corresponding to the query request and the reference full name corresponding to the reference abbreviation in the text to be queried according to at least one target dictionary tree, the method further includes: Determine the first information included in the query request according to at least one preset dictionary tree; wherein the query request is information input by the user in the query input box; A preset dictionary tree including the first information in the at least one preset dictionary tree is determined as a target dictionary tree; wherein the first information is abbreviated name information and / or full name information.
6. An information query device, applied to a server, characterized in that: The device comprises: A receiving module, used for receiving a query request sent by a terminal device; A first determination module is used to determine, according to at least one target dictionary tree, a reference abbreviation corresponding to the query request in the query text and a reference full name corresponding to the reference abbreviation; wherein each of the target dictionary trees includes: at least one abbreviation corresponding to a full name, and an association relationship is established between each of the target dictionary trees and the full name corresponding to the included abbreviation; wherein the target dictionary tree is determined according to the query request; A first acquisition module, used for acquiring a first text segment including the reference abbreviation in the text to be queried; A second acquisition module is used to input the first text segment and the reference full name into a preset neural network model to obtain an output result of the preset neural network model; wherein the output result at least includes: a probability value that the reference abbreviation in the first text segment is the abbreviation of the corresponding reference full name, and position information of the reference abbreviation in the first text segment; The first generating module is used to generate a processing result corresponding to the query request according to the output result, and send the processing result to the terminal device.
7. The information query device according to claim 6, characterized in that: The device also includes: A second generating module generates a short name corresponding to the preset full name according to the preset full name; The third generation module is used to generate a preset dictionary tree according to the abbreviation corresponding to the preset full name; wherein the preset dictionary tree includes a root node and child nodes, each of the child nodes contains at least one character, and the characters on the node path formed from the root node to any child node with an end attribute constitute an abbreviation.
8. The information query device according to claim 6, characterized in that: The first acquisition module includes: A first acquisition submodule is used to acquire a third text segment including the reference abbreviation in the text to be queried; The second acquisition submodule is used to perform preliminary verification on the abbreviations in the third text segment, remove text segments in which some reference abbreviations in the third text segment are not abbreviations of corresponding reference full names, and obtain the first text segment.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the information query method according to any one of claims 1 to 5 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the information query method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method for acquiring shortened form in Chinese from Web page
CN102955819A
Data query method and device
CN108073655A