【发布时间】:2020-01-21 11:09:03
【问题描述】:
我一直在关注sklearn-crfsuitetutorial。
用于训练 CRF 模型的特征示例如下所示。
{'+1:postag': 'Fpa',
'+1:postag[:2]': 'Fp',
'+1:word.istitle()': False,
'+1:word.isupper()': False,
'+1:word.lower()': '(',
'BOS': True,
'bias': 1.0,
'postag': 'NP',
'postag[:2]': 'NP',
'word.isdigit()': False,
'word.istitle()': True,
'word.isupper()': False,
'word.lower()': 'melbourne',
'word[-2:]': 'ne',
'word[-3:]': 'rne'}
sklearn-crfsuite 如何将melbourne 之类的字符串转换为浮点数,因为 CRF 的特征应该只是浮点数。文档中没有提到这一点。
【问题讨论】:
标签: python crf crfsuite python-crfsuite