https://github.com/yagays/wikipedia_graph_embedding
https://github.com/yagays/wikipedia_graph_embedding
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/yagays/wikipedia_graph_embedding
- Owner: yagays
- Created: 2019-09-22T09:11:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-23T02:11:36.000Z (over 5 years ago)
- Last Synced: 2024-11-11T21:37:31.743Z (7 months ago)
- Language: Python
- Size: 3.91 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pytorch-BigGraphによるWikipedia日本語記事のグラフ埋め込み
## 準備
2019年9月1日時点におけるWikipedia日本語記事のSQLダンプデータをダウンロードします。```sh
$ wget https://dumps.wikimedia.org/jawiki/20190901/jawiki-20190901-page.sql.gz
$ wget https://dumps.wikimedia.org/jawiki/20190901/jawiki-20190901-pagelinks.sql.gz
```その後、SQLをパースして記事内のリンク構造を取得します。
```sh
$ python src/parse_page_sql.py
$ python src/convert_relation_tsv.py
```## 実行する
抽出したグラフ構造に対して、Pytorch-BigGraphを実行します。```sh
$ torchbiggraph_import_from_tsv --lhs-col=0 --rel-col=1 --rhs-col=2 \
src/config/jawiki_split_1.py \
data/jawiki-20190901.tsv$ torchbiggraph_train src/config/jawiki_split_1.py \
-p edge_paths=data/jawiki-20190901_partitioned
```CPUスレッド数にも依存しますが、おおよそ10~12GB程度のメモリが必要です。