训练Stanford-NER-CRF,控制迭代次数和正则化(L1,L2)参数 [英] Training Stanford-NER-CRF, control number of iterations and regularisation (L1,L2) parameters

查看:298
本文介绍了训练Stanford-NER-CRF,控制迭代次数和正则化(L1,L2)参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在浏览StanfordNER文档/常见问题解答,但找不到与指定训练中最大迭代次数以及正则化参数L1和L2的值有关的任何东西.

I was looking through StanfordNER documentation/FAQ but I can't find anything related to specifying the maximum number of iterations in training and also the value of the regularisation parameters L1 and L2.

我看到了一个建议设置的答案,例如:

I saw an answer on which is suggested to set, for instance:

maxIterations=10

在属性文件中,但是没有给出任何结果.

in the properties file, but that did not gave any results.

是否可以设置这些参数?

Is it possible to set these parameters?

推荐答案

我不得不挖掘代码,但是找到了,因此StanfordNER基本上支持许多不同的数值优化算法.通过查看以下内容,您可以看到实施了哪些内容,并可以用来训练CRF. CRFClassifier.java文件中的getMinimizer()方法.

I had to dig in the code but found it, so basically StanfordNER supports many different numerical optimization algorithms. One can see which ones are implemented and can be used to train the CRF by looking into the getMinimizer() method in the CRFClassifier.java file.

通过设置,我将属性文件配置为使用Orthant-Wise有限内存拟牛顿算法

I configured my properties file to use the Orthant-Wise Limited-memory Quasi-Newton, by setting:

useOWLQN = true

L1-prior可以设置为:

The L1-prior can be set with:

priorLambda = 10

一个有用的技巧是使用会聚公差参数TOL,该参数在每次迭代时都会检查:|newest_val - previous_val| / |newestVal| < TOLTOL由以下控制:

An useful trick is to play with the convergence tolerance parameter TOL, which is checked at each iteration: |newest_val - previous_val| / |newestVal| < TOL, the TOL is controlled by:

tolerance = 0.01

另一个有用的参数是显式控制学习算法应运行的最大迭代次数:

Yet another useful parameter is to explicitly control the maximum number of iterations for which the learning algorithm should run:

maxQNItr = 100

这篇关于训练Stanford-NER-CRF,控制迭代次数和正则化(L1,L2)参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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