Russian part of ConceptNet5.7 graph, fast access to relations.
Project description
/ru/ConceptNet
ConceptNet 5.7 (Russian part) extraction scripts + fast API object to access the relations. Note: a simple modification of the preprocessing script allows to build a queryable graph of any other subset of ConceptNet.
Installation
pip install ruconceptnet
Usage
>>> from ruconceptnet import ConceptNet
>>> cn = ConceptNet()
>>> cn.get_targets("алкоголь")
[('этиловый_спирт', {'Synonym'}), ('спиртной_напиток', {'Synonym'}), ('алкогольный', {'RelatedTo'}),
('алкоголик', {'RelatedTo'}), ('спирт', {'Synonym'}), ('алкоголизация', {'RelatedTo'})]
>>> cn.get_sources("йога")
[('йоги', {'FormOf'}), ('йогу', {'FormOf'}), ('йогический', {'RelatedTo'}), ('йогою', {'FormOf'}),
('йогой', {'FormOf'}), ('йог', {'RelatedTo'}), ('йоге', {'FormOf'})]
>>> cn.check_pair("человек", "зверь")
(['DistinctFrom'], [])
>>> cn.check_pair("зверь", "человек")
([], ['DistinctFrom'])
Preparations for customization
Please see the prepare_data.sh script. We get the Russian-Russian pairs of nodes with simple grep and build
a 3-dimensional array (source, target, relation) stored as a single sparse SciPy matrix.
Citing
Please do not forget to cite the ConceptNet5 paper.
@inproceedings{10.5555/3298023.3298212,
author = {Speer, Robyn and Chin, Joshua and Havasi, Catherine},
title = {ConceptNet 5.5: An Open Multilingual Graph of General Knowledge},
year = {2017},
publisher = {AAAI Press},
booktitle = {Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence},
pages = {4444–4451},
numpages = {8},
location = {San Francisco, California, USA},
series = {AAAI'17}
}
Citing the repository is not necessary, but greatly appreciated as well, if you use this work.
@misc{ruconceptnet2020alekseev,
title = {{alexeyev/RuConceptNet: /ru/ConceptNet5.7 Python wrapper }},
year = {2020},
url = {https://github.com/alexeyev/RuConceptNet},
language = {english}
}
License
The code is released under the MIT license (please see the LICENSE file).
This work includes a subset data from ConceptNet 5, which was compiled by the Commonsense Computing Initiative. ConceptNet 5 is freely available under the Creative Commons Attribution-ShareAlike license (CC BY SA 3.0) from http://conceptnet.io.
The included data was created by contributors to Commonsense Computing projects, contributors to Wikimedia projects, DBPedia, OpenCyc, Games with a Purpose, Princeton University's WordNet, Francis Bond's Open Multilingual WordNet, and Jim Breen's JMDict.
The complete data in ConceptNet is available under the Creative Commons Attribution-ShareAlike 4.0 license.
For more details, please see "Copying and sharing ConceptNet".
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ruconceptnet-0.0.2.tar.gz.
File metadata
- Download URL: ruconceptnet-0.0.2.tar.gz
- Upload date:
- Size: 4.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e099a9c9c9638f4b67b84aa891a1fa80e53dc758a114509711287165a84a2369
|
|
| MD5 |
6121a9c1f66f5807455462906ccad990
|
|
| BLAKE2b-256 |
26e008bbcf2c5642a08ab5d7246614ae02d0e1b47bf48ba3b5949d0c97aaab86
|
File details
Details for the file ruconceptnet-0.0.2-py3-none-any.whl.
File metadata
- Download URL: ruconceptnet-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21ff98544a48ca7e2af1e12f081821f758b3bc155f434945308812373325df12
|
|
| MD5 |
ccc1e24b2677b4ed17c825aaa9f8e130
|
|
| BLAKE2b-256 |
e85ef04248dd9c3bbe3d2a6bfd53347fda7137ddafc852b3520f2103d94bbf92
|