WO2010026804A1 - 近似照合装置、近似照合方法、プログラム及び記録媒体 - Google Patents

近似照合装置、近似照合方法、プログラム及び記録媒体 Download PDF

Info

Publication number
WO2010026804A1
WO2010026804A1 PCT/JP2009/059215 JP2009059215W WO2010026804A1 WO 2010026804 A1 WO2010026804 A1 WO 2010026804A1 JP 2009059215 W JP2009059215 W JP 2009059215W WO 2010026804 A1 WO2010026804 A1 WO 2010026804A1
Authority
WO
WIPO (PCT)
Prior art keywords
keyword
skip
dictionary
deleted
character string
Prior art date
Application number
PCT/JP2009/059215
Other languages
English (en)
French (fr)
Inventor
邦子 齋藤
賢治 今村
玄一郎 菊井
義博 松尾
Original Assignee
日本電信電話株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日本電信電話株式会社 filed Critical 日本電信電話株式会社
Priority to KR1020117004098A priority Critical patent/KR101245631B1/ko
Priority to CN2009801333447A priority patent/CN102138141B/zh
Priority to JP2010527723A priority patent/JP5238034B2/ja
Publication of WO2010026804A1 publication Critical patent/WO2010026804A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • G06F40/242Dictionaries

Definitions

  • the present invention collates an input character string and a predetermined keyword for extracting a keyword given in advance from a sentence (input character string) described in a natural language, and outputs a matching keyword and its appearance position.
  • a sentence input character string
  • a predetermined keyword for extracting a keyword given in advance from a sentence (input character string) described in a natural language
  • the keyword extraction is a task of extracting a keyword listed in advance such as a dictionary from an input character string described in a natural language.
  • keywords related to the Olympics For example, consider extracting keywords related to the Olympics from the input character string shown in FIG. In this case, as shown in FIG. 2, it is checked whether or not each keyword in a set of keywords (hereinafter referred to as a keyword dictionary) previously listed manually as keywords to be extracted is included in the input character string. To perform extraction.
  • a keyword dictionary a set of keywords
  • the input string is a character string that is written (input) by hand, it often includes typographical errors or omissions, or uses a slightly different expression from the assumed keyword. 2.
  • the number of keywords increases, it becomes difficult to extract at high speed, and there is a problem that it takes time to process a large amount of input character strings.
  • Keyword approximate matching Conventionally, regular expressions have been used as keyword approximate matching methods.
  • a regular expression can extract a slightly different partial character string from a character string by expressing a keyword to be collated with a finite automaton. This is used in the programming language Perl.
  • Perl the programming language
  • the keyword “Olympic” is used. By expressing ⁇ 1 ⁇ npic /, “Olympic” can be extracted from sentence 1 in FIG.
  • DP Dynamic Programming
  • FIG. 3 shows an example of a dictionary (try dictionary) in which the keyword dictionary of FIG. 2 has a trie structure. Each character of the keyword is expressed as a trie branch. “#” In the figure is a terminal symbol representing the end of a keyword, and a trie node can hold a different value for each keyword.
  • Keyword extraction using the trie dictionary is performed by matching the trie dictionary while shifting the input character string one character at a time from the beginning.
  • the first character of the character string is denoted as the 0th character
  • the next character is denoted as the first character, etc.
  • the position i of the character string is the i-th character position where the first character of the character string is the 0th character.
  • i in the position i or the like is a value of the position of the character string.
  • the value of the position of the character string may be represented only by the “position of the character string”.
  • Fig. 4 shows the matching algorithm based on the trie structure.
  • the processing of steps s1 to s5 is repeated for all character positions i of the input character string.
  • initialization is performed by setting the keyword collation position j to 0 and setting the trinode n as the root node (step s1).
  • step s2 If it is determined in step s2 that there is no terminal symbol # in the branch of the node n, it is determined whether or not the character C i + j at the position i + j in the input character string is on a branch label branched from the trinode n (step s4).
  • step s4 when the character C i + j is not in the branch label branched from the trinode n, the processing from step s1 is repeated for the next character position of the input character string.
  • step s4 if the character C i + j is on the branch label branched from the tri-node n, j is set to j + 1, n is updated to the node at the corresponding branch destination, and the process proceeds to step s2 (step s5).
  • keyword matching using the trie dictionary can extract only character strings that completely match the keyword, there is a problem in that it is not possible to extract keywords that use typographical errors, omissions, or slightly different expressions.
  • AC method An improved example of keyword matching using a trie structure is the Aho-Corasick method (hereinafter referred to as the AC method) (see Non-Patent Document 3).
  • the AC method the collation speed depends only on the length (number of characters) of the input character string, so that collation can be performed at higher speed.
  • a failure function and an output function are used for high-speed collation.
  • the failure function compares the branch label suffix up to immediately before the failure with the prefix of the branch label string from the root node of the trie and makes the transition to the longest matching node when the match of the trie fails in the middle Is a function of
  • the output function is a function for outputting all keywords when the collation of the trie succeeds partway and the suffix of the branch label is a keyword. This is different from the case of the trie structure, and all the values that match backward are output. Examples of the failure function and output function when the keyword dictionary is FIG. 2 are shown in FIGS. 5 and 6, respectively, and the collation algorithm by the AC method is shown in FIG.
  • the input character string collation position e is set to 0 and the trinode n is set to 1 (step s11). Subsequently, it is determined whether or not the input character string collation position e is greater than or equal to the input character string length (step s12). If the input character string collation position e is greater than or equal to the input character string length, the process is terminated. If the force character string collation position e is not equal to or longer than the input character string length in step s12, it is determined whether or not the same label as the character at the position e in the input character string is on the branch of the node n (step s13).
  • step s13 if the same label as the character at position e in the input character string is not in the branch of node n, n is the value of the failure function (step s14), and if the value of n is 1, e is set to e + 1. (Step s15), the process proceeds to Step s17.
  • step s13 if the same label as the character at position e in the input character string is on the branch of node n, n is updated to the node at the corresponding branch destination, e is set to e + 1 (step s16), and the process proceeds to step s17. .
  • the node 1 transitions to the branch label destination 16 of “gold” at the 0th character.
  • the value of the output function is not defined, nothing is output. If this is repeated, the node 18 is reached at the second character.
  • the AC method can extract only a character string that completely matches the keyword, there is a problem that a keyword using a typographical error, a typographical error, or a slightly different expression cannot be extracted as in the trie structure.
  • An object of the present invention is to enable extraction at high speed even when an input character string includes a typographical error, omission, or an expression that is slightly different from an assumed keyword and the number of keywords to be extracted is large.
  • the technology using the present invention is capable of performing a high-speed operation on character strings including insertion, deletion, and substitution errors up to N consecutive characters (N is an arbitrary integer) and a large number of keywords by the following method. To match.
  • the value of the skip dictionary holds the deleted character position pk, the number of deleted characters wk, and the keyword (original keyword) that is the source of the deleted keyword for each deleted keyword.
  • collation can be performed at higher speed.
  • ⁇ Keywords can be extracted from input strings that contain insertion, deletion, and substitution errors if they are within N consecutive characters. -Since all keywords are collated at the same time using the trie structure, the processing time hardly increases even if the number of keywords increases. -By using the AC method as a verification method, verification can be performed at higher speed.
  • the keywords output in the present invention can be scored according to the ease of error of characters. Therefore, if there is another keyword supplement in the same area of the input character string, it is possible to compare error characters and output only those that are less prone to error.
  • the morphological analysis is performed by scoring the ease of connection between words using an n-gram model or the like. Can make a bowl.
  • Explanatory drawing showing an example of input character string Explanatory drawing which shows an example of a keyword dictionary Explanatory drawing which shows an example of a try dictionary Process flow diagram showing a matching algorithm with a trie structure Explanatory drawing which shows an example of a failure function Explanatory drawing which shows an example of output function Flow chart of processing showing collation algorithm by AC method
  • the block diagram which shows an example of embodiment of the approximate collation apparatus of this invention Explanatory drawing which shows an example of a deletion keyword and its value
  • Process flow showing skip input / skip dictionary matching algorithm Explanatory drawing which shows an example of the extracted keyword candidate Explanatory drawing showing an example of skip input Explanatory drawing which shows the other example of the extracted keyword candidate
  • Process flow diagram showing input string matching algorithm with trie structure
  • Process flow diagram showing skip input matching algorithm with trie structure Flow chart of processing showing input string matching algorithm by AC method
  • Process flow diagram showing the deduplication algorithm Explanatory drawing which shows an example of the extracted keyword after duplication deletion Explanatory drawing which shows the other example of
  • FIG. 8 shows an example of an embodiment of the approximate matching apparatus according to the present invention, which comprises a skip dictionary creation unit 10, a skip dictionary storage unit 20, and a keyword extraction unit 30.
  • the maximum number of characters to be deleted from the keyword and the maximum skip width of the input character string are equal and denoted as N.
  • the approximate matching device can be realized by mounting a program for realizing the functions of the skip dictionary creating unit 10 and the keyword extracting unit 30 on a computer having a CPU and storage means such as a memory. Further, if the skip dictionary is created by another device or the like and stored in the skip dictionary storage unit 20, the keyword extraction means is installed by installing a program for realizing the function of the keyword extraction unit 30 in the computer. It is possible to realize an approximate matching apparatus including In addition, the program can be stored in a storage medium such as a portable memory and then installed in the computer.
  • the skip dictionary creation unit 10 deletes, for each keyword, a keyword itself, and a deleted keyword including a set of character strings in which at least one character is deleted from all character positions of the keyword. Create a skip dictionary containing.
  • the skip dictionary storage unit 20 stores and holds the skip dictionary created by the skip dictionary creation unit 10.
  • the keyword extracting unit 30 extracts a keyword given in advance from the input character string and a keyword approximated to the keyword by comparing the input character string with the skip dictionary stored in the skip dictionary storage unit 20, Output with position.
  • the skip dictionary creation unit 10 includes a deleted keyword / value generation unit 11, a deleted keyword / value temporary storage unit 12, and a trie dictionary creation unit 13, and is a keyword dictionary that is a set of keywords that are listed manually in advance as keywords to be extracted.
  • the skip dictionary is created from the above and stored in the skip dictionary storage unit 20.
  • ⁇ Deleted keyword / value generator In the deleted keyword / value generating unit 11, for each keyword in the keyword dictionary prepared in advance, first, the keyword itself and a continuous wk character (1 ⁇ wk ⁇ N: N) from all character positions pk of the keyword. Is a deletion keyword composed of a set of character strings from which the keyword deletion maximum number of characters is deleted and stored in the deletion keyword / value temporary storage unit 12.
  • a deleted character position pk, a deleted character number wk, and a pair of original keywords that are keywords of the deleted keyword are generated as values and stored in the deleted keyword / value temporary storage unit 12 in correspondence with the deleted keyword.
  • a deleted keyword may be created only for keywords having a certain length or longer (for example, four characters or longer).
  • the trie dictionary creation 13 reads the deletion keyword generated by the deletion keyword / value generation unit 11 and the value corresponding to the deletion keyword from the deletion keyword / value temporary storage unit 12, and sets each character of the keyword as a branch, for each keyword.
  • a skip dictionary is created by converting into a trie structure that is a tree structure in which common prefixes of keywords including nodes that can hold different values are merged.
  • ⁇ Failure function and output function are further defined when the AC method is used in the skip input / skip dictionary collation unit described later. This is performed for all the keywords and stored in the skip dictionary storage unit 20 as a skip dictionary.
  • the keyword extraction unit 30 includes a skip input / skip dictionary collation unit 31, a collation result temporary storage unit 32, and a duplication deletion unit 33.
  • the keyword extraction unit 30 includes an input character string including typographical characters and omissions, and a skip dictionary stored in the skip dictionary storage unit 20. A keyword is extracted from and output together with its appearance position and value.
  • the skip input / skip dictionary collation unit 31 collates the input character string with the skip dictionary stored in the skip dictionary storage unit 20 to extract keyword supplements.
  • FIG. 10 shows an algorithm for skip input / skip dictionary collation.
  • the keywords extracted here are -EM: Keyword appears in input string with complete match-DEL: Matches keyword with deleted character (blank) in input string-INS: Keyword with inserted character in input string Matching: REP: classified into four matching types, that is, matching with a keyword in a state where a replacement character (wrong character) exists in the input character string.
  • step s21 Collation of input character string and skip dictionary
  • the input character string and the skip dictionary are collated (step s21).
  • this collation algorithm either the normal trie dictionary collation shown in FIG. 4 or the AC method collation shown in FIG. 7 may be used. Moreover, collation algorithms other than these can also be used.
  • the match type is set to EM, the match type, the match start position, end position, error start position, number of error characters, and original keyword in the input character string are output, and the verification result temporary storage unit 32 (step s22).
  • the match type is set to DEL, the match type, the match start position, the end position, the error start position, the number of error characters, the original keyword in the input character string are output, and the verification result is temporarily stored.
  • the match type is set to DEL, the match type, the match start position, the end position, the error start position, the number of error characters, the original keyword in the input character string are output, and the verification result is temporarily stored.
  • both the error start position and the number of error characters are always 0. If the match type is DEL, the error start position and the number of error characters are respectively deleted from the deleted keyword. The character position pk and the number of deleted characters wk.
  • Step s24 the skip width wi characters (1 A character string in which ⁇ wi ⁇ N) is skipped is created (step s24). This is called skip input. For example, if a skip input is created for sentence 1 in FIG. 1, the character string shown in FIG. 12 is obtained.
  • each skip input is compared with the skip dictionary (step s25).
  • the matching algorithm either FIG. 4 or FIG. 7 may be used.
  • collation algorithms other than these can also be used. It is also possible to perform collation while directly skipping the input character string when collating with the skip dictionary without creating a skip input.
  • steps s26 to s29 are repeated for all keyword candidates that match the skip dictionary.
  • pi ⁇ 0 and pi ⁇ deletion keyword character string length it is then determined whether pi ⁇ 0 and pi ⁇ deletion keyword character string length (step s27). If pi ⁇ 0 and pi ⁇ deletion keyword character string length, the flow proceeds to step s28, and pi ⁇ 0. If pi ⁇ character string length of the deleted keyword, the next keyword candidate is processed.
  • the match type is set to INS, the match type, the match start position in the input string, and the end position
  • the error start position, the number of error characters, and the original keyword are output and stored in the verification result temporary storage unit 32 (step s28).
  • the relative skip position pi of the input character string is equal to the deleted character position pk of the deleted keyword, the skip width wi of the input character string, and the number of deleted characters wk of the deleted keyword are If they are equal, the match type is set to REP, and the match type, the match start position, the end position, the error start position, the number of error characters, and the original keyword in the input character string are output and stored in the verification result temporary storage unit 32 (step s29).
  • the error start position and the number of error characters are the skip input relative skip position pi and skip width wi, respectively.
  • the input character string and the skip dictionary were collated by the trie method at all character positions (collation start positions) i of the input character string, and the collation was successful.
  • a keyword or the like is output (steps s31 to s35), and the character position j that failed to be collated is stored together with i (step s36).
  • step s31 to step s36 is repeated for all character positions i in the input character string.
  • initialization is performed by setting the keyword collation position j to 0 and the trinode n as a root node (step s31).
  • step s32 If it is determined in step s32 that the terminal symbol # is not in the branch of the node n, it is determined whether or not the character C i + j at the position i + j in the input character string is in the branch label branched from the trinode n (step s34).
  • step s34 when the character C i + j is not in the branch label branched from the trinode n, the character position i and the keyword matching failure position j are stored in pairs (step s36), and the next character position of the input character string is The processing from step s31 is repeated.
  • step s34 if the character C i + j is on the branch label branched from the tri-node n, j is set to j + 1, n is updated to the node of the corresponding branch destination, and the process proceeds to step s2 (step s35).
  • step s36 indicates that the collation is successful up to j-1 characters for each collation start position (match start position) i.
  • the skip input and the skip dictionary are collated by the trie method at all character positions (collation start positions) i of the input character string (steps s43 to s47).
  • the saved keyword matching failure position f corresponding to the position i is acquired (more precisely, j stored in step s36 is acquired as f) (step s41).
  • the absolute skip position p of the skip input is p ⁇ i, even if the keyword matches, it has already been matched by collation with the input character string. If p> i + f, it is clear that the collation fails before the skip position is reached. Therefore, it is determined whether or not p ⁇ i or p> i + f (step s42). If p ⁇ i or p> i + f, nothing is done and the process moves to the next character position i + 1.
  • initialization is performed by setting the keyword collation position j to 0 and the trinode n as the root node, similarly to the processing shown in FIG. 4 (step s43). ).
  • it is determined whether or not there is a terminal symbol # on the branch of the node n (step s44). If there is the terminal symbol #, all branch labels, values, and match start positions i on the route from the root node are output. (Step s45).
  • step s44 If it is determined in step s44 that there is no terminal symbol # in the branch of the node n, it is determined whether or not the character C i + j at the position i + j in the input character string is on the branch label branched from the trinode n (step s46).
  • step s46 when the character C i + j is not in the branch label branched from the trinode n, the processing from step s41 is repeated for the next character position of the input character string.
  • step s46 when the character C i + j is on the branch label branched from the tri-node n, j is set to j + 1, n is updated to the corresponding branch destination node, and the process proceeds to step s44 (step s47).
  • collation with the skip dictionary is performed at two places (step s21, step s25) of the input character string and the skip input.
  • the collation algorithm with the skip dictionary can be collated at a higher speed by changing the collation algorithm at the two locations from the algorithm shown in FIG. 7 to the algorithm shown in FIG. 16 and FIG.
  • the input character string and the skip dictionary are collated by the AC method, and keywords and the like that have been successfully collated are output (step s51, step s52, steps s54 to s58).
  • the first trinode number n at each character position (collation position) e of the input character string is stored (step s53).
  • This is called a trinode function n triode (e).
  • the tri-node function is a function that associates a character position already verified on the input character string with a state on the trie when there is no skip in the input character string.
  • the input character string collation position e is set to 0, the trinode n is set to 1, and initialization is performed (step s51). Subsequently, it is determined whether or not the input character string collation position e is greater than or equal to the input character string length (step s52). If the input character string collation position e is greater than or equal to the input character string length, the process is terminated. If the input character string collation position e is not greater than or equal to the input character string length in step s52, if triode (e) is not saved, the value of n is substituted into triode (e), and the input character string collation position e and the node n is stored in the storage unit (step s53). Then, it is determined whether or not the same label as the character at position e in the input character string is on the branch of node n (step s54).
  • step s54 if the same label as the character at position e in the input character string is not in the branch of node n, n is the value of the failure function (step s55), and if the value of n is 1, e is set to e + 1. (Step s56), the process proceeds to Step s58. If the same label as the character at the position e in the input character string is in the branch of the node n in step s54, n is updated to the corresponding branch destination node, e is set to e + 1 (step s57), and the process proceeds to step s58. .
  • step s63 the value of the failure function is set to n (step s63), and if the value of n is 1 (YES in step s64), the process is terminated. If the value of n is not 1 (NO in step s64), the process proceeds to step s66.
  • step s62 when the same label as the character at the position e of the skip input is on the branch of the node n, n is updated to the corresponding branch destination node, e is set to e + 1 (step s65), and the process proceeds to step s66.
  • the collation range for skip input can be limited and collation can be performed at higher speed.
  • the duplication deletion unit 33 reads the keyword complement set output from the skip input / skip dictionary collation unit 31 from the collation result temporary storage unit 32, and generates and outputs a set of keywords from which duplicates are deleted. Here, only the one with the smallest number of erroneous characters is selected, and among the remaining ones, the overlapping areas that coincide on the input character string are interpreted as overlapping.
  • the duplicate deletion algorithm is shown in FIG.
  • a set of keyword candidates read out from the matching result temporary storage unit 32 (output of skip input / skip tri match) is set in the keyword complement set C, and a keyword set K to be finally output is an empty set ( ⁇ (Step s71).
  • one candidate (referred to as c) is taken out from the keyword candidate set C (step s74). All candidates whose candidate c matches the original keyword are extracted from the keyword complement set C (step s75). This is Ckeys.
  • the overlapped areas are deleted from the keyword complement set C as compared with the match start position and end position of all keywords in Cmins (step s77).
  • Steps s72 to s74 are repeated until the keyword complement set C becomes an empty set (step s72).
  • K is output as a final keyword set (step s73).
  • the keywords shown in FIG. 20 can be obtained by using the sentences 2 to 4 in FIG. 1 and the skip dictionary created from the keyword dictionary in FIG.
  • match type From the match type, start position, end position, and original keyword information obtained by the approximate matching device according to the embodiment of the present invention, from what character number to what character number in the input sentence matches the dictionary keyword. , It can be seen whether the match type was exact match, replacement, deletion, or insertion. Further, from the information of the error start position and the number of error characters, it is possible to know from what character to what number in the verification character range when the match type is replacement / insertion / deletion.
  • a character string including an erroneous character “Osonpic” can be detected as a one-character replacement type of “Olympic”.
  • the range of the input sentence “boy's 100m breaststroke” can be detected as the dictionary keyword “boy's 100m breaststroke” and the type of character insertion.
  • the technology according to the present invention can be used for a Web information filtering apparatus that prevents a Web page including an inappropriate term from being displayed.
  • Inappropriate term filtering requires the detection of text that contains inappropriate language, but such text is often described as inappropriate language with intentionally altered characters. It is.
  • FIG. 21 shows a configuration example of the Web information filtering apparatus according to the embodiment of the present invention.
  • the Web information filtering apparatus includes a skip dictionary creation unit 10, a skip dictionary storage unit 20, a keyword extraction unit 30, a filtering unit 40, and a display unit (display) 50.
  • the skip dictionary creation unit 10, the skip dictionary storage unit 20, and the keyword extraction unit 30 have the same functions as those shown in FIG. However, in this example, the keyword extraction unit 30 further has a function of inputting text data included in the Web page as an input character string via, for example, a communication network.
  • a list of inappropriate terms to be filtered is given to the skip dictionary creation unit 10 as a keyword dictionary, and a skip dictionary is created by the skip dictionary creation unit 10 and stored in the skip dictionary storage unit 20.
  • the keyword extraction unit 30 performs the keyword matching process described so far on the input character string. Thereby, a character string in which a part of characters of the inappropriate term is changed is also extracted as a deletion keyword.
  • the keyword extraction unit 30 outputs information such as a deleted keyword to the filtering unit 40 together with information on the Web page.
  • the filtering unit 40 controls the Web page information including the deleted keyword not to be passed to the display unit (display) 50. For web pages that do not include the deletion keyword, the filtering unit 40 outputs the web page to the display unit 50 as it is, and the display unit 50 displays the web page.
  • the technique according to the present invention can be applied to an automatic proofreading apparatus for text data.
  • FIG. 22 shows a configuration example of the automatic calibration apparatus according to the embodiment of the present invention.
  • the automatic calibration apparatus includes a skip dictionary creation unit 10, a skip dictionary storage unit 20, a keyword extraction unit 30, an input unit (keyboard) 60, a display control unit 70, and a display unit 50.
  • the skip dictionary creation unit 10, the skip dictionary storage unit 20, and the keyword extraction unit 30 have the same functions as those shown in FIG. However, in this example, the input part 60 for a user to input a character is provided, and the keyword extraction part 30 is further provided with the function to receive the character string which a user inputs from the input part 60 as an input character string. .
  • a word posted in a general dictionary is given as a keyword dictionary to the skip dictionary creation unit 10, and a skip dictionary is created by the skip dictionary creation unit 10 and stored in the skip dictionary storage unit 20.
  • the keyword extraction unit 30 performs the keyword matching process described so far on the input character string, and displays the information such as the deleted keyword obtained from the keyword matching process result and the input character string. Output to.
  • the display control unit 70 controls the display unit 50 so that the deleted keyword extracted by the keyword extraction unit 30 is highlighted and displayed together with the dictionary keyword.
  • the deleted keyword part By highlighting the deleted keyword part and presenting it to the user together with the dictionary keyword, it is possible to prompt the user to correct the part as an automatically detected error candidate.
  • a display image is shown in FIG. In the example shown in FIG. 23, highlighting is performed on the entire appearance portion of the input character string related to the deletion keyword.
  • the error character range may be highlighted using the appearance position of the error extracted by the keyword extraction unit 30.
  • the match type information for example, information indicating the collation range “Osompic” part of sentence 2 and the error character range “So” part, and one-character replacement of the dictionary keyword “Olympic” It is also possible to present the information that there is, and prompt the user to make a final determination as to whether correction is necessary.
  • the above examples are application examples that take advantage of the characteristics of this technology that can include character strings such as typographical omissions and typographical fluctuations as matching targets in dictionary searches, and text that includes other typographical omissions. It can be applied to various language processing techniques such as morphological analysis that performs word division.
  • the four deleted keywords and their values shown in FIG. 26 are generated from the keyword “.”
  • the generated deletion keyword and its value are converted into a trie structure, and a skip dictionary is created.
  • a failure function and an output function are further defined.
  • each skip input is checked against the skip dictionary.
  • the collation algorithm any one of FIGS. 4, 7, 15, and 17 is used according to the collation algorithm used in “(1) Collation of input character string and skip dictionary”.
  • the keyword candidates shown in FIG. 29 are obtained from each sentence in FIG.
  • the four deleted keywords and their values shown in FIG. 33 are generated from the keyword “”.
  • the generated deletion keyword and its value are converted into a trie structure, and a skip dictionary is created.
  • a failure function and an output function are further defined.
  • each skip input is checked against the skip dictionary.
  • the collation algorithm any one of FIGS. 4, 7, 15, and 17 is used according to the collation algorithm used in “(1) Collation of input character string and skip dictionary”.
  • the keyword candidates shown in FIG. 36 are obtained from each sentence in FIG.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

 本発明は、誤字や脱字、想定したキーワードと少し異なる表現が入力文字列に含まれ、抽出したいキーワード数が多い場合であっても、高速に抽出可能とすることを課題とする。その課題を解決するために、スキップ辞書作成部10により、抽出したいキーワードとして予めリストアップされたキーワード辞書について、キーワードそのものと、当該キーワードの全ての文字位置から少なくとも1つの文字を削除した文字列の集合とからなる削除キーワードを含むスキップ辞書を作成してスキップ辞書記憶部20に格納し、キーワード抽出部30により、入力文字列と前記スキップ辞書とを照合することにより、入力文字列から予め与えられたキーワード及び当該キーワードに近似したキーワードを抽出し、その出現位置とともに出力する。

Description

近似照合装置、近似照合方法、プログラム及び記録媒体
 本発明は、自然言語で記述された文章(入力文字列)から予め与えられたキーワードを抽出するための、入力文字列と所定のキーワードとを照合し、一致したキーワードとその出現位置を出力する技術に関する。
 <キーワード抽出>
 キーワード抽出は、自然言語で記述された入力文字列から、辞書のような予めリストアップされたキーワードを抽出するタスクである。
 例えば、図1に示す入力文字列から、オリンピックに関するキーワードを抽出することを考える。この場合、図2に示すような、抽出したいキーワードとして予め人手によりリストアップされたキーワードの集合(以下、キーワード辞書と呼ぶ。)中の各キーワードが前記入力文字列に含まれているかどうかを照合することにより抽出を行う。
 しかし、
 1.入力文字列は、人手により記述(入力)された文字列なので、誤字や脱字が含まれていたり、想定したキーワードと少し異なる表現が使われていることがしばしばある、
 2.キーワード数が多くなると、高速に抽出するのが困難になり、大量の入力文字列を処理するのに時間がかかる、という問題点がある。
 図1の入力文字列から図2のキーワード辞書中の各キーワードを抽出する場合、
 ・文2では、誤字によって「オリンピック」が「オソンピック」になっている、
 ・文3,4では、「男子100m平泳ぎ」が「男子の100m平泳ぎ」、「金メダル」が「メダル」と、わずかに異なった表現で記述されている、ため、文2,3,4からはキーワードを抽出できず、結果的に、文1からキーワード「オリンピック」が抽出されるだけとなる。
 [従来技術]
 (1)キーワードの近似照合
 従来、キーワードの近似照合方法として、正規表現が使われてきた。正規表現は、照合したいキーワードを、有限オートマトンで表現することにより、文字列中からわずかに異なる部分文字列を抽出することができる。これはプログラミング言語Perlなどで使われている。例えば、Perlの場合、「オリンピック」というキーワードを/オ.{1}ンピック/と表現することによって、図1の文1から「オリンピック」を、文2から「オソンピック」を抽出することができる。
 しかし、正規表現によるキーワード近似照合は、1つのキーワード毎に照合を繰り返すことになるため、キーワード数に比例した時間がかかり、キーワードの数が膨大になると照合速度が低下する。そのため、大量の文書から全てのキーワードを抽出するようなタスクでは、処理時間がかかるという問題点がある。
 なお、正規表現以外に、2つの対象物間の類似度を計算するDP(Dynamic Programming)によるマッチング法(非特許文献1参照)を用いることもできるが、キーワード毎にDPマッチングしなければならないため、大量のキーワード数では著しく処理速度が落ちるという問題点がある。
 (2)高速な完全一致照合:その1.トライ構造
 キーワード数が膨大な場合、キーワード辞書をトライ構造(非特許文献2参照)にすることにより、全てのキーワードを同時に照合することができる。トライ構造は、各キーワードの共通接頭辞を併合した木構造である。図2のキーワード辞書をトライ構造にした辞書(トライ辞書)の例を図3に示す。キーワードの各文字は、トライの枝として表現される。図中の「#」は、キーワードの終わりを表す終端記号で、トライのノードにはキーワード毎に異なる値を保持することができる。
 トライ辞書を用いたキーワード抽出は、入力文字列を先頭から1文字ずつずらしながらトライ辞書と照合することにより行う。なお、本明細書及び特許請求の範囲では、全ての文字列について、文字列の最初の文字を0文字目、次の文字を1文字目等と表記する。例えば、文字列の位置iは、当該文字列の最初の文字を0文字目としたi文字目の位置である。また、位置iなどにおけるiは文字列の位置の値である。更に、"文字列の位置"のみで文字列の位置の値を表す場合もある。
 トライ構造による照合アルゴリズムを図4に示す。トライ構造による照合においては、図4に示すように、入力文字列の全ての文字位置iについて、ステップs1~ステップs5の処理が繰り返される。
 まず、キーワード照合位置jを0とし、トライノードnを根ノードとすることにより初期化が行われる(ステップs1)。次に、ノードnの枝に終端記号#があるかどうかの判定がなされ(ステップs2)、終端記号#があれば、根ノードからの経路上の全枝ラベル、値、一致開始位置iが出力される(ステップs3)。
 ステップs2の判定において、ノードnの枝に終端記号#がない場合、入力文字列における位置i+jの文字Ci+jがトライノードnから分岐する枝ラベルにあるかどうかの判定がなさる(ステップs4)。
 ステップs4において、文字Ci+jがトライノードnから分岐する枝ラベルにない場合、入力文字列の次の文字位置について、ステップs1からの処理を繰り返す。ステップs4において、文字Ci+jがトライノードnから分岐する枝ラベルにある場合、jをj+1とし、nを該当枝先のノードに更新してステップs2に進む(ステップs5)。
 例えば、図1の文1を図3のトライ辞書と照合する場合、入力文の6文字目(位置i=6)から照合を開始すると、ノード1,2,3,4,5,6,7を経由して値1に至るので、6文字目からキーワード「オリンピック」が抽出され、その値は値1であることがわかる。
 トライ辞書を用いると、全キーワードを同時に照合できるため、処理速度はキーワード数には依存しない。そのため、数が膨大でも高速に照合することができる。
 しかし、トライ辞書を用いたキーワード照合は、キーワードと完全一致した文字列しか抽出できないため、誤字や脱字、少し異なる表現を使われたキーワードが抽出できないという問題点がある。
 (3)高速な完全一致照合:その2.AC法
 トライ構造を用いたキーワード照合を改良したものに、Aho-Corasick法(以下、AC法と呼ぶ。)(非特許文献3参照)がある。AC法を用いると、照合速度は入力文字列の長さ(文字数)のみに依存するようになるため、さらに高速に照合することができる。
 AC法では、図3のようなトライ辞書(AC法では、goto関数と呼ばれる。)の他に、failure関数、output関数を用いて高速に照合を行う。failure関数は、トライの照合が途中で失敗した際、失敗直前までの枝ラベル接尾辞と、トライの根ノードからの枝ラベル列の接頭辞とを比較して、最長一致するノードへ遷移するための関数である。output関数は、トライの照合が途中まで成功したとき、その枝ラベルの接尾辞がキーワードである場合、全てのキーワードを出力するための関数である。これはトライ構造の場合とは異なり、後方一致した値を全て出力する。キーワード辞書が図2の場合のfailure関数、output関数の例を、それぞれ図5、図6に、AC法による照合アルゴリズムを図7に示す。
 図7に示すように、AC法による照合では、まず、入力文字列照合位置eを0とし、トライノードnを1として初期化を行う(ステップs11)。続いて、入力文字列照合位置eが入力文字列長以上であるか否かの判定が行われ(ステップs12)、入力文字列照合位置eが入力文字列長以上であれば処理を終える。ステップs12で、力文字列照合位置eが入力文字列長以上でない場合、入力文字列の位置eの文字と同じラベルがノードnの枝にあるかどうかの判定がなされる(ステップs13)。
 ステップs13において、入力文字列の位置eの文字と同じラベルがノードnの枝にない場合、nをfailure関数の値とし(ステップs14)、そのnの値が1であれば、eをe+1として(ステップs15)、ステップs17に進む。また、ステップs13において、入力文字列の位置eの文字と同じラベルがノードnの枝にある場合、nを該当枝先のノードに更新し、eをe+1として(ステップs16)、ステップs17に進む。
 ステップs17では、output(n)が空集合でなければ、output(n)中のキーワードと値、及び一致開始位置i=(e-キーワード長)が出力され、ステップs12に進む。
 例えば、入力文字列が「金メダリスト誕生」であった場合、まず、ノード1が、0文字目で「金」の枝ラベル先16に遷移する。ここでは、output関数の値は定義されていないので、何も出力しない。これを繰り返すと、2文字目でノード18に至る。3文字目「リ」は、ノード18から出る枝ラベルにないので、failure関数を参照し、ノード12に遷移する(failure(18)=12)。つまり、入力文字列の1~2文字目「メダ」が既に照合終了した状態になる。ここから3文字目の照合を再開させると、結果的に入力文字列の1~5文字目がキーワード「メダリスト」と一致することがわかる。
 このように、AC法を用いると、入力文字列の長さに比例した時間しかかからないため、高速にキーワード抽出を行うことができる。
 しかし、AC法も、キーワードと完全一致した文字列しか抽出できないため、トライ構造と同様に誤字や脱字、少し異なる表現を使われたキーワードが抽出できないという問題点がある。
田中穂積 監修、「自然言語処理-基礎と応用-」、初版、社団法人電子情報通信学会、平成11年3月25日、p.12~15 松本裕治、影山太郎、永田昌明、齋藤洋典、徳永健伸、「岩波講座言語の科学 3 単語と辞書」、岩波書店、1997、p.74~75 北研二、津田和彦、獅々堀正幹、「情報検索アルゴリズム」、共立出版、2002、p.108~122
 本発明は、誤字や脱字、想定したキーワードと少し異なる表現が入力文字列に含まれ、また、抽出したいキーワード数が多い場合であっても、高速に抽出可能とすることを目的とする。
 上記問題点を解決するため、本発明を用いた技術では、以下の方法でN字連続(Nは任意の整数)までの挿入、削除、置換誤りを含む文字列と、大量のキーワードとを高速に照合する。
 1.キーワード辞書からトライ辞書を構築する際、各キーワード毎に、キーワードそのものと、当該キーワードの全ての文字位置pkから連続するwk字(1≦wk≦N)を削除した文字列の集合とからなる削除キーワードを生成し、トライ構造を作成する。これをスキップ辞書と呼ぶ。
 2.スキップ辞書の値には、各削除キーワード毎に、削除文字位置pk、削除文字数wk及び当該削除キーワードの元となったキーワード(元キーワード)を保持しておく。
 3.入力文字列とスキップ辞書とを照合する際、入力文字列そのものとスキップ辞書との照合だけでなく、当該入力文字列の全ての位置から連続するwi字(1≦wi≦N)スキップした入力文字列(以下、スキップ入力と呼ぶ。)の集合とスキップ辞書との照合も行う。なお、スキップ入力は陽に作成しても良いし、照合時に直接、入力文字列をスキップしながら照合しても良い。
 4.得られた削除キーワードの削除文字位置pk、削除文字数wk、入力文字列のキーワード上での相対スキップ位置pi、スキップ幅wiを比較してその削除キーワードを、
 ・wi,wkがともに0(wi=wk=0)ならば、キーワードは完全一致としてキーワードを出力する、
 ・wiが0で、wkが1以上(wi=0,wk>0)であれば、入力文字列のスキップ位置にwi字の削除文字が存在するものとしてキーワードを出力する、
 ・wiが1以上で、wkが0(wi>0,wk=0)であれば、入力文字列のスキップ位置にwi字の挿入文字が存在するものとしてキーワードを出力する、
 ・wiが1以上で、piとpkが等しく、wiとwk(wi>0,pi=pk,wi=wk)が等しければ、入力文字列のスキップ位置にwi=wk字の置換文字が存在するものとしてキーワードを出力する、
の4種類に分類する。
 5.スキップ辞書にfailure関数、output関数を定義し、照合をAC法で行うことにより、さらに高速に照合を行うこともできる。
 本発明を用いた技術によれば、
 ・挿入、削除、置換誤りが含まれた入力文字列からも、連続したN文字以内の誤りであればキーワードを抽出することができ、
 ・トライ構造を用いて全キーワードを同時に照合しているため、キーワード数が増えても処理時間がほとんど増加せず、
 ・照合方式にAC法を用いることにより、さらに高速に照合することもできる。
 また、本発明で出力するキーワードは、さらに文字の誤りやすさによってスコア付けすることもできる。従って、入力文字列の同じエリアに別のキーワード侯補があった場合、誤り文字を比較して、誤りにくい方だけを出力することもできる。
 また、本発明によれば、入力文字列に含まれるキーワード辞書に載ったキーワード(単語)を全て出力するため、単語同士のつながりやすさをn-gramモデル等でスコア付けすることにより、形態素解析器を作ることができる。
入力文字列の一例を示す説明図 キーワード辞書の一例を示す説明図 トライ辞書の一例を示す説明図 トライ構造による照合アルゴリズムを示す処理の流れ図 failure関数の一例を示す説明図 output関数の一例を示す説明図 AC法による照合アルゴリズムを示す処理の流れ図 本発明の近似照合装置の実施の形態の一例を示す構成図 削除キーワードとその値の一例を示す説明図 スキップ入力/スキップ辞書照合アルゴリズムを示す処理の流れ図 抽出されたキーワード候補の一例を示す説明図 スキップ入力の一例を示す説明図 抽出されたキーワード候補の他の例を示す説明図 トライ構造による入力文字列照合アルゴリズムを示す処理の流れ図 トライ構造によるスキップ入力照合アルゴリズムを示す処理の流れ図 AC法による入力文字列照合アルゴリズムを示す処理の流れ図 AC法によるスキップ入力照合アルゴリズムを示す処理の流れ図 重複削除アルゴリズムを示す処理の流れ図 重複削除後の抽出されたキーワードの一例を示す説明図 重複削除後の抽出されたキーワードの他の例を示す説明図 本発明の実施の形態に係るWeb情報フィルタリング装置の構成図 本発明の実施の形態に係る自動校正装置の構成図 本発明の実施の形態に係る自動校正装置が出力する画面例 中国語の入力文字列の一例を示す説明図 中国語のキーワード辞書の一例を示す説明図 中国語の削除キーワードとその値の一例を示す説明図 中国語の抽出されたキーワード候補の一例を示す説明図 中国語のスキップ入力の一例を示す説明図 中国語の抽出されたキーワード候補の他の例を示す説明図 重複削除後の中国語の抽出されたキーワードの一例を示す説明図 韓国語の入力文字列の一例を示す説明図 韓国語のキーワード辞書の一例を示す説明図 韓国語の削除キーワードとその値の一例を示す説明図 韓国語の抽出されたキーワード候補の一例を示す説明図 韓国語のスキップ入力の一例を示す説明図 韓国語の抽出されたキーワード候補の他の例を示す説明図 重複削除後の韓国語の抽出されたキーワードの一例を示す説明図
 図8は本発明の近似照合装置の実施の形態の一例を示すもので、スキップ辞書作成部10、スキップ辞書記憶部20及びキーワード抽出部30から構成される。なお、本明細書では、キーワードの最大削除文字数と入力文字列の最大スキップ幅は等しく、Nと表記する。
 また、近似照合装置は、CPUや、メモリ等の記憶手段を備えたコンピュータに、スキップ辞書作成部10、及びキーワード抽出部30の機能を実現するためのプログラムを搭載することにより実現可能である。また、スキップ辞書を別の装置等で作成し、それをスキップ辞書記憶部20に記憶することとすれば、コンピュータにキーワード抽出部30の機能を実現するためのプログラムを搭載することによりキーワード抽出手段を備えた近似照合装置を実現できる。また、当該プログラムは、可搬メモリ等の記憶媒体に格納しておき、そこからコンピュータにインストールすることが可能である。
 スキップ辞書作成部10は、予め与えられたキーワードに対して、キーワード毎に、キーワードそのものと、当該キーワードの全ての文字位置から連続する少なくとも1つの文字を削除した文字列の集合とからなる削除キーワードを含むスキップ辞書を作成する。
 スキップ辞書記憶部20は、スキップ辞書作成部10で作成されたスキップ辞書を記憶・保持する。
 キーワード抽出部30は、入力文字列とスキップ辞書記憶部20に保持されたスキップ辞書とを照合することにより、入力文字列から予め与えられたキーワード及び当該キーワードに近似したキーワードを抽出し、その出現位置とともに出力する。
 以下、前述した各部における処理の詳細について例を挙げて説明する。
 ≪スキップ辞書作成部≫
 スキップ辞書作成部10は、削除キーワード/値生成部11、削除キーワード/値一時記憶部12及びトライ辞書作成部13からなり、抽出したいキーワードとして予め人手によりリストアップされたキーワードの集合であるキーワード辞書からスキップ辞書を作成し、スキップ辞書記憶部20に格納する。
 <削除キーワード/値生成部>
 削除キーワード/値生成部11では、予め用意されたキーワード辞書中の各キーワードに対して、まず、キーワードそのものと、当該キーワードの全ての文字位置pkから連続するwk字(1≦wk≦N:Nはキーワードの削除最大文字数)を削除した文字列の集合とからなる削除キーワードを作成し、削除キーワード/値一時記憶部12に記憶する。
 その際、削除文字位置pk、削除文字数wk及び当該削除キーワードの元となったキーワードである元キーワードの組を値として生成し、その削除キーワードに対応させて削除キーワード/値一時記憶部12に記憶する。削除キーワードが元キーワードそのものである場合、wkは0である。pkは何を代入しても良いが、ここでは空欄とする。例えば、最大削除文字数N=2の場合、「オリンピック」というキーワードからは、図9に示す12個の削除キーワードとその値が生成される。
 もちろん、これは全てのキーワードに対して行わなくても良く、ある一定の長さ以上(例えば、4文字以上)の長さのキーワードに対してのみ、削除キーワードを作成しても良い。
 <トライ辞書作成>
 トライ辞書作成13では、削除キーワード/値一時記憶部12から削除キーワード/値生成部11が生成した削除キーワードと当該削除キーワードに対応する値を読み出し、トライ構造に変換して辞書を作成する。
 すなわち、トライ辞書作成13は、削除キーワード/値一時記憶部12から削除キーワード/値生成部11が生成した削除キーワードと当該削除キーワードに対応する値を読み出し、キーワードの各文字を枝とし、キーワード毎に異なる値を保持可能なノードを含む、キーワードの共通接頭辞を併合した木構造であるトライ構造に変換してスキップ辞書を作成する。
 後述するスキップ入力/スキップ辞書照合部でAC法を用いる場合、さらにfailure関数、output関数を定義する。これを全てのキーワードについて行い、スキップ辞書としてスキップ辞書記憶部20に格納する。
 ≪キーワード抽出部≫
 キーワード抽出部30は、スキップ入力/スキップ辞書照合部31、照合結果一時記憶部32及び重複削除部33からなり、誤字や脱字を含む入力文字列とスキップ辞書記憶部20に格納されたスキップ辞書とからキーワードを抽出し、その出現位置及び値とともに出力する。
 <スキップ入力/スキップ辞書照合部>
 まず、スキップ入力/スキップ辞書照合部31では、入力文字列とスキップ辞書記憶部20に格納されたスキップ辞書とを照合して、キーワードの侯補を抽出する。スキップ入力/スキップ辞書照合のアルゴリズムを図10に示す。なお、ここで抽出したキーワードは、
 ・EM:キーワードが入力文字列中に完全一致で出現
 ・DEL:入力文字列に削除文字(脱字)が存在する状態でキーワードと一致
 ・INS:入力文字列に挿入文字が存在する状態でキーワードと一致
 ・REP:入力文字列に置換文字(誤字)が存在する状態でキーワードと一致
の4つの一致タイプに分類される。
 (1)入力文字列とスキップ辞書の照合
 まず、入力文字列とスキップ辞書を照合する(ステップs21)。この照合アルゴリズムは、図4に示した通常のトライ辞書照合、図7に示したAC法による照合のどちらを用いても良い。また、これら以外の照合アルゴリズムを用いることもできる。
 次に、スキップ辞書と一致した全てのキーワード侯補について、以下のステップs22とステップs23の処理を繰り返す。
 削除キーワードの削除文字数wkが0ならば、一致タイプをEMとして、当該一致タイプ、入力文字列における一致開始位置、終了位置、誤り開始位置、誤り文字数、元キーワードを出力して照合結果一時記憶部32に記憶する(ステップs22)。
 削除キーワードの削除文字数wkが0より大きければ、一致タイプをDELとして、当該一致タイプ、入力文字列における一致開始位置、終了位置、誤り開始位置、誤り文字数、元キーワードを出力して照合結果一時記憶部32に記憶する(ステップs23)。
 上記のステップs22、s23において、一致タイプがEMであれば、誤り開始位置、誤り文字数はどちらも常に0となり、一致タイプがDELであれば、誤り開始位置、誤り文字数は、それぞれ削除キーワードの削除文字位置pk、削除文字数wkである。
 例えば、図1の文1と、図2から作成したスキップ辞書とを照合すると、図11に示すキーワード侯補が得られる。
 (2)スキップ入力とスキップ辞書の照合
 ここでは、まず、入力文字列の全ての位置から少なくとも1つの文字をスキップ、詳細には絶対スキップ位置pを一つずつ増加させながらスキップ幅wi字(1≦wi≦N)をスキップさせた文字列を作成する(ステップs24)。これをスキップ入力と呼ぶ。例えば、図1の文1についてスキップ入力を作成すると、図12に示す文字列が得られる。
 次に各スキップ入力とスキップ辞書とを照合する(ステップs25)。照合アルゴリズムは、図4または図7のどちらを用いても良い。また、これら以外の照合アルゴリズムを用いることもできる。なお、スキップ入力を作成せず、スキップ辞書との照合時に、入力文字列を直接スキップしながら照合することも可能である。
 続いて、スキップ辞書と一致した全てのキーワード侯補について、ステップs26~s29の処理を繰り返す。
 まず、ステップs26において、キーワードの一致開始位置iと絶対スキップ位置pから、キーワード上での相対スキップ位置pi=p-iを算出する。
 そして、pi≧0かつpi≦削除キーワードの文字列長であるか否かが判定され(ステップs27)、pi≧0かつpi≦削除キーワードの文字列長であればステップs28に進み、pi≧0かつpi≦削除キーワードの文字列長でなければ次のキーワード候補の処理を行う。
 pi≧0かつpi≦削除キーワードの文字列長である場合において、もし、削除キーワードの削除文字数wkが0ならば、一致タイプをINSとして、当該一致タイプ、入力文字列における一致開始位置、終了位置、誤り開始位置、誤り文字数、元キーワードを出力して照合結果一時記憶部32に記憶する(ステップs28)。
 もし、削除キーワードの削除文字数wkが0より大きく、かつ入力文字列の相対スキップ位置piと削除キーワードの削除文字位置pkが等しく、かつ入力文字列のスキップ幅wiと、削除キーワードの削除文字数wkが等しければ、一致タイプをREPとし、当該一致タイプ、入力文字列における一致開始位置、終了位置、誤り開始位置、誤り文字数、元キーワードを出力して照合結果一時記憶部32に記憶する(ステップs29)。
 ステップs28、s29において、誤り開始位置、誤り文字数は、それぞれスキップ入力の相対スキップ位置pi、スキップ幅wiとなる。
 ステップs24から、ステップs26~s29の繰り返し処理までの処理が入力文字列の絶対スキップ位置p=0から(文字列長-wi)まで繰り返され、当該繰り返しの処理が、入力文字列のスキップ幅wi=1からNまで繰り返される。
 例えば、図12のスキップ入力と、図2のキーワード辞書から作成したスキップ辞書を照合すると、図13に示すキーワード侯補が得られる。なお、一致タイプREPが11個出現しているのは、元キーワードと同一の文字への置換が、各文字位置で出現したと解釈しているからである。
 (3)トライ構造によるスキップ辞書照合の高速化
 図10では入力文字列、スキップ入力の2箇所(ステップs21,ステップs25)でスキップ辞書との照合を行っていた。通常のトライ構造を用いる場合、上記2箇所の照合アルゴリズムを図4から、それぞれ図14,図15に示すようなアルゴリズムに変更することにより、さらに高速にスキップ辞書との照合を行うことができる。
 まず、入力文字列とスキップ辞書との照合(図14)では、入力文字列の全ての文字位置(照合開始位置)iにおいて、入力文字列とスキップ辞書をトライ法で照合し、照合に成功したキーワード等を出力する(ステップs31~ステップs35)とともに、照合に失敗した文字位置jをiと組にして保存しておく(ステップs36)。
 つまり、図14に示すように、入力文字列の全ての文字位置iについて、ステップs31~ステップs36の処理が繰り返される。
 まず、キーワード照合位置jを0とし、トライノードnを根ノードとすることにより初期化が行われる(ステップs31)。次に、ノードnの枝に終端記号#があるかどうかの判定がなされ(ステップs32)、終端記号#があれば、根ノードからの経路上の全枝ラベル、値、一致開始位置iが出力される(ステップs33)。
 ステップs32の判定において、ノードnの枝に終端記号#がない場合、入力文字列における位置i+jの文字Ci+jがトライノードnから分岐する枝ラベルにあるかどうかの判定がなさる(ステップs34)。
 ステップs34において、文字Ci+jがトライノードnから分岐する枝ラベルにない場合、文字位置iと、キーワード照合失敗位置jを対で保存し(ステップs36)、入力文字列の次の文字位置について、ステップs31からの処理を繰り返す。ステップs34において、文字Ci+jがトライノードnから分岐する枝ラベルにある場合、jをj+1とし、nを該当枝先のノードに更新してステップs2に進む(ステップs35)。
 ステップs36の処理により、照合開始位置(一致開始位置)i毎に、j-1文字まで照合が成功したことが示される。
 スキップ入力とスキップ辞書との照合(図15)では、入力文字列の全ての文字位置(照合開始位置)iにおいて、スキップ入力とスキップ辞書をトライ法で照合する(ステップs43~ステップs47)が、その際、位置iに対応する保存済みのキーワード照合失敗位置fを取得(正確には、ステップs36で保存したjをfとして取得)する(ステップs41)。
 ここで、スキップ入力の絶対スキップ位置pがp<iならば、もしキーワードが一致したとしても、入力文字列との照合で一致済みである。また、p>i+fならば、スキップ位置に至る前に照合が失敗することが明らかである。従って、p<iまたはp>i+fであるかどうかの判定を行い(ステップs42)、p<iまたはp>i+fであれば何もせずに次の文字位置i+1に処理を移す。
 p<iまたはp>i+fでなければ、図4に示した処理と同様にして、まず、キーワード照合位置jを0とし、トライノードnを根ノードとすることにより初期化が行われる(ステップs43)。次に、ノードnの枝に終端記号#があるかどうかの判定がなされ(ステップs44)、終端記号#があれば、根ノードからの経路上の全枝ラベル、値、一致開始位置iが出力される(ステップs45)。
 ステップs44の判定において、ノードnの枝に終端記号#がない場合、入力文字列における位置i+jの文字Ci+jがトライノードnから分岐する枝ラベルにあるかどうかの判定がなさる(ステップs46)。
 ステップs46において、文字Ci+jがトライノードnから分岐する枝ラベルにない場合、入力文字列の次の文字位置について、ステップs41からの処理を繰り返す。ステップs46において、文字Ci+jがトライノードnから分岐する枝ラベルにある場合、jをj+1とし、nを該当枝先のノードに更新してステップs44に進む(ステップs47)。
 このように、トライ構造との照合アルゴリズムを変更することにより、スキップ入力の照合範囲を限定することができ、さらに高速な照合を行うことができる。
 (4)AC法によるスキップ辞書照合の高速化
 図10では入力文字列、スキップ入力の2箇所(ステップs21,ステップs25)でスキップ辞書との照合を行っていた。AC法を用いる場合、上記2箇所の照合アルゴリズムを図7から、それぞれ図16,図17に示すようなアルゴリズムに変更することにより、さらに高速にスキップ辞書との照合を行うことができる。
 まず、入力文字列とスキップ辞書との照合(図16)では、入力文字列とスキップ辞書をAC法で照合し、照合に成功したキーワード等を出力する(ステップs51,ステップs52,ステップs54~s58)とともに、入力文字列の各文字位置(照合位置)eにおける最初のトライノード番号nを保存しておく(ステップs53)。これをトライノード関数n=trienode(e)と呼ぶ。トライノード関数は、入力文字列にスキップがない場合、入力文字列上で照合済みの文字位置とトライ上での状態を対応づける関数である。
 より詳細には、図16においてまず、入力文字列照合位置eを0とし、トライノードnを1として初期化を行う(ステップs51)。続いて、入力文字列照合位置eが入力文字列長以上であるか否かの判定が行われ(ステップs52)、入力文字列照合位置eが入力文字列長以上であれば処理を終える。ステップs52で、入力文字列照合位置eが入力文字列長以上でない場合、trienode(e)が保存されていなければ、trienode(e)にnの値を代入し、入力文字列照合位置eとノードnを記憶部に保存する(ステップs53)。そして、入力文字列の位置eの文字と同じラベルがノードnの枝にあるかどうかの判定がなされる(ステップs54)。
 ステップs54において、入力文字列の位置eの文字と同じラベルがノードnの枝にない場合、nをfailure関数の値とし(ステップs55)、そのnの値が1であれば、eをe+1として(ステップs56)、ステップs58に進む。また、ステップs54において、入力文字列の位置eの文字と同じラベルがノードnの枝にある場合、nを該当枝先のノードに更新し、eをe+1として(ステップs57)、ステップs58に進む。
 ステップs58では、output(n)が空集合でなければ、output(n)中のキーワードと値、及び一致開始位置i=(e-削除キーワード長)が出力され、ステップs52に進む。
 スキップ入力とスキップ辞書との照合(図17)では、入力文字列の絶対スキップ位置pからAC法による照合を開始する。即ち、初期状態をスキップ入力の照合位置e=p、トライノードn=trienode(e)として照合を再開する(ステップs61~s66)。
 照合はスキップ入力の最後まで行うのではなく、failure関数によって遷移するトライノードが根ノード(n=1)に遷移した時点で照合を終了する(ステップs64)。これ以降は入力にスキップが存在しないため、入力文字列との照合で得られたキーワードと同一のものしか一致しないからである。
 より詳細には、まず、スキップ入力の照合位置e=p、トライノードn=trienode(e)とし(ステップs61)、スキップ入力の位置eの文字と同じラベルがノードnの枝にあるかどうかの判定がなされる(ステップs62)。
 スキップ入力の位置eの文字と同じラベルがノードnの枝にない場合、nをfailure関数の値とし(ステップs63)、そのnの値が1であれば(ステップs64のYES)、処理を終了し、そのnの値が1でなければ(ステップs64のNO)、ステップs66に進む。
 ステップs62において、スキップ入力の位置eの文字と同じラベルがノードnの枝にある場合、nを該当枝先のノードに更新し、eをe+1として(ステップs65)、ステップs66に進む。
 ステップs66では、output(n)が空集合でなければ、output(n)中のキーワードと値、及び一致開始位置i=(e-キーワード長)が出力され、ステップs62に進む。
 このようにAC法による照合アルゴリズムを変更することにより、スキップ入力の照合範囲を限定することができ、さらに高速な照合を行うことができる。
 <重複削除部>
 重複削除部33では、照合結果一時記憶部32からスキップ入力/スキップ辞書照合部31が出力したキーワード侯補の集合を読み出し、重複するものを削除したキーワードの集合を生成して出力する。ここでは、誤り文字数が最小のものだけを選択し、残りのもののうち、入力文字列上で一致したエリアが重なるものは重複と解釈する。重複削除アルゴリズムを図18に示す。
 1.まず、キーワード侯補集合Cに、照合結果一時記憶部32から読み出したキーワード侯補の集合(スキップ入力/スキップトライ照合の出力)をセットし、最終的に出力するキーワード集合Kを空集合(Φ)とする(ステップs71)。
 2.次に、キーワード侯補集合Cから侯補を一つ(cとする)を取り出す(ステップs74)。この候補cと元キーワードが一致するものを、キーワード侯補集合Cから全て取り出す(ステップs75)。これをCkeysとする。
 3.次に、Ckeysから、誤り文字数が最小の侯補を全て取り出し(Cminsとする)、Cminsをキーワード集合Kに加える(ステップs76)。
 4.最後に、Ckeysの全てのキーワード侯補について、Cmins中の全てのキーワードの一致開始位置、終了位置と比較して、エリアが重なるものをキーワード侯補集合Cから削除する(ステップs77)。
 5.ステップs72~s74を、キーワード侯補集合Cが空集合になるまで繰り返す(ステップs72)。
 6.Kを、最終的なキーワード集合として出力する(ステップs73)。
 このように重複を削除することにより、例えば、図1の文1と、図2のキーワード辞書から作成したスキップ辞書から、図19に示すキーワードだけが残ることになる。つまり、入力文字列の6文字目から、「オリンピック」というキーワードが完全一致で出現したという意味になる。
 同様に、図1の文2~4と、図2のキーワード辞書から作成したスキップ辞書を用いると、図20に示すキーワードが得られる。
 本発明の実施の形態に係る近似照合装置により得られる一致タイプ・開始位置・終了位置・元キーワードの情報からは、各入力文中の、何文字目から何文字目が辞書のキーワードと一致したのか、その一致タイプが完全一致・置換・削除・挿入のいずれかであったのかがわかる。また、誤り開始位置・誤り文字数の情報からは、一致タイプが置換・挿入・削除の場合に、照合文字範囲で何文字目から何文字が誤りであったのかがわかる。
 本発明の実施の形態に係る近似照合装置によれば、例えば、図20に示すように、文2では、「オソンピック」という誤字を含む文字列も「オリンピック」の1文字置換タイプとして検出できる。また、文3では、入力文の「男子の100m平泳ぎ」という範囲が辞書キーワード「男子100m平泳ぎ」と一字挿入のタイプとして検出できる。
 これにより、「オリンピック」や「男子100m平泳ぎ」に関する情報を検索する場面において、「オソンピック」や「男子の100m平泳ぎ」という誤字脱字・表記ゆれを含むテキストでも検索対象となり、その出現範囲とともにユーザーに提示可能となる。すなわち、本発明に係る近似照合装置は、誤字脱字や表記ゆれにも頑健な情報検索装置として利用できる。
 また、例えば、本発明に係る技術を、不適切な用語を含むWebページを表示させないようにするWeb情報フィルタリング装置に利用することもできる。不適切用語のフィルタリングでは、不適切表現を含むテキストの検出が必要であるが、そのようなテキストは故意に元の表記から一部の文字を変更した不適切表現として記載されることが往々にしてある。
 本発明に係る技術では、元のキーワードからN文字連続の変更が加えられた文字列でも検出することが可能であり、従来の不適切用語検出より幅広いテキストの出現に対処できる。
 図21に本発明の実施の形態に係るWeb情報フィルタリング装置の構成例を示す。
 図21に示すように、このWeb情報フィルタリング装置は、スキップ辞書作成部10、スキップ辞書記憶部20、キーワード抽出部30、フィルタリング部40、表示部(ディスプレイ)50を備える。
 スキップ辞書作成部10、スキップ辞書記憶部20、キーワード抽出部30は、これまでに説明した図8に示したものと同様の機能を有する。ただし、本例において、キーワード抽出部30は、例えば通信ネットワークを介して、Webページに含まれるテキストデータを入力文字列として入力する機能を更に有している。
 図21の構成において、フィルタをかけたい不適切用語のリストをキーワード辞書としてスキップ辞書作成部10に与え、スキップ辞書作成部10によりスキップ辞書が作成され、スキップ辞書記憶部20に記憶される。
 そして、キーワード抽出部30が、入力文字列に対してこれまでに説明したキーワード照合処理を行う。これにより、不適切用語の一部の文字が変更されたような文字列も削除キーワードとして抽出される。キーワード抽出部30は、削除キーワード等の情報をWebページの情報とともにフィルタリング部40に出力する。
 フィルタリング部40はキーワード抽出部30から受け取った情報に基づき、削除キーワードを含むWebページの情報を表示部(ディスプレイ)50に渡さないように制御する。削除キーワードを含まないWebページについては、フィルタリング部40は、そのまま表示部50に出力し、表示部50がWebページを表示する。
 また、例えば、本発明に係る技術をテキストデータの自動校正装置に適用することも可能である。
 図22に本発明の実施の形態に係る自動校正装置の構成例を示す。図22に示すように、この自動校正装置は、スキップ辞書作成部10、スキップ辞書記憶部20、キーワード抽出部30、入力部(キーボード)60、表示制御部70、表示部50を備える。
 スキップ辞書作成部10、スキップ辞書記憶部20、キーワード抽出部30は、これまでに説明した図8に示したものと同様の機能を有する。ただし、本例においては、ユーザーが文字入力を行うための入力部60が備えられ、キーワード抽出部30は、ユーザーが入力部60から入力する文字列を入力文字列として受け取る機能を更に備えている。
 図22の構成において、一般的な辞書に掲載されている単語をキーワード辞書としてスキップ辞書作成部10に与え、スキップ辞書作成部10によりスキップ辞書が作成され、スキップ辞書記憶部20に記憶される。そして、キーワード抽出部30が、入力文字列に対してこれまでに説明したキーワード照合処理を行い、キーワード照合処理の結果により得られた削除キーワード等の情報と、入力文字列とを表示制御部70に出力する。
 表示制御部70は、キーワード抽出部30で抽出された削除キーワードをハイライトして辞書キーワードとともに、表示を行うよう表示部50を制御する。削除キーワードの部分をハイライトして辞書キーワードとともにユーザに提示することで、自動検出した誤り候補として当該部分の修正をユーザに促すことが可能となる。表示のイメージを図23に示す。図23に示す例では、削除キーワードに係る入力文字列での出現形の部分全体に対してハイライトを行っている。
 ここで、出現形全体をハイライトさせる代わりに、キーワード抽出部30で抽出した誤りの出現位置を利用して、誤り文字範囲だけをハイライトしてもよい。また、一致タイプの情報を利用して、例えば、文2の照合範囲「オソンピック」の部分と誤り文字の範囲「ソ」の部分とを指摘する情報と、辞書キーワード「オリンピック」の1字置換であるという情報とを提示し、修正要否の最終判断をユーザーに促すこととしてもよい。
 以上の例は、いずれの場合も、誤字脱字や表記ゆれといった文字列を辞書検索の一致対象に含めることができる本技術の特性を活かした適用例であり、他にも誤字脱字を含んだテキストの単語分割を行う形態素解析など、様々な言語処理技術への適用を行うことができる。
 誤字脱字や表記ゆれといった現象は、人間が入力したテキストであれば必ず発生する可能性がある。本発明に係る技術により、これらの現象も含めて言語処理をターゲットとでき、より頑健で柔軟な言語処理アプリケーションを実現できる。
 (中国語における例)
 本発明は、日本語のみでなく、他の言語についても同様に適用することができる。例えば、中国語の例として、図24に示す入力文字列から、図25に示すキーワードを抽出することを考える。
 従来の完全一致によるキーワード抽出法では、文1からはキーワード「
Figure JPOXMLDOC01-appb-C000001

」が抽出されるが、
 ●文2では、「
Figure JPOXMLDOC01-appb-C000002

」が「
Figure JPOXMLDOC01-appb-C000003

」と表記され、また、「男子100米蛙泳」が「男子的100米蛙泳」と、わずかに異なった表現で記述されている、
 ●文3では、「金牌得主」が「金靴得主」と記述されている、
 ため、文2,3からはキーワードが抽出できない。
 本発明に係る技術を用いると、キーワードが大量にあった場合でも、以下に説明するとおり、文2,3からもキーワードを抽出することが可能である。なお、以下の説明では、最大削除文字数N=1として説明する。
 《スキップ辞書作成部》
 スキップ辞書作成部10では、まず、削除キーワードとその値を生成する。例えば、最大削除文字数N=1の場合、「
Figure JPOXMLDOC01-appb-C000004

」というキーワードからは、図26に示す4つの削除キーワードとその値が生成される。
 次に、生成した削除キーワードとその値をトライ構造に変換して、スキップ辞書を作成する。スキップ入力/スキップ辞書照合でAC法を用いる場合、さらにfailure関数、output関数を定義する。
 《キーワード抽出部》
 〈スキップ入力/スキップ辞書照合部〉
 (1)入力文字列とスキップ辞書の照合
 まず、入力文字列そのものとスキップ辞書を照合する。照合アルゴリズムは、図4、図7、図14、図16のいずれかを用いる。すると、図24の各文からは、図27に示すキーワード候補が得られる。
 (2)スキップ入力とスキップ辞書の照合
 入力文字列からスキップ入力を作成する。N=1において、図24の文1から作成したスキップ入力を図28に示す。
 次に、各スキップ入力をスキップ辞書と照合する。照合アルゴリズムは、「(1)入力文字列とスキップ辞書の照合」で用いた照合アルゴリズムにより、図4、図7、図15、図17のいずれかを用いる。
 ●(1)で図4を用いた場合は同じく図4のアルゴリズムを使用する。
 ●(1)で図7を用いた場合は同じく図7のアルゴリズムを使用する。
 ●(1)で図14を用いた場合は図15のアルゴリズムを使用する。
 ●(1)で図16を用いた場合は図17のアルゴリズムを使用する。
 得られた全てのキーワード侯補について、一致タイプを分類すると、図24の各文からは、図29に示すキーワード侯補が得られる。
 〈重複削除部〉
 最後に、キーワード侯補集合から、図18に示すアルゴリズムで重複を削除する。結果、各文からは、図30に示すキーワードが得られる。
 (韓国語における例)
 次に、本発明を日本語以外の言語に適用する別の例として、韓国語の例を説明する。ここでは、図31に示す入力文字列から、図32に示すキーワードを抽出することを考える。
 従来の完全一致によるキーワード抽出法では、文1からはキーワード「
Figure JPOXMLDOC01-appb-C000005

」が抽出されるが、
 ●文2では、「
Figure JPOXMLDOC01-appb-C000006

」が「
Figure JPOXMLDOC01-appb-C000007

」と表記され、また、「
Figure JPOXMLDOC01-appb-C000008

」が「
Figure JPOXMLDOC01-appb-C000009

」と、わずかに異なった表現で記述されている、
 ●文3では、「
Figure JPOXMLDOC01-appb-C000010

」が「
Figure JPOXMLDOC01-appb-C000011

」と記述されている、
 ため、文2,3からはキーワードが抽出できない。
 本発明に係る技術を用いると、キーワードが大量にあった場合でも、以下に説明するとおり、文2,3からもキーワードを抽出することが可能である。なお、以下の説明では、最大削除文字数N=1として説明する。
 《スキップ辞書作成部》
 スキップ辞書作成部10では、まず、削除キーワードとその値を生成する。例えば、最大削除文字数N=1の場合、「
Figure JPOXMLDOC01-appb-C000012

」というキーワードからは、図33に示す4つの削除キーワードとその値が生成される。
 次に、生成した削除キーワードとその値をトライ構造に変換して、スキップ辞書を作成する。スキップ入力/スキップ辞書照合でAC法を用いる場合、さらにfailure関数、output関数を定義する。
 《キーワード抽出部》
 〈スキップ入力/スキップ辞書照合部〉
 (1)入力文字列とスキップ辞書の照合
 まず、入力文字列そのものとスキップ辞書を照合する。照合アルゴリズムは、図4、図7、図14、図16のいずれかを用いる。すると、図31の各文からは、図34に示すキーワード候補が得られる。
 (2)スキップ入力とスキップ辞書の照合
 入力文字列からスキップ入力を作成する。N=1において、図31の文1から作成したスキップ入力を図35に示す。
 次に、各スキップ入力をスキップ辞書と照合する。照合アルゴリズムは、「(1)入力文字列とスキップ辞書の照合」で用いた照合アルゴリズムにより、図4、図7、図15、図17のいずれかを用いる。
 ●(1)で図4を用いた場合は同じく図4のアルゴリズムを使用する。
 ●(1)で図7を用いた場合は同じく図7のアルゴリズムを使用する。
 ●(1)で図14を用いた場合は図15のアルゴリズムを使用する。
 ●(1)で図16を用いた場合は図17のアルゴリズムを使用する。
 得られた全てのキーワード侯補について、一致タイプを分類すると、図31の各文からは、図36に示すキーワード侯補が得られる。
 〈重複削除部〉
 最後に、キーワード侯補集合から、図18に示すアルゴリズムで重複を削除する。結果、各文からは、図37に示すキーワードが得られる。
 このように、日本語のみでなく、他の言語に関しても、N字連続までの挿入、削除、置換誤りを含む文字列と、大量のキーワードを高速に照合することが可能である。
 なお、本発明は、上記の実施の形態に限定されることなく、特許請求の範囲内において種々変更・応用が可能である。
 本国際出願は2008年9月5日に出願された日本国特許出願第2008-228382号に基づく優先権を主張するものであり、その全内容を本国際出願に援用する。
 10:スキップ辞書作成部、11:削除キーワード/値生成部、12:削除キーワード/値一時記憶部、13:トライ辞書作成部、20:スキップ辞書記憶部、30:キーワード抽出部、31:スキップ入力/スキップ辞書照合部、32:照合結果一時記憶部、33:重複削除部、40:フィルタリング部、50:表示部、60:入力部、70:表示制御部

Claims (14)

  1.  自然言語で記述された入力文字列と所定のキーワードとを照合し、一致したキーワードとその出現位置を出力する近似照合装置であって、
     予め与えられたキーワードに対して、キーワードそのものと、当該キーワードの全ての文字位置から少なくとも1つの文字を削除した文字列の集合とからなる削除キーワードを含むスキップ辞書を記憶するスキップ辞書記憶手段と、
     前記入力文字列と、前記スキップ辞書記憶手段に記憶された前記スキップ辞書とを照合することにより、入力文字列から予め与えられたキーワード及び当該キーワードに近似したキーワードを抽出し、その出現位置とともに出力するキーワード抽出手段とを備えた
     ことを特徴とする近似照合装置。
  2.  前記削除キーワードは、前記予め与えられたキーワードそのものと、当該キーワードの全ての文字位置pkから連続するwk字(但し1≦wk≦NであってNはキーワードの削除最大文字数)を削除した文字列の集合とからなり、
     前記スキップ辞書は、前記集合の中の各削除キーワード毎に、当該削除キーワードの値として、その削除文字位置pk、削除文字数wk及び当該削除キーワードの元となったキーワードである元キーワードの組を含むことを特徴とする請求項1に記載の近似照合装置。
  3.  前記キーワード抽出手段は、
     前記入力文字列と前記スキップ辞書記憶手段に格納されたスキップ辞書とを照合し、スキップ辞書と一致した全てのキーワード侯補について、削除キーワードの削除文字数wkが0ならば「キーワードが入力文字列中に完全一致で出現」を表す一致タイプEMに分類し、削除キーワードの削除文字数wkが0より大きければ「入力文字列に削除文字が存在する状態でキーワードと一致」を表す一致タイプDELに分類し、分類した結果を一致タイプとして、一致タイプ、入力文字列における一致開始位置、終了位置、誤り開始位置、誤り文字数、元キーワードを記憶手段に記憶し、
     入力文字列の絶対スキップ位置pを一つずつ増加させながらスキップ幅wi字(但し1≦wi≦NであってNは入力文字列の最大スキップ幅)をスキップさせた文字列であるスキップ入力を作成し、各スキップ入力と前記スキップ辞書とを照合し、スキップ辞書と一致した全てのキーワード侯補について、キーワード上での相対スキップ位置piを算出し、削除キーワードの削除文字数wkが0ならば「入力文字列に挿入文字が存在する状態でキーワードと一致」を表す一致タイプINSに分類し、削除キーワードの削除文字数wkが0より大きく、かつ入力文字列の相対スキップ位置piと削除キーワードの削除文字位置pkが等しく、かつ入力文字列のスキップ幅wiと削除キーワードの削除文字数wkが等しければ「入力文字列に置換文字が存在する状態でキーワードと一致」を表す一致タイプREPに分類し、分類した結果を一致タイプとして、一致タイプ、入力文字列における一致開始位置、終了位置、誤り開始位置、誤り文字数及び元キーワードを記憶手段に記憶するスキップ入力/スキップ辞書照合手段を有する
     ことを特徴とする請求項2に記載の近似照合装置。
  4.  前記キーワード抽出手段は、前記記憶手段から前記スキップ入力/スキップ辞書照合手段が出力したキーワード侯補の集合を読み出し、重複するものを削除したキーワードの集合を生成して出力する重複削除手段を更に有することを特徴とする請求項3に記載の近似照合装置。
  5.  前記スキップ辞書における削除キーワードは、トライ構造を有しており、前記スキップ辞書/スキップ辞書照合手段は、
     前記入力文字列と前記スキップ辞書との照合では、前記入力文字列を先頭から1文字ずつずらしながら前記スキップ辞書と照合し、一致したキーワードを得るとともに入力文字列の各文字位置でのキーワード照合失敗位置の値を保存しておき、
     前記スキップ入力と前記スキップ辞書との照合では、絶対スキップ位置の値が前記入力文字列の文字位置の値以上または文字位置の値とキーワード照合失敗位置の値を加算した値以下の場合のみ、照合を行う
     ことを特徴とする請求項3又は4に記載の近似照合装置。
  6.  前記スキップ辞書における削除キーワードは、トライ構造を有しており、前記スキップ辞書/スキップ辞書照合手段は、
     前記入力文字列と前記スキップ辞書との照合では、入力文字列とスキップ辞書をAC法で照合し、一致したキーワードを得るとともに入力文字列の各文字位置での前記トライ構造のノード番号を保存しておき、
     前記スキップ入力と前記スキップ辞書との照合では、絶対スキップ位置からAC法による照合を再開し、前記トライ構造のノードが根ノードに遷移するまで照合する
     ことを特徴とする請求項3又は4に記載の近似照合装置。
  7.  自然言語で記述された入力文字列と所定のキーワードとを照合し、一致したキーワードとその出現位置を出力する近似照合装置が実行する近似照合方法であって、
     前記近似照合装置は、予め与えられたキーワードに対して、キーワードそのものと、当該キーワードの全ての文字位置から少なくとも1つの文字を削除した文字列の集合とからなる削除キーワードを含むスキップ辞書を記憶するスキップ辞書記憶手段を備え、前記近似照合方法は、
     キーワード抽出手段が、前記入力文字列と、前記スキップ辞書記憶手段に記憶された前記スキップ辞書とを照合することにより、入力文字列から予め与えられたキーワード及び当該キーワードに近似したキーワードを抽出し、その出現位置とともに出力するキーワード抽出ステップを含む
     ことを特徴とする近似照合方法。
  8.  前記削除キーワードは、前記予め与えられたキーワードそのものと、当該キーワードの全ての文字位置pkから連続するwk字(但し1≦wk≦NであってNはキーワードの削除最大文字数)を削除した文字列の集合とからなり、
     前記スキップ辞書は、前記集合の中の各削除キーワード毎に、当該削除キーワードの値として、その削除文字位置pk、削除文字数wk及び当該削除キーワードの元となったキーワードである元キーワードの組を含むことを特徴とする
     ことを特徴とする請求項7に記載の近似照合方法。
  9.  前記キーワード抽出ステップは、
     前記入力文字列と前記スキップ辞書記憶手段に格納されたスキップ辞書とを照合し、スキップ辞書と一致した全てのキーワード侯補について、削除キーワードの削除文字数wkが0ならば「キーワードが入力文字列中に完全一致で出現」を表す一致タイプEMに分類し、削除キーワードの削除文字数wkが0より大きければ「入力文字列に削除文字が存在する状態でキーワードと一致」を表す一致タイプDELに分類し、分類した結果を一致タイプとして、一致タイプ、入力文字列における一致開始位置、終了位置、誤り開始位置、誤り文字数、元キーワードを記憶手段に記憶し、
     入力文字列の絶対スキップ位置pを一つずつ増加させながらスキップ幅wi字、但し1≦wi≦NであってNは入力文字列の最大スキップ幅、をスキップさせた文字列であるスキップ入力を作成し、各スキップ入力と前記スキップ辞書とを照合し、スキップ辞書と一致した全てのキーワード侯補について、キーワード上での相対スキップ位置piを算出し、削除キーワードの削除文字数wkが0ならば「入力文字列に挿入文字が存在する状態でキーワードと一致」を表す一致タイプINSに分類し、削除キーワードの削除文字数wkが0より大きく、かつ入力文字列の相対スキップ位置piと削除キーワードの削除文字位置pkが等しく、かつ入力文字列のスキップ幅wiと削除キーワードの削除文字数wkが等しければ「入力文字列に置換文字が存在する状態でキーワードと一致」を表す一致タイプREPに分類し、分類した結果を一致タイプとして、一致タイプ、入力文字列における一致開始位置、終了位置、誤り開始位置、誤り文字数及び元キーワードを記憶手段に記憶するスキップ入力/スキップ辞書照合ステップを含む
     ことを特徴とする請求項8に記載の近似照合方法。
  10.  前記スキップ入力/スキップ辞書照合ステップは、記憶手段から前記スキップ入力/スキップ辞書照合ステップにおいて記憶されたキーワード侯補の集合を読み出し、重複するものを削除したキーワードの集合を生成して出力するステップを有する
     ことを特徴とする請求項9に記載の近似照合方法。
  11.  前記スキップ辞書における削除キーワードは、トライ構造を有しており、前記スキップ辞書/スキップ辞書照合ステップにおいて、前記キーワード抽出手段は、
     前記入力文字列と前記スキップ辞書との照合では、前記入力文字列を先頭から1文字ずつずらしながら前記スキップ辞書と照合し、一致したキーワードを得るとともに入力文字列の各文字位置でのキーワード照合失敗位置の値を保存しておき、
     前記スキップ入力と前記スキップ辞書との照合では、絶対スキップ位置の値が前記入力文字列の文字位置の値以上または文字位置の値とキーワード照合失敗位置の値を加算した値以下の場合のみ、照合を行う
     ことを特徴とする請求項9又は10に記載の近似照合方法。
  12.  前記スキップ辞書における削除キーワードは、トライ構造を有しており、前記スキップ辞書/スキップ辞書照合ステップにおいて、前記キーワード抽出手段は、
     前記入力文字列と前記スキップ辞書との照合では、入力文字列とスキップ辞書をAC法で照合し、一致したキーワードを得るとともに入力文字列の各文字位置での前記トライ構造のノード番号を保存しておき、
     前記スキップ入力と前記スキップ辞書との照合では、絶対スキップ位置からAC法による照合を再開し、前記トライ構造のノードが根ノードに遷移するまで照合する
     ことを特徴とする請求項9又は10に記載の近似照合方法。
  13.  コンピュータを、自然言語で記述された入力文字列と所定のキーワードとを照合し、一致したキーワードとその出現位置を出力する近似照合装置として機能させるためのプログラムであって、
     前記コンピュータは、予め与えられたキーワードに対して、キーワードそのものと、当該キーワードの全ての文字位置から少なくとも1つの文字を削除した文字列の集合とからなる削除キーワードを含むスキップ辞書を記憶するスキップ辞書記憶手段を備え、前記プログラムは、前記コンピュータを、
     請求項1乃至6のいずれかに記載の近似照合装置のキーワード抽出手段として機能させるためのプログラム。
  14.  請求項13に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体。
PCT/JP2009/059215 2008-09-05 2009-05-19 近似照合装置、近似照合方法、プログラム及び記録媒体 WO2010026804A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
KR1020117004098A KR101245631B1 (ko) 2008-09-05 2009-05-19 근사조합장치, 근사조합방법, 프로그램 및 기록매체
CN2009801333447A CN102138141B (zh) 2008-09-05 2009-05-19 近似比对装置、近似比对方法、程序及记录介质
JP2010527723A JP5238034B2 (ja) 2008-09-05 2009-05-19 近似照合装置、近似照合方法、プログラム及び記録媒体

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2008-228382 2008-09-05
JP2008228382 2008-09-05

Publications (1)

Publication Number Publication Date
WO2010026804A1 true WO2010026804A1 (ja) 2010-03-11

Family

ID=41796978

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2009/059215 WO2010026804A1 (ja) 2008-09-05 2009-05-19 近似照合装置、近似照合方法、プログラム及び記録媒体

Country Status (4)

Country Link
JP (1) JP5238034B2 (ja)
KR (1) KR101245631B1 (ja)
CN (1) CN102138141B (ja)
WO (1) WO2010026804A1 (ja)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012128604A (ja) * 2010-12-14 2012-07-05 Canon Marketing Japan Inc 情報処理装置、情報処理方法、及びコンピュータプログラム
JP2012160101A (ja) * 2011-02-02 2012-08-23 Fujitsu Ltd 情報処理装置、ソフトウェア検査方法およびソフトウェア検査プログラム
JP2014044498A (ja) * 2012-08-24 2014-03-13 Fujitsu Ltd 文字列置換装置、方法及びプログラム

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112487781A (zh) * 2020-12-10 2021-03-12 成都海光微电子技术有限公司 文件比对方法、装置、存储介质及设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS58201140A (ja) * 1982-05-20 1983-11-22 Toshiba Corp 文書作成装置
JPH01237724A (ja) * 1988-03-18 1989-09-22 Hitachi Ltd あいまい文字列検索表示方法
JPH07319900A (ja) * 1994-05-23 1995-12-08 Ibm Japan Ltd 文字列検索システム及び方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7299228B2 (en) * 2003-12-11 2007-11-20 Microsoft Corporation Learning and using generalized string patterns for information extraction
CA2509496A1 (en) * 2005-06-06 2006-12-06 3618633 Canada Inc. Search-enhanced trie-based syntactic pattern recognition of sequences
CN1869983A (zh) * 2006-06-27 2006-11-29 丁光耀 用于信息检索与信息输入的广义子串模式匹配方法
CN100527134C (zh) * 2007-12-04 2009-08-12 威盛电子股份有限公司 多模式搜寻的方法与系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS58201140A (ja) * 1982-05-20 1983-11-22 Toshiba Corp 文書作成装置
JPH01237724A (ja) * 1988-03-18 1989-09-22 Hitachi Ltd あいまい文字列検索表示方法
JPH07319900A (ja) * 1994-05-23 1995-12-08 Ibm Japan Ltd 文字列検索システム及び方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012128604A (ja) * 2010-12-14 2012-07-05 Canon Marketing Japan Inc 情報処理装置、情報処理方法、及びコンピュータプログラム
JP2012160101A (ja) * 2011-02-02 2012-08-23 Fujitsu Ltd 情報処理装置、ソフトウェア検査方法およびソフトウェア検査プログラム
JP2014044498A (ja) * 2012-08-24 2014-03-13 Fujitsu Ltd 文字列置換装置、方法及びプログラム

Also Published As

Publication number Publication date
CN102138141B (zh) 2013-06-05
KR101245631B1 (ko) 2013-03-22
CN102138141A (zh) 2011-07-27
JP5238034B2 (ja) 2013-07-17
JPWO2010026804A1 (ja) 2012-02-02
KR20110044253A (ko) 2011-04-28

Similar Documents

Publication Publication Date Title
US7809744B2 (en) Method and system for approximate string matching
JP5257071B2 (ja) 類似度計算装置及び情報検索装置
JP3152871B2 (ja) ラティスをキーとした検索を行う辞書検索装置および方法
US8005819B2 (en) Indexing and searching product identifiers
US8290967B2 (en) Indexing and search query processing
US8504553B2 (en) Unstructured and semistructured document processing and searching
JP3998668B2 (ja) 形態素解析装置、方法及びプログラム
JP6828335B2 (ja) 検索プログラム、検索装置および検索方法
JP5071373B2 (ja) 言語処理装置、言語処理方法および言語処理用プログラム
JP2020087353A (ja) 要約文生成方法、要約文生成プログラム及び要約文生成装置
JP5238034B2 (ja) 近似照合装置、近似照合方法、プログラム及び記録媒体
US20210342534A1 (en) Sentence structure vectorization device, sentence structure vectorization method, and storage medium storing sentence structure vectorization program
JP3309174B2 (ja) 文字認識方法及び装置
KR101663038B1 (ko) 개체의 표면형 문자열 용례학습기반에 의한 텍스트에서의 개체 범위 인식 장치 및 그 방법
JP5203324B2 (ja) 誤字脱字対応テキスト解析装置及び方法及びプログラム
CN116306594A (zh) 一种医学ocr识别纠错方法
WO2016181470A1 (ja) 認識装置、認識方法およびプログラム
KR20170107808A (ko) 원문문장을 번역 소단위들로 분할하고 소번역단위들의 번역어순을 결정하는 번역어순패턴 데이터 구조, 이를 생성하기 위한 명령어들을 저장한 컴퓨터 판독가능한 저장매체 및 이를 가지고 번역을 수행하는 컴퓨터 판독가능한 저장매체에 저장된 번역 프로그램
JP7135730B2 (ja) 要約生成方法及び要約生成プログラム
CN113885882B (zh) 一种还原iOS类型字符串的方法
JP2005234800A (ja) 用例機械翻訳装置及び用例翻訳コンピュータプログラム、並びに用例検索装置及び用例検索コンピュータプログラム
JP5182960B2 (ja) 店舗名曖昧性解消装置、その方法、プログラム及び記録媒体
KR102550868B1 (ko) 교원 업적 검증 시스템
JP5160120B2 (ja) 情報検索装置、情報検索方法及び情報検索プログラム
JP4084816B2 (ja) 依存構造情報処理装置、そのプログラム及び記録媒体

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 200980133344.7

Country of ref document: CN

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

Ref document number: 09811333

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2010527723

Country of ref document: JP

ENP Entry into the national phase

Ref document number: 20117004098

Country of ref document: KR

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09811333

Country of ref document: EP

Kind code of ref document: A1