Text classification device, method, and program
The text classification method employs a dual comparison string generation and determination process to efficiently classify text with variable strings, addressing inefficiencies in conventional methods by reducing classification time to text length proportionality.
Patent Information
- Application Number
- JP2021026369
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-02-22
- Publication Date
- 2025-11-26
- Estimated Expiration
- 2041-02-22
AI Technical Summary
Conventional text classification methods are inefficient due to their reliance on keyword frequency analysis, leading to large-scale systems and prolonged determination times, especially when variable string portions are present, and existing pattern classification methods are slow when variable strings are not limited to the end of the text.
A text classification method that uses pattern classification rules with a first and second comparison string generation and determination process, deleting characters from both ends of the text string to match fixed patterns, reducing classification time to be proportional to the text length.
Enables rapid text classification even with variable strings in the middle or at the beginning, while maintaining efficiency by classifying text strings with fixed and variable components.
Smart Images

Figure 0007775572000001 
Figure 0007775572000002 
Figure 0007775572000003
Abstract
Description
[Technical Field]
[0001] The present invention relates to a text classification device, method, and program that classify a text string to be classified based on which of a plurality of pattern strings the text string matches. [Background technology]
[0002] Recently, a text classification method has been known that can classify input text into categories at low cost without morphological analysis, which requires a morphological dictionary for text classification processing (see Patent Document 1). [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Application Laid-Open No. 2008-071283 DISCLOSURE OF THE INVENTION [Problem to be solved by the invention]
[0004] Conventional text classification methods learn keywords from completely unstructured text and classify the text based on the frequency of keyword appearance. This takes time proportional to the length of the text, resulting in a large-scale text classification system.
[0005] Unlike conventional text classification methods, this method classifies text using pattern classification rules for text with a certain degree of fixed format, such as log files, by using the longest match method for pattern strings to classify text. This method allows for high-speed classification with a determination time proportional to the length of the text. However, there is a problem in that it cannot be applied when there is a possibility that a variable string portion that can become any string other than a fixed string may be included other than at the end.
[0006] This method of determining which regular expression pattern string a text matches can be used even when there is a possibility that a variable string portion may be included other than at the end. However, since it takes time proportional to the length of the text to perform one regular expression match determination, there is a problem in that the overall determination time is proportional to the length of the text x the number of patterns.
[0007] An object of the present invention is to provide a text classification device, method, and program that can reduce the time required for text classification. [Means for solving the problem]
[0008] 1st The text classification device of the present invention is a text classification device for classifying text character strings, and includes a pattern storage unit that stores pattern classification rules that associate a classification result of the text character string with each of a plurality of pattern character strings, and a end from head a first comparison string generation unit that generates a first comparison string by deleting one character at a time from before The first comparison string and a first pattern character string in the plurality of pattern character strings. a first determination unit that outputs a first classification result in the pattern classification rule based on whether or not the text string matches the text string when the first determination unit outputs the predetermined classification result; the position of the last character deleted by the first comparison character string generation unit to the end of the text string, a second comparison string generation unit that generates a second comparison string by deleting one character at a time from the second comparison string; and a second pattern character string in the plurality of pattern character strings. and a second determination unit that outputs a second classification result in the pattern classification rule based on whether or not the pattern matches the pattern. a first comparison string generation unit that generates a first comparison string by deleting one character at a time from the beginning of the text string to the end of the text string; a first determination unit that outputs a first classification result according to the pattern classification rules based on whether any one character in the first comparison string matches a first pattern string in the plurality of pattern strings; a second comparison string generation unit that generates a second comparison string by deleting one character at a time from the position of the last character deleted by the first comparison string generation unit to the beginning of the text string when the first determination unit outputs a predetermined classification result; and a second determination unit that outputs a second classification result according to the pattern classification rules based on whether any one character in the second comparison string matches a second pattern string in the plurality of pattern strings.
[0009] Third The text classification method of the present invention is a text classification method performed by a text classifier that classifies text strings, and the text classifier includes a pattern storage step in which the text classifier stores pattern classification rules that associate a classification result of the text string with each of a plurality of pattern strings; end from head a first comparison string generation step of generating a first comparison string by deleting one character at a time from before The first comparison string and a first pattern character string in the plurality of pattern character strings. a first determination step of outputting a first classification result in the pattern classification rule based on whether or not the first and second classification results match; Steps When the predetermined classification result is output, the text string In the first comparison string generation step, the position of the last deleted character is a second comparison string generation step of generating a second comparison string by deleting one character at a time from the second comparison string; and a second pattern character string in the plurality of pattern character strings. and a second determination step of outputting a second classification result in the pattern classification rule based on whether or not the first and second patterns match. a first comparison string generation step of generating a first comparison string by deleting one character at a time from the beginning of the text string to the end of the text string; a first determination step of outputting a first classification result according to the pattern classification rules based on whether any one character in the first comparison string matches a first pattern string in the plurality of pattern strings; a second comparison string generation step of generating a second comparison string by deleting one character at a time from the position of the last character deleted in the first comparison string generation step to the beginning of the text string when the first determination step has output a predetermined classification result; and a second determination step of outputting a second classification result according to the pattern classification rules based on whether any one character in the second comparison string matches a second pattern string in the plurality of pattern strings.
[0010] Fifth The text categorization program of the present invention includes a pattern storing step of storing pattern classification rules in which a classification result of a text string is associated with each of a plurality of pattern strings in a computer installed in a text categorization device that classifies a text string; end from head a first comparison string generation step of generating a first comparison string by deleting one character at a time from before The first comparison string and a first pattern character string in the plurality of pattern character strings. a first determination step of outputting a first classification result in the pattern classification rule based on whether or not the first and second classification results match; Steps When the predetermined classification result is output, the text string In the first comparison string generation step, the position of the last deleted character is a second comparison string generation step of generating a second comparison string by deleting one character at a time from the second comparison string; and a second pattern character string in the plurality of pattern character strings. and a second determination step of outputting a second classification result in the pattern classification rule based on whether or not the two match. a first comparison string generation step of generating a first comparison string by deleting one character at a time from the beginning of the text string to the end of the text string; a first determination step of outputting a first classification result according to the pattern classification rules based on whether any one character in the first comparison string matches a first pattern string in the plurality of pattern strings; a second comparison string generation step of generating a second comparison string by deleting one character at a time from the position of the last character deleted in the first comparison string generation step to the beginning of the text string when the first determination step has output a predetermined classification result; and a second determination step of outputting a second classification result according to the pattern classification rules based on whether any one character in the second comparison string matches a second pattern string in the plurality of pattern strings. [Effects of the Invention]
[0011] According to the present invention, text strings can be classified not only when a variable character string portion exists only at the end, but also when a variable character string portion exists in the middle or at the beginning. Furthermore, the time required for text classification is proportional to the length of the text string, so classification can be performed quickly.
[0012] According to the present invention, text strings can be easily classified by taking into consideration the order in which keywords matching a pattern string appear in the scanning direction, and setting as a classification condition the order in which a matching string that matches the beginning portion and a matching string that matches the end portion appear depending on the scanning direction. This method is particularly suitable for classifying text strings that are somewhat standard, such as log files, rather than for classifying arbitrary text strings. Furthermore, this method is suitable for text strings to be classified that contain fixed strings and variable strings and that include a fixed string at the beginning or end. [Brief explanation of the drawings]
[0013] [Figure 1] 1 is a block diagram illustrating an example of the configuration of a text classification device according to an embodiment of the present invention. [Figure 2] FIG. 2 is a conceptual diagram illustrating an outline of pattern classification rules stored in a pattern storage unit of the text classification device in this embodiment. [Figure 3] 10 is a conceptual diagram illustrating a first comparison string generation and first judgment step, which is an example of the operation of the first comparison string generation unit and the first judgment unit of the text classification device in this embodiment. FIG. [Figure 4] This is a conceptual diagram explaining the first comparison string generation and first judgment step of the text classification device in this embodiment, as well as the second comparison string generation and second judgment step, which are examples of the operation of the second comparison string generation unit and the second judgment unit. [Figure 5] This is a conceptual diagram explaining the first comparison string generation and first judgment step of the text classification device in this embodiment, as well as the second comparison string generation and second judgment step, which are examples of the operation of the second comparison string generation unit and the second judgment unit. DETAILED DESCRIPTION OF THE INVENTION
[0014] Hereinafter, with reference to the drawings, an embodiment of the present invention will be described, for example, a text classification device for log files (groups of text strings) collected from network devices such as personal computers (PCs), routers, switches, servers, etc. However, the present invention is not limited to the following embodiment. [Example]
[0015] (Configuration explanation) FIG. 1 is a block diagram showing a schematic configuration of a text classification device 10 connected to a network device 1 in this embodiment.
[0016] Text classification device 10 is a computer device such as a PC, and includes a CPU (Central Processing Unit) 11, a storage device 12, an input unit 13, an output unit 14, and a communication unit 15, which are connected to each other via an internal bus (not shown). Text character strings such as collected log files are acquired by text classification device 10 via input unit 13 and communication unit 15.
[0017] The storage device 12 may be, for example, a random access memory (RAM), a hard disk drive (HDD), a solid state drive (SSD), or a flash memory, which stores various programs and data and serves as a work area for the CPU 11. The input unit 13 may be, for example, a keyboard, a mouse, a touch panel, or a numeric keypad for inputting data. The output unit 14 may be, for example, a display for displaying data to an operator for outputting data. The communication unit 15 communicates with the network device 1 via a LAN cable or a serial cable, either wired or wirelessly, to send and receive data. The input unit 13 and the output unit 14 may also include a universal serial bus (USB) for connecting an external device, for example, a recording medium.
[0018] The overall operation of the text classification device is controlled by a CPU that operates in accordance with an operating system (OS) software program and a text classification application (hereinafter referred to as a text classification application) installed in the storage device 12 .
[0019] Examples of the text classification device 10 include electronic devices that can communicate with the network device 1 via wired or wireless communication, such as a PC, a tablet terminal, or a smartphone.
[0020] The text classification application is installed and deployed in the storage device 12, (1) A pattern storage unit PKP that stores pattern classification rules (hereinafter simply referred to as pattern rules) that associate the classification results of the text strings to be classified with each of a plurality of pattern strings in the text classification device 10; (2) a first comparison string generation unit FCT for generating a first comparison string by deleting characters from one end of the text string to the other end of the text string, one by one; (3) a first determination unit FJP that outputs a first classification result in the pattern rule based on whether or not the text character string or the first comparison character string matches the pattern character string; (4) a second comparison string generation unit SCT that, when the first determination unit FJP outputs a predetermined classification result, deletes one character at a time from the other end of the text string of the first comparison string to one end of the text string to generate a second comparison string; (5) A second judgment unit SJP that outputs a second classification result in the pattern rule based on whether or not the second comparison character string matches any of the pattern character strings.
[0021] (Explanation of operation) (1: Pattern holding part PKP) The pattern storage unit PKP stores pattern rules that associate the classification results of the target text string with each of the multiple pattern strings recorded in the text classification device 10. That is, the pattern storage unit PKP classifies the text string according to which pattern rule the multiple pattern strings match.
[0022] FIG. 2 shows examples of pattern rules (R-1), (R-2), and (R-3) stored in the pattern storage unit PKP.
[0023] Pattern rule (R-1) is a rule that when the "Fixed String 1" from the beginning determines the "leading group" text string as a classification result, and when the pattern string is "Fixed String 1", the classification result is the "leading group". The text string to be classified here consists of a sequence of "Fixed String 1 / Variable String".
[0024] Pattern rule (R-2) is a rule that when the classification result "Beginning / Ending Group" text string is determined by "Fixed String 2-1" from the beginning and "Fixed String 2-2" from the end, and the pattern string is a string in which "Fixed String 2-1" is concatenated with "Fixed String 2-2", the classification result is "Beginning / Ending Group". In addition, when the pattern string is only "Fixed String 2-1", the classification result is "Group Undefined". The text string to be classified here consists of a sequence of "Fixed String 2-1 / Variable String / Fixed String 2-2".
[0025] Pattern rule (R-3) is a rule that when the "fixed string 3" from the end determines the "tail group" text string as a classification result, and when the pattern string is "fixed string 3", the classification result is "tail group". In addition, when the pattern string is only "empty string", the classification result is "undefined group". The text string to be classified here consists of a sequence of "variable string / fixed string 3".
[0026] In the above pattern rules, a "variable string" is a string of any number of characters and any characters, and is also represented here as "...". Conversely, a "fixed string" is a string of a specific number of characters and not any characters other than "...". Each fixed string of the pattern strings that classify the target text string may be a single block (see pattern rules (R-1) (R-3)), or may be two blocks of fixed strings (first pattern string and second pattern string) separated at the beginning and end (see pattern rule (R-2)).
[0027] (Example of pattern rule) The classification results corresponding to each pattern string become the classification category, so consider the following five pattern rules as an example. Pattern string 1: ABCD... → Classification result: Group 1 Pattern string 2: ABEF… → Classification result: Group 2 Pattern string 3: ABGH…IJ → Classification result: Group 3 Pattern string 4: ABGH…KL → Classification result: Group 4 Pattern string 5: …MN → Classification result: Group 5.
[0028] The above five pattern rules have the following meaning: In pattern string 1, a text string that matches pattern rule (R-1) beginning with fixed string 1 "ABCD" followed by a variable string is classified into "group 1." In pattern string 2, a text string that matches pattern rule (R-1) beginning with fixed string 1 "ABEF" followed by a variable string is classified into "group 2." In pattern string 3, a text string that matches pattern rule (R-2), which begins with fixed string 2-2 "ABGH", is followed by a variable string, and ends with fixed string 2-2 "IJ", is classified into "group 3". In pattern string 4, a text string that matches pattern rule (R-2), which begins with fixed string 2-2 "ABGH", is followed by a variable string, and ends with fixed string 2-2 "KL", is classified into "group 4". In pattern character string 5, a text character string that matches pattern rule (R-3) in which the variable character string at the beginning is followed by fixed character string 3 "MN" at the end is classified into "group 5."
[0029] [Pattern rule (R-1): First group text] (2: First comparison string generation unit FCT and 3: First judgment unit FJP) FIG. 3 shows a first comparison string generation and first judgment step, which are examples of the operation of the first comparison string generation unit FCT and the first judgment unit FJP.
[0030] The first comparison string generation unit FCT has a function of scanning a text string to be classified and generating a substring by extracting a part of it. The first judgment unit FJP has a function of searching for a classification result of a pattern rule whose pattern string matches the substring of the text scan. The first judgment unit FJP also has a function of determining whether to complete the classification or allow the second judgment unit SJP to continue scanning the text string to be classified, based on the classification result obtained as a result of the search. Here, "scanning" means "recognizing each character from one end of the text string to the other end or in the reverse direction," and "extracting" means "deleting each character to define the remaining string," and the "substring (i.e., first comparison string)" is the remaining string.
[0031] Therefore, the first comparison string generation unit FCT scans from the end to the beginning as shown in (P-1) of Fig. 3, that is, deletes one character at a time from one end (right end) of the text string to the other end (left end) to generate a first comparison string (substring). At this time, each time a string is cut out, the first determination unit FJP checks whether a pattern rule exists in which the cut-out substring matches a pattern string. Then, as shown in (P-2) of Fig. 3, the first determination unit FJP stops scanning if a pattern rule exists.
[0032] Specifically, with regard to the above-mentioned first comparison string generation unit FCT and first judgment unit FJP, we will explain the case where the text string to be classified is a pattern string in which the first part is a fixed string followed by a variable string, such as the above-mentioned pattern string 1 and pattern string 2, and only pattern strings in which this is a pattern rule (the above-mentioned (R-1)).
[0033] In this case, classification can be performed by the first comparison string generation unit FCT cutting out the beginning of the text string to be classified, and the first judgment unit FJP judging whether there is a pattern rule in which the partial string matches this. Pattern string 1: ABCD... → Classification result: Group 1 Pattern string 2: ABEF… → Classification result: Group 2 As shown in (P-1) of Figure 3, if the text string to be classified is "ABEFXY", when the initial parts are extracted in order from longest to shortest, the substrings "ABEFXY", "ABEFX (see Figure 3 (P-1))", and "ABEF" are generated in that order. However, when the substring "ABEF (see Figure 3 (P-2))" is extracted, this substring matches pattern string 2, and so the first determination unit FJP can determine that the text string "ABEFXY" matches group 2, the classification result of pattern string 2.
[0034] [Pattern rule (R-2): First and last group text] (4: Second comparison string generation unit SCT and 5: Second judgment unit SJP) FIG. 4 shows the first comparison string generation and first judgment step, as well as the second comparison string generation and second judgment step which are operation examples of the second comparison string generation unit SCT and the second judgment unit SJP.
[0035] The second comparison string generation unit SCT has a function of scanning the text string to be classified in the opposite direction to the first comparison string generation unit FCT and generating a substring by extracting a part of it. The second judgment unit SJP has a function of searching for the classification result of a pattern rule whose pattern string matches the substring of the text scan. The first comparison string generation unit FCT and the second comparison string generation unit SCT will continue to extract characters until the first judgment unit FJP and the second judgment unit SJP find a matching pattern rule in the pattern string storage unit PKP, respectively, or the extraction result becomes an empty string.
[0036] The above-mentioned first comparison string generation unit FCT and first judgment unit FJP, as well as the second comparison string generation unit SCT and second judgment unit SJP, determine which of the above pattern string pattern rules 1 to 5 matches the text string to be classified, for example, "ABGHXYKL," and as a result, the text string "ABGHXYKL" can be classified into "Group 4."
[0037] Specifically, we will explain the case where the text string to be classified is like the above pattern string 4 (pattern string 4: ABGH...KL → classification result: group 4), where the first part is the fixed string "ABGH", followed by the variable string "XY", and finally the fixed string "KL".
[0038] In this pattern string, 4 is a pattern string when the classification result is determined by the fixed string from the beginning and the fixed string from the end of pattern rule (R-2), so as a pattern rule, there are the following two cases. Pattern string 4-1: Pattern string "ABGHKL" → Classification result "Group 4" Pattern string 4-2: Pattern string "ABGH" → Classification result "Group undefined".
[0039] If the text character string to be classified is "ABGHXYKL," in the first comparison character string generation and first judgment step (first step) shown in Figure 4, the target text character string is scanned from the end to the beginning, and the substrings "ABGHXYKL," "ABGHXYK (see Figure 4(P-1))," "ABGHXY," "ABGHX," and "ABGH" are extracted in order. When "ABGH" has finally been extracted (see Figure 4(P-2)), the extracted character string matches the pattern character string of pattern character string 4-2, and the result by the first judgment unit FJP is "group indeterminate."
[0040] When the group is indeterminate, the first determination unit FJP causes the second comparison string generation unit SCT to extract the concatenated substrings "ABGHXYKL," "ABGHYKL," and "ABGHKL" sequentially by scanning from the end position of the first comparison string generation and first determination step (first step) shown in (P-2) of FIG. 4 toward the end as shown in (P-3) of FIG. 4. Note that the end position of the first step is after the beginning "ABGH" of the text string to be classified, so the substrings "XYKL," "YKL (see (P-3) of FIG. 4)," and "KL" are extracted and concatenated from after "ABGH" toward the end. When the extracted substring "ABGHKL" (second comparison string) concatenated in the second comparison string generation and second determination step shown in (P-4) of FIG. 4 is extracted, the extracted string matches the pattern string of pattern string 4-1, and the result of the second determination unit SJP is "Group 4." Here, the second comparison string is a string generated by concatenation by the second comparison string generation unit SCT.
[0041] This pattern character string is a pattern character string for the case where the classification result is determined by the fixed character string from the beginning and the fixed character string from the end of pattern rule (R-2), so the character string obtained by concatenating the fixed character string from the beginning and the fixed character string from the end is used as the second comparison character string, and the above pattern character string 4-1 is derived.
[0042] [Pattern rule (R-3): End group text] 5 is a conceptual diagram illustrating the first comparison string generation and first determination step of the text classification device in this embodiment, as well as the second comparison string generation and second determination step, which are examples of the operation of the second comparison string generation unit and the second determination unit. As shown in FIG. 5, the first comparison string generation unit FCT and first determination unit FJP, and the second comparison string generation unit SCT and second determination unit SJP, for example, determine which of the pattern rules of pattern strings 1 to 5 matches the text string "XYMN" to be classified, and as a result, the text string "XYMN" can be classified into "Group 5."
[0043] Specifically, we will explain the case where the text string to be classified starts with a variable string "XY" and ends with a fixed string "MN," as in the above pattern string 5 (pattern string 5: ...MN → classification result: group 5). In this case, the pattern string is the target end group text of the above pattern rule (R-3), and the text is classified using only the fixed string at the end, as follows:
[0044] Therefore, in the above example, the following pattern rule is derived from pattern rule (R-3). Pattern string 5-1: Pattern string "MN" → Classification result "Group 5" Pattern string 5-2: Pattern string " " → Classification result "Group undefined". The pattern character string 5-1 is derived for a fixed character string "MN" from the end, and the pattern character string 5-2 is derived for an empty character string "".
[0045] If the text string to be classified is "XYMN", in the first comparison string generation and first judgment step, the first comparison string generation unit FCT scans from the end to the beginning, as shown in (P-1) of Figure 5, and extracts "XYMN", "XYM (see Figure 5 (P-1))", "XY", "X", and " " in that order, while the first judgment unit FJP checks, and at the point when the empty string " " is finally extracted (see Figure 5 (P-2)), the extracted string matches the pattern string of pattern string 5-2, so the result of the first judgment unit FJP is "group indeterminate".
[0046] Checking whether a pattern rule that matches the pattern string exists in the empty string is a check for the first judgment unit FJP to determine whether to generate a second string for comparison and execute the second judgment step. If a pattern rule of "empty string → unspecified group" exists, the second string for comparison and the second judgment step are executed, but if a pattern rule of "empty string → unspecified group" does not exist, the second string for comparison and the second judgment step are not executed, and the classification result is "no group."
[0047] If the group is indeterminate, in the second comparison string generation and second determination step, the following sequence is extracted by scanning from the end position of the first comparison string generation and first determination step shown in (P-2) of FIG. 5 toward the end: "XYMN", "YMN (see (P-3) of FIG. 5)", and "MN". Note that the end position of the first step is the beginning of the text string to be classified, so extraction is performed from the beginning to the end of the text string. Also, since the end position of the first step is after the empty string "" at the beginning of the text string to be classified, the substrings "XYMN", "YMN", and "MN" are extracted and concatenated from after the empty string "" toward the end. When the second comparison string generation and second determination step has extracted up to "MN" (see (P-4) of FIG. 5), the extracted string matches the pattern string of pattern string 5-1, so the result of the first comparison string generation unit FCT is "Group 5".
[0048] In any of the above text classification processes, if no pattern rule is found until the end, the classification result is determined to be "no group", the second comparison string generation and second judgment step are not executed, and the operation of the entire device is terminated.
[0049] (Explanation of effect) This method can classify text strings not only when a variable character string exists only at the end, but also when a variable character string exists in the middle or at the beginning. Furthermore, the time required for classification is proportional to the length of the text string, so classification can be performed quickly.
[0050] Furthermore, by concatenating the fixed character string resulting from the first match determination with the partial character string extracted from the text character string to be classified with the character string extracted from the text character string to be classified the second time, and then performing a match determination on the concatenated partial character string with the fixed character string, it becomes unnecessary to separately manage pattern rules for the second match determination for each fixed character string resulting from the first match determination, and it becomes possible to centrally manage pattern rules for classification.
[0051] (Variation) In this embodiment, the order is such that the first substring of the character string to be classified is extracted and a match is determined, and then the last substring is extracted and a match determination is performed. However, it is also possible to extract the last substring and a match determination, and then extract the first substring and a match determination is performed. [Explanation of symbols]
[0052] Examples of the text classification device 10 include electronic devices that can communicate with the network device 1 via wired or wireless communication, such as a PC, a tablet terminal, or a smartphone.
[0053] 10 Text Classification Device PKP pattern holder FCT First comparison string generator FJP First Judgment Department SCT 2nd photo character string generation unit SJP Second Judgment Division
Claims
1. 1. A text classifier for classifying a text string, comprising: a pattern storage unit that stores pattern classification rules that associate a classification result of a text string with each of a plurality of pattern strings; a first comparison string generation unit that deletes one character at a time from the end of the text string to the beginning of the text string to generate a first comparison string; a first determination unit that outputs a first classification result in accordance with the pattern classification rule based on whether any one character string in the first comparison character string matches a first pattern character string in the plurality of pattern character strings; a second comparison string generation unit that, when the first determination unit outputs a predetermined classification result, generates a second comparison string by deleting characters one by one from the text string starting from the position of the last character deleted by the first comparison string generation unit toward the end of the text string; a second determination unit that outputs a second classification result in the pattern classification rule based on whether any one character string in the second comparison character strings matches a second pattern character string in the plurality of pattern character strings; A text classification device comprising:
2. the first comparison string generation unit generates the first comparison string by deleting one character at a time from the end of the text string to the beginning until any one character string in the first comparison string matches a first partial pattern character string in the first pattern character string; 2. The text categorization device of claim 1, wherein the second comparison string generation unit generates the second comparison string by deleting characters one by one from the text string starting from the position of the last character deleted by the first comparison string generation unit to the end of the text string until any one character in the second comparison string matches a second partial pattern character in the first pattern character string.
3. 1. A text classification method performed by a text classifier that classifies a text string, comprising: A text classifier a pattern storing step of storing pattern classification rules that associate a classification result of the text string with each of a plurality of pattern strings; a first comparison string generation step of generating a first comparison string by deleting one character at a time from the end of the text string to the beginning of the text string; a first determination step of outputting a first classification result in the pattern classification rule based on whether any one character string in the first comparison character string matches a first pattern character string in the plurality of pattern character strings; a second comparison string generation step of generating a second comparison string by deleting one character at a time from the position of the last character deleted in the first comparison string generation step to the end of the text string when the first determination step outputs a predetermined classification result; a second determination step of outputting a second classification result in the pattern classification rule based on whether any one character string in the second comparison character strings matches a second pattern character string in the plurality of pattern character strings; A text classification method comprising:
4. A computer installed in a text classifier that classifies text strings, a pattern storing step of storing pattern classification rules that associate a classification result of the text string with each of a plurality of pattern strings; a first comparison string generation step of generating a first comparison string by deleting one character at a time from the end of the text string to the beginning of the text string; a first determination step of outputting a first classification result in the pattern classification rule based on whether any one character string in the first comparison character string matches a first pattern character string in the plurality of pattern character strings; a second comparison string generation step of generating a second comparison string by deleting one character at a time from the position of the last character deleted in the first comparison string generation step to the end of the text string when the first determination step outputs a predetermined classification result; a second determination step of outputting a second classification result in the pattern classification rule based on whether any one character string in the second comparison character strings matches a second pattern character string in the plurality of pattern character strings; A program characterized by executing the following.
5. 1. A text classifier for classifying a text string, comprising: a pattern storage unit that stores pattern classification rules that associate a classification result of a text string with each of a plurality of pattern strings; a first comparison string generation unit that generates a first comparison string by deleting one character at a time from the beginning to the end of the text string; a first determination unit that outputs a first classification result in accordance with the pattern classification rule based on whether any one character string in the first comparison character string matches a first pattern character string in the plurality of pattern character strings; a second comparison string generation unit that, when the first determination unit outputs a predetermined classification result, generates a second comparison string by deleting characters one by one from the text string starting from the position of the last character deleted by the first comparison string generation unit toward the beginning of the text string; a second determination unit that outputs a second classification result in the pattern classification rule based on whether any one character string in the second comparison character strings matches a second pattern character string in the plurality of pattern character strings; A text classification device comprising:
6. 1. A text classification method performed by a text classifier that classifies a text string, comprising: A text classifier a pattern storing step of storing pattern classification rules that associate a classification result of the text string with each of a plurality of pattern strings; a first comparison string generation step of generating a first comparison string by deleting one character at a time from the beginning to the end of the text string; a first determination step of outputting a first classification result in the pattern classification rule based on whether any one character string in the first comparison character string matches a first pattern character string in the plurality of pattern character strings; a second comparison string generation step of generating a second comparison string by deleting characters one by one from the position of the last character deleted in the first comparison string generation step to the beginning of the text string when the first determination step outputs a predetermined classification result; a second determination step of outputting a second classification result in the pattern classification rule based on whether any one character string in the second comparison character strings matches a second pattern character string in the plurality of pattern character strings; A text classification method comprising:
7. A computer installed in a text classifier that classifies text strings, a pattern storing step of storing pattern classification rules that associate a classification result of the text string with each of a plurality of pattern strings; a first comparison string generation step of generating a first comparison string by deleting one character at a time from the beginning to the end of the text string; a first determination step of outputting a first classification result in the pattern classification rule based on whether any one character string in the first comparison character string matches a first pattern character string in the plurality of pattern character strings; a second comparison string generation step of generating a second comparison string by deleting characters one by one from the position of the last character deleted in the first comparison string generation step to the beginning of the text string when the first determination step outputs a predetermined classification result; a second determination step of outputting a second classification result in the pattern classification rule based on whether any one character string in the second comparison character strings matches a second pattern character string in the plurality of pattern character strings; A program characterized by executing the following.
Citation Information
Patent Citations
Multiitem input device
JP1981014338A
Data base retrieval method and device and recording medium recording data base retrieval program
JP1999143904A
Document retrieving system
JP1999175564A
Address retrieval system and address retrieval method
JP2003186880A
Text classification method and text classification system
JP2008071283A