gpt4 book ai didi

stanford-nlp - nltk stanford ner tagger 和 stanford ner tagger 在线演示之间的不一致

转载 作者:行者123 更新时间:2023-12-04 04:55:24 27 4
gpt4 key购买 nike

我正在使用 python 的内置库 nltk 来获取 stanford ner tagger api 设置,但我发现此 api 的单词标记与 stanford 的 ner tagger 网站上的在线演示之间存在不一致。有些单词在在线演示中被标记,而它们没有在 python 中的 api 中,类似地,一些单词被标记为不同。我使用了与网站中提到的相同的分类器。谁能告诉我为什么会出现问题以及解决方案是什么......?

最佳答案

我遇到了同样的问题,并确定我的代码和在线演示对文本应用了不同的格式规则。

https://github.com/dat/pyner/blob/master/ner/client.py

for s in ('\f', '\n', '\r', '\t', '\v'): #strip whitespaces
text = text.replace(s, '')
text += '\n' #ensure end-of-line

关于stanford-nlp - nltk stanford ner tagger 和 stanford ner tagger 在线演示之间的不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32659639/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com