在opennlp中训练自己的模型 [英] Training own model in opennlp

查看:235
本文介绍了在opennlp中训练自己的模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现很难创建自己的模型openNLP. 谁能告诉我如何拥有模特. 培训应该如何进行.

I am finding it difficult to create my own model openNLP. Can any one tell me, how to own model. How the training shouls be done.

输入应该是什么,输出模型文件将存储在哪里.

What should be the input and where the output model file will get stored.

推荐答案

https://opennlp.apache.org/docs/1.5.3/manual/opennlp.html

这个网站非常有用,既可以显示代码,也可以使用OpenNLP应用程序来训练所有不同类型的模型,例如实体提取和词性等.

This website is very useful, shows both in code, and using the OpenNLP application to train models for all different types, like entity extraction and part of speech etc.

我可以在这里给您一些代码示例,但是该页面非常易于使用.

I could give you some code examples in here, but the page is very clear to use.

理论上:

基本上,您会创建一个文件,其中列出了您想训练的东西

Essentially you create a file which lists the stuff you want to train

例如

体育[空白]这是有关足球,橄榄球和其他东西的页面

Sport [whitespace] this is a page about football, rugby and stuff

政治[空白]这是关于托尼·布莱尔(Tony Blair)担任总理的页面.

Politics [whitespace] this is a page about tony blair being prime minister.

格式在上一页中有所描述(每种型号均要求使用不同的格式).一旦创建了该文件,就可以通过API或opennlp应用程序(通过命令行)运行它,并生成一个.bin文件.拥有这个.bin文件后,您可以将其加载到模型中,并开始使用它(根据上面网站中的api).

The format is described on the page above (each model expects a different format). once you have created this file, you run it through either the API or the opennlp application (via command line), and it generates a .bin file. Once you have this .bin file, you can load it into a model, and start using it (as per the api in the above website).

这篇关于在opennlp中训练自己的模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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