斯坦福NLP核心会话数据解析

问题描述 投票:0回答:1

我想在我们的会话数据上用Stanford dcoref包进行一些实验。我们的数据包含用户名(发言者)和话语。是否有可能将结构化数据作为输入(而不是原始文本)提供给Stanford dcoref注释器?如果是,会话输入数据的格式应该是什么?

谢谢,-berfin

stanford-nlp
1个回答
0
投票

我能够得到这个基本的例子:

<doc id="speaker-example-1">
<post author="Joe Smith" datetime="2018-02-28T20:10:00" id="p1">
I am hungry!
</post>
<post author="Jane Smith" datetime="2018-02-28T20:10:05" id="p2">
Joe Smith is hungry.
</post>
</doc>

我用过这些属性:

annotators = tokenize,cleanxml,ssplit,pos,lemma,ner,parse,coref

coref.conll = true
coref.algorithm = clustering

# Clean XML tags for SGM (move to sgm specific conf file?)
clean.xmltags = headline|dateline|text|post
clean.singlesentencetags = HEADLINE|DATELINE|SPEAKER|POSTER|POSTDATE
clean.sentenceendingtags = P|POST|QUOTE
clean.turntags = TURN|POST|QUOTE
clean.speakertags = SPEAKER|POSTER
clean.docIdtags = DOCID
clean.datetags = DATETIME|DATE|DATELINE
clean.doctypetags = DOCTYPE
clean.docAnnotations = docID=doc[id],doctype=doc[type],docsourcetype=doctype[source]
clean.sectiontags = HEADLINE|DATELINE|POST
clean.sectionAnnotations = sectionID=post[id],sectionDate=post[date|datetime],sectionDate=postdate,author=post[author],author=poster
clean.quotetags = quote
clean.quoteauthorattributes = orig_author
clean.tokenAnnotations = link=a[href],speaker=post[author],speaker=quote[orig_author]
clean.ssplitDiscardTokens = \\n|\\*NL\\*

此文档还有关于coref系统的很好的信息:

https://stanfordnlp.github.io/CoreNLP/coref.html

我正在考虑在我的示例neural文档中使用.xml选项,但您可能必须将您的数据放入conll格式以使用conll设置运行我们的神经coref。 conll数据具有与其他文档格式之间的说话者信息的会话数据。

本文档包含有关使用neural算法时必须使用的CoNLL格式的信息。

CoNLL 2012格式:http://conll.cemantix.org/2012/data.html

您需要创建一个具有类似目录结构的文件夹(但您可以将文件放入其中)

例如:/Path/to/conll_2012_dir/v9/data/test/data/english/annotations/wb/eng/00/eng_0009.v9_auto_conll

如果您运行此命令:

java -Xmx20g edu.stanford.nlp.coref.CorefSystem -props speaker.properties

具有以下属性:

coref.algorithm = clustering
coref.conll = true
coref.conllOutputPath = /Path/to/output_dir
coref.data = /Path/to/conll_2012_dir

它会将conll输出文件写入/Path/to/output_dir

该命令应读入以_auto_conll结尾的所有文件

© www.soinside.com 2019 - 2024. All rights reserved.