{"id":19446135,"url":"https://github.com/stitchfix/context2vec","last_synced_at":"2025-06-29T11:34:03.952Z","repository":{"id":32131195,"uuid":"35703837","full_name":"stitchfix/context2vec","owner":"stitchfix","description":"Using Word2Vec on lists and sets","archived":false,"fork":false,"pushed_at":"2015-10-28T22:34:36.000Z","size":140,"stargazers_count":34,"open_issues_count":0,"forks_count":6,"subscribers_count":165,"default_branch":"master","last_synced_at":"2025-03-30T13:03:46.605Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stitchfix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-16T00:51:23.000Z","updated_at":"2023-12-16T01:56:40.000Z","dependencies_parsed_at":"2022-09-10T23:31:03.330Z","dependency_job_id":null,"html_url":"https://github.com/stitchfix/context2vec","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/stitchfix%2Fcontext2vec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stitchfix%2Fcontext2vec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stitchfix%2Fcontext2vec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stitchfix%2Fcontext2vec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stitchfix","download_url":"https://codeload.github.com/stitchfix/context2vec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250738114,"owners_count":21479134,"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":[],"created_at":"2024-11-10T16:13:03.342Z","updated_at":"2025-04-25T01:32:00.332Z","avatar_url":"https://github.com/stitchfix.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Using Context2Vec\n\nUse Word2Vec on lists and sets\n\nUse like:\n\n    from sphere.models.context2vec import ContextCorpus\n    from gensim.models import Word2Vec\n\n    # If user 1 bought items 0, 1, 2, 3 and user 2\n    # bought 3, 4, 5 and user bought item 10\n    contexts = {1:{0, 1, 2, 3}, 2:{2, 3, 4, 5}, 3:{10}}\n    cc = ContextCorpus(contexts)\n\n    # Run the w2v model\n    model = Word2Vec(cc, size=30, iter=100, min_count=1, alpha=0.025, sg=0)\n\n    # Find the most similar user to user 1\n    results = model.most_similar('C1', topn=100)\n    related_users = filter(lambda x: x[0].startswith('C'), results)\n\n    # Find all user vectors\n    users = filter(lambda x: x.startswith('C'), model.index2word)\n    user_vectors = [model.syn0[w2v.vocab[w].index] for w in users]\n\n## Running tests\nSimply run\n\n    nosetests\n\nOr to debug:\n\n    nosetests --pdb\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstitchfix%2Fcontext2vec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstitchfix%2Fcontext2vec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstitchfix%2Fcontext2vec/lists"}