调试 Baum Welch 算法的实现(用于 POS 标记)
我正在开发一个项目,其中一部分是开发一个用于 POS 标记的无监督 HMM 训练器,我现在想测试它是否存在可能的错误。
我正在使用 Baum-Welch 算法来训练模型。输入是序列单词(从语料库中提取),输出是来自一组状态 (s1, s2, ... sn)
的隐藏状态序列。 我现在已经完成了编码,但我不确定它是否没有错误。
谁能给我一些调试想法?比如我应该检查输出什么?如何检查我的算法的准确性?
I am working on a project, a part of which is to develop an unsupervised HMM trainer for POS tagging, which I now want to test for posible bugs.
I am using Baum-Welch algorithm to train the model. The inputs are sequence words (drawn from a corpus) and the outputs are sequence of hidden states from a set of states (s1, s2, ... sn)
.
I am now done with the coding, but I am not sure if it is bug free.
Can anyone suggest me some debugging ideas? As in what should I check in the outputs? How to check the accuracy of my algorithm ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无监督词性标注是一个非常有趣的新兴研究课题。如果我理解正确的话,您实际上是在问如何评估标记的准确性,而不是如何调试代码。评估是无监督 POS 归纳中的一个已知问题。您的问题的简短答案是:获取此带注释的语料库 来自 NLTK,然后绘制您所在州的地图通过将状态映射到最常同时出现的标签来将状态映射到语料库标签,并找到正确状态的百分比。该评估过程称为多对一映射。
您应该熟悉文献,因为它将回答您的问题等等。这里有一些可以开始的地方:
早期论文:
<块引用>
马克·约翰逊。 2007. 为什么 EM 找不到好的 HMM POS 标记器?载于 2007 年自然语言处理和计算自然语言学习经验方法联合会议 (EMNLP-CoNLL) 论文集,第 296–305 页。
调查论文:
<块引用>
克里斯托斯·克里斯托罗普洛斯、莎朗·戈德华特和马克·斯蒂德曼。 2010. 两个十年的无监督 POS 入门:我们走了多远?摘自 EMNLP 2010 年会议记录。
调查
当您说“无监督”时,您应该问自己是否只想使用原始文本,或者还想使用字典等。也有这方面的工作。
此外,还有可用于该任务的代码。
另一个询问 NLP 的地方是:http://metaoptimize.com/qa 。
如果您还有其他问题,请随时询问。
Unsupervised POS tagging is a very interesting emerging research topic. If I understand correctly, you are actually asking how to evaluate your tagging accuracy, not how to debug the code. Evaluation is a known issue in unsupervised POS induction. The short answer to your question is: get this annotated corpus from NLTK, then map your states to the corpus tags by mapping a state to the tag it most often co-occurs with, and find the percentage of correct ones. This evaluation procedure is called Many-to-one mapping.
You should make yourself familiar with the literature, as it will answer your questions and more. Here are some places to start:
An early paper:
A survey paper:
When you say "unsupervised", you should ask yourself whether you want to use only raw text, or also want to use a dictionary, for example. There are works on that, too.
Also, there is code available out there for the task.
Another place to ask about NLP is: http://metaoptimize.com/qa .
If you have other questions, don't hesitate to ask.