You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I am trying to use Wordnet for Finnish, but it looks like there is no Finnish data downloaded with the package.
This code produces an error below.
from wn import WordNet
from wn.constants import wordnet_30_dir
fin_wn = WordNet(wordnet_30_dir)
print(fin_wn.langs())
fin_wn.synsets(lemma, lang=lang)
4135382db444:python -u /opt/project/task_generation/generator.py
['eng']
Traceback (most recent call last):
File "/opt/project/task_generation/generator.py", line 18, in <module>
search_wn('cat', 'n', 'fin')
File "/opt/project/task_generation/generator.py", line 10, in search_wn
res = fin_wn.synsets(lemma, lang=lang)
File "/usr/local/lib/python3.8/site-packages/wn/__init__.py", line 154, in synsets
self._load_lang_data(lang)
File "/usr/local/lib/python3.8/site-packages/wn/omw.py", line 79, in _load_lang_data
raise WordNetError("Language is not supported.")
NameError: name 'WordNetError' is not defined
Do I need to install language-specific packages separately?
The text was updated successfully, but these errors were encountered:
@tezer I think the wordnet_30_dir is for the Princeton WordNet 3.0, which is just English. The Open Multilingual Wordnet (OMW) is what you want, so use the omw_dir variable instead. Also note that this project is not being maintained, so you might have better luck with https://github.com/goodmami/wn/ (disclaimer: I'm the author). Here's an example (using that project) to download and use the Finnish wordnet:
>>> import wn
>>> wn.download('finwn')
[...]
>>> for w in wn.words(lang='fi')[:10]:
... print(w.lemma())
...
entiteetti
kokonaisuus
fyysinen entiteetti
abstrahointi
käsitteellistäminen
abstrakti entiteetti
esine
fyysinen esine
samanlainen
elävä olio
If this solves your problem, feel free to close this issue.
Hi
I am trying to use Wordnet for Finnish, but it looks like there is no Finnish data downloaded with the package.
This code produces an error below.
Do I need to install language-specific packages separately?
The text was updated successfully, but these errors were encountered: