从文本提取日期 [英] Date Extraction from Text

查看:249
本文介绍了从文本提取日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用斯坦福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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆