{"id":20307867,"url":"https://github.com/benedekrozemberczki/splitter","last_synced_at":"2025-05-07T15:06:55.861Z","repository":{"id":102016715,"uuid":"176126044","full_name":"benedekrozemberczki/Splitter","owner":"benedekrozemberczki","description":"A Pytorch implementation of \"Splitter: Learning Node Representations that Capture Multiple Social Contexts\" (WWW 2019).","archived":false,"fork":false,"pushed_at":"2023-06-06T22:50:48.000Z","size":11963,"stargazers_count":213,"open_issues_count":1,"forks_count":44,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-07T15:06:36.009Z","etag":null,"topics":["clustering","community-detection","deep-learning","deep-neural-network","deepwalk","ego-splitting","factorization","gensim","graph-embedding","graph-neural-network","graph-representation-learning","implicit-factorization","machine-learning","network-embedding","node-embedding","node2vec","overlapping-community-detection","pytorch","word-vector","word2vec"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benedekrozemberczki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["benedekrozemberczki"]}},"created_at":"2019-03-17T16:08:17.000Z","updated_at":"2025-03-23T13:31:13.000Z","dependencies_parsed_at":"2023-10-20T18:21:42.330Z","dependency_job_id":null,"html_url":"https://github.com/benedekrozemberczki/Splitter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekrozemberczki%2FSplitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekrozemberczki%2FSplitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekrozemberczki%2FSplitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekrozemberczki%2FSplitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benedekrozemberczki","download_url":"https://codeload.github.com/benedekrozemberczki/Splitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252902614,"owners_count":21822261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clustering","community-detection","deep-learning","deep-neural-network","deepwalk","ego-splitting","factorization","gensim","graph-embedding","graph-neural-network","graph-representation-learning","implicit-factorization","machine-learning","network-embedding","node-embedding","node2vec","overlapping-community-detection","pytorch","word-vector","word2vec"],"created_at":"2024-11-14T17:19:24.308Z","updated_at":"2025-05-07T15:06:55.841Z","avatar_url":"https://github.com/benedekrozemberczki.png","language":"Python","funding_links":["https://github.com/sponsors/benedekrozemberczki"],"categories":[],"sub_categories":[],"readme":"Splitter [![Arxiv](https://img.shields.io/badge/ArXiv-1905.02138-orange.svg)](https://arxiv.org/pdf/1905.02138.pdf) [![repo size](https://img.shields.io/github/repo-size/benedekrozemberczki/Splitter.svg)](https://github.com/benedekrozemberczki/Splitter/archive/master.zip) [![benedekrozemberczki](https://img.shields.io/twitter/follow/benrozemberczki?style=social\u0026logo=twitter)](https://twitter.com/intent/follow?screen_name=benrozemberczki)\n======================\nA **PyTorch** implementation of **Splitter: Learning Node Representations that Capture Multiple Social Contexts (WWW 2019).**\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"800\" src=\"splitter.jpg\"\u003e\n\u003c/p\u003e\n\n### Abstract\n\u003cp align=\"justify\"\u003e\nRecent interest in graph embedding methods has focused on learning a single representation for each node in the graph. But can nodes really be best described by a single vector representation? In this work, we propose a method for learning multiple representations of the nodes in a graph (e.g., the users of a social network). Based on a principled decomposition of the ego-network, each representation encodes the role of the node in a different local community in which the nodes participate. These representations allow for improved reconstruction of the nuanced relationships that occur in the graph a phenomenon that we illustrate through state-of-the-art results on link prediction tasks on a variety of graphs, reducing the error by up to 90%. In addition, we show that these embeddings allow for effective visual analysis of the learned community structure.\u003c/p\u003e\n\nThis repository provides a PyTorch implementation of Splitter as described in the paper:\n\n\u003e Splitter: Learning Node Representations that Capture Multiple Social Contexts.\n\u003e Alessandro Epasto and Bryan Perozzi.\n\u003e WWW, 2019.\n\u003e [[Paper]](http://epasto.org/papers/www2019splitter.pdf)\n\n\nThe original Tensorflow implementation is available [[here]](https://github.com/google-research/google-research/tree/master/graph_embedding/persona).\n\n### Requirements\nThe codebase is implemented in Python 3.5.2. package versions used for development are just below.\n```\nnetworkx          1.11\ntqdm              4.28.1\nnumpy             1.15.4\npandas            0.23.4\ntexttable         1.5.0\nscipy             1.1.0\nargparse          1.1.0\ntorch             1.1.0\ngensim            3.6.0\n```\n### Datasets\n\u003cp align=\"justify\"\u003e\nThe code takes the **edge list** of the graph in a csv file. Every row indicates an edge between two nodes separated by a comma. The first row is a header. Nodes should be indexed starting with 0. A sample graph for `Cora` is included in the  `input/` directory.\u003c/p\u003e\n\n### Outputs\n\u003cp align=\"justify\"\u003e\nThe embeddings are saved in the `input/` directory. Each embedding has a header and a column with the node IDs. Finally, the node embedding is sorted by the node ID column.\u003c/p\u003e\n\n### Options\n\u003cp align=\"justify\"\u003e\nThe training of a Splitter embedding is handled by the `src/main.py` script which provides the following command line arguments.\u003c/p\u003e\n\n#### Input and output options\n```\n  --edge-path               STR    Edge list csv.           Default is `input/chameleon_edges.csv`.\n  --embedding-output-path   STR    Embedding output csv.    Default is `output/chameleon_embedding.csv`.\n  --persona-output-path     STR    Persona mapping JSON.    Default is `output/chameleon_personas.json`.\n```\n#### Model options\n```\n  --seed               INT     Random seed.                       Default is 42.\n  --number of walks    INT     Number of random walks per node.   Default is 10.\n  --window-size        INT     Skip-gram window size.             Default is 5.\n  --negative-samples   INT     Number of negative samples.        Default is 5.\n  --walk-length        INT     Random walk length.                Default is 40.\n  --lambd              FLOAT   Regularization parameter.          Default is 0.1\n  --dimensions         INT     Number of embedding dimensions.    Default is 128.\n  --workers            INT     Number of cores for pre-training.  Default is 4.   \n  --learning-rate      FLOAT   SGD learning rate.                 Default is 0.025\n```\n\n\n--------------------------------------------------------------------------------\n\n\n### Examples\n\u003cp align=\"justify\"\u003e\nThe following commands learn an embedding and save it with the persona map. Training a model on the default dataset.\u003c/p\u003e\n\n```\npython src/main.py\n```\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"500\" src=\"splitter.gif\"\u003e\n\u003c/p\u003e\n\nTraining a Splitter model with 32 dimensions.\n```\npython src/main.py --dimensions 32\n```\nIncreasing the number of walks and the walk length.\n```\npython src/main.py --number-of-walks 20 --walk-length 80\n```\n\n--------------------------------------------------------------------------------\n\n**License**\n\n- [GNU License](https://github.com/benedekrozemberczki/Splitter/blob/master/LICENSE)\n\n--------------------------------------------------------------------------------\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenedekrozemberczki%2Fsplitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenedekrozemberczki%2Fsplitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenedekrozemberczki%2Fsplitter/lists"}