使用nltk将日期识别为命名实体? [英] Using the nltk to recognise dates as named entities?

查看:114
本文介绍了使用nltk将日期识别为命名实体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用NLTK命名实体标记器来标识各种命名实体.在《用Python进行自然语言处理》一书中,他们提供了常用命名实体的列表(表7.4,如果有人好奇的话),其中包括:DATE,2008-06-29和TIME,凌晨两点五十. ,下午1:30因此,我印象深刻的是,这可以通过NLTK的命名实体标记器完成.

I'm trying to use the NLTK Named Entity Tagger to identify various named entities. In the book Natural Language Processing with Python they provide a list of commonly used named entitities, (Table 7.4, if anyone is curious) which include: DATE June, 2008-06-29 and TIME two fifty a m, 1:30 p.m. So I got the impresssion that this could be done with the NLTK's named entity tagger.

但是,当我运行标记器时,它似乎并没有像人或组织那样完全掌握日期或时间. NLTK命名实体标记器是否不处理这些日期/时间情况,还是仅采用特定的日期/时间格式?如果它不能处理这些情况,那么有人知道这样做的系统吗?还是创建自己的解决方案?

However, when I've run the tagger, it doesn't seem to pick up dates or times at all, as it does people or organizations. Does the NLTK named entity tagger not handle these date/time cases, or does it only pick up a specific date/time format? If it doesn't handle these cases, does anybody know of a system that does? Or is creating my own the only solution?

谢谢!

推荐答案

您应该查看NLTK的contrib存储库-包含名为timex.py的模块,或在此处下载: https://github.com/nltk/nltk_contrib/blob/master/nltk_contrib /timex.py

You should check out the contrib repository of NLTK - contains a module called timex.py or download it here: https://github.com/nltk/nltk_contrib/blob/master/nltk_contrib/timex.py

从模块的第一行开始:


# Code for tagging temporal expressions in text

这篇关于使用nltk将日期识别为命名实体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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