タイ語の係り受け解析における品詞付与の重要性

Ponrawee Prasertsom, Apiwat Jaroonpol, Attapol T. Rutherford『[The Thai Discourse Treebank: Annotating and Classifying Thai Discourse Connectives](https://doi.org/10.1162/tacl_a_00650)』(Transactions of the Association for Computational Linguistics, Vol.12, pp.613–629)を横目に、[Thai Discourse Treebank](https://github.com/nlp-chula/thai-discourse-treebank/tree/main/data/th-tdtb)の係り受けコーパスを見てみることにした。が、[test.conllu](https://github.com/nlp-chula/thai-discourse-treebank/blob/main/data/th-tdtb/test.conllu)の最初のレコードで挫けてしまった。

```
# newdoc_id = T00178.tsv
# sent_id = T00178.tsv-1
# text = "มีชัย"แจงเหตุไม่เลือก"นาม-แก้วสรร"นั่ง
1	"	_	PUNCT	PUNC	_	2	punct	2:punct	_
2	มีชัย	_	NOUN	NCMN	_	7	nsubj	7:nsubj	_
3	"	_	PUNCT	PUNC	_	2	punct	2:punct	_
4	แจง	_	NOUN	NCMN	_	2	compound	2:compound	_
5	เหตุ	_	NOUN	NCMN	_	2	compound	2:compound	_
6	ไม่	_	PART	NEG	_	7	advmod	7:advmod	_
7	เลือก	_	VERB	VACT	_	0	root	0:root	_
8	"	_	PUNCT	PUNC	_	9	punct	9:punct	_
9	นาม	_	NOUN	NCMN	_	7	obl	7:obl	_
10	-	_	PUNCT	PUNC	_	11	punct	11:punct	_
11	แก้วสรร	_	NOUN	NCMN	_	9	compound	9:compound	_
12	"	_	PUNCT	PUNC	_	13	punct	13:punct	_
13	นั่ง	_	NOUN	NCMN	_	11	nmod	11:nmod	_
```

可視化すると、[こんな感じ](https://koichiyasuoka.github.io/deplacy/deplacy/viewer.svg#%23%20newdoc_id%20%3D%20T00178.tsv%0A%23%20sent_id%20%3D%20T00178.tsv-1%0A%23%20text%20%3D%20%22%E0%B8%A1%E0%B8%B5%E0%B8%8A%E0%B8%B1%E0%B8%A2%22%E0%B9%81%E0%B8%88%E0%B8%87%E0%B9%80%E0%B8%AB%E0%B8%95%E0%B8%B8%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B9%80%E0%B8%A5%E0%B8%B7%E0%B8%AD%E0%B8%81%22%E0%B8%99%E0%B8%B2%E0%B8%A1-%E0%B9%81%E0%B8%81%E0%B9%89%E0%B8%A7%E0%B8%AA%E0%B8%A3%E0%B8%A3%22%E0%B8%99%E0%B8%B1%E0%B9%88%E0%B8%87%0A1%09%22%09_%09PUNCT%09PUNC%09_%092%09punct%092%3Apunct%09_%0A2%09%E0%B8%A1%E0%B8%B5%E0%B8%8A%E0%B8%B1%E0%B8%A2%09_%09NOUN%09NCMN%09_%097%09nsubj%097%3Ansubj%09_%0A3%09%22%09_%09PUNCT%09PUNC%09_%092%09punct%092%3Apunct%09_%0A4%09%E0%B9%81%E0%B8%88%E0%B8%87%09_%09NOUN%09NCMN%09_%092%09compound%092%3Acompound%09_%0A5%09%E0%B9%80%E0%B8%AB%E0%B8%95%E0%B8%B8%09_%09NOUN%09NCMN%09_%092%09compound%092%3Acompound%09_%0A6%09%E0%B9%84%E0%B8%A1%E0%B9%88%09_%09PART%09NEG%09_%097%09advmod%097%3Aadvmod%09_%0A7%09%E0%B9%80%E0%B8%A5%E0%B8%B7%E0%B8%AD%E0%B8%81%09_%09VERB%09VACT%09_%090%09root%090%3Aroot%09_%0A8%09%22%09_%09PUNCT%09PUNC%09_%099%09punct%099%3Apunct%09_%0A9%09%E0%B8%99%E0%B8%B2%E0%B8%A1%09_%09NOUN%09NCMN%09_%097%09obl%097%3Aobl%09_%0A10%09-%09_%09PUNCT%09PUNC%09_%0911%09punct%0911%3Apunct%09_%0A11%09%E0%B9%81%E0%B8%81%E0%B9%89%E0%B8%A7%E0%B8%AA%E0%B8%A3%E0%B8%A3%09_%09NOUN%09NCMN%09_%099%09compound%099%3Acompound%09_%0A12%09%22%09_%09PUNCT%09PUNC%09_%0913%09punct%0913%3Apunct%09_%0A13%09%E0%B8%99%E0%B8%B1%E0%B9%88%E0%B8%87%09_%09NOUN%09NCMN%09_%0911%09nmod%0911%3Anmod%09_%0A%0A)。

![thai1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/428317/631825ae-55db-e5ab-81f0-d4203ec51fd4.png)

正直なところ、かなりヒドイ。この例文は、[LST20 Corpus](https://opend-portal.nectec.or.th/it/dataset/lst20-corpus) `train/T00178.txt`冒頭の

> "	PU	O	B_CLS
> มีชัย	NN	B_PER	I_CLS
> "	PU	O	I_CLS
> แจง	VV	O	I_CLS
> เหตุ	NN	O	I_CLS
> ไม่	NG	O	I_CLS
> เลือก	VV	O	I_CLS
> "	PU	O	I_CLS
> นาม	NN	B_PER	I_CLS
> \-	PU	O	I_CLS
> แก้วสรร	NN	B_PER	I_CLS
> "	PU	O	I_CLS
> นั่ง	VV	O	E_CLS

から取ってきているはずなのに、品詞が無茶苦茶になってしまっていて、結果として係り受けがボロボロだ。特に、LST20 Corpusでは`VV`(動詞)となっている「แจง」や「นั่ง」を、Thai Discourse Treebankでは`NOUN`(名詞)に間違えてしまっているので、係り受け解析で致命傷となっている。私(安岡孝一)なりに書き直してみよう。

```
# text = "มีชัย"แจงเหตุไม่เลือก"นาม-แก้วสรร"นั่ง
1	"	_	PUNCT	PUNC	_	2	punct	_	SpaceAfter=No
2	มีชัย	_	PROPN	NPRP	_	4	nsubj	_	SpaceAfter=No
3	"	_	PUNCT	PUNC	_	2	punct	_	SpaceAfter=No
4	แจง	_	VERB	VACT	_	0	root	_	SpaceAfter=No
5	เหตุ	_	NOUN	NCMN	_	4	obj	_	SpaceAfter=No
6	ไม่	_	PART	NEG	Polarity=Neg	7	advmod	_	SpaceAfter=No
7	เลือก	_	VERB	VACT	_	5	acl	_	SpaceAfter=No
8	"	_	PUNCT	PUNC	_	9	punct	_	SpaceAfter=No
9	นาม	_	PROPN	NPRP	_	7	obj	_	SpaceAfter=No
10	-	_	PUNCT	PUNC	_	9	punct	_	SpaceAfter=No
11	แก้วสรร	_	PROPN	NPRP	_	9	flat:name	_	SpaceAfter=No
12	"	_	PUNCT	PUNC	_	9	punct	_	SpaceAfter=No
13	นั่ง	_	VERB	VACT	_	9	acl	_	SpaceAfter=No
```

![thai2.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/428317/fabfb8ad-dc33-df63-7e5e-8411a72049b6.png)

私が見る限り`root`は「แจง」になるので、係り受け構造が根本から違っている。また、「"มีชัย"」は「มีชัย ฤชุพันธุ์」を、「"นาม-แก้วสรร"」は「แก้วสรร อติโพธิ」を指しているので、`PROPN`(固有名詞)にすべきだ。というか、元のLST20 Corpusでも`B_PER`が付されていて人名だと明示されてるのに、どうしてThai Discourse Treebankはちゃんと品詞付与してないんだろ。