Method and apparatus for processing text information
First Claim
1. A method for processing text information, comprising:
- obtaining, by a terminal, text information and extracting, by the terminal, text characters contained in the text information;
extracting, by the terminal, from the text characters, target characters satisfying a predetermined rule;
calculating, by the terminal, a filtering index of the text information according to the target characters;
when the filtering index meets a predetermined condition, executing, by the terminal, an operation corresponding to the predetermined condition on the text information;
wherein the step of calculating, by the terminal, the filtering index of the text information according to the target characters comprises;
separately converting the text characters and the target characters into characters in a given encoding form; and
calculating a ratio of a total number of bytes of the converted target characters to a total number of bytes of remaining characters in the converted text characters excluding the converted target characters, and using the ratio as the filtering index of the text information; and
wherein, when the filtering index meets the predetermined condition, executing, by the terminal, the operation corresponding to the predetermined condition on the text information comprises;
analyzing a magnitude relationship between the filtering index and a preset numerical range, and assigning a corresponding weight value to the filtering index according to an analysis result and a preset weight table, andwhen a value obtained after assigning the corresponding weight value to the filtering index according to the analysis result and the preset weight table meets the predetermined condition, executing, by the terminal, the operation corresponding to the predetermined condition on the text information comprises.
1 Assignment
0 Petitions
Accused Products
Abstract
The present application relates to a A method for processing text information is provided, the method including: obtaining text information and extracting text characters contained in the text information; extracting, from the text characters, target characters satisfying a predetermined rule; calculating a filtering index of the text information according to the target characters; and when the filtering index meets a predetermined condition, executing an operation corresponding to the predetermined condition on the text information. In addition, an apparatus for processing text information is further provided. The method and apparatus for processing text information can improve the accuracy and efficiency of filtering out junk text information.
3 Citations
14 Claims
-
1. A method for processing text information, comprising:
-
obtaining, by a terminal, text information and extracting, by the terminal, text characters contained in the text information; extracting, by the terminal, from the text characters, target characters satisfying a predetermined rule; calculating, by the terminal, a filtering index of the text information according to the target characters; when the filtering index meets a predetermined condition, executing, by the terminal, an operation corresponding to the predetermined condition on the text information; wherein the step of calculating, by the terminal, the filtering index of the text information according to the target characters comprises;
separately converting the text characters and the target characters into characters in a given encoding form; and
calculating a ratio of a total number of bytes of the converted target characters to a total number of bytes of remaining characters in the converted text characters excluding the converted target characters, and using the ratio as the filtering index of the text information; andwherein, when the filtering index meets the predetermined condition, executing, by the terminal, the operation corresponding to the predetermined condition on the text information comprises; analyzing a magnitude relationship between the filtering index and a preset numerical range, and assigning a corresponding weight value to the filtering index according to an analysis result and a preset weight table, and when a value obtained after assigning the corresponding weight value to the filtering index according to the analysis result and the preset weight table meets the predetermined condition, executing, by the terminal, the operation corresponding to the predetermined condition on the text information comprises. - View Dependent Claims (2, 3, 4, 6, 7)
-
-
5. A method for processing text information, the method comprising:
-
obtaining, by a terminal, text information and extracting, by the terminal, text characters contained in the text information; extracting, by the terminal, from the text characters, target characters satisfying a predetermined rule; calculating, by the terminal, a filtering index of the text information according to the target characters; when the filtering index meets a predetermined condition, executing, by the terminal, an operation corresponding to the predetermined condition on the text information; wherein the calculating, by the terminal, the filtering index of the text information according to the target characters comprises;
separately converting the text characters and the target characters into characters in a given encoding form; and
calculating a ratio of a total number of bytes of the converted target characters to a total number of bytes of remaining characters in the converted text characters excluding the converted target characters, and using the ratio as the filtering index of the text information; andwherein, when the filtering index meets a predetermined condition, the executing, by the terminal, the operation corresponding to the predetermined condition on the text information comprises; analyzing a magnitude relationship between the filtering index and a preset numerical range, and assigning a corresponding weight value to the filtering index according to an analysis result and a preset weight table; analyzing the text characters to determine whether the text characters contain characters matching preset target keywords and analyzing the situation of the characters that are contained in the text characters and match the target keywords, and assigning a corresponding weight value to an analysis result according to the preset weight table; obtaining a user identifier of a sender of the text information, matching the user identifier with user identifiers in a preset blacklist and whitelist, and assigning a corresponding weight value to a matching result according to the preset weight table; and obtaining respective base values of the filtering index, the analysis result, and the matching result, and performing a weighting operation on the respective base values, the weight value corresponding to the filtering index, the weight value corresponding to the analysis result, and the weight value corresponding to the matching result; and when a value obtained after the weighting operation is greater than a preset numerical value, determining that the text information is the junk text information, and executing the corresponding operation on the text information.
-
-
8. An apparatus for processing text information, comprising:
-
a memory storing instructions; and a processor in communication with the memory, wherein, when the processor executes the instructions, the processor is configured to cause the apparatus to; obtain text information and extract text characters contained in the text information; extract, from the text characters, target characters satisfying a predetermined rule; calculate a filtering index of the text information according to the target characters; when the calculated filtering index meets a predetermined condition, execute an operation corresponding to the predetermined condition on the text information; wherein, when the processor is configured to cause the apparatus to calculate the filtering index of the text information according to the target characters, the processor is configured to cause the apparatus to separately convert the text characters and the target characters into characters in a given encoding form; and
calculate a ratio of a total number of bytes of the converted target characters to a total number of bytes of remaining characters in the converted text characters excluding the converted target characters, and use the ratio as the filtering index of the text information; andwherein, when the processor is configured to cause the apparatus to execute the operation corresponding to the predetermined condition on the text information, the processor is configured to cause the apparatus to; analyze a magnitude relationship between the filtering index and a preset numerical range, and assign a corresponding weight value to the filtering index according to an analysis result and a preset weight table, and when a value obtained after assigning the corresponding weight value to the filtering index according to the analysis result and the preset weight table meets the predetermined condition, execute the operation corresponding to the predetermined condition on the text information comprises. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
Specification