首页 文章

GATE情绪分析如何运作?

提问于
浏览
0

我成功地创建了一个情感分析管道,如下所示:https://gate.ac.uk/sale/talks/gate-course-may10/track-3/module-11-ml-adv/module-11-sentiment.pdf但现在我想使用不同的语料库:它是德语;我有两个包含带有正面或负面特征的德语短语的文件 . 我把它写成一个.xml文件,如下所示:

<?xml version='1.0' encoding='UTF-8' ?>
<GateDocument>
<GateDocumentFeatures>
<Feature>
  <Name className="java.lang.String">gate.SourceURL</Name>
  <Value className="java.lang.String">file:/C:/Users/user/Documents/text</Value>
</Feature>
<Feature>
  <Name className="java.lang.String">MimeType</Name>
  <Value className="java.lang.String">text/plain</Value>
</Feature>
</GateDocumentFeatures>

<TextWithNodes>
<Node id="0" />10:41 Uhr &apos; Ist aber ein schwacher Trost. 
<Node id="47" />1969 das Problem der Entsorgung offiziell angesprochen. 
<Node id="103" />
...
</TextWithNodes>

<AnnotationSet Name="Key">
<Annotation Id="0" Type="comment" StartNode="0" EndNode="47">
<Feature>
  <Name className="java.lang.String">rating</Name>
  <Value className="java.lang.Double">2.0</Value>
</Feature>
</Annotation>
...
</AnnotationSet>
</GateDocument>

但我不明白如何使用paum.xml:

1)在教程的例子中有一个字符串评级功能(例如“2_Star_Rating”)而不是Double,但我不知道paum.xml /管道如何处理这个字符串功能 - 我怎么能告诉我我现在有一个Double值可以使用的管道?

2)当我在应用程序模式下运行批处理学习PR时:文本语料库如何不得不喜欢?纯文本好吗?

在第一次试用中,我使用了教程中相同的paum.xml文件,并将我的评级从double(2.0)转换为Strings(“2_Star_Rating”) - 并且在训练和应用程序模式下没有出现错误 - 但是当我查看我的文本文件时(我在app.mode上运行我的管道),没有设置注释 .

2 回答

  • 1

    为什么不使用简化的XML,如:

    这是带有opinion1的comment1文本

    这是带有opinion2的comment2文本

    它可以是每个文件的注释或在一个文件中包含大量注释的文件 .

    然后,您可以使用AnnotationSet Transfer PR并将“原始标记”中的注释复制到语料库填充后的默认设置 .

  • 0

    最后我发现了GATE的期望:给定的文件(应该进行分析)必须如下所示:

    <?xml version='1.0' encoding='UTF-8' ?>
    <GateDocument>
    <GateDocumentFeatures>
    <Feature>
      <Name className="java.lang.String">gate.SourceURL</Name>
      <Value className="java.lang.String">file:/C:/Users/user/Documents/text</Value>
    </Feature>
    <Feature>
      <Name className="java.lang.String">MimeType</Name>
      <Value className="java.lang.String">text/html</Value>
    </Feature>
    </GateDocumentFeatures>
    <TextWithNodes>
    <Node id="0" />sentence1
    <Node id="9" />
    ...
    </TextWithNodes>
    
    <AnnotationSet Name="Key">
    <Annotation Id="1" Type="comment" StartNode="0" EndNode="9">
    </Annotation>
    ...
    </AnnotationSet>
    </GateDocument>
    

相关问题