Message recognition methods, apparatus, devices, and computer storage media
By combining a multi-modal matching model and a keyword matching strategy, the problem of low accuracy and efficiency in message recognition in existing technologies is solved, and efficient and accurate identification and filtering of malicious messages across messages is achieved.
Patent Information
- Application Number
- CN202210214487.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-04
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-03-04
AI Technical Summary
Existing message recognition technologies are insufficient in terms of accuracy and efficiency, making it difficult to effectively identify and filter out harmful messages.
A multi-modal matching model is used for message recognition. Keyword matching results are constructed by pre-set keyword sets and iteratively updated by combining matching location information and strategies to achieve cross-message keyword recognition. The accuracy and efficiency of recognition are improved by combining and filtering strategies.
It improves the accuracy and efficiency of message recognition, effectively filtering out messages whose location relationships do not meet the keyword matching strategy, and reducing false positives.
Smart Images

Figure CN116738012B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer data processing technology, specifically to a message recognition method, apparatus, device, and computer storage medium. Background Technology
[0002] Currently, various applications may contain malicious users who post illegal and inappropriate messages such as harassing advertisements and reactionary attacks. The presence of such messages can lead to a poor user experience. Therefore, it is necessary to identify and filter out such messages sent between users.
[0003] The inventors of this application discovered during the implementation of embodiments of the present invention that existing message recognition methods suffer from low accuracy or efficiency. Summary of the Invention
[0004] In view of the above problems, embodiments of the present invention provide a message recognition method, apparatus, device, and computer storage medium to solve the problem of low accuracy or efficiency of message recognition in the prior art.
[0005] According to one aspect of the present invention, a message recognition method is provided, the method comprising:
[0006] Identify at least one message to be identified corresponding to the target user group;
[0007] Based on the at least one message to be identified, the multi-mode matching model is sequentially input into the message sending order to obtain the keyword matching result corresponding to the target user group; wherein, the multi-mode matching model is constructed based on a preset keyword set; the keyword matching result includes the matched keyword and the corresponding matching position information; before each message is input, the state of the multi-mode matching model and the keyword matching result are updated according to the previously input message;
[0008] The message recognition result corresponding to the at least one message to be recognized is determined based on the keyword matching result and at least one keyword matching strategy corresponding to the keyword set.
[0009] In one optional approach, the keyword matching strategy includes a combination strategy and a filtering strategy; the message recognition result includes the target message and the corresponding hit strategy; the hit strategy is at least one of the keyword matching strategies; the method further includes:
[0010] The message to be identified is filtered according to the matching location information and the filtering strategy to obtain the first candidate message;
[0011] The target message and its corresponding hit strategy are determined based on the matching keywords included in the first candidate message and the combination strategy; the hit strategy is at least one of the combination strategies.
[0012] In one alternative approach, the filtering strategy includes a distance threshold; the method further includes:
[0013] The distance between the matching keywords is determined based on the matching location information;
[0014] The matching keywords are filtered based on the distance and the distance threshold to obtain the first hit keyword;
[0015] The message to be identified, which includes the first hit keyword, is determined as the first candidate message.
[0016] In an optional embodiment, the keyword matching result further includes the total length of the input message; the method further includes:
[0017] Before the current message to be identified is input, the initial state of the multi-mode matching model is set according to the temporary state of the multi-mode matching model after the previous message input;
[0018] The length of the matching keywords output by the multi-modal matching model after the state setting is determined for the currently input message to be identified;
[0019] When it is determined that the current message to be identified has been input, the total length of the input information is updated according to the length of the currently input message to be identified;
[0020] The matching location information is updated based on the length of the matching keyword and the updated total length of the input message.
[0021] In an alternative approach, the method further includes:
[0022] The message to be identified is filtered according to the total length of the input message, the matching position information, and the filtering strategy to obtain a second candidate message;
[0023] The target message and the corresponding hit strategy are determined based on the matching keywords and the combination strategy included in the second alternative message.
[0024] In one alternative approach, the filtering strategy includes a length threshold; the method further includes:
[0025] The matching location information is standardized based on the length threshold and the total length of the input messages to obtain the processed matching location information.
[0026] The matching keywords are filtered based on the processed matching location information to obtain the second hit keyword;
[0027] The message to be identified, which includes the second hit keyword, is determined as the second candidate message.
[0028] In one alternative approach, the filtering strategy further includes a frequency threshold; the method further includes:
[0029] The frequency of occurrence of each matching keyword is determined based on the matching location information;
[0030] The messages to be identified are filtered based on the frequency of occurrence and the frequency threshold to obtain the first candidate messages.
[0031] According to another aspect of the present invention, a message recognition device is provided, comprising:
[0032] The first determining module is used to determine at least one message to be identified corresponding to the target user group;
[0033] The input module is used to sequentially input the at least one message to be identified into a multi-mode matching model according to the message sending order to obtain the keyword matching result corresponding to the target user group; wherein, the multi-mode matching model is constructed based on a preset keyword set; the keyword matching result includes the matching keyword and the corresponding matching position information; before each message is input, the state of the multi-mode matching model and the keyword matching result are updated according to the previously input message;
[0034] The second determining module is used to determine the message identification result corresponding to the at least one message to be identified based on the keyword matching result and the at least one keyword matching strategy.
[0035] According to another aspect of the present invention, a message recognition device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;
[0036] The memory is used to store at least one executable instruction that causes the processor to perform the operation of the message recognition method as described in any embodiment.
[0037] In one alternative, a computer-readable medium is provided, the storage medium storing at least one executable instruction that, when executed on a message recognition device, causes the message recognition device to perform operations as described in any embodiment of the message recognition method.
[0038] This invention identifies at least one message to be identified corresponding to a target user group; it then sequentially inputs this message into a multi-mode matching model according to the message sending order to obtain keyword matching results for the target user group. The multi-mode matching model is constructed based on a preset keyword set. The keyword matching results include matched keywords and corresponding matching position information. Before each message input, the state of the multi-mode matching model and the keyword matching results are updated based on the previously input message. By iteratively updating the model's state and matching results based on the previously input message, keyword identification across messages can be achieved without merging multiple messages, thereby improving message identification efficiency. Finally, based on the keyword matching results and at least one keyword matching strategy, the message identification result corresponding to at least one message to be identified is determined. This allows for further filtering of identified cross-message keywords by combining matching position information and keyword matching strategies, filtering out messages whose positional relationships do not meet the keyword matching strategy, such as keyword combinations with excessively large positions, thereby improving message identification accuracy.
[0039] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0040] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0041] Figure 1 A flowchart illustrating the message recognition method provided in an embodiment of the present invention is shown;
[0042] Figure 2 A schematic diagram of the structure of the AC automaton provided in an embodiment of the present invention is shown;
[0043] Figure 3 A flowchart illustrating a message recognition method provided in another embodiment of the present invention is shown;
[0044] Figure 4 A flowchart illustrating a message recognition method provided in another embodiment of the present invention is shown;
[0045] Figure 5 A schematic diagram of the structure of the message recognition device provided in an embodiment of the present invention is shown;
[0046] Figure 6 A schematic diagram of the structure of the message recognition device provided in an embodiment of the present invention is shown. Detailed Implementation
[0047] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0048] Before describing the message recognition method of this invention, the relevant terms will be explained:
[0049] Pattern matching: A basic operation of strings in data structures. Given a substring, find all substrings in a given string that are identical to the given substring.
[0050] Multipattern matching: A type of pattern matching used to match multiple pattern strings from a given string. Commonly used multipattern matching algorithms include Trie trees, the Aho-Corasick (AC) algorithm, and the WM algorithm. The core idea of the AC (Aho-Corasick) algorithm is to cleverly transform character comparisons into state transitions using finite automata.
[0051] Automaton: Starting from the first character of the main string and the initial state 0 of the automaton, if the character is matched successfully, the automaton's goto (transition) function is used to transition to the next state; and if the transition state has an output (output) function, the matched pattern string is output; if the character is not matched, the automaton's failure (match failure) function is used to recursively transition.
[0052] Figure 1 A flowchart of a message recognition method provided in an embodiment of the present invention is shown. This method is executed by a computer processing device. The computer processing device may include a mobile phone, a laptop computer, etc. Figure 1 As shown, the method includes at least steps 10-30:
[0053] Step 10: Identify at least one message to be identified corresponding to the target user group.
[0054] In one embodiment of the present invention, the target user group includes at least one sending user and one receiving user, wherein the sending user sends at least one message to be identified to the receiving user. Specifically, at least one message to be identified can be obtained, and the corresponding target user group can be determined according to the sender and receiver identifiers in the message to be identified.
[0055] Step 20: Input the at least one message to be identified into the multi-mode matching model in the order of message sending to obtain the keyword matching result corresponding to the target user group; wherein, the multi-mode matching model is constructed based on a preset keyword set; the keyword matching result includes the matched keyword and the corresponding matching position information; before each message is input, the state of the multi-mode matching model and the keyword matching result are updated according to the previously input message.
[0056] In one embodiment of the present invention, a multi-modal matching model is used for string matching, specifically an Aho-Corasick automaton model. The keyword set includes at least one keyword to be identified, and a keyword can consist of at least one character. The matching position information can be the starting position of the matched keyword in the message input sequence corresponding to the target user group. The message input sequence consists of at least one message to be identified arranged in the order it was sent.
[0057] In one embodiment of the present invention, the keyword matching results and the state of the multi-mode matching model can be stored in a cache in the form of a hash table, wherein the hash table includes at least a number of key-value pairs, the key of which is the identifier of the target user group, and the value of which is the state of the multi-mode matching model, the matching keyword, and at least one of the matching keyword.
[0058] In one embodiment of the present invention, considering that in addition to matching preset keywords, keywords also need to be filtered according to the context of the text in which the keyword appears, the keyword matching result also includes the total length of the input message.
[0059] In another embodiment of the invention, a hash table can be added to the cache area to store the keyword matching results corresponding to the target user group. For example... Figure 3 As shown, the key value of the hash table is "sender identifier + receiver identifier". The key field is allocated 20 bytes of memory, and "sender + receiver" are uniformly converted into a hash value for storage. Each key value corresponds to a value containing three fields: "current automaton state", "cache text length", and "list of matched keywords and positions". The cache text length refers to the total length of the input message, and the matched keywords are the keywords used for matching. These three fields are allocated 4 bytes, 2 bytes, and 120 bytes of memory respectively. The automaton state is represented by an integer variable, which can represent a maximum text length of 65535. The matched keywords are represented by an integer variable and stored using 4 bytes. The position information is stored using 2 bytes. One matched keyword and position information occupies 6 bytes, and a total of 20 matched keywords and position information can be cached. Each key-value structure occupies 146 bytes of memory.
[0060] In another embodiment of the present invention, step 20 further includes: step 201: before the current message to be identified is input, the initial state of the multi-mode matching model is set according to the temporary state of the multi-mode matching model after the previous message input.
[0061] In one embodiment of the present invention, the multi-mode matching model can be an automaton, more specifically, an Aho-Corasick automaton. The temporary state of the Aho-Corasick automaton after the input of the previous message is set as the initial state of the Aho-Corasick automaton, so that matching begins from the set initial state after the input of the next message.
[0062] When the preset keywords are "app" and "os", the constructed AC automaton can be referenced. Figure 2 As shown. Combined Figure 2 as well as Figure 3 The working process of the AC automaton is explained as follows: it sequentially receives message 1 (appo) and message 2 (send) corresponding to the same group of receiving and sending users, and inputs message 1... Figure 2 The AC automaton is shown below. When the last character "o" of the message to be recognized is input, the state of the AC automaton is "4". At this time, the sender + receiver "A+B" is used as the key. After the message ends, the automaton state is "4", the total length of the input message is "4", and the list of hit keywords and positions "app:0" is used as the value. This is written into a hash table as shown below. Figure 3 In the buffer shown. Before the message to be identified, 2, enters the input queue of the AC automaton, it first searches in the hash table of the buffer. The input key is sender + receiver "A+B". If a value is found, the automaton is in state "4" after reading the message in the value. The initial state of the AC automaton is set to "4" before matching.
[0063] Step 202: Determine the length of the matching keywords output by the multi-modal matching model after the state setting for the currently input message to be identified.
[0064] In one embodiment of the present invention, when a matching keyword exists, the multi-modal matching model after setting the state will output the matched keyword. The length of the matching keyword can be the number of characters. For example, the length of the matching keyword "os" is 2.
[0065] Step 203: When it is determined that the current message to be identified has been input, update the total length of the input information according to the length of the currently input message to be identified.
[0066] In one embodiment of the present invention, the total length of the input information is the sum of the lengths of all previously input messages to be identified. Therefore, the length of the currently input message to be identified is added to the total length of the input information for updating.
[0067] Continue to combine Figure 3 Using the example from the aforementioned embodiment, when the first character "s" of message 2 is input, since the initial state of the AC automaton is "4", after the input is "s", the state changes to "5", and "5" is the output state. At the same time, the total length of the input information is increased by 1, resulting in "5".
[0068] Step 204: Update the matching location information according to the length of the matching keyword and the updated total length of the input message.
[0069] In one embodiment of the present invention, the matching position information may be the position of the matching keyword in the input message sequence consisting of all input messages to be identified, specifically the starting position. Therefore, the difference between the updated total length of the input messages and the length of the matching keyword is determined as the starting position of the matching keyword.
[0070] As in the example above, if the starting position of the matching keyword in the text is the length of the cache file (5) - the length of the text of the currently input message to be identified (i.e., "os") (2), then the matching position information is "3".
[0071] Step 30: Determine the message recognition result corresponding to the at least one message to be recognized based on the keyword matching result and at least one keyword matching strategy corresponding to the keyword set.
[0072] In one embodiment of the present invention, the keyword matching strategy includes a combination strategy and a filtering strategy. The combination strategy is used to combine key groups for matching, and the filtering strategy is used to filter keywords that do not meet preset conditions.
[0073] As in the example above, the final output message recognition result is "os:3", that is, the keyword "os" across message 1 and message 2 was successfully matched, with its starting position being 3.
[0074] Considering that in actual production processes, without constraints within a certain text range, the large volume of message input might lead to misjudgments of keyword combinations due to two keywords being too far apart. Therefore, it is necessary to impose contextual constraints on the matched keywords and discard keywords that exceed the text constraints.
[0075] Therefore, in another embodiment of the present invention, the keyword matching strategy includes a combination strategy and a filtering strategy; wherein, the combination strategy includes logical relationships, sequential relationships and positional relationships between keywords, such as the appearance logic of keywords like AND, OR and NOT, and the sequential relationship represents the order in which matching keywords appear in the context, etc.
[0076] A filtering strategy refers to a strategy that filters matching keywords based on preset contextual constraints, thereby selecting keyword combinations that do not meet the requirements based on the context and improving the accuracy of message recognition. Contextual constraints are used to indicate that the message appearing with the matching keywords is context-related, rather than belonging to an unrelated dialogue process. Contextual constraints can be positional constraints on the matching keywords, such as the distance between matching keyword positions should be less than a position threshold. This distance threshold is used to characterize the general distance between matching keywords when expressing the semantic meaning of their combination.
[0077] Furthermore, contextual constraints can also apply to keyword positions and the total length of the entire associated message, such as the total length of all messages to be identified should be less than a length threshold, which is used to characterize the message length that a normal dialogue process should contain.
[0078] The message recognition result includes the target message and the corresponding matching strategy; the target message refers to the message to be identified containing the keywords in the keyword combination matched by the matching strategy. The keyword combination includes at least one of the aforementioned preset keywords. The matching strategy comprises the matching strategy and filtering strategy for the matched keyword combination, and the matching strategy is at least one of the keyword matching strategies.
[0079] Step 30 also includes:
[0080] Step 301: Filter the message to be identified according to the matching location information and the filtering strategy to obtain the first candidate message.
[0081] In one embodiment of the present invention, the filtering strategy includes a filtering type and a threshold corresponding to the filtering type. The filtering type refers to the type of object on which the filtering is based. The object may be the distance and / or order between matching keywords, the context length of the message containing the keyword, and the frequency of occurrence of the matching keyword, etc.
[0082] Therefore, in one embodiment of the present invention, the filtering strategy includes a distance threshold; step 301 further includes:
[0083] Step 3012: Determine the distance between the matching keywords based on the matching location information.
[0084] In one embodiment of the present invention, the order and start and end positions of each matching keyword are determined according to the matching position information, and the difference between the start and end positions of the preceding matching keyword and the following matching keyword is determined as the distance between a pair of matching keywords.
[0085] Step 3013: Filter the matching keywords according to the distance and the distance threshold to obtain the first hit keyword.
[0086] In one embodiment of the present invention, matching keywords with a distance less than a distance threshold are identified as first hit keywords, thereby filtering out cases where the matching keywords belong to unrelated contexts. This avoids combining unrelated matching keywords, which could lead to false hits on the combination strategy and improve the accuracy of the strategy hit.
[0087] Step 3014: The message to be identified that includes the first hit keyword is determined as the first candidate message.
[0088] In one embodiment of the present invention, when the first hit keyword is segmented into parts existing in multiple messages to be identified, the messages to be identified containing each part are all determined as the first candidate messages.
[0089] Furthermore, considering that some keywords, due to their grammatical or semantic characteristics, can only represent a specific meaning when they appear multiple times consecutively or at intervals, in another embodiment of the present invention, the filtering strategy further includes a frequency threshold. The frequency threshold is used to characterize the number of times the matching keyword appears and its frequency, where frequency can characterize the occurrence of a certain number of characters at a time.
[0090] Step 301 further includes: Step 3015: Determine the frequency of occurrence of each of the matching keywords based on the matching location information.
[0091] In one embodiment of the present invention, the number of times each matching keyword appears is determined based on its position, and the frequency of its appearance is determined based on the distance between the positions, such as once every 10 characters.
[0092] Step 3016: Filter the message to be identified according to the occurrence frequency and the frequency threshold to obtain the first candidate message.
[0093] In one embodiment of the present invention, matching keywords with a distance less than a distance threshold are identified as first hit keywords, thereby filtering out cases where the matching keywords belong to unrelated contexts. This avoids combining unrelated matching keywords and mishitting the combination strategy, thereby improving the accuracy of the strategy hit.
[0094] Furthermore, even if the distance between keywords meets the threshold for keywords in an independent conversation, the number of characters in a typical conversation, i.e., the length of the context text, is within a certain range. Therefore, in addition to filtering keywords based on the distance between matching keywords, we can also filter the length of the input message based on a length threshold, thereby filtering out the matching results of the nearest preset number of characters.
[0095] In one embodiment of the present invention, step 30 further includes: step 302: filtering the message to be identified according to the total length of the input message, the matching position information and the filtering strategy to obtain a second candidate message.
[0096] In one embodiment of the present invention, the filtering strategy includes a preset context length threshold, and the matching position information is standardized according to the length threshold. The standardization process may include offset processing, which is used to shift the absolute position of the matching keyword forward or backward, i.e., to prune the context, so that the matching keyword output by the automaton appears within a preset range.
[0097] In one embodiment of the present invention, the filtering strategy includes a length threshold; the length threshold is used to characterize; step 302 further includes:
[0098] Step 3021: Standardize the matching location information according to the length threshold and the total length of the input messages to obtain the processed matching location information.
[0099] In one embodiment of the present invention, the standardization process may involve offsetting the matching position information based on a length threshold. Specifically, the offsetting process may involve subtracting the length threshold from the matching position.
[0100] Continuing with the previous example, when the last character "d" of the message to be identified 2 is matched, the sender + receiver "A+B" is used as the key, the AC automaton state is "0" after the message ends, the total length of the input message is "8", and the matching keywords and position list "app:0, os:3" is used as the value and written into the buffer as a hash table.
[0101] like Figure 4 As shown, the keyword matching strategy "(app)&(os)" is true at this point. If the length threshold is "6", only the most recent 6 characters of the matching results are returned. If the total length of the entered message is found to be greater than "6", such as "8", then the total length of the entered message needs to be changed to "6", as shown. Figure 4The hash table below shows the "Total Length of Input Messages". Since the difference between "8" and "6" is 2, the starting position of each hit keyword in the text needs to be reduced by 2, resulting in "app: -2, os: 1".
[0102] Step 3022: Filter the matching keywords according to the processed matching position information to obtain the second hit keyword.
[0103] In one embodiment of the present invention, corresponding to the offset processing method, matching keywords with a starting position less than zero in the matching position information are filtered out.
[0104] It should be noted that the filtering method corresponds to the offset processing method, and its purpose is to filter out the matching keywords contained in the part of the matching results that exceeds the required matching text length.
[0105] Based on the previous example, since the keyword "app" starts with a negative number in the text, the keyword "app" is discarded, and only "os:1" is retained. Figure 4 As shown in the table below, the strategy "(app)&(os)" is determined to be false at this point. This ensures keyword matching within a certain text range.
[0106] Step 3023: The message to be identified, which includes the second hit keyword, is determined as the second candidate message.
[0107] Step 3023 is similar to step 3014, and will not be described again.
[0108] Step 3024: Determine the target message and the corresponding hit strategy based on the matching keywords and the combination strategy included in the second alternative message.
[0109] In one embodiment of the present invention, combinations of matching keywords are filtered according to a combination strategy to obtain the matching strategy corresponding to the matched keyword combinations. The message to be identified containing the keywords corresponding to the matching strategy is determined as the target message.
[0110] Step 303: Determine the target message and the corresponding hit strategy based on the matching keywords and the combination strategy included in the first candidate message.
[0111] Step 303 is similar to step 3024 described above, and will not be repeated here.
[0112] The message recognition method of this invention determines at least one message to be recognized corresponding to a target user group; it then sequentially inputs the at least one message to be recognized into a multi-mode matching model according to the message sending order to obtain the keyword matching result corresponding to the target user group; wherein, the multi-mode matching model is constructed based on a preset keyword set; the keyword matching result includes the matched keyword and the corresponding matching position information; wherein, before each message is input, the state of the multi-mode matching model and the keyword matching result are updated according to the previously input message. By iteratively updating the state of the model and the matching result based on the previously input message to be recognized, keyword recognition across messages can be achieved without merging multiple messages to be recognized, thereby improving the efficiency of message recognition. Finally, the message recognition result corresponding to at least one message to be recognized is determined based on the keyword matching result and at least one keyword matching strategy. This allows for further filtering of the identified cross-message keywords by combining the matching position information and the keyword matching strategy, filtering out messages whose positional relationship does not meet the keyword matching strategy, such as keyword combinations that are too far apart in position, thereby improving the accuracy of message recognition.
[0113] Figure 5 A schematic diagram of the structure of a message recognition device provided in an embodiment of the present invention is shown. Figure 5 As shown, the device 400 includes: a first determining module 401, an input module 402, and a second determining module 403.
[0114] The first determining module 401 is used to determine at least one message to be identified corresponding to the target user group;
[0115] The input module 402 is used to sequentially input the at least one message to be identified into a multi-mode matching model according to the message sending order to obtain the keyword matching result corresponding to the target user group; wherein, the multi-mode matching model is constructed according to a preset keyword set; the keyword matching result includes the matching keyword and the corresponding matching position information; before each message is input, the state of the multi-mode matching model and the keyword matching result are updated according to the previously input message;
[0116] The second determining module 403 is used to determine the message recognition result corresponding to the at least one message to be recognized based on the keyword matching result and at least one keyword matching strategy corresponding to the keyword set.
[0117] The operation process performed by the message recognition device in this embodiment of the invention is largely the same as that in the aforementioned method embodiment, and will not be described again.
[0118] The message recognition device of this invention determines at least one message to be recognized corresponding to a target user group; it then sequentially inputs the at least one message to be recognized into a multi-mode matching model according to the message sending order to obtain the keyword matching result corresponding to the target user group; wherein, the multi-mode matching model is constructed based on a preset keyword set; the keyword matching result includes the matched keyword and the corresponding matching position information; wherein, before each message is input, the state of the multi-mode matching model and the keyword matching result are updated according to the previously input message. By iteratively updating the state of the model and the matching result according to the previously input message to be recognized, keyword recognition across messages can be achieved without merging multiple messages to be recognized, thereby improving the efficiency of message recognition. Finally, the message recognition result corresponding to at least one message to be recognized is determined based on the keyword matching result and at least one keyword matching strategy. This allows for further filtering of the identified cross-message keywords by combining the matching position information and the keyword matching strategy, filtering out messages whose positional relationship does not meet the keyword matching strategy, such as keyword combinations that are too far apart in position, thereby improving the accuracy of message recognition.
[0119] Figure 6 The diagram shows a schematic of the message recognition device provided in an embodiment of the present invention. The specific implementation of the message recognition device is not limited by the specific embodiments of the present invention.
[0120] like Figure 6 As shown, the message recognition device may include: a processor 502, a communications interface 504, a memory 506, and a communications bus 508.
[0121] The processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508. Communication interface 504 is used to communicate with other network elements such as clients or other servers. The processor 502 executes program 510, specifically performing the relevant steps described above in the message recognition method embodiment.
[0122] Specifically, program 510 may include program code, which includes computer-executable instructions.
[0123] Processor 502 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The message recognition device may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.
[0124] Memory 506 is used to store program 410. Memory 506 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0125] Specifically, program 510 can be called by processor 502 to cause the message recognition device to perform the following operations:
[0126] Identify at least one message to be identified corresponding to the target user group;
[0127] Based on the at least one message to be identified, the multi-mode matching model is sequentially input into the message sending order to obtain the keyword matching result corresponding to the target user group; wherein, the multi-mode matching model is constructed based on a preset keyword set; the keyword matching result includes the matched keyword and the corresponding matching position information; before each message is input, the state of the multi-mode matching model and the keyword matching result are updated according to the previously input message;
[0128] The message recognition result corresponding to the at least one message to be recognized is determined based on the keyword matching result and at least one keyword matching strategy corresponding to the keyword set.
[0129] The operation process performed by the message recognition device in this embodiment of the invention is largely the same as that in the aforementioned method embodiments, and will not be described again.
[0130] The message recognition device of this invention determines at least one message to be recognized corresponding to a target user group; it then sequentially inputs the at least one message to be recognized into a multi-mode matching model according to the message sending order to obtain the keyword matching result corresponding to the target user group; wherein, the multi-mode matching model is constructed based on a preset keyword set; the keyword matching result includes the matched keyword and the corresponding matching position information; wherein, before each message is input, the state of the multi-mode matching model and the keyword matching result are updated according to the previously input message. By iteratively updating the state of the model and the matching result according to the previously input message to be recognized, keyword recognition across messages can be achieved without merging multiple messages to be recognized, thereby improving the efficiency of message recognition. Finally, the message recognition result corresponding to at least one message to be recognized is determined based on the keyword matching result and at least one keyword matching strategy. This allows for further filtering of the identified cross-message keywords by combining the matching position information and the keyword matching strategy, filtering out messages whose positional relationship does not meet the keyword matching strategy, such as keyword combinations that are too far apart in position, thereby improving the accuracy of message recognition.
[0131] This invention provides a computer-readable storage medium storing at least one executable instruction that, when executed on a message recognition device, causes the message recognition device to perform the message recognition method described in any of the above method embodiments.
[0132] Specifically, the executable instructions can be used to cause the message recognition device to perform the following operations:
[0133] Identify at least one message to be identified corresponding to the target user group;
[0134] Based on the at least one message to be identified, the multi-mode matching model is sequentially input into the message sending order to obtain the keyword matching result corresponding to the target user group; wherein, the multi-mode matching model is constructed based on a preset keyword set; the keyword matching result includes the matched keyword and the corresponding matching position information; before each message is input, the state of the multi-mode matching model and the keyword matching result are updated according to the previously input message;
[0135] The message recognition result corresponding to the at least one message to be recognized is determined based on the keyword matching result and at least one keyword matching strategy corresponding to the keyword set.
[0136] The operation process performed by the executable instructions stored in the computer storage medium of this invention embodiment is largely the same as that of the aforementioned method embodiment, and will not be repeated here.
[0137] The executable instructions stored in the computer storage medium of this invention determine at least one message to be identified corresponding to a target user group; input the at least one message to be identified sequentially into a multi-mode matching model according to the message sending order to obtain the keyword matching result corresponding to the target user group; wherein, the multi-mode matching model is constructed based on a preset keyword set; the keyword matching result includes the matched keyword and the corresponding matching position information; wherein, before each message is input, the state of the multi-mode matching model and the keyword matching result are updated according to the previously input message. By iteratively updating the state of the model and the matching result according to the previously input message to be identified, keyword identification across messages can be achieved without merging multiple messages to be identified, thereby improving the efficiency of message identification. Finally, the message identification result corresponding to at least one message to be identified is determined according to the keyword matching result and at least one keyword matching strategy. The identified cross-message keywords can be further filtered by combining the matching position information and the keyword matching strategy, filtering out messages whose positional relationship does not meet the keyword matching strategy, such as keyword combinations that are too far apart in position, thereby improving the accuracy of message identification.
[0138] This invention provides a message recognition device for performing the above-described message recognition method.
[0139] This invention provides a computer program that can be called by a processor to cause a message recognition device to execute the message recognition method in any of the above method embodiments.
[0140] This invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions, which, when executed on a computer, cause the computer to perform the message recognition method described in any of the above method embodiments.
[0141] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of the present invention are not directed to any particular programming language. It should be understood that the content of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0142] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0143] Similarly, it should be understood that, in order to streamline the invention and aid in understanding one or more of the various aspects of the invention, features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.
[0144] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0145] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.
Claims
1. A message recognition method, characterized in that, The method includes: Identify at least one message to be identified corresponding to the target user group; Based on the at least one message to be identified, the multi-mode matching model is sequentially input into the message sending order to obtain the keyword matching result corresponding to the target user group; wherein, the multi-mode matching model is constructed based on a preset keyword set; the keyword matching result includes the matched keyword and the corresponding matching position information; before each message is input, the state of the multi-mode matching model and the keyword matching result are updated according to the previously input message; The message recognition result corresponding to the at least one message to be recognized is determined based on the keyword matching result and at least one keyword matching strategy corresponding to the keyword set.
2. The method according to claim 1, characterized in that, The keyword matching strategy includes a combination strategy and a filtering strategy; the message recognition result includes the target message and the corresponding hit strategy; the hit strategy is at least one of the keyword matching strategies; Determining the message identification result corresponding to the at least one message to be identified based on the keyword matching result and the at least one keyword matching strategy includes: The message to be identified is filtered according to the matching location information and the filtering strategy to obtain the first candidate message; The target message and its corresponding hit strategy are determined based on the matching keywords included in the first candidate message and the combination strategy; the hit strategy is at least one of the combination strategies.
3. The method according to claim 2, characterized in that, The filtering strategy includes a distance threshold; the step of filtering the message to be identified based on the matching location information and the filtering strategy to obtain a first candidate message includes: The distance between the matching keywords is determined based on the matching location information; The matching keywords are filtered based on the distance and the distance threshold to obtain the first hit keyword; The message to be identified, which includes the first hit keyword, is determined as the first candidate message.
4. The method according to claim 1, characterized in that, The keyword matching result also includes the total length of the input messages; before each message is input, the state of the multi-modal matching model and the keyword matching result are updated based on the previously input message, including: Before the current message to be identified is input, the initial state of the multi-mode matching model is set according to the temporary state of the multi-mode matching model after the previous message input; The length of the matching keywords output by the multi-modal matching model after the state setting is determined for the currently input message to be identified; When it is determined that the current message to be identified has been input, the total length of the input messages is updated according to the length of the currently input message to be identified. The matching location information is updated based on the length of the matching keyword and the updated total length of the input message.
5. The method according to claim 4, characterized in that, The keyword matching strategy includes a combination strategy and a filtering strategy; the message recognition result includes the target message and the corresponding hit strategy; the hit strategy is at least one of the keyword matching strategies; The step of determining the message identification result corresponding to the at least one message to be identified based on the keyword matching result and the at least one keyword matching strategy further includes: The message to be identified is filtered according to the total length of the input message, the matching position information, and the filtering strategy to obtain a second candidate message; The target message and the corresponding hit strategy are determined based on the matching keywords and the combination strategy included in the second alternative message.
6. The method according to claim 5, characterized in that, The filtering strategy includes a length threshold; the step of filtering the message to be identified based on the total length of the input message, the matching position information, and the filtering strategy to obtain a second candidate message includes: The matching location information is standardized based on the length threshold and the total length of the input messages to obtain the processed matching location information. The matching keywords are filtered based on the processed matching location information to obtain the second hit keyword; The message to be identified, which includes the second hit keyword, is determined as the second candidate message.
7. The method according to claim 2, characterized in that, The filtering strategy further includes a frequency threshold; the step of filtering the message to be identified based on the matching location information and the filtering strategy to obtain a first candidate message includes: The frequency of occurrence of each matching keyword is determined based on the matching location information; The messages to be identified are filtered based on the frequency of occurrence and the frequency threshold to obtain the first candidate messages.
8. A message recognition device, characterized in that, The device includes: The first determining module is used to determine at least one message to be identified corresponding to the target user group; The input module is used to sequentially input the at least one message to be identified into a multi-mode matching model according to the message sending order to obtain the keyword matching result corresponding to the target user group; wherein, the multi-mode matching model is constructed based on a preset keyword set; the keyword matching result includes the matching keyword and the corresponding matching position information; before each message is input, the state of the multi-mode matching model and the keyword matching result are updated according to the previously input message; The second determining module is used to determine the message recognition result corresponding to the at least one message to be recognized based on the keyword matching result and at least one keyword matching strategy corresponding to the keyword set.
9. A message recognition device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation of the message recognition method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores at least one executable instruction, which, when executed on the message recognition device, causes the message recognition device to perform the operation of the message recognition method as described in any one of claims 1-7.
Citation Information
Patent Citations
Dynamic message filtering
CN101069175A
Keyword notification method, equipment and computer program product based on character recognition
CN105518712A