【发布时间】:2015-09-24 02:02:35
【问题描述】:
有没有办法训练现有的 Apache OpenNLP POS Tagger 模型?我需要在模型中添加一些特定于我的应用程序的专有名词。当我尝试使用以下命令时:
opennlp POSTaggerTrainer -type maxent -model en-pos-maxent.bin \
-lang en -data en-pos.train -encoding UTF-8
重新训练整个模型。我只想在en-pos-maxent.bin 后面加几句新的句子
这是我的训练文件的样子:
Where_WRB is_VBZ the_DT Seven_DNNP Dwarfs_DNNP Mine_DNNP Train_DNNP ?_?
Where_WRB is_VBZ the_DT Astro_DNNP Orbiter_DNNP ?_?
Where_WRB is_VBZ the_DT Barnstormer_DNNP ?_?
Where_WRB is_VBZ the_DT Big_DNNP Thunder_DNNP Mountain_DNNP Railroad_DNNP ?_?
Where_WRB is_VBZ the_DT Buzz_DNNP Lightyears_DNNP Space_DNNP Ranger_DNNP Spin_DNNP ?_?
Where_WRB is_VBZ the_DT Casey_DNNP Jr_DNNP Splash_DNNP N_DNNP Soak_DNNP Station_DNNP ?_?
Where_WRB is_VBZ the_DT Cinderella_DNNP Castle_DNNP ?_?
Where_WRB is_VBZ the_DT Country_DNNP Bear_DNNP Jamboree_DNNP ?_?
Where_WRB is_VBZ the_DT Dumbo_DNNP the_DNNP Flying_DNNP Elephant_DNNP ?_?
Where_WRB is_VBZ the_DT Enchanted_DNNP Tales_DNNP with_DNNP Belle_DNNP ?_?
Where_WRB is_VBZ the_DT Frontierland_DNNP Shootin_DNNP Arcade_DNNP ?_?
训练模型后,除训练文件中的单词外,所有单词都被标记为DNNP。
例如,如果我要求标记单词 'Where'(存在于训练文件中),答案是 WRB,但如果我要求标记单词 'hello'(不存在于训练文件中) ,它被标记为DNNP。所以我想补充几句。我该怎么做?
【问题讨论】:
标签: nlp text-mining opennlp pos-tagger