Beginner question: Question db using python to find word similarities

449 views
Skip to first unread message

Ashish Agrawal

unread,
Jul 1, 2015, 9:45:35 AM7/1/15
to conceptn...@googlegroups.com
Hi all,

I ma new to conceptnet. I used the web API to find similarity between two words: 'Finance' and 'money'.

I was hoping to do that via python script and by querying the database not the web API. I have been getting an error if I query the web API 'TOO MANY REQUEST".

I was hoping if someone could help me out with a code snippet showing how to use and query conceptnet 5 db to find similarities.

Thanks

Amirouche Boubekki

unread,
Jul 8, 2015, 2:27:58 PM7/8/15
to conceptn...@googlegroups.com

Retry later or build yourself the database locally.
 

Thanks

Rob Speer

unread,
Jul 8, 2015, 2:35:27 PM7/8/15
to conceptn...@googlegroups.com
You hit the rate limit on the web API, understandably.

You can run your own local version of the API in various ways, described at https://github.com/commonsense/conceptnet5/wiki/Running-your-own-copy.

A problem I've become aware of: the "high-bandwidth" method has been failing because the download comes from the same server as the API, and when it's overloaded it just cuts off the download and leaves you with an incomplete file. The most reliable method at this time is the Docker method.

--
You received this message because you are subscribed to the Google Groups "conceptnet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conceptnet-use...@googlegroups.com.
To post to this group, send email to conceptn...@googlegroups.com.
Visit this group at http://groups.google.com/group/conceptnet-users.
For more options, visit https://groups.google.com/d/optout.

Debanjan Bhattacharyya

unread,
Dec 29, 2015, 11:11:52 AM12/29/15
to conceptnet-users
The way I was able to do it is such
Note: I did not build conceptnet5.4. I just did a sudo python setup.py install on the contents of https://pypi.python.org/pypi/ConceptNet/5.4.2/conceptnet-5.4.2.tar.gz. I also downloaded all the files from http://conceptnet5.media.mit.edu/downloads/current/. Then I set the CONCEPTNET_DATA directory to the path where I unzipped all the tar.bz2 files.

from conceptnet5 import assoc_query
finder,wrapper = assoc_query.get_assoc_data('assoc-space-5.4')

wrapper.associations([('/c/en/finance',1.0)],filter='/c/en/money/.')

lalit purohit

unread,
Apr 28, 2016, 11:26:05 AM4/28/16
to conceptnet-users
Hi Debanjan,

When I run this python code it generates error -
"The assoc_space package is not installed". 

Please help to get around this problem.

Thanx

Lalit
Reply all
Reply to author
Forward
0 new messages