WO2022134355A1 - Keyword prompt-based search method and apparatus, and electronic device and storage medium - Google Patents

Keyword prompt-based search method and apparatus, and electronic device and storage medium Download PDF

Info

Publication number
WO2022134355A1
WO2022134355A1 PCT/CN2021/083827 CN2021083827W WO2022134355A1 WO 2022134355 A1 WO2022134355 A1 WO 2022134355A1 CN 2021083827 W CN2021083827 W CN 2021083827W WO 2022134355 A1 WO2022134355 A1 WO 2022134355A1
Authority
WO
WIPO (PCT)
Prior art keywords
word
retrieval
search
standard
user
Prior art date
Application number
PCT/CN2021/083827
Other languages
French (fr)
Chinese (zh)
Inventor
付桂振
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022134355A1 publication Critical patent/WO2022134355A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates

Definitions

  • the present application relates to the technical field of semantic parsing, and in particular, to a retrieval method, apparatus, electronic device, and computer-readable storage medium based on keyword hints.
  • Data retrieval is a function that people attach great importance to in daily life, such as work and study. There is a large amount of data in the Internet, and how to accurately and efficiently query the data required by users has become the focus of people's attention.
  • the inventor realizes that the existing methods for improving the accuracy and efficiency of data retrieval are mostly the prefix matching method based on Tire tree, which uses the words input by the user to match the pre-key words from the preset keyword database to realize the retrieval prompt for the user. , to assist the user to complete the retrieval, but the matching requirements for words in this method are too high. When there are typos in the words, the user cannot be accurately prompted, thereby reducing the retrieval efficiency and retrieval accuracy.
  • a retrieval method based on keyword hints comprising:
  • the user is prompted by using the subject word set to obtain a search phrase, and the search phrase is used for retrieval.
  • a retrieval device based on keyword hints includes:
  • a similar word matching module is used to obtain the input word of the user, and perform similar word matching on the input word to obtain a similar word set;
  • An error prompting module used for using the similar word set to give an error prompt to the input word to obtain a search term
  • the first retrieval module is used for monitoring the user instruction of the user, and when the user instruction is a retrieval instruction, the retrieval word is used for retrieval;
  • an associated word matching module configured to perform associated word matching on the search term when the user instruction is an input command to obtain an associated word set
  • a subject heading screening module used for subject screening the associated word set to obtain a subject heading set with the same subject as the search term
  • the second retrieval module is used for prompting the user by using the subject word set, obtaining a retrieval phrase, and using the retrieval phrase for retrieval.
  • An electronic device comprising:
  • a processor that executes the instructions stored in the memory to achieve the following steps:
  • the user is prompted by using the subject word set to obtain a search phrase, and the search phrase is used for retrieval.
  • a computer-readable storage medium having at least one instruction stored in the computer-readable storage medium, the at least one instruction being executed by a processor in an electronic device to implement the following steps:
  • the user is prompted by using the subject word set to obtain a search phrase, and the search phrase is used for retrieval.
  • the present application can solve the problem of low efficiency and accuracy when searching based on keywords.
  • FIG. 1 is a schematic flowchart of a retrieval method based on keyword hints provided by an embodiment of the present application
  • FIG. 2 is a functional block diagram of a retrieval device based on keyword hints provided by an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of an electronic device implementing the keyword-hinting-based retrieval method according to an embodiment of the present application.
  • the embodiment of the present application provides a retrieval method based on keyword hints.
  • the execution subject of the keyword hint-based retrieval method includes, but is not limited to, at least one of the electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server and a terminal.
  • the retrieval method based on keyword hints may be executed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform.
  • the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
  • the retrieval method based on keyword hints includes:
  • the input word of the user may be any word or phrase, for example, the keyword "Internet of Things” input by the user when querying Internet of Things related documents; the key word input by the user when querying information about diabetes related to diabetes The word "diabetes”.
  • performing similar word matching on the input word to obtain a similar word set including:
  • the standard character library includes a plurality of standard characters and standard fonts and standard pronunciations corresponding to each standard character;
  • the first standard word and the second standard word are assembled into a similar word set of the input word.
  • a natural language processing model with a character parsing function is used to parse the input word, and the input word pronunciation and input glyph of each word in the input word are obtained, wherein the natural language processing model includes but is not limited to Forward Convolutional Neural Network Model and Recurrent Convolutional Neural Network Model.
  • the standard word library can be stored in a database in advance, and the standard word library can be obtained from the database for storing the standard word library by using a java statement with a data calling function.
  • the standard character library includes a plurality of standard characters and standard fonts and standard pronunciations corresponding to each standard character.
  • the screening of the first standard word with the same sound as the input word from the standard word library includes:
  • the standard word corresponding to the standard word sound whose distance value is smaller than the preset distance threshold is selected from the standard word library as the first standard word.
  • calculating the similarity between the standard pronunciation of each standard word in the standard word library and the input pronunciation includes:
  • R is the standard word sound of any standard word in the standard word library
  • S is the input word sound
  • Pearson is the similarity calculation
  • Sim is the similarity between R and S.
  • the step of filtering out the second standard word with the same shape as the input font from the standard font library is consistent with the step of filtering out the first standard word with the same sound as the input word from the standard font library, I won't go into details here.
  • the use of the similar word set to give an error prompt to the input word to obtain a search word includes:
  • An error prompt is given to the user according to the sequence of the similar word list, and the search words returned by the user are obtained.
  • the calculating the word popularity of each similar word in the similar word set includes:
  • the following heat algorithm is used to calculate the word heat of each similar word in the similar word set:
  • tf m is the word popularity of the m-th similar word
  • n is the total number of times the m-th similar word appears in the pre-built retrieval database
  • k is the total number of texts in the retrieval database
  • is the pre-built retrieval database. set weight coefficient.
  • the pre-built retrieval library includes any database that stores documents or data. For example, if a user searches for data in Baidu Library, Baidu Library is the search library.
  • the word popularity may indicate the frequency of word occurrences. The higher the word popularity, the more likely the similar words corresponding to the word popularity are correct words. Therefore, in this embodiment of the present application, the word popularity is ranked from high to high. Arrange each similar character in the similar character set in a small order to obtain a similar character list, and give an error prompt to the user according to the sequence of the similar character list.
  • using similar word sets to prompt errors for input words to obtain search words can reduce the probability of incorrectly inputting search words, reduce the possibility of users retrieving erroneous content, and help improve retrieval accuracy.
  • the user instruction includes a retrieval instruction and an input instruction.
  • the retrieval instruction refers to a computer instruction to perform retrieval, for example, after obtaining a retrieval term, execute retrieval instruction to directly use the retrieval term to perform retrieval;
  • the input instruction refers to a computer instruction to continue writing the input term, for example, when After obtaining the search term, the user wishes to continue to write the input term instead of directly using the search term for retrieval.
  • the embodiment of the present application uses the ASM enhanced bytecode filter to intercept and obtain user instructions in the network.
  • the ASM enhanced bytecode filter is a code analysis tool based on the Java bytecode level, using The section code filter intercepts user instructions, which can improve the success rate of user instruction interception.
  • the retrieval using the retrieval term includes:
  • performing word coding on the retrieval term to obtain retrieval coding including:
  • the character codes are combined to obtain a retrieval code.
  • the embodiment of the present application uses a preset encoder to encode and convert each character in the character set, and the encoder includes but is not limited to an ASCII (American Standard Code for Information Interchange, American Standard Code for Information Interchange) encoder. .
  • ASCII American Standard Code for Information Interchange, American Standard Code for Information Interchange
  • the combining the character codes specifically refers to: combining the character codes corresponding to each character in the search term according to the order of the characters in the search term to obtain the character codes. For example, if there is a search term "ice cream”, in which the character code of "ice” is ab, the character code of "ice” is ef, and the character code of "rain” is cd, according to the three characters in the search term "ice cream” The character codes corresponding to each word are sequentially combined to obtain the search code "abefcd" of the search word "ice cream”.
  • the retrieval environment is determined by the storage environment where the retrieval content is located.
  • the storage environment is the java environment, that is, the retrieval environment is the java environment.
  • Using a compiler corresponding to the retrieval environment to compile the retrieval code into a retrieval sentence can improve the usability of the retrieval sentence and ensure the success rate of retrieval.
  • the associated word matching is performed on the search term to obtain an associated word set, including:
  • the standard words corresponding to the standard vectors whose distance values are smaller than the preset distance threshold are collected as a related word set.
  • the embodiment of the present application uses a preset word vector transformation model to perform word vector transformation on the search term to obtain a retrieval vector.
  • the word vector transformation model includes but is not limited to CRF model (Conditional Random Fields Model, conditional random field model), HMM model (Hidden Markov Model, hidden Markov model).
  • CRF model Conditional Random Fields Model, conditional random field model
  • HMM model Hidden Markov Model, hidden Markov model
  • the calculating the distance value between the retrieval vector and the standard vector corresponding to each standard word in the preset standard thesaurus includes:
  • S(X, Y m ) is the distance value
  • X is the retrieval vector
  • Y m is the mth standard word in the standard vocabulary.
  • the standard words corresponding to the standard vectors whose distance values are less than the preset distance threshold are collected as a set of related words, wherein the related words in the set of related words can be stored in a blockchain node. Improve the efficiency of obtaining related words.
  • the related words are matched on the search terms to obtain a set of related words, and words related to the search terms can be screened from the standard thesaurus, which is beneficial to improve the retrieval efficiency.
  • the subject selection is performed on the associated word set to obtain a subject word set with the same subject as the search terms, including:
  • the associated vocabulary set with the matching degree greater than the preset matching threshold is regarded as the subject vocabulary set.
  • the embodiment of the present application uses a pre-trained convolutional neural network to extract the retrieval topic of the search term and the associated word topic of each associated word in the associated word set, where the retrieval topic refers to the category of the retrieval term, and the associated word The subject refers to the category of the related word. For example, when the search term or the related word is "ice cream", the search subject of the search term or the related word subject of the related word is food.
  • calculating the matching degree between the retrieval topic and the associated word topics of each associated word in the associated word set includes:
  • d(A, B) 2 is the matching degree
  • A is the retrieval topic
  • B is the associated word topic of any associated word in the associated word set.
  • the use of the subject word set to prompt the user to obtain a search phrase includes:
  • the feedback word and the search word set are the search word group.
  • the retrieval records of multiple users in the background include retrieval traces of multiple users stored in the background, such as retrieval time, retrieval content, and the like.
  • step of using the subject word set to prompt the user to obtain a search phrase is consistent with the step of using the similar word set to give an error prompt to the input word and obtaining the search word in step S2, which is not described here. Do repeat.
  • the step of using the search phrase to search is the same as the step of using the search word to search in step S3, and will not be repeated here.
  • the retrieval records of multiple users in the background can be used to analyze and obtain the word popularity of each theme word in the theme theme set.
  • the words in the thesaurus are sorted in descending order of word popularity and prompted to the user, which is beneficial to improve the efficiency of retrieval.
  • the search words are obtained, which can reduce the probability of incorrectly inputting the search words and reduce the possibility of the user retrieving wrong content.
  • the related words are matched for the search term, and the matched related word set is subject to subject screening to obtain the subject word set with the same subject as the search term, using the subject word set Prompting the user is beneficial to reduce the time for the user to input keywords and improve the retrieval efficiency. Therefore, the retrieval method based on keyword hints proposed in this application can solve the problem of low efficiency and accuracy in keyword-based retrieval.
  • FIG. 2 it is a functional block diagram of a retrieval device based on keyword hinting provided by an embodiment of the present application.
  • the retrieval apparatus 100 based on keyword hinting described in this application can be installed in an electronic device.
  • the keyword prompt-based retrieval device 100 may include a similar word matching module 101 , an error prompt module 102 , a first retrieval module 103 , a related word matching module 104 , a subject word screening module 105 and a second retrieval module 106 .
  • the modules described in this application may also be referred to as units, which refer to a series of computer program segments that can be executed by the processor of an electronic device and can perform fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the similar word matching module 101 is used for acquiring the input words of the user, and performing similar word matching on the input words to obtain a similar word set.
  • the input word of the user may be any word or phrase, for example, the keyword "Internet of Things” input by the user when querying Internet of Things related documents; the key word input by the user when querying information about diabetes related to diabetes The word "diabetes”.
  • the similar word matching module 101 is specifically used for:
  • the standard character library includes a plurality of standard characters and standard fonts and standard pronunciations corresponding to each standard character;
  • the first standard word and the second standard word are assembled into a similar word set of the input word.
  • a natural language processing model with a character parsing function is used to parse the input word, and the input word pronunciation and input glyph of each word in the input word are obtained, wherein the natural language processing model includes but is not limited to Forward Convolutional Neural Network Model and Recurrent Convolutional Neural Network Model.
  • the standard word library can be stored in a database in advance, and the standard word library can be obtained from the database for storing the standard word library by using a java statement with a data calling function.
  • the standard character library includes a plurality of standard characters and standard fonts and standard pronunciations corresponding to each standard character.
  • the screening of the first standard word with the same sound as the input word from the standard word library includes:
  • the standard word corresponding to the standard word sound whose distance value is smaller than the preset distance threshold is selected from the standard word library as the first standard word.
  • calculating the similarity between the standard pronunciation of each standard word in the standard word library and the input pronunciation includes:
  • R is the standard word sound of any standard word in the standard word library
  • S is the input word sound
  • Pearson is the similarity calculation
  • Sim is the similarity between R and S.
  • the step of filtering out the second standard word with the same shape as the input font from the standard font library is consistent with the step of filtering out the first standard word with the same sound as the input word from the standard font library, I won't go into details here.
  • the error prompting module 102 is configured to use the similar word set to give an error prompt to the input word to obtain a search word.
  • the error prompt module 102 is specifically used for:
  • An error prompt is given to the user according to the sequence of the similar word list, and the search words returned by the user are obtained.
  • the calculating the word popularity of each similar word in the similar word set includes:
  • the following heat algorithm is used to calculate the word heat of each similar word in the similar word set:
  • tf m is the word popularity of the m-th similar word
  • n is the total number of times the m-th similar word appears in the pre-built retrieval database
  • k is the total number of texts in the retrieval database
  • is the pre-built retrieval database. set weight coefficient.
  • the pre-built retrieval library includes any database that stores documents or data. For example, if a user searches for data in Baidu Library, Baidu Library is the search library.
  • the word popularity may indicate the frequency of word occurrences. The higher the word popularity, the more likely the similar words corresponding to the word popularity are correct words. Therefore, in this embodiment of the present application, the word popularity is ranked from high to high. Arrange each similar character in the similar character set in a small order to obtain a similar character list, and give an error prompt to the user according to the sequence of the similar character list.
  • using similar word sets to prompt errors for input words to obtain search words can reduce the probability of incorrectly inputting search words, reduce the possibility of users retrieving erroneous content, and help improve retrieval accuracy.
  • the first retrieval module 103 is configured to monitor the user instruction of the user, and when the user instruction is a retrieval instruction, use the retrieval word to perform retrieval.
  • the user instruction includes a retrieval instruction and an input instruction.
  • the retrieval instruction refers to a computer instruction to perform retrieval, for example, after obtaining a retrieval term, execute retrieval instruction to directly use the retrieval term to perform retrieval;
  • the input instruction refers to a computer instruction to continue writing the input term, for example, when After obtaining the search term, the user wishes to continue to write the input term instead of directly using the search term for retrieval.
  • the embodiment of the present application uses the ASM enhanced bytecode filter to intercept and obtain user instructions in the network.
  • the ASM enhanced bytecode filter is a code analysis tool based on the Java bytecode level, using The section code filter intercepts user instructions, which can improve the success rate of user instruction interception.
  • the first retrieval module 103 is specifically used for:
  • performing word coding on the retrieval term to obtain retrieval coding including:
  • the character codes are combined to obtain a retrieval code.
  • the embodiment of the present application uses a preset encoder to encode and convert each character in the character set, and the encoder includes but is not limited to an ASCII (American Standard Code for Information Interchange, American Standard Code for Information Interchange) encoder. .
  • ASCII American Standard Code for Information Interchange, American Standard Code for Information Interchange
  • the combining the character codes specifically refers to: combining the character codes corresponding to each character in the search term according to the sequence of the characters in the search term to obtain the character codes. For example, if there is a search term "ice cream”, in which the character code of "ice” is ab, the character code of "ice” is ef, and the character code of "rain” is cd, according to the three characters in the search term "ice cream” The character codes corresponding to each word are sequentially combined to obtain the search code "abefcd" of the search word "ice cream”.
  • the retrieval environment is determined by the storage environment where the retrieval content is located.
  • the storage environment is the java environment, that is, the retrieval environment is the java environment.
  • Using a compiler corresponding to the retrieval environment to compile the retrieval code into a retrieval sentence can improve the usability of the retrieval sentence and ensure the success rate of retrieval.
  • the associated word matching module 104 is configured to perform associated word matching on the search term when the user instruction is an input instruction to obtain a associated word set.
  • the associated word matching module 104 is specifically used for:
  • the standard words corresponding to the standard vectors whose distance values are smaller than the preset distance threshold are collected as a related word set.
  • the embodiment of the present application uses a preset word vector transformation model to perform word vector transformation on the search term to obtain a retrieval vector.
  • the word vector conversion model includes but is not limited to CRF model (Conditional Random Fields Model, conditional random field model), HMM model (Hidden Markov Model, Hidden Markov Model).
  • CRF model Conditional Random Fields Model, conditional random field model
  • HMM model Hidden Markov Model, Hidden Markov Model
  • the calculating the distance value between the retrieval vector and the standard vector corresponding to each standard word in the preset standard thesaurus includes:
  • S(X, Y m ) is the distance value
  • X is the retrieval vector
  • Y m is the mth standard word in the standard vocabulary.
  • the standard words corresponding to the standard vectors whose distance values are less than the preset distance threshold are collected as a set of related words, wherein the related words in the set of related words can be stored in a blockchain node. Improve the efficiency of obtaining related words.
  • the related words are matched on the search terms to obtain a set of related words, and words related to the search terms can be screened out from the standard thesaurus, which is beneficial to improve the retrieval efficiency.
  • the subject word screening module 105 is configured to perform subject screening on the associated word set to obtain a theme word set with the same subject as the search terms.
  • the subject heading screening module 105 is specifically used for:
  • the associated vocabulary set with the matching degree greater than the preset matching threshold is regarded as the subject vocabulary set.
  • the embodiment of the present application uses a pre-trained convolutional neural network to extract the retrieval topic of the search term and the associated word topic of each associated word in the associated word set, where the retrieval topic refers to the category of the retrieval term, and the associated word The subject refers to the category of the related word. For example, when the search term or the related word is "ice cream", the search subject of the search term or the related word subject of the related word is food.
  • calculating the matching degree between the retrieval topic and the associated word topics of each associated word in the associated word set includes:
  • d(A, B) 2 is the matching degree
  • A is the retrieval topic
  • B is the associated word topic of any associated word in the associated word set.
  • the second retrieval module 106 is configured to use the subject word set to prompt the user, obtain a retrieval phrase, and use the retrieval phrase to perform retrieval.
  • the second retrieval module 106 is specifically configured to:
  • the feedback word and the search word set are the search word group.
  • the retrieval records of multiple users in the background include retrieval traces of multiple users stored in the background, such as retrieval time, retrieval content, and the like.
  • the step of using the subject word set to prompt the user to obtain the search phrase is consistent with the step of error prompting module 102 using the similar word set to prompt the input word to obtain the search word, here I won't go into details.
  • the step of using the search phrase to perform retrieval is the same as the step of the first retrieval module 103 to perform the retrieval using the search phrase, and will not be repeated here.
  • the retrieval records of multiple users in the background can be used to analyze and obtain the word popularity of each theme word in the theme theme set.
  • the words in the thesaurus are sorted in descending order of word popularity and prompted to the user, which is beneficial to improve the efficiency of retrieval.
  • the search words are obtained, which can reduce the probability of incorrectly inputting the search words and reduce the possibility of the user retrieving wrong content.
  • the related words are matched for the search term, and the matched related word set is subject to subject screening to obtain the subject word set with the same subject as the search term, using the subject word set Prompting the user is beneficial to reduce the time for the user to input keywords and improve the retrieval efficiency. Therefore, the retrieval device based on keyword hints proposed in this application can solve the problem of low efficiency and accuracy in keyword-based retrieval.
  • FIG. 3 it is a schematic structural diagram of an electronic device implementing a retrieval method based on keyword hints provided by an embodiment of the present application.
  • the electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a keyword-hinting-based retrieval program 12.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1 .
  • the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash memory card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can not only be used to store application software installed in the electronic device 1 and various data, such as the code of the retrieval program 12 based on keyword hints, etc., but also can be used to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits.
  • Central Processing Unit CPU
  • microprocessor digital processing chip
  • graphics processor and combination of various control chips, etc.
  • the processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and by running or executing the programs or modules stored in the memory 11 (for example, based on Keyword hint retrieval program, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (Extended industry standard architecture, EISA for short) bus or the like.
  • PCI peripheral component interconnect
  • EISA Extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the figure. components, or a combination of certain components, or a different arrangement of components.
  • the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components.
  • the electronic device 1 may further include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • a network interface optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like.
  • the display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
  • the retrieval program 12 based on keyword hints stored in the memory 11 of the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, can realize:
  • the user is prompted by using the subject word set to obtain a search phrase, and the search phrase is used for retrieval.
  • the modules/units integrated in the electronic device 1 may be stored in a computer-readable storage medium.
  • the computer-readable storage medium may be volatile or non-volatile.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM, Read-Only). Memory).
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be volatile or non-volatile.
  • the readable storage medium stores a computer program, and the computer program is stored in the When executed by the processor of the electronic device, it can achieve:
  • the user is prompted by using the subject word set to obtain a search phrase, and the search phrase is used for retrieval.
  • modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
  • the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

Abstract

A keyword prompt-based search method, a keyword prompt-based search apparatus, a device, and a storage medium, which relate to semantic parsing technology. The method comprises: acquiring an input word of a user, and performing similar word matching on the input word, so as to obtain a similar word set (S1); performing error prompting on the input word by using the similar word set, so as to obtain a search word (S2); monitoring a user instruction of the user, and when the user instruction is a search instruction, performing a search by using the search word (S3); when the user instruction is an input instruction, performing associated word matching on the search word, so as to obtain an associated word set (S4); performing subject screening on the associated word set, so as to obtain a subject word set with the same subject as the search word (S5); and prompting the user by using the subject word set, so as to obtain a search phrase, and performing a search by using the search phrase (S6). The problem of the efficiency and the accuracy being not high during a keyword-based search can be solved.

Description

基于关键词提示的检索方法、装置、电子设备及存储介质Retrieval method, device, electronic device and storage medium based on keyword hints
本申请要求于2020年12月25日提交中国专利局、申请号为CN202011564401.1,发明名称为“基于关键词提示的检索方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on December 25, 2020, with the application number CN202011564401.1, and the invention title is "Keyword Hint-based Retrieval Method, Device, Electronic Device and Storage Medium", The entire contents of which are incorporated herein by reference.
技术领域technical field
本申请涉及语义解析技术领域,尤其涉及一种基于关键词提示的检索方法、装置、电子设备及计算机可读存储介质。The present application relates to the technical field of semantic parsing, and in particular, to a retrieval method, apparatus, electronic device, and computer-readable storage medium based on keyword hints.
背景技术Background technique
数据检索是人们日常生活中处理工作、学习等非常重视的一个功能,互联网中存在大量的数据,而如何准确、高效的查询出用户需要的数据成为人们关注的重点。Data retrieval is a function that people attach great importance to in daily life, such as work and study. There is a large amount of data in the Internet, and how to accurately and efficiently query the data required by users has become the focus of people's attention.
发明人意识到现有的提高数据检索精确度与效率方法多为基于Tire树的前缀匹配方法,该方法利用用户输入的词语从预设关键词库中匹配先关词语以实现对用户的检索提示,辅助用户完成检索,但该方法中对词语的匹配要求过高,当词语中出现错别字等情况时,无法精确的对用户进行提示,进而降低检索效率和检索精确度。The inventor realizes that the existing methods for improving the accuracy and efficiency of data retrieval are mostly the prefix matching method based on Tire tree, which uses the words input by the user to match the pre-key words from the preset keyword database to realize the retrieval prompt for the user. , to assist the user to complete the retrieval, but the matching requirements for words in this method are too high. When there are typos in the words, the user cannot be accurately prompted, thereby reducing the retrieval efficiency and retrieval accuracy.
发明内容SUMMARY OF THE INVENTION
一种基于关键词提示的检索方法,包括:A retrieval method based on keyword hints, comprising:
获取用户的输入词,对所述输入词进行相近字匹配,得到相近字集;Obtain the input word of the user, and perform similar word matching on the input word to obtain a similar word set;
利用所述相近字集对所述输入词进行错误提示,得到检索词;Using the similar word set to give an error prompt to the input word to obtain a search word;
监测用户的用户指令,当所述用户指令为检索指令时,利用所述检索词进行检索;Monitor the user instruction of the user, and when the user instruction is a retrieval instruction, use the retrieval word to perform retrieval;
当所述用户指令为输入指令时,对所述检索词进行关联词匹配,得到关联词集;When the user instruction is an input instruction, perform associated word matching on the search term to obtain an associated word set;
对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集;Perform theme screening on the associated word set to obtain a theme word set with the same theme as the search term;
利用所述主题词集对用户进行提示,得到检索词组,利用所述检索词组进行检索。The user is prompted by using the subject word set to obtain a search phrase, and the search phrase is used for retrieval.
一种基于关键词提示的检索装置,所述装置包括:A retrieval device based on keyword hints, the device includes:
相近字匹配模块,用于获取用户的输入词,对所述输入词进行相近字匹配,得到相近字集;A similar word matching module is used to obtain the input word of the user, and perform similar word matching on the input word to obtain a similar word set;
错误提示模块,用于利用所述相近字集对所述输入词进行错误提示,得到检索词;An error prompting module, used for using the similar word set to give an error prompt to the input word to obtain a search term;
第一检索模块,用于监测用户的用户指令,当所述用户指令为检索指令时,利用所述检索词进行检索;The first retrieval module is used for monitoring the user instruction of the user, and when the user instruction is a retrieval instruction, the retrieval word is used for retrieval;
关联词匹配模块,用于当所述用户指令为输入指令时,对所述检索词进行关联词匹配,得到关联词集;an associated word matching module, configured to perform associated word matching on the search term when the user instruction is an input command to obtain an associated word set;
主题词筛选模块,用于对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集;a subject heading screening module, used for subject screening the associated word set to obtain a subject heading set with the same subject as the search term;
第二检索模块,用于利用所述主题词集对用户进行提示,得到检索词组,利用所述检索词组进行检索。The second retrieval module is used for prompting the user by using the subject word set, obtaining a retrieval phrase, and using the retrieval phrase for retrieval.
一种电子设备,所述电子设备包括:An electronic device comprising:
存储器,存储至少一个指令;及a memory that stores at least one instruction; and
处理器,执行所述存储器中存储的指令以实现如下步骤:A processor that executes the instructions stored in the memory to achieve the following steps:
获取用户的输入词,对所述输入词进行相近字匹配,得到相近字集;Obtain the input word of the user, and perform similar word matching on the input word to obtain a similar word set;
利用所述相近字集对所述输入词进行错误提示,得到检索词;Using the similar word set to give an error prompt to the input word to obtain a search word;
监测用户的用户指令,当所述用户指令为检索指令时,利用所述检索词进行检索;Monitor the user instruction of the user, and when the user instruction is a retrieval instruction, use the retrieval word to perform retrieval;
当所述用户指令为输入指令时,对所述检索词进行关联词匹配,得到关联词集;When the user instruction is an input instruction, perform associated word matching on the search term to obtain an associated word set;
对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集;Perform theme screening on the associated word set to obtain a theme word set with the same theme as the search term;
利用所述主题词集对用户进行提示,得到检索词组,利用所述检索词组进行检索。The user is prompted by using the subject word set to obtain a search phrase, and the search phrase is used for retrieval.
一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现如下步骤:A computer-readable storage medium having at least one instruction stored in the computer-readable storage medium, the at least one instruction being executed by a processor in an electronic device to implement the following steps:
获取用户的输入词,对所述输入词进行相近字匹配,得到相近字集;Obtain the input word of the user, and perform similar word matching on the input word to obtain a similar word set;
利用所述相近字集对所述输入词进行错误提示,得到检索词;Using the similar word set to give an error prompt to the input word to obtain a search word;
监测用户的用户指令,当所述用户指令为检索指令时,利用所述检索词进行检索;Monitor the user instruction of the user, and when the user instruction is a retrieval instruction, use the retrieval word to perform retrieval;
当所述用户指令为输入指令时,对所述检索词进行关联词匹配,得到关联词集;When the user instruction is an input instruction, perform associated word matching on the search term to obtain an associated word set;
对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集;Perform theme screening on the associated word set to obtain a theme word set with the same theme as the search term;
利用所述主题词集对用户进行提示,得到检索词组,利用所述检索词组进行检索。The user is prompted by using the subject word set to obtain a search phrase, and the search phrase is used for retrieval.
本申请可以解决基于关键词检索时效率和精确度不高的问题。The present application can solve the problem of low efficiency and accuracy when searching based on keywords.
附图说明Description of drawings
图1为本申请一实施例提供的基于关键词提示的检索方法的流程示意图;1 is a schematic flowchart of a retrieval method based on keyword hints provided by an embodiment of the present application;
图2为本申请一实施例提供的基于关键词提示的检索装置的功能模块图;2 is a functional block diagram of a retrieval device based on keyword hints provided by an embodiment of the present application;
图3为本申请一实施例提供的实现所述基于关键词提示的检索方法的电子设备的结构示意图。FIG. 3 is a schematic structural diagram of an electronic device implementing the keyword-hinting-based retrieval method according to an embodiment of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the purpose of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
本申请实施例提供一种基于关键词提示的检索方法。所述基于关键词提示的检索方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述基于关键词提示的检索方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。The embodiment of the present application provides a retrieval method based on keyword hints. The execution subject of the keyword hint-based retrieval method includes, but is not limited to, at least one of the electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server and a terminal. In other words, the retrieval method based on keyword hints may be executed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
参照图1所示,为本申请一实施例提供的基于关键词提示的检索方法的流程示意图。在本实施例中,所述基于关键词提示的检索方法包括:Referring to FIG. 1 , a schematic flowchart of a retrieval method based on keyword hints provided by an embodiment of the present application is shown. In this embodiment, the retrieval method based on keyword hints includes:
S1、获取用户的输入词,对所述输入词进行相近字匹配,得到相近字集。S1. Acquire a user's input word, and perform similar word matching on the input word to obtain a similar word set.
本申请实施例中,所述用户的输入词可为任何字或词语,例如,用户在查询物联网相关文献时输入的关键字“物联网”;用户在查询糖尿病的疾病相关信息时输入的关键字“糖尿病”。In the embodiment of the present application, the input word of the user may be any word or phrase, for example, the keyword "Internet of Things" input by the user when querying Internet of Things related documents; the key word input by the user when querying information about diabetes related to diabetes The word "diabetes".
详细地,所述对所述输入词进行相近字匹配,得到相近字集,包括:In detail, performing similar word matching on the input word to obtain a similar word set, including:
解析所述输入词,得到所述输入词中每个字的输入字音和输入字形;Analyzing the input word to obtain the input pronunciation and input glyph of each word in the input word;
获取预设的标准字库,其中,所述标准字库包括多个标准字及各标准字对应的标准字形和标准字音;Acquiring a preset standard character library, wherein the standard character library includes a plurality of standard characters and standard fonts and standard pronunciations corresponding to each standard character;
从所述标准字库中筛选出与所述输入字音相同的第一标准字;Screen out the first standard word with the same sound as the input word from the standard word library;
从所述标准字库中筛选出与所述输入字形相同的第二标准字;Screen out the second standard word that is the same as the input font from the standard font library;
将所述第一标准字和所述第二标准字汇集为所述输入词的相近字集。The first standard word and the second standard word are assembled into a similar word set of the input word.
本申请实施例利用具有文字解析功能的自然语言处理模型对所述输入词进行解析,得到所述输入词中每个字的输入字音和输入字形,其中,所述自然语言处理模型包括但不限于前向卷积神经网络模型和循环卷积神经网络模型。In the embodiment of the present application, a natural language processing model with a character parsing function is used to parse the input word, and the input word pronunciation and input glyph of each word in the input word are obtained, wherein the natural language processing model includes but is not limited to Forward Convolutional Neural Network Model and Recurrent Convolutional Neural Network Model.
详细地,所述标准字库可由用于预先存储于数据库中,可利用具有数据调用功能的java语句从用于存储标准字库的数据库中获取所述标准词库。所述标准字库包括多个标准字及各标准字对应的标准字形和标准字音。In detail, the standard word library can be stored in a database in advance, and the standard word library can be obtained from the database for storing the standard word library by using a java statement with a data calling function. The standard character library includes a plurality of standard characters and standard fonts and standard pronunciations corresponding to each standard character.
本申请实施例中,所述从所述标准字库中筛选出与所述输入字音相同的第一标准字,包括:In the embodiment of the present application, the screening of the first standard word with the same sound as the input word from the standard word library includes:
依次计算所述标准字库中每个标准字的标准字音与所述输入字音的相似度;Calculate successively the similarity of the standard word pronunciation of each standard word in the described standard word library and the described input word pronunciation;
从所述标准字库中筛选出所述距离值小于预设的距离阈值的标准字音对应的标准字为第一标准字。The standard word corresponding to the standard word sound whose distance value is smaller than the preset distance threshold is selected from the standard word library as the first standard word.
详细地,所述依次计算所述标准字库中每个标准字的标准字音与所述输入字音的相似度,包括:In detail, calculating the similarity between the standard pronunciation of each standard word in the standard word library and the input pronunciation in turn includes:
利用如下相似度算法计算所述标准字库中每个标准字的标准字音与所述输入字音的相似度:Utilize the following similarity algorithm to calculate the similarity between the standard pronunciation of each standard word in the standard word library and the input pronunciation:
Sim=Pearson(R,S)Sim=Pearson(R, S)
其中,R为所述标准字库中任一标准字的标准字音,S为所述输入字音,Pearson为相似度运算,Sim为R与S之间的相似度。Wherein, R is the standard word sound of any standard word in the standard word library, S is the input word sound, Pearson is the similarity calculation, and Sim is the similarity between R and S.
具体地,所述从所述标准字库中筛选出与所述输入字形相同的第二标准字的步骤与从所述标准字库中筛选出与所述输入字音相同的第一标准字的步骤一致,在此不做赘述。Specifically, the step of filtering out the second standard word with the same shape as the input font from the standard font library is consistent with the step of filtering out the first standard word with the same sound as the input word from the standard font library, I won't go into details here.
S2、利用所述相近字集对所述输入词进行错误提示,得到检索词。S2. Use the similar word set to give an error prompt to the input word to obtain a search word.
本申请实施例中,所述利用所述相近字集对所述输入词进行错误提示,得到检索词,包括:In the embodiment of the present application, the use of the similar word set to give an error prompt to the input word to obtain a search word includes:
计算所述相近字集中各相近字的字热度;calculating the word popularity of each similar character in the similar character set;
按照所述字热度从大到小的顺序将所述相近字集中每个相近字进行排列,得到相近字列表;Arrange each similar word in the similar word set in descending order of the word popularity to obtain a similar word list;
按照所述相近字列表的顺序对用户进行错误提示并获取用户返回的检索词。An error prompt is given to the user according to the sequence of the similar word list, and the search words returned by the user are obtained.
详细地,所述计算所述相近字集中各相近字的字热度,包括:In detail, the calculating the word popularity of each similar word in the similar word set includes:
利用如下热度算法计算所述相近字集中各相近字的字热度:The following heat algorithm is used to calculate the word heat of each similar word in the similar word set:
Figure PCTCN2021083827-appb-000001
Figure PCTCN2021083827-appb-000001
其中,tf m为第m个相近字的字热度,n为所述第m个相近字在预先构建的检索库中出现的总次数,k为所述检索库中文本的总数量,α为预设的权重系数。 Among them, tf m is the word popularity of the m-th similar word, n is the total number of times the m-th similar word appears in the pre-built retrieval database, k is the total number of texts in the retrieval database, and α is the pre-built retrieval database. set weight coefficient.
具体地,所述预先构建的检索库包括任何存储文献或数据的数据库,例如,用户在百度文库内查找数据,则百度文库为所述检索库。Specifically, the pre-built retrieval library includes any database that stores documents or data. For example, if a user searches for data in Baidu Library, Baidu Library is the search library.
进一步地,所述字热度可表示字出现的频率,所述字热度越大,说明所述字热度对应的相近字越可能是正确的字,因此本申请实施例按照所述字热度从大到小的顺序将所述相近字集中每个相近字进行排列,得到相近字列表,按照所述相近字列表的顺序对用户进行错误提示。Further, the word popularity may indicate the frequency of word occurrences. The higher the word popularity, the more likely the similar words corresponding to the word popularity are correct words. Therefore, in this embodiment of the present application, the word popularity is ranked from high to high. Arrange each similar character in the similar character set in a small order to obtain a similar character list, and give an error prompt to the user according to the sequence of the similar character list.
本申请实施例中,利用相近字集对输入词进行错误提示,得到检索词,可减少检索词输入错误的概率,降低用户检索错误内容的可能性,有利于提高检索的精确度。In the embodiment of the present application, using similar word sets to prompt errors for input words to obtain search words can reduce the probability of incorrectly inputting search words, reduce the possibility of users retrieving erroneous content, and help improve retrieval accuracy.
S3、监测用户的用户指令,当所述用户指令为检索指令时,利用所述检索词进行检索。S3. Monitor the user instruction of the user, and when the user instruction is a retrieval instruction, use the retrieval word to perform retrieval.
本申请实施例中,所述用户指令包括检索指令和输入指令。其中,所述检索指令是指执行检索的计算机指令,例如,获取检索词后,执行检索指令直接利用该检索词进行检索;所述输入指令是指继续写入输入词的计算机指令,例如,当获取检索词后,用户希望继续写入输入词,而非直接利用该检索词进行检索。In this embodiment of the present application, the user instruction includes a retrieval instruction and an input instruction. Wherein, the retrieval instruction refers to a computer instruction to perform retrieval, for example, after obtaining a retrieval term, execute retrieval instruction to directly use the retrieval term to perform retrieval; the input instruction refers to a computer instruction to continue writing the input term, for example, when After obtaining the search term, the user wishes to continue to write the input term instead of directly using the search term for retrieval.
详细地,本申请实施例使用ASM增强字节码过滤器拦截获取网络中的用户指令,所述ASM增强字节码过滤器是一款基于java字节码层面的代码分析工具,利用ASM增强字节码过滤器对用户指令进行拦截,可提高用户指令拦截的成功率。In detail, the embodiment of the present application uses the ASM enhanced bytecode filter to intercept and obtain user instructions in the network. The ASM enhanced bytecode filter is a code analysis tool based on the Java bytecode level, using The section code filter intercepts user instructions, which can improve the success rate of user instruction interception.
本申请实施例中,当所述用户指令为检索指令时,所述利用所述检索词进行检索,包括:In this embodiment of the present application, when the user instruction is a retrieval instruction, the retrieval using the retrieval term includes:
对所述检索词进行词编码,得到检索编码;performing word coding on the search term to obtain a search code;
检测检索环境;Check the retrieval environment;
利用与所述检索环境相应的编译器将所述检索编码编译为检索语句;Utilize a compiler corresponding to the retrieval environment to compile the retrieval code into retrieval sentences;
执行所述检索语句进行检索。Execute the retrieval statement to retrieve.
详细地,所述对所述检索词进行词编码,得到检索编码,包括:In detail, performing word coding on the retrieval term to obtain retrieval coding, including:
将所述字符集中每个字符进行编码转化,得到字符编码;encoding and converting each character in the character set to obtain character encoding;
将所述字符编码进行组合,得到检索编码。The character codes are combined to obtain a retrieval code.
详细地,本申请实施例利用预设的编码器对所述字符集中每个字符进行编码转化,所述编码器包括但不限于ASCII(American Standard Code for Information Interchange,美国标准信息交换代码)编码器。In detail, the embodiment of the present application uses a preset encoder to encode and convert each character in the character set, and the encoder includes but is not limited to an ASCII (American Standard Code for Information Interchange, American Standard Code for Information Interchange) encoder. .
所述将所述字符编码进行组合具体是指:将所述检索词中每个字对应的字符编码按照所述检索词中字的顺序进行组合,得到字符编码。例如,存在检索词“冰淇淋”,其中,“冰”的字符编码为ab,“淇”的字符编码为ef,“淋”的字符编码为cd,则按照检索词“冰淇淋”中三个字的顺序将每个字对应的字符编码进行组合,得到检索词“冰淇淋”的检索编码“abefcd”。The combining the character codes specifically refers to: combining the character codes corresponding to each character in the search term according to the order of the characters in the search term to obtain the character codes. For example, if there is a search term "ice cream", in which the character code of "ice" is ab, the character code of "ice" is ef, and the character code of "rain" is cd, according to the three characters in the search term "ice cream" The character codes corresponding to each word are sequentially combined to obtain the search code "abefcd" of the search word "ice cream".
本申请实施例中,所述检索环境由检索内容所在的存储环境所决定,例如,当检索内容存储于java数据库时,则存储环境为java环境,即检索环境为java环境。In the embodiment of the present application, the retrieval environment is determined by the storage environment where the retrieval content is located. For example, when the retrieval content is stored in a java database, the storage environment is the java environment, that is, the retrieval environment is the java environment.
利用与检索环境相应的编译器将检索编码编译为检索语句,可提高检索语句的可用性,保证检索的成功率。Using a compiler corresponding to the retrieval environment to compile the retrieval code into a retrieval sentence can improve the usability of the retrieval sentence and ensure the success rate of retrieval.
S4、当所述用户指令为输入指令时,对所述检索词进行关联词匹配,得到关联词集。S4. When the user instruction is an input instruction, perform associated word matching on the search term to obtain an associated word set.
本申请实施例中,当所述用户指令为输入指令时,所述对所述检索词进行关联词匹配,得到关联词集,包括:In the embodiment of the present application, when the user instruction is an input instruction, the associated word matching is performed on the search term to obtain an associated word set, including:
对所述检索词进行词向量转化,得到检索向量;performing word vector transformation on the search term to obtain a search vector;
计算所述检索向量与预设的标准词库中各标准词对应的标准向量的距离值;Calculate the distance value between the retrieval vector and the standard vector corresponding to each standard word in the preset standard thesaurus;
汇集所述距离值小于预设距离阈值的标准向量对应的标准词为关联词集。The standard words corresponding to the standard vectors whose distance values are smaller than the preset distance threshold are collected as a related word set.
详细地,本申请实施例利用预设的词向量转化模型对所述检索词进行词向量转化,得到检索向量。其中,所述词向量转化模型包括但不限于CRF模型(Conditional Random Fields Model,条件随机场模型),HMM模型(Hidden Markov Model,隐马尔可夫模型)。利用词向量转化模型对所述检索词进行词向量转化,可提高检索词转化为检索向量的效率。In detail, the embodiment of the present application uses a preset word vector transformation model to perform word vector transformation on the search term to obtain a retrieval vector. Wherein, the word vector transformation model includes but is not limited to CRF model (Conditional Random Fields Model, conditional random field model), HMM model (Hidden Markov Model, hidden Markov model). Using the word vector transformation model to transform the search words into word vectors can improve the efficiency of transforming the search words into search vectors.
具体地,所述计算所述检索向量与预设的标准词库中各标准词对应的标准向量的距离值,包括:Specifically, the calculating the distance value between the retrieval vector and the standard vector corresponding to each standard word in the preset standard thesaurus includes:
利用如下距离算法计算所述检索向量与预设的标准词库中各标准词对应的标准向量的距离值:Use the following distance algorithm to calculate the distance between the retrieval vector and the standard vector corresponding to each standard word in the preset standard thesaurus:
Figure PCTCN2021083827-appb-000002
Figure PCTCN2021083827-appb-000002
其中,S(X,Y m)为所述距离值,X为所述检索向量,Y m为所述标准词库中第m个标准词。 Wherein, S(X, Y m ) is the distance value, X is the retrieval vector, and Y m is the mth standard word in the standard vocabulary.
本申请实施例汇集距离值小于预设距离阈值的标准向量对应的标准词为关联词集,其中,关联词集中的关联词可存储于区块链节点中,利用区块链对数据的高吞吐性,可提高获取关联词的效率。In this embodiment of the present application, the standard words corresponding to the standard vectors whose distance values are less than the preset distance threshold are collected as a set of related words, wherein the related words in the set of related words can be stored in a blockchain node. Improve the efficiency of obtaining related words.
本申请实施例中,对检索词进行关联词匹配,得到关联词集,可从标准词库中筛选出与检索词相关联的词语,有利于提高检索效率。In the embodiment of the present application, the related words are matched on the search terms to obtain a set of related words, and words related to the search terms can be screened from the standard thesaurus, which is beneficial to improve the retrieval efficiency.
S5、对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集。S5. Perform subject filtering on the associated word set to obtain a subject word set with the same subject as the search term.
本申请实施例中,所述对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集,包括:In the embodiment of the present application, the subject selection is performed on the associated word set to obtain a subject word set with the same subject as the search terms, including:
提取所述检索词的检索主题;extracting the search subject of the search term;
提取所述关联词集中各关联词的关联词主题;extracting the associated word subject of each associated word in the associated word set;
计算所述检索主题与所述关联词集中各关联词的关联词主题的匹配度;Calculate the degree of matching between the retrieval topic and the associated word topics of each associated word in the associated word set;
将所述匹配度大于预设的匹配阈值的关联词汇集为主题词集。The associated vocabulary set with the matching degree greater than the preset matching threshold is regarded as the subject vocabulary set.
详细地,本申请实施例利用预先训练完成的卷积神经网络提取所述检索词的检索主题,和所述关联词集中各关联词的关联词主题,所述检索主题是指检索词的类别,所述关联词主题是指关联词的类别,例如,检索词或关联词为“冰淇淋”时,检索词的检索主题或关联词的关联词主题为食物。In detail, the embodiment of the present application uses a pre-trained convolutional neural network to extract the retrieval topic of the search term and the associated word topic of each associated word in the associated word set, where the retrieval topic refers to the category of the retrieval term, and the associated word The subject refers to the category of the related word. For example, when the search term or the related word is "ice cream", the search subject of the search term or the related word subject of the related word is food.
具体地,所述计算所述检索主题与所述关联词集中各关联词的关联词主题的匹配度,包括:Specifically, calculating the matching degree between the retrieval topic and the associated word topics of each associated word in the associated word set includes:
利用如下匹配算法计算所述检索主题与所述关联词集中各关联词的关联词主题的匹配度:Use the following matching algorithm to calculate the matching degree between the retrieval topic and the associated word topics of each associated word in the associated word set:
d(A,B) 2=‖A-B‖ 2 d(A, B) 2 = ‖AB‖ 2
其中,d(A,B) 2为所述匹配度,A为所述检索主题,B为关联词集任一关联词的关联词主题。 Wherein, d(A, B) 2 is the matching degree, A is the retrieval topic, and B is the associated word topic of any associated word in the associated word set.
S6、利用所述主题词集对用户进行提示,得到检索词组,利用所述检索词组进行检索。S6. Prompt the user by using the subject word set to obtain a search phrase, and use the search phrase to perform retrieval.
本申请实施例中,所述利用所述主题词集对用户进行提示,得到检索词组,包括:In the embodiment of the present application, the use of the subject word set to prompt the user to obtain a search phrase includes:
获取后台多用户的检索记录;Get the retrieval records of multiple users in the background;
根据所述检索记录计算所述主题词集中各主题词的词语热度;Calculate the word popularity of each subject heading in the subject heading set according to the retrieval record;
按照所述词语热度从大到小的顺序将所述主题词集中的词语进行排序,得到主题词列表;Sort the words in the subject vocabulary set in descending order of the word popularity to obtain a subject vocabulary list;
根据所述主题词列表的顺序对用户进行提示,得到用户的反馈用词;Prompt the user according to the order of the subject word list, and obtain the feedback words from the user;
将所述反馈用词和所述检索词汇集为所述检索词组。The feedback word and the search word set are the search word group.
详细地,所述后台多用户的检索记录包括后台存储的多个用户的检索痕迹,如检索时间、检索内容等。Specifically, the retrieval records of multiple users in the background include retrieval traces of multiple users stored in the background, such as retrieval time, retrieval content, and the like.
详细地,所述利用所述主题词集对用户进行提示,得到检索词组的步骤与步骤S2中利用所述相近字集对所述输入词进行错误提示,得到检索词的步骤一致,在此不做赘述。所述利用所述检索词组进行检索的步骤与步骤S3中利用所述检索词进行检索的步骤一致,在此不做赘述。In detail, the step of using the subject word set to prompt the user to obtain a search phrase is consistent with the step of using the similar word set to give an error prompt to the input word and obtaining the search word in step S2, which is not described here. Do repeat. The step of using the search phrase to search is the same as the step of using the search word to search in step S3, and will not be repeated here.
本申请实施例利用所述后台多用户的检索记录可分析得出主题词集中各主题词被检索的词语热度,词语热度越高则说明该主题词越有可能是用户需要检索的词语,因此按照词语热度从大到小的顺序将主题词集中的词语进行排序并对用户进行提示,有利于提高检索的效率。In this embodiment of the present application, the retrieval records of multiple users in the background can be used to analyze and obtain the word popularity of each theme word in the theme theme set. The words in the thesaurus are sorted in descending order of word popularity and prompted to the user, which is beneficial to improve the efficiency of retrieval.
本申请实施例通过对用户的输入词进行相近字匹配,利用匹配到的相近字集对输入词进行错误提示,得到检索词,可减少检索词输入错误的概率,降低用户检索错误内容的可能性,有利于提高检索的精确度;当用户指令为输入指令时,对检索词进行关联词匹配,并对匹配到的关联词集进行主题筛选,得到与检索词相同主题的主题词集,利用主题词集对用户进行提示,有利于减少用户输入关键词的时间,提高检索效率。因此本申请提出的基于关键词提示的检索方法,可以解决基于关键词检索时效率和精确度不高的问题。In the embodiment of the present application, by performing similar word matching on the input words of the user, and using the matched similar word set to give an error prompt to the input words, the search words are obtained, which can reduce the probability of incorrectly inputting the search words and reduce the possibility of the user retrieving wrong content. , which is beneficial to improve the accuracy of retrieval; when the user command is an input command, the related words are matched for the search term, and the matched related word set is subject to subject screening to obtain the subject word set with the same subject as the search term, using the subject word set Prompting the user is beneficial to reduce the time for the user to input keywords and improve the retrieval efficiency. Therefore, the retrieval method based on keyword hints proposed in this application can solve the problem of low efficiency and accuracy in keyword-based retrieval.
如图2所示,是本申请一实施例提供的基于关键词提示的检索装置的功能模块图。As shown in FIG. 2 , it is a functional block diagram of a retrieval device based on keyword hinting provided by an embodiment of the present application.
本申请所述基于关键词提示的检索装置100可以安装于电子设备中。根据实现的功能,所述基于关键词提示的检索装置100可以包括相近字匹配模块101、错误提示模块102、第一检索模块103、关联词匹配模块104、主题词筛选模块105和第二检索模块106。本申请所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The retrieval apparatus 100 based on keyword hinting described in this application can be installed in an electronic device. According to the implemented functions, the keyword prompt-based retrieval device 100 may include a similar word matching module 101 , an error prompt module 102 , a first retrieval module 103 , a related word matching module 104 , a subject word screening module 105 and a second retrieval module 106 . The modules described in this application may also be referred to as units, which refer to a series of computer program segments that can be executed by the processor of an electronic device and can perform fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述相近字匹配模块101,用于获取用户的输入词,对所述输入词进行相近字匹配,得到相近字集。The similar word matching module 101 is used for acquiring the input words of the user, and performing similar word matching on the input words to obtain a similar word set.
本申请实施例中,所述用户的输入词可为任何字或词语,例如,用户在查询物联网相关文献时输入的关键字“物联网”;用户在查询糖尿病的疾病相关信息时输入的关键字“糖尿病”。In the embodiment of the present application, the input word of the user may be any word or phrase, for example, the keyword "Internet of Things" input by the user when querying Internet of Things related documents; the key word input by the user when querying information about diabetes related to diabetes The word "diabetes".
详细地,所述相近字匹配模块101具体用于:In detail, the similar word matching module 101 is specifically used for:
解析所述输入词,得到所述输入词中每个字的输入字音和输入字形;Analyzing the input word to obtain the input pronunciation and input glyph of each word in the input word;
获取预设的标准字库,其中,所述标准字库包括多个标准字及各标准字对应的标准字形和标准字音;Acquiring a preset standard character library, wherein the standard character library includes a plurality of standard characters and standard fonts and standard pronunciations corresponding to each standard character;
从所述标准字库中筛选出与所述输入字音相同的第一标准字;Screen out the first standard word with the same sound as the input word from the standard word library;
从所述标准字库中筛选出与所述输入字形相同的第二标准字;Screen out the second standard word that is the same as the input font from the standard font library;
将所述第一标准字和所述第二标准字汇集为所述输入词的相近字集。The first standard word and the second standard word are assembled into a similar word set of the input word.
本申请实施例利用具有文字解析功能的自然语言处理模型对所述输入词进行解析,得到所述输入词中每个字的输入字音和输入字形,其中,所述自然语言处理模型包括但不限于前向卷积神经网络模型和循环卷积神经网络模型。In the embodiment of the present application, a natural language processing model with a character parsing function is used to parse the input word, and the input word pronunciation and input glyph of each word in the input word are obtained, wherein the natural language processing model includes but is not limited to Forward Convolutional Neural Network Model and Recurrent Convolutional Neural Network Model.
详细地,所述标准字库可由用于预先存储于数据库中,可利用具有数据调用功能的java语句从用于存储标准字库的数据库中获取所述标准词库。所述标准字库包括多个标准字及各标准字对应的标准字形和标准字音。In detail, the standard word library can be stored in a database in advance, and the standard word library can be obtained from the database for storing the standard word library by using a java statement with a data calling function. The standard character library includes a plurality of standard characters and standard fonts and standard pronunciations corresponding to each standard character.
本申请实施例中,所述从所述标准字库中筛选出与所述输入字音相同的第一标准字,包括:In the embodiment of the present application, the screening of the first standard word with the same sound as the input word from the standard word library includes:
依次计算所述标准字库中每个标准字的标准字音与所述输入字音的相似度;Calculate successively the similarity of the standard word pronunciation of each standard word in the described standard word library and the described input word pronunciation;
从所述标准字库中筛选出所述距离值小于预设的距离阈值的标准字音对应的标准字为第一标准字。The standard word corresponding to the standard word sound whose distance value is smaller than the preset distance threshold is selected from the standard word library as the first standard word.
详细地,所述依次计算所述标准字库中每个标准字的标准字音与所述输入字音的相似度,包括:In detail, calculating the similarity between the standard pronunciation of each standard word in the standard word library and the input pronunciation in turn includes:
利用如下相似度算法计算所述标准字库中每个标准字的标准字音与所述输入字音的相似度:Utilize the following similarity algorithm to calculate the similarity between the standard pronunciation of each standard word in the standard word library and the input pronunciation:
Sim=Pearson(R,S)Sim=Pearson(R, S)
其中,R为所述标准字库中任一标准字的标准字音,S为所述输入字音,Pearson为相似度运算,Sim为R与S之间的相似度。Wherein, R is the standard word sound of any standard word in the standard word library, S is the input word sound, Pearson is the similarity calculation, and Sim is the similarity between R and S.
具体地,所述从所述标准字库中筛选出与所述输入字形相同的第二标准字的步骤与从所述标准字库中筛选出与所述输入字音相同的第一标准字的步骤一致,在此不做赘述。Specifically, the step of filtering out the second standard word with the same shape as the input font from the standard font library is consistent with the step of filtering out the first standard word with the same sound as the input word from the standard font library, I won't go into details here.
所述错误提示模块102,用于利用所述相近字集对所述输入词进行错误提示,得到检索词。The error prompting module 102 is configured to use the similar word set to give an error prompt to the input word to obtain a search word.
本申请实施例中,所述错误提示模块102具体用于:In the embodiment of the present application, the error prompt module 102 is specifically used for:
计算所述相近字集中各相近字的字热度;calculating the word popularity of each similar character in the similar character set;
按照所述字热度从大到小的顺序将所述相近字集中每个相近字进行排列,得到相近字列表;Arrange each similar word in the similar word set in descending order of the word popularity to obtain a similar word list;
按照所述相近字列表的顺序对用户进行错误提示并获取用户返回的检索词。An error prompt is given to the user according to the sequence of the similar word list, and the search words returned by the user are obtained.
详细地,所述计算所述相近字集中各相近字的字热度,包括:In detail, the calculating the word popularity of each similar word in the similar word set includes:
利用如下热度算法计算所述相近字集中各相近字的字热度:The following heat algorithm is used to calculate the word heat of each similar word in the similar word set:
Figure PCTCN2021083827-appb-000003
Figure PCTCN2021083827-appb-000003
其中,tf m为第m个相近字的字热度,n为所述第m个相近字在预先构建的检索库中出现的总次数,k为所述检索库中文本的总数量,α为预设的权重系数。 Among them, tf m is the word popularity of the m-th similar word, n is the total number of times the m-th similar word appears in the pre-built retrieval database, k is the total number of texts in the retrieval database, and α is the pre-built retrieval database. set weight coefficient.
具体地,所述预先构建的检索库包括任何存储文献或数据的数据库,例如,用户在百度文库内查找数据,则百度文库为所述检索库。Specifically, the pre-built retrieval library includes any database that stores documents or data. For example, if a user searches for data in Baidu Library, Baidu Library is the search library.
进一步地,所述字热度可表示字出现的频率,所述字热度越大,说明所述字热度对应的相近字越可能是正确的字,因此本申请实施例按照所述字热度从大到小的顺序将所述相近字集中每个相近字进行排列,得到相近字列表,按照所述相近字列表的顺序对用户进行错误提示。Further, the word popularity may indicate the frequency of word occurrences. The higher the word popularity, the more likely the similar words corresponding to the word popularity are correct words. Therefore, in this embodiment of the present application, the word popularity is ranked from high to high. Arrange each similar character in the similar character set in a small order to obtain a similar character list, and give an error prompt to the user according to the sequence of the similar character list.
本申请实施例中,利用相近字集对输入词进行错误提示,得到检索词,可减少检索词输入错误的概率,降低用户检索错误内容的可能性,有利于提高检索的精确度。In the embodiment of the present application, using similar word sets to prompt errors for input words to obtain search words can reduce the probability of incorrectly inputting search words, reduce the possibility of users retrieving erroneous content, and help improve retrieval accuracy.
所述第一检索模块103,用于监测用户的用户指令,当所述用户指令为检索指令时,利用所述检索词进行检索。The first retrieval module 103 is configured to monitor the user instruction of the user, and when the user instruction is a retrieval instruction, use the retrieval word to perform retrieval.
本申请实施例中,所述用户指令包括检索指令和输入指令。其中,所述检索指令是指执行检索的计算机指令,例如,获取检索词后,执行检索指令直接利用该检索词进行检索;所述输入指令是指继续写入输入词的计算机指令,例如,当获取检索词后,用户希望继续写入输入词,而非直接利用该检索词进行检索。In this embodiment of the present application, the user instruction includes a retrieval instruction and an input instruction. Wherein, the retrieval instruction refers to a computer instruction to perform retrieval, for example, after obtaining a retrieval term, execute retrieval instruction to directly use the retrieval term to perform retrieval; the input instruction refers to a computer instruction to continue writing the input term, for example, when After obtaining the search term, the user wishes to continue to write the input term instead of directly using the search term for retrieval.
详细地,本申请实施例使用ASM增强字节码过滤器拦截获取网络中的用户指令,所述ASM增强字节码过滤器是一款基于java字节码层面的代码分析工具,利用ASM增强字节码过滤器对用户指令进行拦截,可提高用户指令拦截的成功率。In detail, the embodiment of the present application uses the ASM enhanced bytecode filter to intercept and obtain user instructions in the network. The ASM enhanced bytecode filter is a code analysis tool based on the Java bytecode level, using The section code filter intercepts user instructions, which can improve the success rate of user instruction interception.
本申请实施例中,所述第一检索模块103具体用于:In the embodiment of the present application, the first retrieval module 103 is specifically used for:
对所述检索词进行词编码,得到检索编码;performing word coding on the search term to obtain a search code;
检测检索环境;Check the retrieval environment;
利用与所述检索环境相应的编译器将所述检索编码编译为检索语句;Utilize a compiler corresponding to the retrieval environment to compile the retrieval code into retrieval sentences;
执行所述检索语句进行检索。Execute the retrieval statement to retrieve.
详细地,所述对所述检索词进行词编码,得到检索编码,包括:In detail, performing word coding on the retrieval term to obtain retrieval coding, including:
将所述字符集中每个字符进行编码转化,得到字符编码;encoding and converting each character in the character set to obtain character encoding;
将所述字符编码进行组合,得到检索编码。The character codes are combined to obtain a retrieval code.
详细地,本申请实施例利用预设的编码器对所述字符集中每个字符进行编码转化,所述编码器包括但不限于ASCII(American Standard Code for Information Interchange,美国标准信息交换代码)编码器。In detail, the embodiment of the present application uses a preset encoder to encode and convert each character in the character set, and the encoder includes but is not limited to an ASCII (American Standard Code for Information Interchange, American Standard Code for Information Interchange) encoder. .
所述将所述字符编码进行组合具体是指:将所述检索词中每个字对应的字符编码按照所述检索词中字的顺序进行组合,得到字符编码。例如,存在检索词“冰淇淋”,其中,“冰”的字符编码为ab,“淇”的字符编码为ef,“淋”的字符编码为cd,则按照检索词“冰淇淋”中三个字的顺序将每个字对应的字符编码进行组合,得到检索词“冰淇淋”的检索编码“abefcd”。The combining the character codes specifically refers to: combining the character codes corresponding to each character in the search term according to the sequence of the characters in the search term to obtain the character codes. For example, if there is a search term "ice cream", in which the character code of "ice" is ab, the character code of "ice" is ef, and the character code of "rain" is cd, according to the three characters in the search term "ice cream" The character codes corresponding to each word are sequentially combined to obtain the search code "abefcd" of the search word "ice cream".
本申请实施例中,所述检索环境由检索内容所在的存储环境所决定,例如,当检索内容存储于java数据库时,则存储环境为java环境,即检索环境为java环境。In the embodiment of the present application, the retrieval environment is determined by the storage environment where the retrieval content is located. For example, when the retrieval content is stored in a java database, the storage environment is the java environment, that is, the retrieval environment is the java environment.
利用与检索环境相应的编译器将检索编码编译为检索语句,可提高检索语句的可用性,保证检索的成功率。Using a compiler corresponding to the retrieval environment to compile the retrieval code into a retrieval sentence can improve the usability of the retrieval sentence and ensure the success rate of retrieval.
所述关联词匹配模块104,用于当所述用户指令为输入指令时,对所述检索词进行关联词匹配,得到关联词集。The associated word matching module 104 is configured to perform associated word matching on the search term when the user instruction is an input instruction to obtain a associated word set.
本申请实施例中,所述关联词匹配模块104具体用于:In this embodiment of the present application, the associated word matching module 104 is specifically used for:
对所述检索词进行词向量转化,得到检索向量;performing word vector transformation on the search term to obtain a search vector;
计算所述检索向量与预设的标准词库中各标准词对应的标准向量的距离值;Calculate the distance value between the retrieval vector and the standard vector corresponding to each standard word in the preset standard thesaurus;
汇集所述距离值小于预设距离阈值的标准向量对应的标准词为关联词集。The standard words corresponding to the standard vectors whose distance values are smaller than the preset distance threshold are collected as a related word set.
详细地,本申请实施例利用预设的词向量转化模型对所述检索词进行词向量转化,得到检索向量。其中,所述词向量转化模型包括但不限于CRF模型(Conditional Random Fields Model,条件随机场模型),HMM模型(Hidden Markov Model,隐马尔可夫模型)。利用 词向量转化模型对所述检索词进行词向量转化,可提高检索词转化为检索向量的效率。In detail, the embodiment of the present application uses a preset word vector transformation model to perform word vector transformation on the search term to obtain a retrieval vector. Wherein, the word vector conversion model includes but is not limited to CRF model (Conditional Random Fields Model, conditional random field model), HMM model (Hidden Markov Model, Hidden Markov Model). Using the word vector transformation model to perform word vector transformation on the retrieval words can improve the efficiency of converting the retrieval words into retrieval vectors.
具体地,所述计算所述检索向量与预设的标准词库中各标准词对应的标准向量的距离值,包括:Specifically, the calculating the distance value between the retrieval vector and the standard vector corresponding to each standard word in the preset standard thesaurus includes:
利用如下距离算法计算所述检索向量与预设的标准词库中各标准词对应的标准向量的距离值:Use the following distance algorithm to calculate the distance between the retrieval vector and the standard vector corresponding to each standard word in the preset standard thesaurus:
Figure PCTCN2021083827-appb-000004
Figure PCTCN2021083827-appb-000004
其中,S(X,Y m)为所述距离值,X为所述检索向量,Y m为所述标准词库中第m个标准词。 Wherein, S(X, Y m ) is the distance value, X is the retrieval vector, and Y m is the mth standard word in the standard vocabulary.
本申请实施例汇集距离值小于预设距离阈值的标准向量对应的标准词为关联词集,其中,关联词集中的关联词可存储于区块链节点中,利用区块链对数据的高吞吐性,可提高获取关联词的效率。In this embodiment of the present application, the standard words corresponding to the standard vectors whose distance values are less than the preset distance threshold are collected as a set of related words, wherein the related words in the set of related words can be stored in a blockchain node. Improve the efficiency of obtaining related words.
本申请实施例中,对检索词进行关联词匹配,得到关联词集,可从标准词库中筛选出与检索词相关联的词语,有利于提高检索效率。In the embodiment of the present application, the related words are matched on the search terms to obtain a set of related words, and words related to the search terms can be screened out from the standard thesaurus, which is beneficial to improve the retrieval efficiency.
所述主题词筛选模块105,用于对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集。The subject word screening module 105 is configured to perform subject screening on the associated word set to obtain a theme word set with the same subject as the search terms.
本申请实施例中,所述主题词筛选模块105具体用于:In the embodiment of the present application, the subject heading screening module 105 is specifically used for:
提取所述检索词的检索主题;extracting the search subject of the search term;
提取所述关联词集中各关联词的关联词主题;extracting the associated word subject of each associated word in the associated word set;
计算所述检索主题与所述关联词集中各关联词的关联词主题的匹配度;Calculate the degree of matching between the retrieval topic and the associated word topics of each associated word in the associated word set;
将所述匹配度大于预设的匹配阈值的关联词汇集为主题词集。The associated vocabulary set with the matching degree greater than the preset matching threshold is regarded as the subject vocabulary set.
详细地,本申请实施例利用预先训练完成的卷积神经网络提取所述检索词的检索主题,和所述关联词集中各关联词的关联词主题,所述检索主题是指检索词的类别,所述关联词主题是指关联词的类别,例如,检索词或关联词为“冰淇淋”时,检索词的检索主题或关联词的关联词主题为食物。In detail, the embodiment of the present application uses a pre-trained convolutional neural network to extract the retrieval topic of the search term and the associated word topic of each associated word in the associated word set, where the retrieval topic refers to the category of the retrieval term, and the associated word The subject refers to the category of the related word. For example, when the search term or the related word is "ice cream", the search subject of the search term or the related word subject of the related word is food.
具体地,所述计算所述检索主题与所述关联词集中各关联词的关联词主题的匹配度,包括:Specifically, calculating the matching degree between the retrieval topic and the associated word topics of each associated word in the associated word set includes:
利用如下匹配算法计算所述检索主题与所述关联词集中各关联词的关联词主题的匹配度:Use the following matching algorithm to calculate the matching degree between the retrieval topic and the associated word topics of each associated word in the associated word set:
d(A,B) 2=‖A-B‖ 2 d(A, B) 2 = ‖AB‖ 2
其中,d(A,B) 2为所述匹配度,A为所述检索主题,B为关联词集任一关联词的关联词主题。 Wherein, d(A, B) 2 is the matching degree, A is the retrieval topic, and B is the associated word topic of any associated word in the associated word set.
所述第二检索模块106,用于利用所述主题词集对用户进行提示,得到检索词组,利用所述检索词组进行检索。The second retrieval module 106 is configured to use the subject word set to prompt the user, obtain a retrieval phrase, and use the retrieval phrase to perform retrieval.
本申请实施例中,所述第二检索模块106具体用于:In this embodiment of the present application, the second retrieval module 106 is specifically configured to:
获取后台多用户的检索记录;Get the retrieval records of multiple users in the background;
根据所述检索记录计算所述主题词集中各主题词的词语热度;Calculate the word popularity of each subject heading in the subject heading set according to the retrieval record;
按照所述词语热度从大到小的顺序将所述主题词集中的词语进行排序,得到主题词列表;Sort the words in the subject vocabulary set in descending order of the word popularity to obtain a subject vocabulary list;
根据所述主题词列表的顺序对用户进行提示,得到用户的反馈用词;Prompt the user according to the order of the subject word list, and obtain the feedback words from the user;
将所述反馈用词和所述检索词汇集为所述检索词组。The feedback word and the search word set are the search word group.
详细地,所述后台多用户的检索记录包括后台存储的多个用户的检索痕迹,如检索时间、检索内容等。Specifically, the retrieval records of multiple users in the background include retrieval traces of multiple users stored in the background, such as retrieval time, retrieval content, and the like.
详细地,所述利用所述主题词集对用户进行提示,得到检索词组的步骤与错误提示模 块102利用所述相近字集对所述输入词进行错误提示,得到检索词的步骤一致,在此不做赘述。所述利用所述检索词组进行检索的步骤与第一检索模块103利用所述检索词进行检索的步骤一致,在此不做赘述。In detail, the step of using the subject word set to prompt the user to obtain the search phrase is consistent with the step of error prompting module 102 using the similar word set to prompt the input word to obtain the search word, here I won't go into details. The step of using the search phrase to perform retrieval is the same as the step of the first retrieval module 103 to perform the retrieval using the search phrase, and will not be repeated here.
本申请实施例利用所述后台多用户的检索记录可分析得出主题词集中各主题词被检索的词语热度,词语热度越高则说明该主题词越有可能是用户需要检索的词语,因此按照词语热度从大到小的顺序将主题词集中的词语进行排序并对用户进行提示,有利于提高检索的效率。In this embodiment of the present application, the retrieval records of multiple users in the background can be used to analyze and obtain the word popularity of each theme word in the theme theme set. The words in the thesaurus are sorted in descending order of word popularity and prompted to the user, which is beneficial to improve the efficiency of retrieval.
本申请实施例通过对用户的输入词进行相近字匹配,利用匹配到的相近字集对输入词进行错误提示,得到检索词,可减少检索词输入错误的概率,降低用户检索错误内容的可能性,有利于提高检索的精确度;当用户指令为输入指令时,对检索词进行关联词匹配,并对匹配到的关联词集进行主题筛选,得到与检索词相同主题的主题词集,利用主题词集对用户进行提示,有利于减少用户输入关键词的时间,提高检索效率。因此本申请提出的基于关键词提示的检索装置,可以解决基于关键词检索时效率和精确度不高的问题。In the embodiment of the present application, by performing similar word matching on the input words of the user, and using the matched similar word set to give an error prompt to the input words, the search words are obtained, which can reduce the probability of incorrectly inputting the search words and reduce the possibility of the user retrieving wrong content. , which is beneficial to improve the accuracy of retrieval; when the user command is an input command, the related words are matched for the search term, and the matched related word set is subject to subject screening to obtain the subject word set with the same subject as the search term, using the subject word set Prompting the user is beneficial to reduce the time for the user to input keywords and improve the retrieval efficiency. Therefore, the retrieval device based on keyword hints proposed in this application can solve the problem of low efficiency and accuracy in keyword-based retrieval.
如图3所示,是本申请一实施例提供的实现基于关键词提示的检索方法的电子设备的结构示意图。As shown in FIG. 3 , it is a schematic structural diagram of an electronic device implementing a retrieval method based on keyword hints provided by an embodiment of the present application.
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如基于关键词提示的检索程序12。The electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a keyword-hinting-based retrieval program 12.
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如基于关键词提示的检索程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1 . In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash memory card (Flash Card), etc. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software installed in the electronic device 1 and various data, such as the code of the retrieval program 12 based on keyword hints, etc., but also can be used to temporarily store data that has been output or will be output.
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如基于关键词提示的检索程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。In some embodiments, the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits. Central Processing Unit (CPU), microprocessor, digital processing chip, graphics processor and combination of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and by running or executing the programs or modules stored in the memory 11 (for example, based on Keyword hint retrieval program, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (Extended industry standard architecture, EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
图3仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图3示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the figure. components, or a combination of certain components, or a different arrangement of components.
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等, 在此不再赘述。For example, although not shown, the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management The device implements functions such as charge management, discharge management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The electronic device 1 may further include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。Further, the electronic device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like. The display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only used for illustration, and are not limited by this structure in the scope of the patent application.
所述电子设备1中的所述存储器11存储的基于关键词提示的检索程序12是多个指令的组合,在所述处理器10中运行时,可以实现:The retrieval program 12 based on keyword hints stored in the memory 11 of the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, can realize:
获取用户的输入词,对所述输入词进行相近字匹配,得到相近字集;Obtain the input word of the user, and perform similar word matching on the input word to obtain a similar word set;
利用所述相近字集对所述输入词进行错误提示,得到检索词;Using the similar word set to give an error prompt to the input word to obtain a search word;
监测用户的用户指令,当所述用户指令为检索指令时,利用所述检索词进行检索;Monitor the user instruction of the user, and when the user instruction is a retrieval instruction, use the retrieval word to perform retrieval;
当所述用户指令为输入指令时,对所述检索词进行关联词匹配,得到关联词集;When the user instruction is an input instruction, perform associated word matching on the search term to obtain an associated word set;
对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集;Perform theme screening on the associated word set to obtain a theme word set with the same theme as the search term;
利用所述主题词集对用户进行提示,得到检索词组,利用所述检索词组进行检索。The user is prompted by using the subject word set to obtain a search phrase, and the search phrase is used for retrieval.
具体地,所述处理器10对上述指令的具体实现方法可参考图1对应实施例中相关步骤的描述,在此不赘述。Specifically, for the specific implementation method of the above-mentioned instruction by the processor 10, reference may be made to the description of the relevant steps in the corresponding embodiment of FIG. 1, and details are not described herein.
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。所述计算机可读存储介质可以是易失性的,也可以是非易失性的。例如,所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。Further, if the modules/units integrated in the electronic device 1 are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. The computer-readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM, Read-Only). Memory).
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质可以是易失性的,也可以是非易失性的,所述可读存储介质存储有计算机程序,所述计算机程序在被电子设备的处理器所执行时,可以实现:The present application also provides a computer-readable storage medium. The computer-readable storage medium may be volatile or non-volatile. The readable storage medium stores a computer program, and the computer program is stored in the When executed by the processor of the electronic device, it can achieve:
获取用户的输入词,对所述输入词进行相近字匹配,得到相近字集;Obtain the input word of the user, and perform similar word matching on the input word to obtain a similar word set;
利用所述相近字集对所述输入词进行错误提示,得到检索词;Using the similar word set to give an error prompt to the input word to obtain a search word;
监测用户的用户指令,当所述用户指令为检索指令时,利用所述检索词进行检索;Monitor the user instruction of the user, and when the user instruction is a retrieval instruction, use the retrieval word to perform retrieval;
当所述用户指令为输入指令时,对所述检索词进行关联词匹配,得到关联词集;When the user instruction is an input instruction, perform associated word matching on the search term to obtain an associated word set;
对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集;Perform theme screening on the associated word set to obtain a theme word set with the same theme as the search term;
利用所述主题词集对用户进行提示,得到检索词组,利用所述检索词组进行检索。The user is prompted by using the subject word set to obtain a search phrase, and the search phrase is used for retrieval.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division manners in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背 离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。It will be apparent to those skilled in the art that the present application is not limited to the details of the above-described exemplary embodiments, but that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Accordingly, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of the application is to be defined by the appended claims rather than the foregoing description, which is therefore intended to fall within the scope of the claims. All changes within the meaning and scope of the equivalents of , are included in this application. Any reference signs in the claims shall not be construed as limiting the involved claim.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。Furthermore, it is clear that the word "comprising" does not exclude other units or steps and the singular does not exclude the plural. Several units or means recited in the system claims can also be realized by one unit or means by means of software or hardware. Second-class terms are used to denote names and do not denote any particular order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and not to limit them. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be Modifications or equivalent substitutions can be made without departing from the spirit and scope of the technical solutions of the present application.

Claims (20)

  1. 一种基于关键词提示的检索方法,其中,所述方法包括:A retrieval method based on keyword hints, wherein the method comprises:
    获取用户的输入词,对所述输入词进行相近字匹配,得到相近字集;Obtain the input word of the user, and perform similar word matching on the input word to obtain a similar word set;
    利用所述相近字集对所述输入词进行错误提示,得到检索词;Using the similar word set to give an error prompt to the input word to obtain a search word;
    监测用户的用户指令,当所述用户指令为检索指令时,利用所述检索词进行检索;Monitor the user instruction of the user, and when the user instruction is a retrieval instruction, use the retrieval word to perform retrieval;
    当所述用户指令为输入指令时,对所述检索词进行关联词匹配,得到关联词集;When the user instruction is an input instruction, perform associated word matching on the search term to obtain an associated word set;
    对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集;Perform theme screening on the associated word set to obtain a theme word set with the same theme as the search term;
    利用所述主题词集对用户进行提示,得到检索词组,利用所述检索词组进行检索。The user is prompted by using the subject word set to obtain a search phrase, and the search phrase is used for retrieval.
  2. 如权利要求1所述的基于关键词提示的检索方法,其中,所述从所述标准字库中筛选出与所述输入字音相同的第一标准字,包括:The retrieval method based on keyword hints as claimed in claim 1, wherein the filtering out the first standard word with the same sound as the input word from the standard word library comprises:
    依次计算所述标准字库中每个标准字的标准字音与所述输入字音的相似度;Calculate successively the similarity of the standard word pronunciation of each standard word in the described standard word library and the described input word pronunciation;
    从所述标准字库中筛选出所述距离值小于预设的距离阈值的标准字音对应的标准字为第一标准字。The standard word corresponding to the standard word sound whose distance value is smaller than the preset distance threshold is selected from the standard word library as the first standard word.
  3. 如权利要求1所述的基于关键词提示的检索方法,其中,所述利用所述相近字集对所述输入词进行错误提示,得到检索词,包括:The retrieval method based on keyword hints as claimed in claim 1, wherein the use of the similar word set to perform error hints on the input words to obtain retrieval words, comprising:
    计算所述相近字集中各相近字的字热度;calculating the word popularity of each similar character in the similar character set;
    按照所述字热度从大到小的顺序将所述相近字集中每个相近字进行排列,得到相近字列表;Arrange each similar word in the similar word set in descending order of the word popularity to obtain a similar word list;
    按照所述相近字列表的顺序对用户进行错误提示并获取用户返回的检索词。An error prompt is given to the user according to the sequence of the similar word list, and the search words returned by the user are obtained.
  4. 如权利要求1所述的基于关键词提示的检索方法,其中,所述利用所述检索词进行检索,包括:The retrieval method based on keyword hints according to claim 1, wherein the retrieval by using the retrieval words comprises:
    对所述检索词进行词编码,得到检索编码;performing word coding on the search term to obtain a search code;
    检测检索环境;Check the retrieval environment;
    利用与所述检索环境相应的编译器将所述检索编码编译为检索语句;Utilize a compiler corresponding to the retrieval environment to compile the retrieval code into retrieval sentences;
    执行所述检索语句进行检索。Execute the retrieval statement to retrieve.
  5. 如权利要求4所述的基于关键词提示的检索方法,其中,所述对所述检索词进行词编码,得到检索编码,包括:The retrieval method based on keyword hints as claimed in claim 4, wherein, performing word coding on the retrieval term to obtain retrieval coding, comprising:
    将所述字符集中每个字符进行编码转化,得到字符编码;encoding and converting each character in the character set to obtain character encoding;
    将所述字符编码进行组合,得到检索编码。The character codes are combined to obtain a retrieval code.
  6. 如权利要求1至5中任一项所述的基于关键词提示的检索方法,其中,所述对所述检索词进行关联词匹配,得到关联词集,包括:The retrieval method based on keyword hints according to any one of claims 1 to 5, wherein, performing related word matching on the search terms to obtain a related word set, comprising:
    对所述检索词进行词向量转化,得到检索向量;performing word vector transformation on the search term to obtain a search vector;
    计算所述检索向量与预设的标准词库中各标准词对应的标准向量的距离值;Calculate the distance value between the retrieval vector and the standard vector corresponding to each standard word in the preset standard thesaurus;
    汇集所述距离值小于预设距离阈值的标准向量对应的标准词为关联词集。The standard words corresponding to the standard vectors whose distance values are smaller than the preset distance threshold are collected as a related word set.
  7. 如权利要求1至5中任一项所述的基于关键词提示的检索方法,其中,所述对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集,包括:The keyword-hinting-based retrieval method according to any one of claims 1 to 5, wherein the subject selection of the associated word set to obtain a subject word set with the same subject as the search terms, comprising:
    提取所述检索词的检索主题;extracting the search subject of the search term;
    提取所述关联词集中各关联词的关联词主题;extracting the associated word subject of each associated word in the associated word set;
    计算所述检索主题与所述关联词集中各关联词的关联词主题的匹配度;Calculate the degree of matching between the retrieval topic and the associated word topics of each associated word in the associated word set;
    将所述匹配度大于预设的匹配阈值的关联词汇集为主题词集。The associated vocabulary set with the matching degree greater than the preset matching threshold is regarded as the subject vocabulary set.
  8. 一种基于关键词提示的检索装置,其中,所述装置包括:A retrieval device based on keyword hints, wherein the device includes:
    相近字匹配模块,用于获取用户的输入词,对所述输入词进行相近字匹配,得到相近字集;A similar word matching module is used to obtain the input word of the user, and perform similar word matching on the input word to obtain a similar word set;
    错误提示模块,用于利用所述相近字集对所述输入词进行错误提示,得到检索词;An error prompting module, used for using the similar word set to give an error prompt to the input word to obtain a search term;
    第一检索模块,用于监测用户的用户指令,当所述用户指令为检索指令时,利用所述检索词进行检索;The first retrieval module is used for monitoring the user instruction of the user, and when the user instruction is a retrieval instruction, the retrieval word is used for retrieval;
    关联词匹配模块,用于当所述用户指令为输入指令时,对所述检索词进行关联词匹配,得到关联词集;an associated word matching module, configured to perform associated word matching on the search term when the user instruction is an input command to obtain an associated word set;
    主题词筛选模块,用于对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集;a subject heading screening module, used for subject screening the associated word set to obtain a subject heading set with the same subject as the search term;
    第二检索模块,用于利用所述主题词集对用户进行提示,得到检索词组,利用所述检索词组进行检索。The second retrieval module is used for prompting the user by using the subject word set, obtaining a retrieval phrase, and using the retrieval phrase for retrieval.
  9. 一种电子设备,其中,所述电子设备包括:An electronic device, wherein the electronic device comprises:
    至少一个处理器;以及,at least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of:
    获取用户的输入词,对所述输入词进行相近字匹配,得到相近字集;Obtain the input word of the user, and perform similar word matching on the input word to obtain a similar word set;
    利用所述相近字集对所述输入词进行错误提示,得到检索词;Using the similar word set to give an error prompt to the input word to obtain a search word;
    监测用户的用户指令,当所述用户指令为检索指令时,利用所述检索词进行检索;Monitoring the user's user instruction, when the user instruction is a retrieval instruction, use the retrieval word to perform retrieval;
    当所述用户指令为输入指令时,对所述检索词进行关联词匹配,得到关联词集;When the user instruction is an input instruction, perform associated word matching on the search term to obtain an associated word set;
    对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集;Perform theme screening on the associated word set to obtain a theme word set with the same theme as the search term;
    利用所述主题词集对用户进行提示,得到检索词组,利用所述检索词组进行检索。The user is prompted by using the subject word set to obtain a search phrase, and the search phrase is used for retrieval.
  10. 如权利要求9所述的电子设备,其中,所述从所述标准字库中筛选出与所述输入字音相同的第一标准字,包括:The electronic device according to claim 9, wherein the filtering out the first standard word with the same sound as the input word from the standard word library comprises:
    依次计算所述标准字库中每个标准字的标准字音与所述输入字音的相似度;Calculate successively the similarity of the standard word pronunciation of each standard word in the described standard word library and the described input word pronunciation;
    从所述标准字库中筛选出所述距离值小于预设的距离阈值的标准字音对应的标准字为第一标准字。The standard word corresponding to the standard word sound whose distance value is smaller than the preset distance threshold is selected from the standard word library as the first standard word.
  11. 如权利要求9所述的电子设备,其中,所述利用所述相近字集对所述输入词进行错误提示,得到检索词,包括:The electronic device according to claim 9, wherein the using the similar word set to perform an error prompt on the input word to obtain a search word, comprising:
    计算所述相近字集中各相近字的字热度;calculating the word popularity of each similar character in the similar character set;
    按照所述字热度从大到小的顺序将所述相近字集中每个相近字进行排列,得到相近字列表;Arrange each similar word in the similar word set in descending order of the word popularity to obtain a similar word list;
    按照所述相近字列表的顺序对用户进行错误提示并获取用户返回的检索词。An error prompt is given to the user according to the sequence of the similar word list, and the search words returned by the user are obtained.
  12. 如权利要求9所述的电子设备,其中,所述利用所述检索词进行检索,包括:The electronic device according to claim 9, wherein the retrieval using the retrieval term comprises:
    对所述检索词进行词编码,得到检索编码;performing word coding on the search term to obtain a search code;
    检测检索环境;Check the retrieval environment;
    利用与所述检索环境相应的编译器将所述检索编码编译为检索语句;Utilize a compiler corresponding to the retrieval environment to compile the retrieval code into retrieval sentences;
    执行所述检索语句进行检索。Execute the retrieval statement to retrieve.
  13. 如权利要求12所述的电子设备,其中,所述对所述检索词进行词编码,得到检索编码,包括:The electronic device according to claim 12 , wherein, performing word coding on the search term to obtain the search code, comprising:
    将所述字符集中每个字符进行编码转化,得到字符编码;encoding and converting each character in the character set to obtain character encoding;
    将所述字符编码进行组合,得到检索编码。The character codes are combined to obtain a retrieval code.
  14. 如权利要求9至13中任一项所述的电子设备,其中,所述对所述检索词进行关联词匹配,得到关联词集,包括:The electronic device according to any one of claims 9 to 13, wherein, performing related word matching on the search term to obtain a related word set, comprising:
    对所述检索词进行词向量转化,得到检索向量;performing word vector transformation on the search term to obtain a search vector;
    计算所述检索向量与预设的标准词库中各标准词对应的标准向量的距离值;Calculate the distance value between the retrieval vector and the standard vector corresponding to each standard word in the preset standard thesaurus;
    汇集所述距离值小于预设距离阈值的标准向量对应的标准词为关联词集。The standard words corresponding to the standard vectors whose distance values are smaller than the preset distance threshold are collected as a related word set.
  15. 如权利要求9至13中任一项所述的电子设备,其中,所述对所述关联词集进行 主题筛选,得到与所述检索词相同主题的主题词集,包括:The electronic device according to any one of claims 9 to 13, wherein the subject selection is performed on the associated word set to obtain a subject word set with the same subject as the search terms, including:
    提取所述检索词的检索主题;extracting the search subject of the search term;
    提取所述关联词集中各关联词的关联词主题;extracting the associated word subject of each associated word in the associated word set;
    计算所述检索主题与所述关联词集中各关联词的关联词主题的匹配度;Calculate the degree of matching between the retrieval topic and the associated word topics of each associated word in the associated word set;
    将所述匹配度大于预设的匹配阈值的关联词汇集为主题词集。The associated vocabulary set with the matching degree greater than the preset matching threshold is regarded as the subject vocabulary set.
  16. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下步骤:A computer-readable storage medium storing a computer program, wherein the computer program implements the following steps when executed by a processor:
    获取用户的输入词,对所述输入词进行相近字匹配,得到相近字集;Obtain the input word of the user, and perform similar word matching on the input word to obtain a similar word set;
    利用所述相近字集对所述输入词进行错误提示,得到检索词;Using the similar word set to give an error prompt to the input word to obtain a search word;
    监测用户的用户指令,当所述用户指令为检索指令时,利用所述检索词进行检索;Monitor the user instruction of the user, and when the user instruction is a retrieval instruction, use the retrieval word to perform retrieval;
    当所述用户指令为输入指令时,对所述检索词进行关联词匹配,得到关联词集;When the user instruction is an input instruction, perform associated word matching on the search term to obtain an associated word set;
    对所述关联词集进行主题筛选,得到与所述检索词相同主题的主题词集;Perform theme screening on the associated word set to obtain a theme word set with the same theme as the search term;
    利用所述主题词集对用户进行提示,得到检索词组,利用所述检索词组进行检索。The user is prompted by the subject word set to obtain a search phrase, and the search phrase is used for retrieval.
  17. 如权利要求16所述的计算机可读存储介质,其中,所述从所述标准字库中筛选出与所述输入字音相同的第一标准字,包括:The computer-readable storage medium of claim 16, wherein the filtering out the first standard word with the same sound as the input word from the standard word library comprises:
    依次计算所述标准字库中每个标准字的标准字音与所述输入字音的相似度;Calculate successively the similarity of the standard word pronunciation of each standard word in the described standard word library and the described input word pronunciation;
    从所述标准字库中筛选出所述距离值小于预设的距离阈值的标准字音对应的标准字为第一标准字。The standard word corresponding to the standard word sound whose distance value is smaller than the preset distance threshold is selected from the standard word library as the first standard word.
  18. 如权利要求16所述的计算机可读存储介质,其中,所述利用所述相近字集对所述输入词进行错误提示,得到检索词,包括:The computer-readable storage medium according to claim 16, wherein the using the similar word set to perform an error prompt on the input word to obtain a search word, comprising:
    计算所述相近字集中各相近字的字热度;calculating the word popularity of each similar character in the similar character set;
    按照所述字热度从大到小的顺序将所述相近字集中每个相近字进行排列,得到相近字列表;Arrange each similar word in the similar word set in descending order of the word popularity to obtain a similar word list;
    按照所述相近字列表的顺序对用户进行错误提示并获取用户返回的检索词。An error prompt is given to the user according to the sequence of the similar word list, and the search words returned by the user are obtained.
  19. 如权利要求16所述的计算机可读存储介质,其中,所述利用所述检索词进行检索,包括:The computer-readable storage medium of claim 16, wherein the searching using the search terms comprises:
    对所述检索词进行词编码,得到检索编码;performing word coding on the search term to obtain a search code;
    检测检索环境;Check the retrieval environment;
    利用与所述检索环境相应的编译器将所述检索编码编译为检索语句;Utilize a compiler corresponding to the retrieval environment to compile the retrieval code into retrieval sentences;
    执行所述检索语句进行检索。Execute the retrieval statement to retrieve.
  20. 如权利要求19所述的计算机可读存储介质,其中,所述对所述检索词进行词编码,得到检索编码,包括:The computer-readable storage medium according to claim 19, wherein, performing word coding on the search term to obtain the search code, comprising:
    将所述字符集中每个字符进行编码转化,得到字符编码;encoding and converting each character in the character set to obtain character encoding;
    将所述字符编码进行组合,得到检索编码。The character codes are combined to obtain a retrieval code.
PCT/CN2021/083827 2020-12-25 2021-03-30 Keyword prompt-based search method and apparatus, and electronic device and storage medium WO2022134355A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011564401.1A CN112667775A (en) 2020-12-25 2020-12-25 Keyword prompt-based retrieval method and device, electronic equipment and storage medium
CN202011564401.1 2020-12-25

Publications (1)

Publication Number Publication Date
WO2022134355A1 true WO2022134355A1 (en) 2022-06-30

Family

ID=75409348

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/083827 WO2022134355A1 (en) 2020-12-25 2021-03-30 Keyword prompt-based search method and apparatus, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN112667775A (en)
WO (1) WO2022134355A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117171587A (en) * 2023-09-27 2023-12-05 珠海云建数据信息技术有限公司 Material information encoding method, platform, electronic device and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113704587B (en) * 2021-08-31 2023-06-06 中国平安财产保险股份有限公司 User adhesion analysis method, device, equipment and medium based on stage division
CN115858739B (en) * 2023-03-02 2023-05-02 中国中医科学院中国医史文献研究所 Traditional Chinese medicine ancient book document retrieval system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011022995A1 (en) * 2009-08-27 2011-03-03 中兴通讯股份有限公司 Search condition prompt system and method for english word search
CN103678668A (en) * 2013-12-24 2014-03-26 乐视网信息技术(北京)股份有限公司 Prompting method of relevant search result, server and system
CN105426498A (en) * 2015-11-24 2016-03-23 小米科技有限责任公司 Cue word outputting method and device
CN108763332A (en) * 2018-05-10 2018-11-06 北京奇艺世纪科技有限公司 A kind of generation method and device of Search Hints word
CN110019647A (en) * 2017-10-25 2019-07-16 华为技术有限公司 A kind of keyword search methodology, device and search engine

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011022995A1 (en) * 2009-08-27 2011-03-03 中兴通讯股份有限公司 Search condition prompt system and method for english word search
CN103678668A (en) * 2013-12-24 2014-03-26 乐视网信息技术(北京)股份有限公司 Prompting method of relevant search result, server and system
CN105426498A (en) * 2015-11-24 2016-03-23 小米科技有限责任公司 Cue word outputting method and device
CN110019647A (en) * 2017-10-25 2019-07-16 华为技术有限公司 A kind of keyword search methodology, device and search engine
CN108763332A (en) * 2018-05-10 2018-11-06 北京奇艺世纪科技有限公司 A kind of generation method and device of Search Hints word

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117171587A (en) * 2023-09-27 2023-12-05 珠海云建数据信息技术有限公司 Material information encoding method, platform, electronic device and storage medium
CN117171587B (en) * 2023-09-27 2024-03-22 珠海云建数据信息技术有限公司 Material information encoding method, platform, electronic device and storage medium

Also Published As

Publication number Publication date
CN112667775A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
WO2022134759A1 (en) Keyword generation method and apparatus, and electronic device and computer storage medium
CN110502621B (en) Question answering method, question answering device, computer equipment and storage medium
WO2022134355A1 (en) Keyword prompt-based search method and apparatus, and electronic device and storage medium
US10713571B2 (en) Displaying quality of question being asked a question answering system
CN108304375B (en) Information identification method and equipment, storage medium and terminal thereof
US9727637B2 (en) Retrieving text from a corpus of documents in an information handling system
US9286290B2 (en) Producing insight information from tables using natural language processing
WO2022121171A1 (en) Similar text matching method and apparatus, and electronic device and computer storage medium
US8239188B2 (en) Example based translation apparatus, translation method, and translation program
US8321442B2 (en) Searching and matching of data
US9720977B2 (en) Weighting search criteria based on similarities to an ingested corpus in a question and answer (QA) system
US20220012296A1 (en) Systems and methods to automatically categorize social media posts and recommend social media posts
US9720962B2 (en) Answering superlative questions with a question and answer system
US20120290561A1 (en) Information processing apparatus, information processing method, program, and information processing system
CA2853627C (en) Automatic creation of clinical study reports
US20220277005A1 (en) Semantic parsing of natural language query
Bellare et al. Learning extractors from unlabeled text using relevant databases
WO2022160454A1 (en) Medical literature retrieval method and apparatus, electronic device, and storage medium
CN115438166A (en) Keyword and semantic-based searching method, device, equipment and storage medium
US8583415B2 (en) Phonetic search using normalized string
Yan et al. Chemical name extraction based on automatic training data generation and rich feature set
Khan et al. A clustering framework for lexical normalization of Roman Urdu
CN109885641A (en) A kind of method and system of database Chinese Full Text Retrieval
WO2021151303A1 (en) Named entity alignment device and apparatus, and electronic device and readable storage medium
KR101247346B1 (en) System and method for searching dictionary

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21908367

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21908367

Country of ref document: EP

Kind code of ref document: A1