【问题标题】:How to train Stanford NLP NER Extraction model to skip the repeating words?如何训练斯坦福 NLP NER 提取模型跳过重复词?
【发布时间】:2019-11-08 09:22:41
【问题描述】:

我正在尝试使用 .NET FrameworkStanFord NER 模型从文本中提取 NER。 我有一个像

这样的文字

大家好,我是 John Doe。体重指数27,体表面积2.3m。

为此,我确实创建了 tsv 文件来训练模型。如下:

Hello   O
,   O
I   O
am  O
John    PERSON
Doe.    PERSON
Body    BMI
Mass    BMI
index   BMI
is  O
27. O
And O
Body    O
Surface O
Area    O
is  O
2.3m.   O

prop 文件如下

trainFileList = train/standford_train.tsv
serializeTo = dummy-ner-model-eng.ser.gz
map = word=0,answer=1

useClassFeature=true
useWord=true
useNGrams=true
noMidNGrams=true
maxNGramLeng=6
usePrev=true
useNext=true
useSequences=true
usePrevSequences=true
maxLeft=1
useTypeSeqs=true
useTypeSeqs2=true
useTypeySequences=true
wordShape=chris2useLC
useDisjunctive=true

并使用下面的java命令

java -mx1g -cp stanford-ner.jar;lib/* edu.stanford.nlp.ie.crf.CRFClassifier -annotators 'tokenize,ssplit,pos,lemma,ner,regexner' -prop train/prop.txt

所以,我面临的问题是,由于 身体质量指数身体表面积 的重复,带有 BMI 标记的身体会出现两次。

有什么办法可以省略第二个body标签?

【问题讨论】:

    标签: nlp stanford-nlp named-entity-recognition


    【解决方案1】:

    您需要生成更多的训练数据,其中包含Body 未标记为BMI 的示例。如果您只是在寻找特定的模式,那么使用基于规则的方法可能会获得更好的结果。斯坦福 CoreNLP 中有基于规则的 NER 构建工具。

    更多信息:https://stanfordnlp.github.io/CoreNLP/tokensregex.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-22
      • 2017-06-06
      • 1970-01-01
      • 1970-01-01
      • 2020-08-30
      • 1970-01-01
      • 2017-11-27
      • 1970-01-01
      相关资源
      最近更新 更多