Event search method, apparatus, and storage medium
By generating word vectors and phrase vectors, and using TF-IDF weights and similarity thresholds for semantic expansion search, the accuracy problem of event search in the urban governance system is solved, and the accuracy and efficiency of search results are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINGDONG CITY BEIJING DIGITS TECH CO LTD
- Filing Date
- 2023-04-06
- Publication Date
- 2026-05-22
AI Technical Summary
The existing urban governance system lacks semantic expansion search in event search, resulting in the loss of some search results or the return of results with low relevance.
By acquiring words describing the event, word vectors and phrase vectors are generated. Then, TF-IDF weights and similarity thresholds are used to generate extended words for semantic extension search.
It improves the accuracy of search results, avoids the loss of some results and the return of irrelevant results, and enhances the efficiency of event search and user experience.
Smart Images

Figure CN116414945B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to an event search method, apparatus, and storage medium. Background Technology
[0002] Search queries are an effective way for users to obtain information. When a user conducts a search query, the search system generates corresponding search results based on the user's search request. Events can be of various types, including trending news events and urban governance events. For example, the urban governance system receives a massive number of events reported by citizens or other organizations. These events are entered by operators and stored in the government service platform. Relevant departments need to assign, receive, handle, follow up on, analyze, and assess these events. In the process of developing this invention, the inventors discovered that existing urban governance systems perform a complete match of search terms in the event database without semantic expansion, resulting in the loss of some search results; or, by segmenting search terms into fine-grained words or characters, or by using similar words for expansion, they return search results with low relevance when performing search queries. Summary of the Invention
[0003] In view of this, one technical problem to be solved by the present invention is to provide an event search method, apparatus and storage medium.
[0004] According to a first aspect of this disclosure, an event search method is provided, comprising: acquiring event terms corresponding to event description information, and generating word vector information corresponding to the event terms; constructing event phrases based on the event terms, and determining weight information of each event term constituting the event phrase; generating phrase vector information corresponding to the event phrase based on the word vector information and the corresponding weight information; performing expansion processing on search terms based on the word vector information and the phrase vector information to obtain expanded terms corresponding to the search terms; and performing event search processing based on the search terms and the expanded terms.
[0005] Optionally, constructing an event phrase based on the event words includes: constructing a sliding window according to the number of words corresponding to the sliding window; using the sliding window to extract multiple consecutive event words from the event word set to form a candidate phrase; determining the number of times or frequency of the candidate phrase appearing in the event description information; and selecting candidate phrases whose number of occurrences is greater than a number threshold or whose frequency is greater than a frequency threshold as the event phrase.
[0006] Optionally, the weight information includes: TF-IDF weights; the determination of the weight information of each event word constituting the event phrase includes: calculating the TF-IDF weights of each event word constituting the event phrase to obtain the TF-IDF weights of each event word constituting the event phrase.
[0007] Optionally, generating phrase vector information corresponding to the event phrase includes: obtaining the word vectors of each event word that makes up the event phrase based on the word vector information; and generating the phrase vector information by weighting the word vectors according to the TF-IDF weights and word vectors of each event word that makes up the event phrase.
[0008] Optionally, the step of expanding the search term based on the word vector information and the phrase vector information to obtain expanded terms corresponding to the search term includes: obtaining the search term vector corresponding to the search term; determining that the search term vector exists in the word vector information, and determining a first similarity between the search term vector and each word vector in the word vector information; selecting event words as candidate expanded terms based on the first similarity, a first similarity threshold, and a first quantity threshold; determining that the search term vector exists in the phrase vector information, and obtaining a second similarity between the search term vector and each phrase vector in the phrase vector information; selecting event phrases as candidate expanded terms based on the second similarity, a second similarity threshold, and a second quantity threshold; and filtering all candidate expanded terms to determine the expanded terms.
[0009] Optionally, the filtering process for all candidate extended words includes deleting candidate extended words that contain other candidate extended words.
[0010] Optionally, generating word vector information corresponding to the event words includes: processing the event words using a word vector model to generate word vector information corresponding to the event words.
[0011] Optionally, obtaining the event words corresponding to the event description information includes: performing word segmentation on the event description information to obtain word segments corresponding to the event description information; and filtering the word segments according to stop word information to obtain the event words.
[0012] Optionally, the event includes: a city-wide governance event; the event description information includes: description information of the city-wide governance event.
[0013] According to a second aspect of this disclosure, an event search apparatus is provided, comprising: a corpus processing module, configured to acquire event words corresponding to event description information and generate word vector information corresponding to the event words; a phrase processing module, configured to construct event phrases based on the event words and determine the weight information of each event word constituting the event phrase; and generate phrase vector information corresponding to the event phrase based on the word vector information and the corresponding weight information; an extended word generation module, configured to perform extended processing on search terms based on the word vector information and the phrase vector information to obtain extended words corresponding to the search terms; and an event search module, configured to perform event search processing based on the search terms and the extended words.
[0014] Optionally, the phrase processing module includes: a phrase generation unit, configured to construct a sliding window based on the number of words corresponding to the sliding window; extract multiple consecutive event words from the event word set using the sliding window to form candidate phrases; determine the number of times or frequency of the candidate phrases appearing in the event description information; and use candidate phrases whose number of occurrences is greater than a number threshold or whose frequency is greater than a frequency threshold as the event phrases.
[0015] Optionally, the weight information includes: TF-IDF weights; the phrase processing module includes: a weight determination unit, used to calculate the TF-IDF weights of each event word constituting the event phrase, and obtain the TF-IDF weights of each event word constituting the event phrase.
[0016] Optionally, the phrase processing module includes: a phrase vector generation unit, used to obtain the word vectors of each event word constituting the event phrase based on the word vector information; and to generate the phrase vector information by performing weighted calculations based on the TF-IDF weights and word vectors of each event word constituting the event phrase.
[0017] Optionally, the extended word generation module is configured to: obtain a search word vector corresponding to the search word; determine that the search word exists in the event word set, and determine a first similarity between the search word vector and each word vector in the word vector information; select event words as candidate extended words based on the first similarity, a first similarity threshold, and a first quantity threshold; determine that the search word exists in the event phrase set, and obtain a second similarity between the search word vector and each phrase vector in the phrase vector information; select event phrases as candidate extended words based on the second similarity, a second similarity threshold, and a second quantity threshold; and filter all candidate extended words to determine the extended words.
[0018] Optionally, the extended word generation module is used to delete candidate extended words that contain other candidate extended words.
[0019] Optionally, the corpus processing module includes: a word vector generation unit, used to process the event words using a word vector model to generate word vector information corresponding to the event words.
[0020] Optionally, the corpus processing module includes: a corpus generation unit, configured to perform word segmentation on the event description information to obtain word segments corresponding to the event description information; and to filter the word segments according to stop word information to obtain the event words.
[0021] Optionally, the event includes: a city-wide governance event; the event description information includes: description information of the city-wide governance event.
[0022] According to a third aspect of this disclosure, an event search apparatus is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to perform the method described above based on instructions stored in the memory.
[0023] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided that stores computer instructions which are executed by a processor as described above.
[0024] The event search method, apparatus, and storage medium disclosed herein expand the search term to obtain corresponding extended terms, and perform event search processing based on the search term and extended terms. This avoids the loss of some search results caused by searching according to the input keywords, avoids the return of a large number of irrelevant results by searching at the word level, improves the accuracy of search results, improves event search efficiency, and enhances the user experience. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a flowchart illustrating an embodiment of the event search method according to the present disclosure;
[0027] Figure 2 This is a schematic diagram of the corpus processing flow in one embodiment of the event search method according to the present disclosure;
[0028] Figure 3This is a schematic diagram of the phrase expansion process in one embodiment of the event search method according to the present disclosure;
[0029] Figure 4 This is a schematic diagram of the process of performing search term expansion processing in one embodiment of the event search method according to the present disclosure;
[0030] Figure 5 This is a schematic flowchart of an embodiment of an event search device according to the present disclosure;
[0031] Figure 6 This is a flowchart illustrating a phrase processing module in one embodiment of an event search apparatus according to the present disclosure;
[0032] Figure 7 This is a flowchart illustrating the corpus processing module in one embodiment of the event search apparatus according to the present disclosure;
[0033] Figure 8 This is a schematic flowchart of another embodiment of the event search apparatus according to the present disclosure. Detailed Implementation
[0034] The present disclosure will now be described more fully with reference to the accompanying drawings, which illustrate exemplary embodiments of the present disclosure. The technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present disclosure, and not all embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present disclosure. The technical solutions of the present disclosure will be described in various aspects below with reference to the various figures and embodiments.
[0035] The terms "first" and "second" used in the following text are only used to describe the differences between them and have no other special meaning.
[0036] Figure 1 This is a flowchart illustrating an embodiment of the event search method according to the present disclosure, as shown below. Figure 1 As shown:
[0037] Step 101: Obtain event words corresponding to the event description information and generate word vector information corresponding to the event words.
[0038] In one embodiment, there can be multiple types of events, such as trending news events or urban governance events. The event description information can be descriptive of trending news events or urban governance events. Urban events can include traffic accidents, epidemics, natural disasters, etc.
[0039] Step 102: Construct event phrases based on event words and determine the weight information of each event word that makes up the event phrase.
[0040] Step 103: Generate phrase vector information corresponding to the event phrase based on the word vector information and the corresponding weight information.
[0041] Step 104: Expand the search term based on word vector information and phrase vector information to obtain expanded terms corresponding to the search term.
[0042] Step 105: Perform event search processing based on the search term and expanded terms.
[0043] In one embodiment, after a user enters a search term, semantically similar search terms or compound phrases are automatically expanded as expanded terms. Various existing event search processing methods can be used, such as using search terms and expanded terms as retrieval elements to perform a full match across all event description information to generate event search results.
[0044] Figure 2 This is a schematic diagram of the corpus processing flow in one embodiment of the event search method according to this disclosure, such as... Figure 2 As shown:
[0045] Step 201: Perform word segmentation on the event description information to obtain the word segments corresponding to the event description information.
[0046] Step 202: Filter the word segmentation based on the stop word information to obtain event words.
[0047] Step 203: Use a word vector model to process the event words and generate word vector information corresponding to the event words.
[0048] In one embodiment, the event description information can be information generated by the operator based on the description of the person reporting. Various existing word segmentation tools can be used to segment the event description information, such as the existing jieba word segmentation tool, to divide each event description in the event description information set into a combination of multiple words.
[0049] For example, the event description information is "Regarding the problem of random vehicle parking, the illegal parking of vehicles on the west side of Ximen West Road has not been resolved. The street has feedback that the property management should contact the community for independent management. However, the property management of the community has had multiple meetings with the community, the Exhibition Center, and the traffic police team in the early stage. The management right of this road belongs to the Exhibition Center and it is not a municipal road. Therefore, the traffic police are unable to enforce the law for management, and the property management can only persuade and contact (such as if the vehicle belongs to this community) to regulate parking. Now, the random parking of vehicles on the West Road has turned the original two-way lane into only the middle lane, resulting in the blockage of the fire lane and serious safety hazards. Now the government is strictly cracking down on fire problems, but the Exhibition Center is not taking any action. Such a serious problem has remained unmanaged and there has been a lot of buck-passing. It is hoped that the government will pay attention, contact the community to confirm the situation, and then hand over the road jurisdiction to the urban management or the traffic police for management."
[0050] After using the word segmentation tool to segment the event description information, the word segmentation result is "Regarding the problem of random vehicle parking, the illegal parking of vehicles on the west side of Ximen West Road has not been resolved. The street has feedback that the property management should contact the community for independent management. However, the property management of the community has had multiple meetings with the community, the Exhibition Center, and the traffic police team in the early stage. The management right of this road belongs to the Exhibition Center and it is not a municipal road. Therefore, the traffic police are unable to enforce the law for management, and the property management can only persuade and contact (such as if the vehicle belongs to this community) to regulate parking. Now, the random parking of vehicles on the West Road has turned the original two-way lane into only the middle lane, resulting in the blockage of the fire lane and serious safety hazards. Now the government is strictly cracking down on fire problems, but the Exhibition Center is not taking any action. Such a serious problem has remained unmanaged and there has been a lot of buck-passing. It is hoped that the government will pay attention, contact the community to confirm the situation, and then hand over the road jurisdiction to the urban management or the traffic police for management."
[0051] Stop words are query words that are automatically ignored when processing a query request. Stop words are usually words that appear frequently and have no practical meaning, such as "de" (的), "le" (了), etc. Obtain the preset stop word list, create a stop word list set, and sequentially determine whether each word in the word segmentation result is in the stop word list set. If the word is in the stop word list set, then remove this word from the word segmentation result.
[0052] After removing the stop words, the obtained event word information is "Vehicle random parking, Ximen West Road, vehicle illegal parking, solution, street feedback, property management, community, independent management, property management of the community, early stage, with the community, Exhibition Center, traffic police team, meeting, road management right, belongs to, Exhibition Center, not, municipal road, traffic police, law enforcement management, property management, can only persuade, and, vehicle, community, regulate parking, West Road, vehicle random parking, original two-way lane, lane, resulting in, fire lane, blockage, safety hazard, government, strictly crack down on, fire, Exhibition Center, not, so far, unmanaged, buck-passing, hope, government, pay attention, community, confirm the situation, road jurisdiction, hand over to, urban management, traffic police, management."
[0053] The acquired event words are input into a word vector model to train and obtain word vectors, which are the vector representations corresponding to the event words. The word vector model can be any existing model, such as GloVe or word2vec. The existing word2vec model can be used to process event words. Word2vec is a natural language processing model, a simple neural network that represents words as dense, low-dimensional real-valued vectors. The spatial distance between two words can be calculated using these vectors, representing the semantic relationship between them. For example, using the existing word2vec model, the word vector information corresponding to event words could be: {“vehicle”: [0.02, 0.07, -0.3, ..., 0.34], “illegally parked”: [0.12, 0.9, -0.1, ..., -0.54], ...}, etc.
[0054] Figure 3 This is a flowchart illustrating phrase expansion processing in one embodiment of the event search method according to the present disclosure, as shown below. Figure 3 As shown:
[0055] Step 301: Construct a sliding window based on the number of words corresponding to the sliding window. The number of words can be set as the length of the sliding window, for example, 2, 3, etc.
[0056] Step 302: Use a sliding window to extract multiple consecutive event words from the event word set to form candidate phrases.
[0057] In one embodiment, after generating candidate phrases, the number of times or frequency of the candidate phrases appearing in the event description information is determined, and candidate phrases with a number of occurrences greater than a number threshold or a frequency greater than a frequency threshold are selected as event phrases.
[0058] Step 303: Based on the event word information, calculate the TF-IDF weights of each event word that makes up the event phrase to obtain the TF-IDF weights of each event word that makes up the event phrase.
[0059] In one embodiment, the weight information of word vectors can be TF-IDF (Term Frequency-Inverse Document Frequency) weights, where TF stands for Term Frequency and IDF stands for Inverse Document Frequency. TF-IDF weights are used to evaluate the importance of a word to a document in a document set or corpus. Existing TF-IDF algorithms can be used to calculate the TF-IDF weights of each event word that makes up an event phrase based on event word information, which includes multiple event words.
[0060] Step 304: Based on word vector information, obtain the word vectors of each event word that makes up the event phrase.
[0061] Step 305: Based on the TF-IDF weights and word vectors of each event word that makes up the event phrase, perform weighted calculations to generate phrase vector information.
[0062] In one embodiment, all event words in the event word set are obtained. A sliding window of length n words is used to slide within the event word set, and the words in the sliding window are grouped into candidate phrases. The number of times each phrase appears in the event word set is counted, and candidate phrases with a frequency or occurrence greater than a count threshold or frequency threshold are selected as event phrases.
[0063] For example, the event term in the event term set is "the problem of illegally parked vehicles". A sliding window is constructed based on the number of terms n=3. Multiple event terms are extracted from the event term set using the sliding window to form candidate phrases. The resulting candidate phrases are, in order: "about illegally parked vehicles", "illegally parked vehicles", "illegally parked", and "the problem of parking". The number or frequency of occurrence of the candidate phrases in the event description information is determined. Candidate phrases with a frequency greater than a frequency threshold are selected as event phrases. The frequency threshold and the number of occurrence threshold can be set.
[0064] Using the existing TF-IDF algorithm, the term frequency-inverse document frequency (TF-IDF) of the words appearing in the event phrase (event words) is calculated as the TF-IDF weight of the event words. Based on the weighted average of the word vectors of each event word that makes up the event phrase, the phrase vector information corresponding to the event phrase is obtained.
[0065] For example, the event phrase P = {w1, w2, ..., w k},w1,w2,...,w k Given the individual event words that make up the event phrase, and vw as the word vector of each event word, a phrase vector v is generated. p for:
[0066] v P =∑ w∈{P} softmax(tf-idf(w))v w (1-1);
[0067] Here, w represents the individual event words that make up the event phrase; the TF-IDF weights of the individual event words in the event phrase are tf-idf(w), and softmax(tf-idf(w)) normalizes the TF-IDF weights of the individual event words in the event phrase. Existing methods can be used to multiply the TF-IDF weights of the individual event words in the event phrase by their corresponding word vectors, and the sum of these multiplications yields the phrase vector v. P .
[0068] Figure 4 This is a schematic diagram illustrating the process of expanding search terms in one embodiment of the event search method according to this disclosure, as shown below. Figure 4 As shown:
[0069] Step 401: Obtain the search term vectors corresponding to the search terms. Various existing methods can be used to obtain the search term vectors. For example, the word2vec model can be used to process the search terms and obtain the search term vectors.
[0070] Step 402: Determine if the search term vector exists in the word vector information. If it does, proceed to step 403; otherwise, proceed to step 405. Determine if the user-input search term is present in the word vector information. The word vector information is a set containing all word vectors.
[0071] Step 403: Determine the first similarity between the search word vector and each word vector in the word vector information. The first similarity can be cosine similarity, etc., and the word vector information contains word vectors of all event materials.
[0072] Step 404: Based on the first similarity, the first similarity threshold, and the first quantity threshold, select event words as candidate expanded words. For example, select event words with a first similarity greater than the first similarity threshold and a quantity less than the first quantity threshold as candidate expanded words.
[0073] Step 405: Determine if the search term exists in the phrase vector information. If yes, proceed to step 406; otherwise, proceed to step 408. The phrase vector information is a set containing all phrase vectors.
[0074] Step 406: Obtain the second similarity between the search word vector and each phrase vector in the phrase vector information. The second similarity can be cosine similarity, etc., and the phrase vector information includes phrase vectors of all event phrases.
[0075] Step 407: Based on the second similarity, the second similarity threshold, and the second quantity threshold, select event phrases as candidate expanded words.
[0076] For example, event phrases with a second similarity greater than a similarity threshold and a number less than a second quantity threshold can be selected as candidate expanded words. The second similarity threshold and the second quantity threshold can be set.
[0077] Step 408 involves filtering all candidate expansion words to determine the final expansion words. Various methods can be used to filter all candidate expansion words. For example, candidate expansion words that contain other candidate expansion words can be deleted.
[0078] In one embodiment, word vector information and phrase vector information are loaded. It is determined whether the search term q exists in the event word set. If it exists, the first cosine similarity between the word vector of search term q and each word vector in the word vector information is determined. A first similarity threshold s1 and a first quantity threshold k1 are set, and at most k1 event words with a first cosine similarity greater than s1 are returned as candidate expanded words, where s1 and k1 can be 0.8 and 100, respectively. For example, three first cosine similarities are calculated as [0.9, 0.8, 0.7], with s1 = 0.8. , If k1 = 1, then the expanded words will only select event words with a first cosine similarity of 0.9.
[0079] Determine if the search term q exists in the event phrase set. If it exists, determine the second cosine similarity between the word vector of search term q and each phrase vector in the phrase vector information. Set a second similarity threshold s2 and a second quantity threshold k2, and return at most k2 event phrases with a second cosine similarity of s2 or higher as candidate expanded words, where s2 and k2 can be 0.9 and 50, respectively.
[0080] Obtain a candidate extended word set S'. Sort all candidate extended words in S' in ascending order of length to obtain a candidate extended word set L. Then, sequentially select candidate extended words w from L and remove other candidate extended words in S' that contain the substring w. Finally, obtain the extended word set S. For example, if the search term is "vehicle violations", the obtained extended words would be "illegally parked vehicles", "motor vehicles illegally parked", "motor vehicles illegally parked on sidewalks", etc.
[0081] In existing technologies, searching by input keywords can easily lead to some results not being found, or word-level searches returning a large number of irrelevant results. For example, directly searching for the keyword "illegally parked vehicles" may miss a large number of events containing phrases such as "illegally parked cars" or "illegally parked motor vehicles." The event search method disclosed in this paper expands the search terms through semantic analysis technology, which can avoid the situation of some results not being found when searching by input keywords and avoid the situation of returning a large number of irrelevant results when searching by word level, thereby improving the event search experience and better serving event governance and analysis.
[0082] In one embodiment, such as Figure 5 As shown, this disclosure provides an event search device 50, including a corpus processing module 51, a phrase processing module 52, an extended word generation module 53, and an event search module 54. The corpus processing module 51 acquires event words corresponding to event description information and generates word vector information corresponding to the event words. The phrase processing module 52 constructs event phrases based on the event words and determines the weight information of each event word constituting the event phrase.
[0083] The phrase processing module 52 generates phrase vector information corresponding to the event phrase based on the word vector information and the corresponding weight information. The extended word generation module 53 expands the search term based on the word vector information and phrase vector information to obtain extended words corresponding to the search term. The event search module 54 performs event search processing based on the search term and extended words.
[0084] In one embodiment, the extended word generation module 53 obtains the search term vector corresponding to the search term. The extended word generation module 53 determines that the search term exists in the event word set and determines the first similarity between the search term vector and each word vector in the word vector information. Based on the first similarity, a first similarity threshold, and a first quantity threshold, the extended word generation module 53 selects event words as candidate extended words.
[0085] The extended word generation module 53 determines that the search term exists in the event phrase set and obtains the second similarity between the search term vector and each phrase vector in the phrase vector information. Based on the second similarity, the second similarity threshold, and the second quantity threshold, the extended word generation module 53 selects event phrases as candidate extended words. The extended word generation module 53 filters all candidate extended words to determine the extended words. For example, the extended word generation module 53 deletes candidate extended words that contain other candidate extended words.
[0086] In one embodiment, such as Figure 6 As shown, the phrase processing module 52 includes a phrase generation unit 521, a weight determination unit 522, and a phrase vector generation unit 523. The phrase generation unit 521 constructs a sliding window based on the number of words corresponding to the sliding window. The phrase generation unit 521 uses the sliding window to extract multiple consecutive event words from the event word set to form candidate phrases. The phrase generation unit 521 determines the number of times or frequency of the candidate phrases appear in the event description information, and selects candidate phrases with a frequency greater than a frequency threshold or a frequency greater than a frequency threshold as event phrases.
[0087] The weight information includes TF-IDF weights, etc. The weight determination unit 522 calculates the TF-IDF weights of each event word constituting the event phrase based on the event word information, obtaining the TF-IDF weights of each event word constituting the event phrase. The phrase vector generation unit 523 obtains the word vectors of each event word constituting the event phrase based on the word vector information. The phrase vector generation unit 523 performs a weighted calculation based on the TF-IDF weights and word vectors of each event word constituting the event phrase, generating phrase vector information.
[0088] In one embodiment, such as Figure 7 As shown, the corpus processing module 51 includes a word vector generation unit 511 and a corpus generation unit 512. The word vector generation unit 511 uses a word vector model to process event words, generating word vector information corresponding to the event words. The corpus generation unit 512 performs word segmentation processing on the event description information, obtaining word segments corresponding to the event description information. The corpus generation unit 512 filters the word segments based on stop word information to obtain event words.
[0089] In one embodiment, such as Figure 8 As shown, this disclosure provides an event search apparatus that may include a memory 81, a processor 82, a communication interface 83, and a bus 84. The memory 81 is used to store instructions, and the processor 82 is coupled to the memory 81. The processor 82 is configured to execute the event search method described above based on the instructions stored in the memory 81.
[0090] The memory 81 can be a high-speed RAM, non-volatile memory, or a memory array. The memory 81 may also be divided into blocks, and these blocks can be combined into virtual volumes according to certain rules. The processor 82 can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the event search method of this disclosure.
[0091] In one embodiment, this disclosure provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the method as described in any of the above embodiments.
[0092] The event search method, apparatus, and storage medium in the above embodiments expand the search terms to obtain extended terms corresponding to the search terms, and perform event search processing based on the search terms and extended terms. This avoids the loss of some search results caused by searching according to the input keywords, avoids the return of a large number of irrelevant results by searching at the word level, improves the accuracy of search results, improves event search efficiency, better serves event governance and analysis, and improves the user experience.
[0093] The methods and systems of this disclosure can be implemented in many ways. For example, they can be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of this disclosure are not limited to the order specifically described above, unless otherwise specifically stated. Furthermore, in some embodiments, this disclosure may also be implemented as a program recorded on a recording medium, the program including machine-readable instructions for implementing the methods according to this disclosure. Thus, this disclosure also covers recording media storing programs for performing the methods according to this disclosure.
[0094] The description in this disclosure is provided for illustrative and descriptive purposes only and is not intended to be exhaustive or to limit the disclosure to its forms. Many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described in order to better illustrate the principles and practical application of this disclosure and to enable those skilled in the art to understand this disclosure and to design various embodiments with various modifications suitable for a particular purpose.
Claims
1. An event search method, comprising: Obtain event words corresponding to the event description information, and generate word vector information corresponding to the event words; Based on the event words, an event phrase is constructed, and the weight information of each event word that makes up the event phrase is determined; Based on the word vector information and the corresponding weight information, generate phrase vector information corresponding to the event phrase; Based on the word vector information and the phrase vector information, the search term is expanded to obtain expanded terms corresponding to the search term, including: Obtain the search term vector corresponding to the search term; Determine that the search term vector exists in the term vector information, and determine the first similarity between the search term vector and each term vector in the term vector information; Based on the first similarity, the first similarity threshold, and the first quantity threshold, event words are selected as candidate expanded words; Determine that the search term vector exists in the phrase vector information, and obtain the second similarity between the search term vector and each phrase vector in the phrase vector information; Based on the second similarity, the second similarity threshold, and the second quantity threshold, event phrases are selected as candidate expanded words; All candidate expanded words are filtered to determine the expanded words; Event search processing is performed based on the search terms and the expanded terms.
2. The method as described in claim 1, wherein constructing the event phrase based on the event words comprises: Construct a sliding window based on the number of words corresponding to the sliding window; The sliding window is used to extract multiple consecutive event words from the event word set to form candidate phrases; Determine the number of times or frequency of the candidate phrases appearing in the event description information; Candidate phrases whose number of occurrences exceeds a threshold or whose frequency exceeds a threshold are selected as event phrases.
3. The method as described in claim 1, wherein, The weight information includes: TF-IDF weights; the weight information for determining each event word that makes up the event phrase includes: TF-IDF weights are calculated for each event word that makes up the event phrase to obtain the TF-IDF weights of each event word that makes up the event phrase.
4. The method as described in claim 3, wherein generating phrase vector information corresponding to the event phrase includes: Based on the word vector information, obtain the word vectors of each event word that makes up the event phrase; The phrase vector information is generated by weighting the TF-IDF weights and word vectors of each event word that makes up the event phrase.
5. The method as described in claim 1, wherein filtering all candidate expanded words includes: Candidate expansion words that contain other candidate expansion words are deleted.
6. The method as described in claim 1, wherein generating word vector information corresponding to the event words includes: The event words are processed using a word vector model to generate word vector information corresponding to the event words.
7. The method as described in claim 1, wherein obtaining the event terms corresponding to the event description information includes: The event description information is segmented into words to obtain words corresponding to the event description information. The word segmentation is filtered based on the stop word information to obtain the event words.
8. The method according to any one of claims 1 to 7, wherein, The events include: urban governance events; the event description information includes: description information of urban governance events.
9. An event search device, comprising: The corpus processing module is used to acquire event words corresponding to event description information and generate word vector information corresponding to the event words; The phrase processing module is used to construct an event phrase based on the event words, determine the weight information of each event word that makes up the event phrase, and generate phrase vector information corresponding to the event phrase according to the word vector information and the corresponding weight information. The extended word generation module is used to expand the search term based on the word vector information and the phrase vector information to obtain extended words corresponding to the search term. Specifically, the extended word generation module is used to: obtain a search word vector corresponding to the search word; determine that the search word vector exists in the word vector information and determine a first similarity between the search word vector and each word vector in the word vector information; select event words as candidate extended words based on the first similarity, a first similarity threshold, and a first quantity threshold; determine that the search word vector exists in the phrase vector information and obtain a second similarity between the search word vector and each phrase vector in the phrase vector information; select event phrases as candidate extended words based on the second similarity, a second similarity threshold, and a second quantity threshold; and filter all candidate extended words to determine the extended words. The event search module is used to perform event search processing based on the search terms and the extended terms.
10. An event search device, comprising: Memory; And a processor coupled to the memory, the processor being configured to perform the method as described in any one of claims 1 to 8 based on instructions stored in the memory.
11. A computer-readable storage medium that non-transitoryly stores computer instructions, which are executed by a processor according to any one of claims 1 to 8.