这是我的要求。我想以允许我实现以下内容的方式标记和标记段落。
- 应该在段落中识别日期和时间并将它们标记为日期和时间
- 应该识别段落中的已知短语并将它们标记为 CUSTOM
- 其余内容应该被标记化应该被默认的nltk的word_tokenize和pos_tag函数标记化?
例如,下面的句子
"They all like to go there on 5th November 2010, but I am not interested."
如果自定义短语是“我不感兴趣”,则应按如下方式标记和标记。
[('They', 'PRP'), ('all', 'VBP'), ('like', 'IN'), ('to', 'TO'), ('go', 'VB'),
('there', 'RB'), ('on', 'IN'), ('5th November 2010', 'DATE'), (',', ','),
('but', 'CC'), ('I am not interested', 'CUSTOM'), ('.', '.')]
任何建议都会很有用。