从文本提取日期 [英] Date Extraction from Text
问题描述
我正在尝试使用斯坦福NLP工具来提取日期(8/11/2012)表单文本。
I am trying to use Stanford NLP tool to extract dates ( 8/11/2012 ) form text.
这里是链接!对于这个工具的演示
Here's a link! for the demo of this tool
你可以帮助我如何训练分类器来识别日期(8/11/2012)。
Can u help me in how to train the classifier to identify date ( 8/11/2012 ).
我尝试使用培训数据作为
I tried using training data as
Woodhouse PERS
8/18/2012日期
,O
帅哥O
Woodhouse PERS 8/18/2012 Date , O handsome O
,但不适用于相同的测试数据。
but does not work for same test data .
推荐答案
使用NLP工具从文本中提取日期似乎是过分的,如果这是你正在努力完成的。您应该考虑其他选项,如简单的Java正则表达式(例如此处) 。
Using the NLP tool to extract dates from text seems like overkill if this is all you are trying to accomplish. You should consider other options like a simple Java regular expression (eg. here).
如果您正在做一些需要Stanford NLP工具更多功能的内容,请查看 SUTime 注释器。他们的演示页面将让您了解其行为方式。确保检查选项从文件
读取规则,您将看到您的日期已注释。
If you are doing something that requires more features from the Stanford NLP tool, take a look at the SUTime annotator. Their demo page will let you get a feel for how it behaves. Make sure to check the option Read rules from file
and you will see that your date gets annotated.
用法:
SUTime annotations are provided automatically with the StanfordCoreNLP pipeline by including the ner annotator.
这篇关于从文本提取日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!