{"id":27881793,"url":"https://github.com/src-d/swivel-spark-prep","last_synced_at":"2025-05-05T05:05:14.766Z","repository":{"id":79454036,"uuid":"90353028","full_name":"src-d/swivel-spark-prep","owner":"src-d","description":"Distributed equivalent of prep.py and fastprep from Swivel using Apache Spark.","archived":false,"fork":false,"pushed_at":"2017-07-06T16:20:23.000Z","size":111,"stargazers_count":5,"open_issues_count":3,"forks_count":3,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-05T05:05:06.865Z","etag":null,"topics":["apache-spark","swivel"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/src-d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-05-05T08:11:37.000Z","updated_at":"2018-07-20T13:30:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"cdc3a7dc-706f-47c8-a0e9-cb14240b02d5","html_url":"https://github.com/src-d/swivel-spark-prep","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/src-d%2Fswivel-spark-prep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fswivel-spark-prep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fswivel-spark-prep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fswivel-spark-prep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/src-d","download_url":"https://codeload.github.com/src-d/swivel-spark-prep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252442485,"owners_count":21748451,"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":["apache-spark","swivel"],"created_at":"2025-05-05T05:05:14.154Z","updated_at":"2025-05-05T05:05:14.758Z","avatar_url":"https://github.com/src-d.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swivel Spark prep [![Build Status](https://travis-ci.org/src-d/swivel-spark-prep.svg?branch=master)](https://travis-ci.org/src-d/swivel-spark-prep)\n\u003e Distributed data preparation for the Swivel model\n\nDistributed equivalent of `prep.py` and `fastprep` from [Swivel](https://github.com/tensorflow/models/blob/master/swivel/) using Apache Spark.\n\n\n# Development\n```\n./gradlew idea # if using InteliJ\n./gradlew build\n./gradlew test\n```\n\n# Run\n\nOn a single machine, Apache Spark in Local mode\n```\n./gradlew shadowJar\n./sparkprep --help\n```\n\nOn an Apache Spark standalone cluster\n```\n./gradlew build\n\n# https://github.com/tensorflow/ecosystem/tree/master/hadoop#build-and-install\ncp \u003cpath-to-ecosystem-hadoop\u003e/target/tensorflow-hadoop-1.0-SNAPSHOT-shaded-protobuf.jar .\n# or use un-official build from .m2 or .gradle cache, after ./gradlew shadowJar\ncp \u003cpath-to\u003e/tensorflow-hadoop-1.0-01232017-SNAPSHOT-shaded-protobuf.jar .\n\n\nMASTER=\"\u003cmaster-url\u003e\" ./sparkprep-cluster --help\n```\n\n# Algorithm\n\nPre-processing consist of 3 jobs:\n 1. reading or creating a vocabulary\n 2. coocurence matrix\n  - vectorizing input: token-\u003eint using the vocaulary\n  - build full dense coocurence matrix, for given window size\n  - shard coocurence matrix to N pices (over each dimention)\n     * encode each shard in a single ProtoBuff\n     * save N^2 files\n 3. coocurence matrix: count marginal summs","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrc-d%2Fswivel-spark-prep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrc-d%2Fswivel-spark-prep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrc-d%2Fswivel-spark-prep/lists"}