CoreNLP 출력을위한 CoNLL 포맷 옵션이 있지만, 불행히도 MaltParser가 기대하는 것과 일치하지 않습니다. (혼란스럽게도 서로 다른 경쟁 연도에 대해 서로 다른 몇 가지 일반적인 CoNLL 데이터 형식이 있습니다.)
-outputFormat conll
옵션을 사용하여 명령 줄에서 CoreNLP를 실행하면 다음과 같은 TSV 형식으로 출력됩니다 대답 끝에서) :
INDEX WORD LEMMA POS NER DEPHEAD DEPREL
MaltParser는 약간 다른 형식을 예상하지만 데이터 입/출력 형식을 사용자 정의 할 수 있습니다. maltparser/appdata/dataformat/myconll.xml
이 내용을 넣어보십시오 :
<?xml version="1.0" encoding="UTF-8"?>
<dataformat name="myconll" reader="tab" writer="tab">
<column name="ID" category="INPUT" type="INTEGER"/>
<column name="FORM" category="INPUT" type="STRING"/>
<column name="LEMMA" category="INPUT" type="STRING"/>
<column name="POSTAG" category="INPUT" type="STRING"/>
<column name="NER" category="IGNORE" type="STRING"/>
<column name="HEAD" category="HEAD" type="INTEGER"/>
<column name="DEPREL" category="DEPENDENCY_EDGE_LABEL" type="STRING"/>
</dataformat>
그런 다음 MaltParser 설정 파일에 추가 (maltparser/examples/optionexample.xml
의 예제 설정 찾기) :
<?xml version="1.0" encoding="UTF-8"?>
<experiment>
<optioncontainer>
...
<optiongroup groupname="input">
<option name="format" value="myconll"/>
</optiongroup>
</optioncontainer>
...
</experiment>
이 그럼 당신은 훈련 데이터로 CoreNLP CoNLL 출력을 제공 할 수 있어야합니다을 MaltParser에게.
테스트되지 않았지만 MaltParser 문서가 정직한 경우이 방법이 효과적입니다. 출처 :
예 CoreNLP CoNLL 출력 (I에서만 사용 주석 자 tokenize,ssplit,pos
)
$ echo "This is a test." | java edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos -outputFormat conll 2>/dev/null
1 This this DT _ _ _
2 is be VBZ _ _ _
3 a a DT _ _ _
4 test test NN _ _ _
5 . . . _ _ _
이 원시 텍스트 코퍼스 또는 treebank인가? 종속성 주석이있는 코퍼스 (dependency treebank 또는 종속성 treebank로 변환 될 수있는 constituency treebank)가 있어야합니다. –
이것은 원시 텍스트 코퍼스입니다. 위에 링크 된 게시물에는 Stanford Parser를 통해 constituency treebank를 검색하는 절차가 있지만, 이것은 .tree 파일입니다. 몰트 파서는 .conll 파일 만 가져간다고 믿습니다. – jeffrey