【问题标题】:Annotating sentence in multiple lines in GATE在 GATE 中多行注释句子
【发布时间】:2016-12-17 22:39:58
【问题描述】:

我对 GATE 中的 Sentence Splitter 模块有疑问。我的文字是这样的:

Social history. He drank a lot in his young age. He did
not attend a school. He was depressed of his condition.

虽然我们确定句子应该像这样拆分

Sentence 1: Social history.
Sentence 2: He drank a lot in his young age.
Sentence 3: He did not attend a school.
Sentence 4: He was depressed of his condition.

ANNIE Sentence Splitter 识别出不同行中的文本应该被分组到不同的句子中,因此结果如下:

Sentence 1: Social history.
Sentence 2: He drank a lot in his young age.
Sentence 3: He did 
Sentence 4: not attend a school.
Sentence 5: He was depressed of his condition.

那是因为句子被分成了多行。有没有办法告诉句子拆分器该句子可能不止一行?或者有没有更好的方法来识别此类文本中的句子?

谢谢你:)

【问题讨论】:

  • 您可能正在将单行传递给句子拆分器。您应该首先阅读完整的文件并将完整的文本传递给句子拆分器。
  • 其实我用的是GATE Developer,所以我想我一下子把所有的句子都传完了@RAVI

标签: nlp gate java-annotations


【解决方案1】:

尝试使用 RegEx Sentence Splitter 而不是 Annie。

使用 ANNIE Sentence Splitter,您有参数 TransducerURL,默认情况下指向如下内容:

/PATH-TO-GATE/plugins/ANNIE/resources/sentenceSplitter/grammar/main-single-nl.jape

在这个文件夹里还有一个jape文件叫:

/PATH-TO-GATE/plugins/ANNIE/resources/sentenceSplitter/grammar/main.jape

如果你改变它应该可以工作。

【讨论】:

  • 谢谢,其实官网上有记载,可惜我没查。我尝试使用您提到的方法,它有效!但是出现了另一个问题,有些行没有用句号关闭,句子拆分器将其覆盖到下一行。所以我想我必须决定哪一个有更好的优势和更少的缺点。
  • 如果对您来说有问题,您可以尝试编辑规则文件。也许你会想办法捕捉特殊情况:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-30
  • 1970-01-01
相关资源
最近更新 更多