泰米尔语分块

Chunking for Tamil language

我想为泰米尔语(一种印度语)使用 NLTK 词块划分器。 However, it says that it doesn't support Unicode because it uses the 'pre' module for regular expressions.

Unresolved Issues

If we use the re module for regular expressions, Python's regular expression engine generates "maximum recursion depth exceeded" errors when processing very large texts, even for regular expressions that should not require any recursion. We therefore use the pre module instead. But note that pre does not include Unicode support, so this module will not work with unicode strings.

有任何解决方法或其他方法的建议吗?

您可以使用 LTRC's Shallow Parser 泰米尔语。

您可以查看在线演示,here

分块是针对特定语言的,因此您无论如何都需要为泰米尔语训练一个分块。当然,如果您对可用的现成解决方案感到满意(我不知道是否有任何解决方案,例如现在已删除的答案中的 link 是否有任何好处),您可以在这里停止阅读.如果没有,您可以训练自己的,但您需要一个语料库,该语料库用您想要识别的块进行注释:也许您在寻找 NP 块(通常情况),但也许是其他东西。

一旦你有了带注释的语料库,请仔细阅读 NLTK 书的第 6 章和第 7 章,尤其是 section 7.3, Developing and evaluating chunkers.. While Chapter 7 begins with the nltk's regexp chunker, keep reading and you'll see how to build a "sequence classifier" that does not rely on the nltk's regexp-based chunking engine. (Chapter 6 对此必不可少,所以不要跳过它。

这不是一项简单的任务:您需要了解分类器方法,将各个部分放在一起,可能将您的语料库转换为 IOB format,最后 select 个能给您带来满意性能的特征。但它非常简单,可以针对任何语言或您拥有带注释语料库的分块任务执行。唯一开放的部分是思考上下文线索,您可以将这些线索转换为特征以帮助分类器做出正确决定,并进行试验直到找到一个好的组合。 (从好的方面来说,它是一种比纯粹基于正则表达式的解决方案更强大的方法,即使对于 ascii 文本也是如此)。