我正在尝试在具有词性标记功能的项目中设置 OpenNLP NameFinder。我从FeatureGeneratorAdapter类扩展了我的要素类,并覆盖了以下方法。不幸的是,此方法仅在参数中采用原始标记。问题是如何将 POS 标签信息传递给这个方法?
public void createFeatures(List features, String[] tokens, int index, String[] previousOutcomes)
我正在尝试在具有词性标记功能的项目中设置 OpenNLP NameFinder。我从FeatureGeneratorAdapter类扩展了我的要素类,并覆盖了以下方法。不幸的是,此方法仅在参数中采用原始标记。问题是如何将 POS 标签信息传递给这个方法?
public void createFeatures(List features, String[] tokens, int index, String[] previousOutcomes)
Try just passing in the pos as the tokens, ie append the pos to the word like this
bob_nn, went_vv etc....
the goal of the method in the interface is to return the "List features" ref back filled with the tokens so you may as well just put the pos_token combos straight into the list to begin with... never tried this before so hope this helps