Closed Shawn-Guo-CN closed 7 years ago
Set the environment variables CONCEPTNET_DB_USER
and CONCEPTNET_DB_PASSWORD
to the username and password that let you connect to your PostgreSQL database.
Thanks for the reply. But I now got another error. The whole trace back information is as follow: rule miniaturize: input: data/vectors/numberbatch.h5, data/vectors/w2v-google-news.h5 output: data/vectors/mini.h5 jobid: 3 resources: ram=4
Traceback (most recent call last): File "/home/shawnguo/.local/lib/python3.5/site-packages/wordfreq/init.py", line 273, in word_frequency return _wf_cache[args] KeyError: ('##', 'ja', 'combined', 0.0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/shawnguo/.local/bin/cn5-vectors", line 11, in
What's wrong this time? I'd be really grateful if you could help.
How to set the environment variables CONCEPTNET_DB_USER and CONCEPTNET_DB_PASSWORD? I didn't set password for the db user "shawnguo". I can access the db by using psql in my shell and no password is required.
The error you got above comes from trying to decide which Japanese words and phrases to put in the combined vector space, which involves dependencies that I forgot to describe. It needs MeCab, the Japanese tokenizer.
I've pushed an update that will get the Python side of those dependencies, and updated the https://github.com/commonsense/conceptnet5/wiki/Build-process page with what else you need to do. In particular, you need to install libmecab-dev
and mecab-ipadic-utf8
.
As for access to the database: The psql
command uses a kind of connection that Python can't use, and sometimes Postgres is configured to allow just that kind of connection without a password. I added a link to the wiki page that explains how to allow all local connections without a password: https://gist.github.com/p1nox/4953113
Well, thank you very much. I still have one question, do I really have to install python package MeCab from source? I didn't figure out how to install it via pip.
Ah, the package is named 'mecab-python3', despite that you import it as 'MeCab'. I pushed an update to the conceptnet5 repo that puts it in the dependencies when you want to build vectors.
When I build a conceptnet on our sever, an error raised, the traceback information shows as follow: pg8000.core.ProgrammingError: ('FATAL', '28P01', 'password authentication failed for user "shawnguo"', 'auth.c', '288', 'auth_failed', '', '') Error in job load_db while creating output file data/psql/done. RuleException: CalledProcessError in line 353 of /home/shawnguo/GitWS/conceptnet5/Snakefile: Command 'cn5-db load_data data/psql && touch data/psql/done' returned non-zero exit status 1 File "/home/shawnguo/GitWS/conceptnet5/Snakefile", line 353, in __rule_load_db File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
How does this happen?And, how to handle it?