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

查看:26
本文介绍了在 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] 这是一个关于足球、橄榄球和其他东西的页面

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

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

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天全站免登陆