JP2019016162A - Morphological analysis program, morphological analysis device, and morphological analysis method - Google Patents
Morphological analysis program, morphological analysis device, and morphological analysis method Download PDFInfo
- Publication number
- JP2019016162A JP2019016162A JP2017133065A JP2017133065A JP2019016162A JP 2019016162 A JP2019016162 A JP 2019016162A JP 2017133065 A JP2017133065 A JP 2017133065A JP 2017133065 A JP2017133065 A JP 2017133065A JP 2019016162 A JP2019016162 A JP 2019016162A
- Authority
- JP
- Japan
- Prior art keywords
- character string
- analysis
- morpheme
- morphological analysis
- dictionary
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/284—Lexical analysis, e.g. tokenisation or collocates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/237—Lexical tools
- G06F40/247—Thesauruses; Synonyms
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)
- Machine Translation (AREA)
Abstract
Description
本発明は、形態素解析プログラム、形態素解析装置、および形態素解析方法に関する。 The present invention relates to a morpheme analysis program, a morpheme analyzer, and a morpheme analysis method.
近年、インターネット上の情報が飛躍的に増大しており、ビッグデータを用いたビジネスが増加しているため、ビッグデータを効率的に処理することが望まれている。日本語、中国語、または韓国語の文書のように、単語と単語がスペース等の区切り文字で区切られていない表記の文書の場合、単語の出現頻度を計算するために形態素解析が行われる。 In recent years, information on the Internet has increased dramatically, and business using big data has increased. Therefore, it is desired to process big data efficiently. In the case of a document in which a word and a word are not separated by a delimiter such as a space, such as a Japanese, Chinese, or Korean document, morphological analysis is performed to calculate the appearance frequency of the word.
形態素解析は、テキストを形態素に分割し、各形態素に対して品詞情報を付与する処理である。形態素解析により得られる形態素は、単語として扱われることもある。このような形態素解析を行うことで、文書中の単語間の関係及び単語の品詞が決定され、文書中のテキストを単語に分割することができる。しかし、形態素解析は処理負荷が大きいため、大量のテキストを処理するには長い時間がかかる。 Morphological analysis is a process of dividing text into morphemes and adding part-of-speech information to each morpheme. A morpheme obtained by morpheme analysis may be treated as a word. By performing such morphological analysis, the relationship between words in the document and the part of speech of the word are determined, and the text in the document can be divided into words. However, since morphological analysis has a heavy processing load, it takes a long time to process a large amount of text.
形態素解析においては、解析対象の文字列の表記に部分一致する全ての単語を辞書から抜き出し、単語の候補(解析候補)を列挙したグラフ構造であるラティスを利用した解析が行われる。 In morphological analysis, all words that partially match the notation of the character string to be analyzed are extracted from the dictionary, and analysis using a lattice that is a graph structure in which word candidates (analysis candidates) are listed is performed.
図1は、ラティスの例を示す図である。
図1では、解析対象である入力文=「送られてきた」に対するラティスを構築した場合を示す。形態素解析では、構築したラティスに対して文脈(前後の形態素)を考慮して、正しい形態素列を決定する。それにより、「送られてきた」の形態素解析結果は、「送ら(動詞・未然形)|れて(接尾辞)|きた(接尾辞)」となる。ラティスの構築は、計算コストが大きく、時間がかかる。
FIG. 1 is a diagram illustrating an example of a lattice.
FIG. 1 shows a case where a lattice for an input sentence = “sent” that is an analysis target is constructed. In the morphological analysis, a correct morpheme sequence is determined in consideration of the context (front and back morphemes) for the constructed lattice. As a result, the result of the morphological analysis of “sent” is “sent (verb / form)” | (suffix) | kita (suffix). Lattice construction is computationally expensive and time consuming.
形態素解析において、計算コストの大きいラティスの構築を行なわず、パターンマッチングを用いることで高速化する方法が知られている(例えば、非特許文献1参照)。文を2以上の単語に高速に分割する単語分割装置が知られている(例えば、特許文献1参照)。精度の高い単語分割用辞書を得る辞書登録装置が知られている(例えば、特許文献2参照)。 In morphological analysis, there is known a method of increasing the speed by using pattern matching without constructing a lattice having a high calculation cost (for example, see Non-Patent Document 1). 2. Description of the Related Art A word dividing device that divides a sentence into two or more words at high speed is known (for example, see Patent Document 1). A dictionary registration device that obtains a word segmentation dictionary with high accuracy is known (see, for example, Patent Document 2).
しかしながら、非特許文献1記載の形態素解析方法では、パターンマッチングにより高速に形態素解析を行うことができるが、誤った解析結果を出力する場合があり、解析精度が低いという問題がある。
However, although the morpheme analysis method described in
1つの側面において、本発明は、形態素解析の解析精度を向上させることを目的とする。 In one aspect, an object of the present invention is to improve analysis accuracy of morphological analysis.
実施の形態に係る形態素解析プログラムは、形態素解析辞書と、複数の文それぞれに含まれる文字列と、前記複数の文それぞれに対して共通に得られた前記文字列の第1の形態素解析結果とを含むマッチング辞書を記憶する記憶部を備えるコンピュータに以下の処理を実行させる。 The morpheme analysis program according to the embodiment includes a morpheme analysis dictionary, a character string included in each of a plurality of sentences, and a first morpheme analysis result of the character string obtained in common for each of the plurality of sentences. A computer having a storage unit that stores a matching dictionary including the following processes is executed.
前記コンピュータは、解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致する文字列に対して、前記第1の形態素解析結果を出力する。 The computer outputs the first morpheme analysis result for a character string that matches the character string included in the matching dictionary in the analysis target text.
前記コンピュータは、前記解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致しない残りの文字列に対し、前記形態素解析辞書を用いて、複数の形態素解析結果の候補を含むラティスを生成する
前記コンピュータは、前記ラティスを用いて前記残りの文字列に対する形態素解析を行い、前記残りの文字列に対する第2の形態素解析結果を出力する
The computer generates a lattice including a plurality of morphological analysis result candidates using the morphological analysis dictionary for the remaining character strings that do not match the character strings included in the matching dictionary in the analysis target text. The computer performs a morphological analysis on the remaining character string using the lattice, and outputs a second morpheme analysis result on the remaining character string
実施の形態によれば、形態素解析の解析精度を向上させることができる。 According to the embodiment, the analysis accuracy of morphological analysis can be improved.
以下、図面を参照しながら実施の形態について説明する。
最初に非特許文献1記載の従来技術を用いて、形態素解析を行った場合について述べる。従来技術では、最初に辞書を用いた最長一致法により、解析対象の文に対する形態素列を出力し、誤って出力された形態素列のうち、置き換えパターンに一致する形態素列を当該置き換えパターンに従って正しい形態素列に置き換えている。
(従来技術による形態素解析の第1の例)
解析対象である入力文=「非常に評判がいいわけだ」に対して、最長一致法による形態素解析の結果は、「非常に|評判|が|いいわけ|だ」となる。従来技術では、誤った解析結果を修正するため、置き換えパターンを参照し、一致する形態素列を修正する。
Hereinafter, embodiments will be described with reference to the drawings.
First, a case where morphological analysis is performed using the conventional technique described in Non-Patent
(First example of morphological analysis according to the prior art)
For the input sentence to be analyzed = “very good reputation”, the result of the morphological analysis by the longest match method is “very | reputation | is | good reason | is”. In the prior art, in order to correct an erroneous analysis result, a replacement pattern is referred to and a matching morpheme string is corrected.
ここで、「が|いいわけ|だ」を「が|いい|わけだ」に修正する置き換えパターンがあるとする。その場合、「非常に|評判|が|いいわけ|だ」は、「非常に|評判|が|いい|わけだ」に修正される。このように、適切な置き換えパターンがある場合は、「非常に評判がいいわけだ」の解析結果として、正しい解析結果である「非常に|評判|が|いい|わけだ」が得られる。 Here, it is assumed that there is a replacement pattern that corrects “ga | good reason | da” to “ga | good matter”. In that case, "very | reputation | is | good reason | is" is corrected to "very | reputation | is | good | As described above, when there is an appropriate replacement pattern, the analysis result “very good reputation” is obtained as the analysis result “very good reputation” as the analysis result “very good reputation”.
しかし、上記のような適切な置き換えパターンが存在しない場合、形態素列は修正されないため、「非常に評判がいいわけだ」に対する形態素解析の結果として、誤った解析結果である「非常に|評判|が|いいわけ|だ」が得られる。
(従来技術による形態素解析の第2の例)
入力文=「人手不足と言うがいいわけだ」に対して、最長一致法による形態素解析の結果は、「人手|不足|と|言う|が|いいわけ|だ」となる。従来技術では、誤った解析結果を修正するため、置き換えパターンを参照し、一致する形態素列を修正する。
However, if there is no appropriate replacement pattern as described above, the morpheme sequence is not corrected. Therefore, as a result of the morphological analysis for “Very Reputable”, the erroneous analysis result “Very | Reputation | | Good reason |
(Second example of conventional morphological analysis)
For the input sentence = “It is good to say that there is a shortage of manpower”, the result of the morphological analysis by the longest match method is “manual | shortage | and | say | In the prior art, in order to correct an erroneous analysis result, a replacement pattern is referred to and a matching morpheme string is corrected.
ここで、「人手|不足|と|言う|が|いいわけ|だ」に含まれる形態素列を修正する置き換えパターンが存在しない場合、解析結果は修正されずに、正しい解析結果である「人手|不足|と|言う|が|いいわけ|だ」が得られる。 Here, if there is no replacement pattern for correcting the morpheme sequence included in “manual | shortage | and | say | is | good reason | da”, the analysis result is not corrected and the correct analysis result is “manual | shortage” | And | say | is | good reason |
ここで、「が|いいわけ|だ」を「が|いい|わけだ」に修正する置き換えパターンがあるとする。その場合、「人手|不足|と|言う|が|いいわけ|だ」は、「人手|不足|と|言う|が|いい|わけだ」に修正される。置き換えパターンを適用することにより、「人手不足と言うがいいわけだ」に対する形態素解析の結果として、誤った解析結果である「人手|不足|と|言う|が|いい|わけだ」が得られる。 Here, it is assumed that there is a replacement pattern that corrects “ga | good reason | da” to “ga | good matter”. In this case, “manual | insufficient | and | say | is | good reason | da” is corrected to “manual | insufficient | and | say | is | good”. By applying the replacement pattern, the result of the morphological analysis for “manual shortage is good” is obtained as the result of erroneous analysis “manual | shortage | and | say | is | good”.
このように、置き換えパターンは、文脈を考慮したルールになっておらず、置き換えパターンを適用することで、誤った解析結果が得られることがある。 As described above, the replacement pattern is not a rule considering the context, and an erroneous analysis result may be obtained by applying the replacement pattern.
図2は、実施の形態に係る形態素解析装置の構成図である。
形態素解析装置101は、辞書生成部201、形態素解析部301、および記憶部401を有する。
FIG. 2 is a configuration diagram of the morpheme analyzer according to the embodiment.
The
辞書生成部201は、文脈独立辞書構築部211、形態素解析部221、依存性判定部231を有する。
The
文脈独立辞書構築部211は、形態素解析部221と依存性判定部231の判定結果を用いて文脈独立辞書421を生成する。
The context independent
形態素解析部221は、コーパス411の形態素解析を行う。形態素解析部221は、例えば、既存の形態素解析方法を用いて、形態素解析を行う。
The
依存性判定部231は、依存性判定部231は、文字列が文脈により形態素解析の結果が異なる(文脈に依存する)文字列であるか判定する。
The
実施の形態において、文脈により形態素解析の結果が異なる文字列を文脈依存文字列と称する。また、実施の形態において、文脈により形態素解析の結果が変化しない文字列を文脈独立文字列と称する。 In the embodiment, a character string having a different morphological analysis result depending on a context is referred to as a context-dependent character string. In the embodiment, a character string whose morphological analysis result does not change depending on the context is referred to as a context-independent character string.
形態素解析部301は、文脈独立文字列解析部311および文脈依存文字列解析部321を有する。
The
文脈独立文字列解析部311は、文脈独立辞書421を用いてパターンマッチングにより、入力文431の形態素解析を行う。文脈独立文字列解析部311により、入力文431のうち文脈独立文字列の形態素解析が行われる。
The context independent character
文脈依存文字列解析部321は、ラティス構築部322および形態素列選択部323を有する。文脈依存文字列解析部321は、入力文431のうち文脈独立文字列解析部311により解析されていない文字列(すなわち、文脈依存文字列)の形態素解析を行う。
The context-dependent character
ラティス構築部322は、未解析の文字列のラティスを構築する。ラティス(単語ラティスとも呼ぶ)は、解析対象の文字列の表記に部分一致する全ての単語を形態素解析辞書から抜き出し、単語の候補(解析結果の候補)を列挙したグラフ構造である。
The
形態素列選択部323は、構築されたラティスにおいて、文章として最も確からしいと思われる単語の並び(パス)を選択する。形態素列選択部323は、例えば、Viterbiアルゴリズムを用いて、評価値を最小とするようなパスを選択する。尚、形態素列選択部323は、Viterbiアルゴリズムに限らずビームサーチ等の方法を用いても良い。
The morpheme
記憶部401は、形態素解析装置101で使用されるデータやプログラム等を記憶する。記憶部401は、コーパス411、文脈独立辞書421、入力文431、および解析結果441を記憶する。また、記憶部401は、ラティス構築部322および形態素解析部221がラティスを構築するときに使用する複数の単語(形態素)を含む形態素解析辞書(不図示)を記憶する。
The
コーパス411は、複数の文の集合である。コーパス411は、辞書生成部201により文脈独立辞書421の生成に用いられる。
The
文脈独立辞書421は、文脈独立文字列と文脈独立文字列に対する形態素解析の結果を示す情報である。文脈独立辞書421は、マッチング辞書の一例である。
The context
入力文431は、形態素解析部301による形態素解析の対象となる文である。入力文431は、解析対象テキストの一例である。
The
解析結果441は、入力文431の形態素解析の結果である。
図3は、文脈独立辞書の例である。
The
FIG. 3 is an example of a context independent dictionary.
文脈独立辞書421は、文脈により形態素解析の結果が変化しない文字列である文脈独立文字列を示す情報である。文脈独立辞書421は、文字列と形態素列とを含む。文脈独立辞書421には、文字列と形態素列とが対応付けられて記録されている。
The context
文字列は、文脈独立文字列である。
形態素列は、文字列に対する形態素解析の結果である。形態素列は、形態素解析により文字列が分割された複数の形態素の集合である。明細書および図面において、形態素列の「|」は形態素間の切れ目を示す。尚、形態素列には、各形態素の品詞や活用形を示す情報が付加されていてもよい。
The character string is a context-independent character string.
The morpheme string is a result of morpheme analysis on the character string. A morpheme string is a set of a plurality of morphemes obtained by dividing a character string by morpheme analysis. In the specification and drawings, “|” in the morpheme string indicates a break between morphemes. Note that the morpheme string may be added with information indicating the part of speech or the utilization form of each morpheme.
例えば、図3の文脈独立辞書421は、文字列として「夜間や休日」、対応する形態素列として「夜間|や|休日」を含む。また、図3の文脈独立辞書421は、文字列として「がれきの山」、対応する形態素列として「がれき|の|山」を含む。
For example, the context-
「夜間や休日」は、「夜間や休日」の前後の文脈によって、形態素解析の結果が変化しない文字列である。すなわち、「夜間や休日」に対する形態素解析の結果は、常に同じである。「夜間や休日」に対して形態素解析を行うと、「夜間|や|休日」のように分割される。 “Night or holiday” is a character string whose morphological analysis result does not change depending on the context before and after “night or holiday”. That is, the result of the morphological analysis for “nighttime or holiday” is always the same. When the morphological analysis is performed on “nighttime or holiday”, it is divided into “nighttime | or | holiday”.
「がれきの山」についても、形態素解析の結果は、常に「がれき|の|山」のように分割される。 Also for “debris mountain”, the result of morphological analysis is always divided as “debris | no | mountain”.
上記のような文脈独立文字列は、文字列の前後の文脈によらず形態素解析の結果が常に同じとなるため、文脈独立文字列だけで正しい解析結果を得ることが可能である。 The context-independent character string as described above always has the same morphological analysis result regardless of the context before and after the character string. Therefore, it is possible to obtain a correct analysis result using only the context-independent character string.
また、文脈独立辞書421は、文字列として、型番、人名、顔文字、定型句、英単語、またはタブや改行を示す制御用トークンなどが登録されてもよい。型番、人名、顔文字、定型句、英単語、および制御用トークンは、文字列の前後の文脈によらず形態素解析の結果が常に同じとなる文字列である。また、文脈独立辞書421は、文字列が括弧であるときの括弧に対する形態素解析の結果や文字列が連続した数値のような数値表現であるときの数値表現に対する形態素解析の結果を示す情報を含んでもよい。括弧や数値表現は文字列の前後の文脈によらず形態素解析の結果が常に同じとなる文字列である。
In the context-
次に、文脈により形態素解析の結果が異なる文字列である文脈依存文字列について述べる。 Next, a context-dependent character string, which is a character string whose morphological analysis results differ depending on the context, will be described.
図4は、文脈依存文字列と解析結果の例である。
ここでは、文脈依存文字列として「よく知っているからだ」、「休日や夜間」、および「雪の山」の3つの例について述べる。
(1)「よく知っているからだ」
「よく知っているからだ」に対して形態素解析を行うと、「よく知っているからだ」の前後の文脈によって、「よく|知っている|から|だ」または「よく|知っている|からだ(体)」のように分割される。
(2)「休日や夜間」
「休日や夜間」の前に「今週の」が付いている場合、「今週の休日や夜間」に対して形態素解析を行うと、「今週|の|休日|や|夜間」のように分割される。
FIG. 4 is an example of a context-dependent character string and an analysis result.
Here, three examples of context-sensitive character strings “because you know well”, “holiday and night”, and “snow mountain” will be described.
(1) “Because I know well”
If you perform morphological analysis on "Because you know well", depending on the context before and after "Because you know well", "Well | Know | From | Da" or "Well | Know | Body) ”.
(2) "Holidays and nights"
If "this week" is preceded by "holiday or night", morphological analysis is performed on "this week's holiday or night". The
「休日や夜間」の前に「病院の定」が付いている場合、「病院の定休日や夜間」に対して形態素解析を行うと、「病院|の|定休日|や|夜間」のように分割される。
(3)「雪の山」
「雪の山」の後に「を見る」が付いている場合、「雪の山を見る」に対して形態素解析を行うと、「雪|の|山|を|見る」のように分割される。
If “hospital fixed” precedes “holiday or night”, the morphological analysis of “hospital closed holiday or night” would result in “hospital | no | fixed holiday | or | night” It is divided into.
(3) “Snowy Mountain”
When “see” is attached after “snow mountain”, if morphological analysis is performed on “see snow mountain”, it is divided into “snow | no | mountain | see” .
「雪の山」の前に「大」且つ「雪の山」の後に「形県」が付いている場合、「大雪の山形県」に対して形態素解析を行うと、「大雪|の|山形|県」のように分割される。 When “large” is added before “snow mountain” and “gata prefecture” is added after “snow mountain”, when “morphological analysis” is performed on “snow mountain”, It is divided like |
上記のような文脈依存文字列は、文字列の前後の文脈により形態素解析の結果が異なるため、文脈依存文字列だけでは、正しい解析結果を得ることが難しい。 The context-dependent character string as described above has different morphological analysis results depending on the context before and after the character string, and it is difficult to obtain a correct analysis result only with the context-dependent character string.
次に、実施の形態に係る形態素解析処理の例を示す。
図5は、実施の形態に係る形態素解析処理を示す図である。
Next, an example of morphological analysis processing according to the embodiment will be described.
FIG. 5 is a diagram illustrating morphological analysis processing according to the embodiment.
図5では、入力文431として「非常に評判がいいわけだ」の形態素解析を行う場合について説明する。また、文脈独立辞書421は、文字列=「非常に評判がいい」と形態素列=「非常に|評判|が|いい」が含まれているとする。
FIG. 5 illustrates a case where a morphological analysis of “very good reputation” is performed as the
文脈独立文字列解析部311は、入力文=「非常に評判がいいわけだ」に対して、文脈独立辞書421を用いた最長一致法による解析を行う。図5では、入力文=「非常に評判がいいわけだ」のうち「非常に評判がいい」が文脈独立辞書421の文字列と一致する。
The context-independent character
よって、入力文=「非常に評判がいいわけだ」のうち「非常に評判がいい」の形態素解析の結果は、「非常に|評判|が|いい」となる。 Therefore, the result of the morphological analysis of “very good reputation” in the input sentence = “very good reputation” is “very | reputation | is good”.
次に、入力文のうち、文脈独立文字列解析部311により解析されなかった残りの文字列の形態素解析を文脈依存文字列解析部321が行う。すなわち、文脈依存文字列解析部321は、入力文=「非常に評判がいいわけだ」のうち、文脈独立文字列解析部311により解析されなかった残りの文字列=「わけだ」の形態素解析を行う。
Next, the context-dependent character
ラティス構築部322は、残り(未解析)の文字列=「わけだ」とその前後の解析済みの文字列=「非常に評判がいいわけだ」のラティスを構築する。
The
形態素列選択部323は、構築されたラティスにおいて、文章として最も確からしいと思われる単語の並び(パス)を選択する。その結果、未解析の文字列=「わけだ」の解析結果は、「わけだ」となる。
The morpheme
以上により、入力文=「非常に評判がいいわけだ」の形態素解析の結果は、「非常に|評判|が|いい|わけだ」となる。 As described above, the result of the morphological analysis of the input sentence = “very good reputation” becomes “very | reputation | is |
次に、入力文に含まれる文字列が文脈独立辞書421に含まれていない場合について述べる。文脈独立辞書421に用いられるコーパスのサイズが小さく、文脈独立辞書421に文字列=「非常に評判がいい」が含まれない場合を説明する。
Next, a case where the character string included in the input sentence is not included in the context
図6は、実施の形態に係る形態素解析処理を示す図である。
図6では、図5と同様に入力文431として「非常に評判がいいわけだ」の形態素解析を行う場合について説明する。また、文脈独立辞書421は、文字列=「非常に評判がいい」は含まれていないとする。
FIG. 6 is a diagram illustrating morphological analysis processing according to the embodiment.
FIG. 6 illustrates a case where the morphological analysis of “very good reputation” is performed as the
文脈独立文字列解析部311は、入力文=「非常に評判がいいわけだ」に対して、文脈独立辞書421を用いた最長一致法による解析を行う。図6では、入力文=「非常に評判がいいわけだ」のうち、一致する文字列が文脈独立辞書421に含まれていない。
The context-independent character
よって、入力文=「非常に評判がいいわけだ」のいずれの文字列も文脈独立文字列解析部311により解析されない。
Therefore, any character string of the input sentence = “it is very popular” is not analyzed by the context independent character
次に、入力文のうち、文脈独立文字列解析部311により解析されなかった残りの文字列の形態素解析を文脈依存文字列解析部321が行う。すなわち、文脈依存文字列解析部321は、入力文=「非常に評判がいいわけだ」の形態素解析を行う。
Next, the context-dependent character
ラティス構築部322は、残り(未解析)の文字列=「非常に評判がいいわけだ」のラティスを構築する。
The
形態素列選択部323は、構築されたラティスにおいて、文章として最も確からしいと思われる単語の並び(パス)を選択する。その結果、未解析の文字列=「非常に評判がいいわけだ」の解析結果は、「非常に|評判|が|いい|わけだ」となる。
The morpheme
以上により、入力文=「非常に評判がいいわけだ」の形態素解析の結果は、「非常に|評判|が|いい|わけだ」となる。 As described above, the result of the morphological analysis of the input sentence = “very good reputation” becomes “very | reputation | is |
このように、入力文に含まれる文字列が文脈独立辞書421に含まれていない場合でも、正しく形態素解析を行うことができる。
Thus, even when the character string included in the input sentence is not included in the context
図7は、実施の形態に係る文脈独立辞書生成処理のフローチャートである。
ここで、コーパス401は、文si(i=0〜N)を含むとする。実施の形態において、文s1、s2、s12、s15、s20、s30、s35を下記に示す。
文s1=「朝日新聞東京本社が「宅配便で不審な段ボール箱が二箱送られてきた」と築地署に届け出た。」
文s2=「そうする必要があるからだ。」
文s12=「担当者は朝日新聞の取材に回答した。」
文s15=「からだと健康に気を付けましょう。」
文s20=「朝日新聞東京本社は大江戸線築地市場駅の前にある。」
文s30=「本社が意思決定権を持つ。」
文s35=「発行元の日本社が責任を負う。」
また、文siのiは、文siの文IDとする。
FIG. 7 is a flowchart of context-independent dictionary generation processing according to the embodiment.
Here, it is assumed that the
Sentence s 1 = “The Asahi Shimbun Tokyo headquarters reported to the Tsukiji station that“ two suspicious cardboard boxes were sent by courier ”. "
Sentence s 2 = “Because it is necessary to do so.”
Sentence s 12 = “The person in charge answered the Asahi Shimbun.”
Sentence s 15 = “Let's take care of our body.”
Sentence 20 = “The Asahi Shimbun Tokyo headquarters is in front of Tsukiji market station on the Oedo Line.”
Sentence s 30 = “Head office has decision-making power.”
Sentence 35 = “The publisher, Japan, is responsible.”
In addition, i of the sentence s i is the sentence ID of the sentence s i.
ステップS501は、ステップS506の終端に対応するループの始端である。変数iの初期値は0であり、ループを実行する条件はiがN以下であり、ループの終了毎にiは1ずつインクリメントされる。 Step S501 is the beginning of a loop corresponding to the end of step S506. The initial value of the variable i is 0, the condition for executing the loop is that i is N or less, and i is incremented by 1 at the end of the loop.
ステップS502において、形態素解析部221は、コーパス401を読み出し、コーパス401に含まれる文siの形態素解析を行う。例えば、形態素解析部221は、文siに対するラティスを構築して、形態素解析を行う。文siに対する形態素解析の結果である形態素列を形態素列s’iとする。文s1の形態素解析の結果s’1は、s’1=「朝日|新聞|東京|本社|が|「|〜」となる。また、形態素列s’iのiは、形態素列s’iの文IDとする。
In step S502, the
ステップS503において、ステップS505の終端に対応するループの始端である。依存性判定部231は、形態素列s’iに含まれる連続する部分形態素列のうち未選択の連続する部分形態素列を1つ選択する。選択された部分形態素列nは、n=(文字列p、形態素列m、文ID)と表記する。文字列pは形態素列mを繋げた文字列であり、形態素列mは選択された部分形態素列を構成する形態素列であり、文IDは選択された部分形態素列nが含まれる形態素列s’iまたは文siの文IDである。例えば、n=(朝日新聞、朝日|新聞、1)となる。また、n=(新聞東京本社、新聞|東京|本社、1)となる
ステップS504において、依存性判定部231は、文字列pごとに、形態素列mと文IDの配列をT[p].M、T[p].Hにそれぞれ保存する。例えば、文字列p=「朝日新聞」の場合、T[朝日新聞].M=[朝日|新聞]、T[朝日新聞].H=[1,12、〜]となる。また、文字列p=「からだ」の場合、T[からだ].M=[から|だ,からだ(体)],T[からだ].H=[2,15、〜]となる。すなわち、文字列=「からだ」の形態素解析の結果は「から|だ」または「からだ(体)」となることを示す。また、T[からだ].H=[2,15、〜]は、文字列=「からだ」が文s2、s15に含まれていることを示す。
In step S503, it is the beginning of a loop corresponding to the end of step S505. The
ステップS505において、ステップS503の始端に対応するループの終端である。形態素列s’iに含まれる連続する部分形態素列を全て選択済みの場合、制御はステップS506に進み、形態素列s’iにおいて未選択の連続する部分形態素列がある場合、制御はステップS503に戻る。 In step S505, it is the end of the loop corresponding to the start of step S503. If all the continuous partial morpheme sequences included in the morpheme sequence s ′ i have been selected, the control proceeds to step S506. If there is an unselected continuous partial morpheme sequence in the morpheme sequence s ′ i , the control proceeds to step S503. Return.
ステップS506は、ステップS501の始端に対応するループの終端である。iがNより大きい場合、処理はステップS507に進み、iがN以下の場合、iは1インクリメントされ、制御はステップS501に戻る。 Step S506 is the end of the loop corresponding to the start of step S501. If i is larger than N, the process proceeds to step S507. If i is N or less, i is incremented by 1, and the control returns to step S501.
ステップS507において、ステップS516の終端に対応するループの始端である。依存性判定部231は、配列T[p]の文字列pのうち未選択の文字列pを1つ選択する。以下、ステップS508〜S515における文字列pは、選択された文字列pであるとする。
In step S507, it is the beginning of the loop corresponding to the end of step S516. The
ステップS508において、依存性判定部231は、配列T[p].Mの要素の数|T[p].M|が1であるか判定する。配列T[p].Mの要素の数が1である場合、制御はステップS510に進み、T[p].Mの要素の数が1以外の場合、制御はステップS509に進む。例えば、文字列p=「からだ」である場合、T[からだ].M=[から|だ,からだ(体)]であるので、|T[p].M|=2となり、制御はステップS509に進む。例えば、文字列p=「東京本社が「宅配便」である場合、T[東京本社が「宅配便].M=[東京本社が「宅配便]であるので、|T[p].M|=1となり、制御はステップS510に進む。ステップS508では、文字列pの形態素解析の結果が複数あるか、言い換えれば文字列pの形態素解析が常に同一であるかチェックしている。
In step S508, the
ステップS509において、文字列pを破棄する。
ステップS510において、依存性判定部231は、配列T[p].Hの要素の数|T[p].H|が1より大きいか判定する。配列T[p].Hの要素の数が1より大きい場合、制御はステップS512に進み、T[p].Hの要素の数が1以下の場合、制御はステップS511に進む。例えば、文字列p=「東京本社が「宅配便」である場合、T[東京本社が「宅配便].H=[1]であるので、|T[p].H|=1となり、制御はステップS511に進む。例えば、文字列p=「朝日新聞東京本社」である場合、T[朝日新聞東京本社].H=[1,12,30]であるので、|T[p].H|=3となり、制御はステップS512に進む。
In step S509, the character string p is discarded.
In step S510, the
ステップS511において、文字列pを破棄する。
ステップS512において、依存性判定部231は、文字列pを含む文集合の文IDであるHp’を得る。例えば、文字列p=「本社が」である場合、「本社が」を含む文は、文s1,s20,s30,s35であるので、Hp’=1,20,30,35となる。
In step S511, the character string p is discarded.
In step S512, the
ステップS513において、依存性判定部231は、配列T[p].Hと文集合Hp’が等しいか判定する。配列T[p].Hと文集合Hp’が等しい場合、制御はステップS515に進み、配列T[p].Hと文集合H’が等しくない場合、制御はステップS514に進む。例えば、文字列p=「本社が」である場合、配列T[p].H=[1,12,30]であり、Hp’=1,20,30,35であり、配列T[p].HとHp’は等しくないため、制御はステップS514に進む。ステップS513では、形態素列の境界が異なる場合があるかを検出している。
In step S513, the
ステップS514において、文字列pを破棄する。
ステップS515において、文字列pと当該文字列pの解析結果である形態素列を文脈独立辞書421に登録する。文字列p=「朝日新聞東京本社」である場合、T[朝日新聞東京本社].M=[朝日|新聞|東京|本社]、T[朝日新聞東京本社].H=[1,12,30]となり、文字列p=「朝日新聞東京本社」と形態素列=「朝日|新聞|東京|本社」が文脈独立辞書421に登録される。
In step S514, the character string p is discarded.
In step S515, the character string p and the morpheme string that is the analysis result of the character string p are registered in the context
ステップS516において、ステップS507の始端に対応するループの終端である。
図8は、実施の形態に係る形態素解析処理のフローチャートである。
In step S516, the end of the loop corresponding to the start of step S507.
FIG. 8 is a flowchart of morpheme analysis processing according to the embodiment.
ステップS601において、文脈独立文字列解析部311は、入力文431を読み出す。入力文431に含まれる文字を先頭から順にc0、c1、〜、cNと表記する。また、変数i=0とする。実施の形態において、入力文=「朝日新聞東京本社が「宅配便で不審な段ボール箱が」とする。
In step S601, the context independent character
ステップS602において、文脈独立文字列解析部311は、入力文431と文脈独立辞書421とのパターンマッチングを行い、文脈独立辞書421に含まれる文字列と一致する文字列を入力文431から検出する。詳細には、文脈独立文字列解析部311は、文脈独立辞書421を検索し、文脈独立辞書421に含まれる文字列とマッチするciを先頭とする最長の文字列ci〜cjを探索する。
In step S602, the context-independent character
例えば、i=0の時、c0〜c7=「朝日新聞東京本社」となる。i=8の時、マッチする文字列はない。i=9の時、c9〜c11=「「宅配」となる。i=12の時、マッチする文字列はない。i=13の時、c13〜c22=「で不審な段ボール箱が」となる。 For example, when i = 0, c0 to c7 = “Asahi Shimbun Tokyo head office”. When i = 8, there is no matching character string. When i = 9, c9 to c11 = “home delivery”. When i = 12, there is no matching character string. When i = 13, c13 to c22 = “Suspicious cardboard box”.
ステップS603において、文脈独立文字列解析部311は、ciを先頭とする文字列に一致する文字列が文脈独立辞書421にあるかチェックする。一致する文字列が文脈独立辞書421にある場合制御はステップS605に進み、一致する文字列が文脈独立辞書421に無い場合、制御はステップS604に進む。
In step S603, the context-independent character
ステップS604において、文脈独立文字列解析部311は、変数iを1インクリメントする。
In step S604, the context-independent character
ステップS605において、文脈独立文字列解析部311は、変数iをj+1に設定する。例えば、i=0の時、ステップS602で述べたようにc0〜c7=「朝日新聞東京本社」となり、j=7なので、iは、8(=7+1)に設定される。
In step S605, the context-independent character
ステップS606において、文脈独立文字列解析部311は、文字列ci〜cjに対する解析結果を解析結果441として記憶部401に保存する。例えば、i=0の時、c0〜c7=「朝日新聞東京本社」に対する解析結果=「朝日|新聞|東京|本社」を解析結果441として記憶部401に保存する。i=9の時、c9〜c11=「「宅配」に対する解析結果=「「|宅配」を解析結果441として記憶部401に保存する。i=13の時、c13〜c22=「で不審な段ボール箱が」に対する解析結果=「で|不審な|段ボール|箱|が」を解析結果441として記憶部401に保存する。
In step S606, the context-independent character
ステップS607において、文脈独立文字列解析部311は、変数iがNより大きいか判定する。変数iがNより大きい場合、制御はステップS608に進み、変数iがN以下の場合、制御はステップS602に戻る。
In step S607, the context-independent character
ステップS608において、入力文431のうち文脈独立文字列解析部311において未解析の文字列をs0、s1、〜、sMとする。また、変数k=0とする。実施の形態において、入力文=「朝日新聞東京本社が「宅配便で不審な段ボール箱が」のうち、「朝日新聞東京本社」、「「宅配」、および「で不審な段ボール箱が」が解析済みのため、未解析の文字列は、s0=「が」、s1=「便」となる。
In step S608, it s 0,
ステップS609において、ラティス構築部322は、文字列skと文字列skの前後の解析済みの形態素について、複数の単語を含む辞書を用いてラティスを構築する。文字列s0=「が」とその前後の解析済みの形態素のラティスを図9に示す。文字列s1=「便」とその前後の解析済みの形態素のラティスを図10に示す。
In step S609, the
ステップS610において、形態素列選択部323は、構築されたラティスにおいて、文章として最も確からしいと思われる単語の並び(パス)を選択する。形態素列選択部323は、例えば、Viterbiアルゴリズムを用いて、評価値を最小とするようなパスを選択する。例えば、文字列s0=「が」に対して、解析結果として「が(助詞)」が選択される。文字列s0=「が」の解析結果と文字列s0の前後の解析済みの形態素を含む形態素列を図11に示す。例えば、文字列s1=「便」に対して、解析結果として「便(びん)」が選択される。文字列s1=「便」の解析結果と文字列s1の前後の解析済みの形態素を含む形態素列を図12に示す。
In step S610, the morpheme
ステップS611において、形態素列選択部323は、変数kを1インクリメントする。
In step S611, the morpheme
ステップS612において、形態素列選択部323は、変数kがMより大きいか判定する。変数kがMより大きい場合、制御はステップS613に進み、変数kがM以下の場合、制御はステップS609に戻る。
In step S612, the morpheme
ステップS613において、文字列s1〜sMに対する形態素解析の結果を解析結果441として記憶部401に保存する。
In step S613, stored in the
図8に示す形態素解析処理のように、未解析の文字列について、未解析の文字列ごとに形態素解析を行うのでなく、全ての未解析の文字列を含む入力文全体のラティスを用いて形態素解析を行ってもよい。 As in the morpheme analysis process shown in FIG. 8, morpheme analysis is not performed for each unanalyzed character string for an unanalyzed character string, but using a lattice of the entire input sentence including all unanalyzed character strings. Analysis may be performed.
図13は、実施の形態に係る形態素解析処理の変形例のフローチャートである。
図8の形態素解析処理と同様に、入力文=「朝日新聞東京本社が「宅配便で不審な段ボール箱が」とする。
FIG. 13 is a flowchart of a modification of the morphological analysis process according to the embodiment.
As in the morphological analysis process of FIG. 8, it is assumed that the input sentence = “Asahi Shimbun Tokyo head office is“ suspicious cardboard box by courier ”.
ステップS1601〜S1608の処理は、それぞれ図8のステップS601〜S607の処理と同様であるため、説明は省略する。 The processes in steps S1601 to S1608 are the same as the processes in steps S601 to S607 in FIG.
ステップS1609において、ラティス構築部322は、文字列skと文字列skの前後の解析済みの形態素について、複数の単語を含む辞書を用いてラティスを構築する。
In step S1609, the
ステップS1610において、形態素列選択部323は、変数kを1インクリメントする。
In step S1610, the morpheme
ステップS1611において、形態素列選択部323は、変数kがMより大きいか判定する。変数kがMより大きい場合、制御はステップS1612に進み、変数kがM以下の場合、制御はステップS1609に戻る。実施の形態において、変数kがMより大きい場合、図14に示すような未解析の文字列s0=「が」、s1=「便」を含む入力文全体のラティスが構築される。
In step S <b> 1611, the morpheme
ステップS1612において、形態素列選択部323は、構築されたラティスにおいて、文章として最も確からしいと思われる単語の並び(パス)を選択する。形態素列選択部323は、例えば、Viterbiアルゴリズムを用いて、評価値を最小とするようなパスを選択する。例えば、文字列s0=「が」に対して、解析結果として「が(助詞)」が選択される。例えば、文字列s1=「便」に対して、解析結果として「便(びん)」が選択される。文字列s0=「が」、s1=「便」の解析結果を含む入力文全体の形態素列を図15に示す。入力文全体のラティスを構築して形態素解析を行うことで、図9,10のように未解析の文字列とその前後の形態素列のラティスのみから形態素解析を行うより、精度を向上できる。
In step S <b> 1612, the morpheme
ステップS613において、文字列s1〜sMに対する形態素解析の結果を解析結果441として記憶部401に保存する。
In step S613, stored in the
実施の形態の形態素解析装置によれば、パターンマッチングにより形態素解析を行い、パターンマッチングに合致しなかったテキストに対してラティスを構築して解析を行うことで、形態素解析の精度を保ちながら高速化できる。 According to the morphological analysis device of the embodiment, morphological analysis is performed by pattern matching, and a lattice is constructed and analyzed for text that does not match pattern matching, thereby speeding up while maintaining the accuracy of morphological analysis it can.
実施の形態の形態素解析装置によれば、パターンマッチングに合致しなかったテキストに対してのみラティスを構築して形態素解析を行うので、解析対象のテキスト全体のラティスを構築して形態素解析を行う場合に比べて、計算コストを低減できる。 According to the morphological analysis device of the embodiment, the lattice is constructed only for the text that does not match the pattern matching and the morphological analysis is performed. Therefore, the lattice of the entire text to be analyzed is constructed and the morphological analysis is performed. Compared with, the calculation cost can be reduced.
図16は、情報処理装置の構成図である。
図2の形態素解析装置101は、例えば、図16に示すような情報処理装置(コンピュータ)10を用いて実現可能である。
FIG. 16 is a configuration diagram of the information processing apparatus.
The
図16の情報処理装置は、Central Processing Unit(CPU)1、メモリ2、入力装置3、出力装置4、補助記憶装置5、媒体駆動装置6、及びネットワーク接続装置7を含む。これらの構成要素はバス8により互いに接続されている。
The information processing apparatus in FIG. 16 includes a central processing unit (CPU) 1, a
メモリ2は、例えば、Read Only Memory(ROM)、Random Access Memory(RAM)、フラッシュメモリ等の半導体メモリである。メモリ2は、形態素解析処理のためのプログラム及びデータを格納する。メモリ2は、記憶部401として用いることができる。
The
CPU1(プロセッサ)は、例えば、メモリ2を利用してプログラムを実行することにより、文脈独立辞書構築部211、形態素解析部221、依存性判定部231、文脈独立文字列解析部311、ラティス構築部322、および形態素列選択部323として動作する。
The CPU 1 (processor) executes, for example, a program using the
入力装置3は、例えば、キーボード、ポインティングデバイス等であり、ユーザ又はオペレータからの指示や情報の入力に用いられる。出力装置4は、例えば、表示装置、プリンタ、スピーカ等であり、ユーザ又はオペレータへの問い合わせや処理結果の出力に用いられる。処理結果は、形態素解析の結果であってもよい。
The
補助記憶装置5は、例えば、磁気ディスク装置、光ディスク装置、光磁気ディスク装置、テープ装置等である。補助記憶装置5は、ハードディスクドライブ又はフラッシュメモリであってもよい。情報処理装置は、補助記憶装置5にプログラム及びデータを格納しておき、それらをメモリ2にロードして使用することができる。補助記憶装置5は、記憶部401として用いることができる。
The
媒体駆動装置6は、可搬型記録媒体9を駆動し、その記録内容にアクセスする。可搬型記録媒体9は、メモリデバイス、フレキシブルディスク、光ディスク、光磁気ディスク等である。可搬型記録媒体9は、Compact Disk Read Only Memory(CD−ROM)、Digital Versatile Disk(DVD)、Universal Serial Bus(USB)メモリ等であってもよい。ユーザ又はオペレータは、この可搬型記録媒体9にプログラム及びデータを格納しておき、それらをメモリ2にロードして使用することができる。
The medium driving device 6 drives a portable recording medium 9 and accesses the recorded contents. The portable recording medium 9 is a memory device, a flexible disk, an optical disk, a magneto-optical disk, or the like. The portable recording medium 9 may be a compact disk read only memory (CD-ROM), a digital versatile disk (DVD), a universal serial bus (USB) memory, or the like. A user or an operator can store programs and data in the portable recording medium 9 and load them into the
このように、プログラム及びデータを格納するコンピュータ読み取り可能な記録媒体は、メモリ2、補助記憶装置5、及び可搬型記録媒体9のような、物理的な(非一時的な)記録媒体である。
As described above, the computer-readable recording medium for storing the program and data is a physical (non-transitory) recording medium such as the
ネットワーク接続装置7は、Local Area Network(LAN)、インターネット等の通信ネットワークに接続され、通信に伴うデータ変換を行う通信インタフェースである。情報処理装置は、ネットワーク接続装置7を介して外部の装置からプログラム及びデータを受信し、それらをメモリ2にロードして使用することができる。
The
情報処理装置は、ネットワーク接続装置7を介して、ユーザ端末から指示や情報を受信し、形態素解析処理を行って、処理結果をユーザ端末へ送信することもできる。
The information processing apparatus can also receive instructions and information from the user terminal via the
なお、情報処理装置が図16のすべての構成要素を含む必要はなく、用途や条件に応じて一部の構成要素を省略することも可能である。例えば、ユーザ又はオペレータからの指示や情報の入力を行わない場合は、入力装置3を省略してもよく、ユーザ又はオペレータへの問い合わせや処理結果の出力を行わない場合は、出力装置4を省略してもよい。情報処理装置が可搬型記録媒体9又は通信ネットワークにアクセスしない場合は、媒体駆動装置6又はネットワーク接続装置7を省略してもよい。
Note that the information processing apparatus does not have to include all the components illustrated in FIG. 16, and some of the components may be omitted depending on the application and conditions. For example, the
以上の実施の形態に関し、さらに以下の付記を開示する。
(付記1)
形態素解析辞書と、複数の文それぞれに含まれる文字列と、前記複数の文それぞれに対して共通に得られた前記文字列の第1の形態素解析結果とを含むマッチング辞書を記憶する記憶部を備えるコンピュータに
解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致する文字列に対して、前記第1の形態素解析結果を出力し、
前記解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致しない残りの文字列に対し、前記形態素解析辞書を用いて、複数の形態素解析結果の候補を含むラティスを生成し、
前記ラティスを用いて前記残りの文字列に対する形態素解析を行い、前記残りの文字列に対する第2の形態素解析結果を出力する、
処理を実行させる形態素解析プログラム。
(付記2)
前記複数の文の形態素解析を行い、前記複数の文それぞれに含まれる文字列の形態素解析結果がすべて同じである場合に、前記文字列を前記マッチング辞書に登録する処理を前記コンピュータにさらに実行させる付記1記載の形態素解析プログラム。
(付記3)
前記マッチング辞書は、複数の文字列と前記複数の文字列の複数の形態素解析結果とを含み、前記複数の文字列は、前記複数の文それぞれに含まれる文字列と他の文字列とを含み、前記複数の形態素解析結果は、前記第1の形態素解析結果と前記他の文字列の形態素解析結果とを含み、
前記解析対象テキストのうち、前記マッチング辞書に含まれる前記複数の文字列それぞれと一致する複数の文字列に対して、前記複数の形態素解析結果を出力し、
前記解析対象テキストのうち、前記マッチング辞書に含まれる前記複数の文字列と一致しない残りの文字列に対し、前記形態素解析辞書を用いて前記ラティスを生成し、前記ラティスを用いて前記複数の文字列と一致しない残りの文字列に対する形態素解析を行う
処理を前記コンピュータにさらに実行させる付記1記載の形態素解析プログラム。
(付記4)
形態素解析辞書と、複数の文それぞれに含まれる文字列と、前記複数の文それぞれに対して共通に得られた前記文字列の第1の形態素解析結果とを含むマッチング辞書を記憶する記憶部と、
解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致する文字列に対して、前記第1の形態素解析結果を出力する第1の解析部と、
前記解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致しない残りの文字列に対し、前記形態素解析辞書を用いて、複数の形態素解析結果の候補を含むラティスを生成し、前記ラティスを用いて前記残りの文字列に対する形態素解析を行い、前記残りの文字列に対する第2の形態素解析結果を出力する第2の解析部と、
を備える形態素解析装置。
(付記5)
前記複数の文の形態素解析を行い、前記複数の文それぞれに含まれる文字列の形態素解析結果がすべて同じである場合に、前記文字列を前記マッチング辞書に登録する辞書生成部と、
をさらに備えることを特徴とする付記4記載の形態素解析装置。
(付記6)
前記マッチング辞書は、複数の文字列と前記複数の文字列の複数の形態素解析結果とを含み、前記複数の文字列は、前記複数の文それぞれに含まれる文字列と他の文字列とを含み、前記複数の形態素解析結果は、前記第1の形態素解析結果と前記他の文字列の形態素解析結果とを含み、
前記第1の解析部は、前記解析対象テキストのうち、前記マッチング辞書に含まれる前記複数の文字列それぞれと一致する複数の文字列に対して、前記複数の形態素解析結果を出力し、
前記第2の解析部は、前記解析対象テキストのうち、前記マッチング辞書に含まれる前記複数の文字列と一致しない残りの文字列に対し、前記形態素解析辞書を用いて前記ラティスを生成し、前記ラティスを用いて前記複数の文字列と一致しない残りの文字列に対する形態素解析を行うことを特徴とする付記4記載の形態素解析装置。
(付記7)
形態素解析辞書と、複数の文それぞれに含まれる文字列と、前記複数の文それぞれに対して共通に得られた前記文字列の第1の形態素解析結果とを含むマッチング辞書を記憶する記憶部を備える形態素解析装置が
解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致する文字列に対して、前記第1の形態素解析結果を出力し、
前記解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致しない残りの文字列に対し、前記形態素解析辞書を用いて、複数の形態素解析結果の候補を含むラティスを生成し、
前記ラティスを用いて前記残りの文字列に対する形態素解析を行い、前記残りの文字列に対する第2の形態素解析結果を出力する、
処理を有する形態素解析方法。
(付記8)
前記複数の文の形態素解析を行い、前記複数の文それぞれに含まれる文字列の形態素解析結果がすべて同じである場合に、前記文字列を前記マッチング辞書に登録する処理をさらに有する付記7記載の形態素解析方法。
(付記9)
前記マッチング辞書は、複数の文字列と前記複数の文字列の複数の形態素解析結果とを含み、前記複数の文字列は、前記複数の文それぞれに含まれる文字列と他の文字列とを含み、前記複数の形態素解析結果は、前記第1の形態素解析結果と前記他の文字列の形態素解析結果とを含み、
前記解析対象テキストのうち、前記マッチング辞書に含まれる前記複数の文字列それぞれと一致する複数の文字列に対して、前記複数の形態素解析結果を出力し、
前記解析対象テキストのうち、前記マッチング辞書に含まれる前記複数の文字列と一致しない残りの文字列に対し、前記形態素解析辞書を用いて前記ラティスを生成し、前記ラティスを用いて前記複数の文字列と一致しない残りの文字列に対する形態素解析を行う
処理をさらに有する付記7記載の形態素解析方法。
Regarding the above embodiment, the following additional notes are disclosed.
(Appendix 1)
A storage unit for storing a matching dictionary including a morpheme analysis dictionary, a character string included in each of a plurality of sentences, and a first morpheme analysis result of the character string obtained in common for each of the plurality of sentences; The computer includes the output of the first morpheme analysis result for the character string that matches the character string included in the matching dictionary in the analysis target text,
Among the analysis target text, for the remaining character strings that do not match the character strings included in the matching dictionary, using the morphological analysis dictionary, generate a lattice including a plurality of morphological analysis result candidates,
Performing morphological analysis on the remaining character string using the lattice, and outputting a second morphological analysis result on the remaining character string;
A morphological analysis program that executes processing.
(Appendix 2)
Performing a morphological analysis of the plurality of sentences, and causing the computer to further execute a process of registering the character strings in the matching dictionary when all the morphological analysis results of the character strings included in the plurality of sentences are the same. The morphological analysis program according to
(Appendix 3)
The matching dictionary includes a plurality of character strings and a plurality of morphological analysis results of the plurality of character strings, and the plurality of character strings include a character string included in each of the plurality of sentences and another character string. The plurality of morpheme analysis results include the first morpheme analysis result and the morpheme analysis result of the other character string,
Among the analysis target text, for the plurality of character strings that match each of the plurality of character strings included in the matching dictionary, the plurality of morpheme analysis results are output,
Of the analysis target text, for the remaining character strings that do not match the plurality of character strings included in the matching dictionary, the lattice is generated using the morphological analysis dictionary, and the plurality of characters using the lattice The morpheme analysis program according to
(Appendix 4)
A storage unit for storing a morphological analysis dictionary, a matching dictionary including a character string included in each of a plurality of sentences, and a first morphological analysis result of the character string obtained in common for each of the plurality of sentences; ,
A first analysis unit that outputs the first morpheme analysis result for a character string that matches the character string included in the matching dictionary in the analysis target text;
Using the morpheme analysis dictionary, a lattice including a plurality of morpheme analysis result candidates is generated for the remaining character strings that do not match the character strings included in the matching dictionary in the analysis target text, and the lattice A second analysis unit that performs morpheme analysis on the remaining character string using and outputs a second morpheme analysis result on the remaining character string;
A morphological analyzer comprising:
(Appendix 5)
Performing morphological analysis of the plurality of sentences, and when the morphological analysis results of the character strings included in each of the plurality of sentences are all the same, a dictionary generation unit that registers the character strings in the matching dictionary;
The morphological analysis device according to appendix 4, further comprising:
(Appendix 6)
The matching dictionary includes a plurality of character strings and a plurality of morphological analysis results of the plurality of character strings, and the plurality of character strings include a character string included in each of the plurality of sentences and another character string. The plurality of morpheme analysis results include the first morpheme analysis result and the morpheme analysis result of the other character string,
The first analysis unit outputs the plurality of morpheme analysis results for a plurality of character strings that match each of the plurality of character strings included in the matching dictionary in the analysis target text,
The second analysis unit generates the lattice using the morphological analysis dictionary for the remaining character strings that do not match the plurality of character strings included in the matching dictionary in the analysis target text, and The morpheme analyzer according to appendix 4, wherein morpheme analysis is performed on the remaining character strings that do not match the plurality of character strings using a lattice.
(Appendix 7)
A storage unit for storing a matching dictionary including a morpheme analysis dictionary, a character string included in each of a plurality of sentences, and a first morpheme analysis result of the character string obtained in common for each of the plurality of sentences; The morpheme analyzer comprising the output of the first morpheme analysis result for the character string that matches the character string included in the matching dictionary in the analysis target text,
Among the analysis target text, for the remaining character strings that do not match the character strings included in the matching dictionary, using the morphological analysis dictionary, generate a lattice including a plurality of morphological analysis result candidates,
Performing morphological analysis on the remaining character string using the lattice, and outputting a second morphological analysis result on the remaining character string;
A morphological analysis method having processing.
(Appendix 8)
The
(Appendix 9)
The matching dictionary includes a plurality of character strings and a plurality of morphological analysis results of the plurality of character strings, and the plurality of character strings include a character string included in each of the plurality of sentences and another character string. The plurality of morpheme analysis results include the first morpheme analysis result and the morpheme analysis result of the other character string,
Among the analysis target text, for the plurality of character strings that match each of the plurality of character strings included in the matching dictionary, the plurality of morpheme analysis results are output,
Of the analysis target text, for the remaining character strings that do not match the plurality of character strings included in the matching dictionary, the lattice is generated using the morphological analysis dictionary, and the plurality of characters using the lattice The morpheme analysis method according to
101 形態素解析装置
201 辞書生成部
211 文脈独立辞書構築部
221 形態素解析部
231 依存性判定部
301 形態素解析部
311 文脈独立文字列解析部
321 文脈依存文字列解析部
322 ラティス構築部
323 形態素列選択部
401 記憶部
411 コーパス
421 文脈独立辞書
431 入力文
441 解析結果
DESCRIPTION OF
Claims (5)
解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致する文字列に対して、前記第1の形態素解析結果を出力し、
前記解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致しない残りの文字列に対し、前記形態素解析辞書を用いて、複数の形態素解析結果の候補を含むラティスを生成し、
前記ラティスを用いて前記残りの文字列に対する形態素解析を行い、前記残りの文字列に対する第2の形態素解析結果を出力する、
処理を実行させる形態素解析プログラム。 A storage unit for storing a matching dictionary including a morpheme analysis dictionary, a character string included in each of a plurality of sentences, and a first morpheme analysis result of the character string obtained in common for each of the plurality of sentences; The computer includes the output of the first morpheme analysis result for the character string that matches the character string included in the matching dictionary in the analysis target text,
Among the analysis target text, for the remaining character strings that do not match the character strings included in the matching dictionary, using the morphological analysis dictionary, generate a lattice including a plurality of morphological analysis result candidates,
Performing morphological analysis on the remaining character string using the lattice, and outputting a second morphological analysis result on the remaining character string;
A morphological analysis program that executes processing.
前記解析対象テキストのうち、前記マッチング辞書に含まれる前記複数の文字列それぞれと一致する複数の文字列に対して、前記複数の形態素解析結果を出力し、
前記解析対象テキストのうち、前記マッチング辞書に含まれる前記複数の文字列と一致しない残りの文字列に対し、前記形態素解析辞書を用いて前記ラティスを生成し、前記ラティスを用いて前記複数の文字列と一致しない残りの文字列に対する形態素解析を行う
処理を前記コンピュータにさらに実行させる請求項1記載の形態素解析プログラム。 The matching dictionary includes a plurality of character strings and a plurality of morphological analysis results of the plurality of character strings, and the plurality of character strings include a character string included in each of the plurality of sentences and another character string. The plurality of morpheme analysis results include the first morpheme analysis result and the morpheme analysis result of the other character string,
Among the analysis target text, for the plurality of character strings that match each of the plurality of character strings included in the matching dictionary, the plurality of morpheme analysis results are output,
Of the analysis target text, for the remaining character strings that do not match the plurality of character strings included in the matching dictionary, the lattice is generated using the morphological analysis dictionary, and the plurality of characters using the lattice The morpheme analysis program according to claim 1, further causing the computer to execute a process of performing a morphological analysis on a remaining character string that does not match a string.
解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致する文字列に対して、前記第1の形態素解析結果を出力する第1の解析部と、
前記解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致しない残りの文字列に対し、前記形態素解析辞書を用いて、複数の形態素解析結果の候補を含むラティスを生成し、前記ラティスを用いて前記残りの文字列に対する形態素解析を行い、前記残りの文字列に対する第2の形態素解析結果を出力する第2の解析部と、
を備える形態素解析装置。 A storage unit for storing a morphological analysis dictionary, a matching dictionary including a character string included in each of a plurality of sentences, and a first morphological analysis result of the character string obtained in common for each of the plurality of sentences; ,
A first analysis unit that outputs the first morpheme analysis result for a character string that matches the character string included in the matching dictionary in the analysis target text;
Using the morpheme analysis dictionary, a lattice including a plurality of morpheme analysis result candidates is generated for the remaining character strings that do not match the character strings included in the matching dictionary in the analysis target text, and the lattice A second analysis unit that performs morpheme analysis on the remaining character string using and outputs a second morpheme analysis result on the remaining character string;
A morphological analyzer comprising:
解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致する文字列に対して、前記第1の形態素解析結果を出力し、
前記解析対象テキストのうち、前記マッチング辞書に含まれる前記文字列と一致しない残りの文字列に対し、前記形態素解析辞書を用いて、複数の形態素解析結果の候補を含むラティスを生成し、
前記ラティスを用いて前記残りの文字列に対する形態素解析を行い、前記残りの文字列に対する第2の形態素解析結果を出力する、
処理を有する形態素解析方法。 A storage unit for storing a matching dictionary including a morpheme analysis dictionary, a character string included in each of a plurality of sentences, and a first morpheme analysis result of the character string obtained in common for each of the plurality of sentences; The morpheme analyzer comprising the output of the first morpheme analysis result for the character string that matches the character string included in the matching dictionary in the analysis target text,
Among the analysis target text, for the remaining character strings that do not match the character strings included in the matching dictionary, using the morphological analysis dictionary, generate a lattice including a plurality of morphological analysis result candidates,
Performing morphological analysis on the remaining character string using the lattice, and outputting a second morphological analysis result on the remaining character string;
A morphological analysis method having processing.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017133065A JP2019016162A (en) | 2017-07-06 | 2017-07-06 | Morphological analysis program, morphological analysis device, and morphological analysis method |
CN201810686874.5A CN109213992A (en) | 2017-07-06 | 2018-06-28 | Morphological analysis apparatus and morphological analysis method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017133065A JP2019016162A (en) | 2017-07-06 | 2017-07-06 | Morphological analysis program, morphological analysis device, and morphological analysis method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2019016162A true JP2019016162A (en) | 2019-01-31 |
Family
ID=64989858
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017133065A Pending JP2019016162A (en) | 2017-07-06 | 2017-07-06 | Morphological analysis program, morphological analysis device, and morphological analysis method |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP2019016162A (en) |
CN (1) | CN109213992A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000311168A (en) * | 1999-04-28 | 2000-11-07 | Nec Corp | System and method for analyzing morpheme and recording medium recording morpheme analysis program |
JP2002157244A (en) * | 2000-11-20 | 2002-05-31 | Ricoh Co Ltd | Device and method for analyzing japanese morpheme and storage medium |
Family Cites Families (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH02297195A (en) * | 1989-03-02 | 1990-12-07 | Nec Corp | Morpheme analysis system |
JP3380077B2 (en) * | 1994-05-23 | 2003-02-24 | 沖電気工業株式会社 | Morphological analyzer |
JPH11282837A (en) * | 1998-03-26 | 1999-10-15 | Matsushita Electric Ind Co Ltd | Japanese morpheme analysis device and method and recording medium |
EP1271341A3 (en) * | 2001-06-30 | 2005-11-30 | Unilever N.V. | System for analysing textual data |
JP2003256418A (en) * | 2002-03-06 | 2003-09-12 | Ricoh Co Ltd | Character string processing device, character string processing program and recording media |
JP5112116B2 (en) * | 2008-03-07 | 2013-01-09 | 株式会社東芝 | Machine translation apparatus, method and program |
JP2011081763A (en) * | 2009-09-09 | 2011-04-21 | Sony Corp | Information processing apparatus, information processing method and information processing program |
JP5853595B2 (en) * | 2011-10-31 | 2016-02-09 | 富士通株式会社 | Morphological analyzer, method, program, speech synthesizer, method, program |
CN104866496B (en) * | 2014-02-22 | 2019-12-10 | 腾讯科技(深圳)有限公司 | method and device for determining morpheme importance analysis model |
JP6300601B2 (en) * | 2014-03-31 | 2018-03-28 | Kddi株式会社 | Dictionary device, morpheme analyzer, data structure, morpheme analysis method and program |
JP6619932B2 (en) * | 2014-12-26 | 2019-12-11 | Kddi株式会社 | Morphological analyzer and program |
JP2016177369A (en) * | 2015-03-18 | 2016-10-06 | 株式会社東芝 | Dictionary update device, dictionary update method, dictionary update program and morphological analysis device |
JP2016224483A (en) * | 2015-05-26 | 2016-12-28 | 日本電信電話株式会社 | Model learning device, method and program |
-
2017
- 2017-07-06 JP JP2017133065A patent/JP2019016162A/en active Pending
-
2018
- 2018-06-28 CN CN201810686874.5A patent/CN109213992A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000311168A (en) * | 1999-04-28 | 2000-11-07 | Nec Corp | System and method for analyzing morpheme and recording medium recording morpheme analysis program |
JP2002157244A (en) * | 2000-11-20 | 2002-05-31 | Ricoh Co Ltd | Device and method for analyzing japanese morpheme and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109213992A (en) | 2019-01-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3998668B2 (en) | Morphological analyzer, method and program | |
KR102565274B1 (en) | Automatic interpretation method and apparatus, and machine translation method and apparatus | |
US8849665B2 (en) | System and method of providing machine translation from a source language to a target language | |
JP2007141133A (en) | Device, method and program of example translation | |
JP2015022590A (en) | Character input apparatus, character input method, and character input program | |
CN103050115A (en) | Recognizing device, recognizing method, generating device, and generating method | |
KR20160133349A (en) | Method for generating a phase table and method for machine translation using the phase table | |
JP2009258293A (en) | Speech recognition vocabulary dictionary creator | |
JP5097802B2 (en) | Japanese automatic recommendation system and method using romaji conversion | |
JP5342760B2 (en) | Apparatus, method, and program for creating data for translation learning | |
JP5697648B2 (en) | Word division device, data structure of word division dictionary, word division method, and program | |
JP5623380B2 (en) | Error sentence correcting apparatus, error sentence correcting method and program | |
JP2015084047A (en) | Text set creation device, text set creating method and text set create program | |
JP2005339347A (en) | Japanese-chinese mechanical translation device, japanese-chinese mechanical translation method and japanese-chinese mechanical translation program | |
JP2019016162A (en) | Morphological analysis program, morphological analysis device, and morphological analysis method | |
JP4084515B2 (en) | Alphabet character / Japanese reading correspondence apparatus and method, alphabetic word transliteration apparatus and method, and recording medium recording the processing program therefor | |
Sproat et al. | Applications of lexicographic semirings to problems in speech and language processing | |
JP2017059216A (en) | Query calibration system and method | |
JP6805927B2 (en) | Index generator, data search program, index generator, data search device, index generation method, and data search method | |
Che et al. | Improving mandarin prosodic boundary prediction with rich syntactic features | |
JP5120749B2 (en) | Storage medium recording tree structure dictionary, tree structure dictionary creating apparatus, and tree structure dictionary creating program | |
JP2017026808A (en) | Voice recognition device, voice recognition method, and program | |
US20180033425A1 (en) | Evaluation device and evaluation method | |
JP6309852B2 (en) | Enhanced position prediction apparatus, enhanced position prediction method, and program | |
JP7102986B2 (en) | Speech recognition device, speech recognition program, speech recognition method and dictionary generator |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200409 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210629 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210823 |
|
RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20210823 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20210823 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20220118 |