2016-03-08 18 views
0

我学会使用polyglot为POS标签提供印度尼西亚文本。
POLYGLOT >> ValueError:未找到包裹u'pos2.ms

import polyglot 
from polyglot.text import Text, Word 

text=Text("Menurut dia, Syahganda, dikenal sebagai penggiat isu-isu pertanahan serta perburuhan.") 
print text.pos_tags 

但错误出现了:

Traceback (most recent call last): 
    File "polyglot-tagger.py", line 35, in <module> 
    arrTag=text.pos_tags 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/decorators.py", line 20, in __get__ 
    value = obj.__dict__[self.func.__name__] = self.func(obj) 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/text.py", line 147, in pos_tags 
    for word,t in self.pos_tagger.annotate(self.words): 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/decorators.py", line 20, in __get__ 
    value = obj.__dict__[self.func.__name__] = self.func(obj) 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/text.py", line 100, in pos_tagger 
    return get_pos_tagger(lang=self.language.code) 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/decorators.py", line 30, in memoizer 
    cache[key] = obj(*args, **kwargs) 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/tag/base.py", line 147, in get_pos_tagger 
    return POSTagger(lang=lang) 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/tag/base.py", line 126, in __init__ 
    super(POSTagger, self).__init__(lang=lang) 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/tag/base.py", line 40, in __init__ 
    self.predictor = self._load_network() 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/tag/base.py", line 134, in _load_network 
    self.model = load_pos_model(lang=self.lang, version=2) 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/decorators.py", line 30, in memoizer 
    cache[key] = obj(*args, **kwargs) 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/load.py", line 114, in load_pos_model 
    p = locate_resource(src_dir, lang) 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/load.py", line 47, in locate_resource 
    if downloader.status(package_id) != downloader.INSTALLED: 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/downloader.py", line 737, in status 
    info = self._info_or_id(info_or_id) 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/downloader.py", line 507, in _info_or_id 
    return self.info(info_or_id) 
    File "/usr/local/lib/python2.7/dist-packages/polyglot/downloader.py", line 933, in info 
    raise ValueError('Package %r not found in index' % id) 
ValueError: Package u'pos2.ms' not found in index 

当我试图下载pos2.ms(兼任的语音模型马来语),它不存在model。我该怎么办?

**我使用Ubuntu和Python 2.7

感谢您的帮助之前

回答

相关问题