0

ポリグロットを使用して POS タグにインドネシア語のテキストを付ける方法を学びます。

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(マレー語の品詞モデル)をダウンロードしようとしたところ、モデルに存在しませんでした。私は何をすべきか?

**Ubuntu と python 2.7 を使用しています

以前はお世話になりました

4

1 に答える 1

-1

マレー語の言語カバレッジを確認してください http://polyglot.readthedocs.org/en/latest/POS.html#languages-coverage

今後、さらに多くの言語を追加する予定です

于 2016-03-08T19:11:16.390 に答える