{ "info": { "author": "Jonathan Raiman", "author_email": "jonathanraiman@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Science/Research", "Operating System :: OS Independent", "Programming Language :: Python :: 3.3" ], "description": "# Glove\n\nCython general implementation of the Glove multi-threaded training.\n\nGloVe is an unsupervised learning algorithm for generating vector representations for words.\nTraining is done using a co-occcurence matrix from a corpus. The resulting representations contain structure useful for many other tasks.\n\nThe paper describing the model is [here](http://nlp.stanford.edu/projects/glove/glove.pdf).\n\nThe original implementation for this Machine Learning model can be [found here](http://nlp.stanford.edu/projects/glove/).\n\n@author Jonathan Raiman\n\n## Example\n\nTo use this package you need a sparse co-occurence matrix.\nThis matrix is represented by nested dictionaries that use ints as keys\nwith a 0-index.\n\nFor instance below we have a corpus of 3 indices. Below 0 co-occurs with 2, 3.5 times:\n\n```python\nimport glove\n\ncooccur = {\n\t0: {\n\t\t0: 1.0,\n\t\t2: 3.5\n\t},\n\t1: {\n\t\t2: 0.5\n\t},\n\t2: {\n\t\t0: 3.5,\n\t\t1: 0.5,\n\t\t2: 1.2\n\t}\n}\n\nmodel = glove.Glove(cooccur, vocab_size=3, d=50, alpha=0.75, x_max=100.0)\n\nfor epoch in range(25):\n err = model.train(batch_size=200, workers=9, batch_size=50)\n print(\"epoch %d, error %.3f\" % (epoch, err), flush=True)\n```\n\nThe trained embeddings are now present under `model.W`.\n\n## Usage\n\nThe model is controlled by setting several hyperpameters.\n\n### Glove.__init__()\n\n* `cooccurence` dict> : the co-occurence matrix\n* `alpha` float : (default 0.75) hyperparameter for controlling the exponent for normalized co-occurence counts.\n* `x_max` float : (default 100.0) hyperparameter for controlling smoothing for common items in co-occurence matrix.\n* `d` int : (default 50) how many embedding dimensions for learnt vectors\n* `seed` int : (default 1234) the random seed\n\n### Glove.train\n\n* `step_size` float : the learning rate for the model\n* `workers` int : number of worker threads used for training\n* `batch_size` int : how many examples should each thread receive (controls the size of the job queue)", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/JonathanRaiman/glove", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/JonathanRaiman/glove", "keywords": "NLP,Machine Learning", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "glove", "package_url": "https://pypi.org/project/glove/", "platform": "any", "project_url": "https://pypi.org/project/glove/", "project_urls": { "Download": "https://github.com/JonathanRaiman/glove", "Homepage": "https://github.com/JonathanRaiman/glove" }, "release_url": "https://pypi.org/project/glove/1.0.2/", "requires_dist": null, "requires_python": "", "summary": "Python package for computing embeddings from co-occurence matrices", "version": "1.0.2" }, "last_serial": 3287245, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "0fcbf26d5585a6081df18508d1f147d6", "sha256": "c639bd590bef579fa9dedaf03e78f54e0c9f285436c925a3b5c26466c44f1fe6" }, "downloads": -1, "filename": "glove-1.0.0.tar.gz", "has_sig": false, "md5_digest": "0fcbf26d5585a6081df18508d1f147d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3598, "upload_time": "2015-09-21T15:34:22", "url": "https://files.pythonhosted.org/packages/2a/d5/0c0a5e4ec274ab6e18e053a7af757c57d91a3eaedc27a6a2a3c0578bcdff/glove-1.0.0.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "7890930e2d401b63f0079ee812979ea2", "sha256": "b2e00cdcc3fa77a72f4e6ab89f73236da34feb0e38908b5aea8110cdb3b747c6" }, "downloads": -1, "filename": "glove-1.0.2.tar.gz", "has_sig": false, "md5_digest": "7890930e2d401b63f0079ee812979ea2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44867, "upload_time": "2017-10-29T04:15:21", "url": "https://files.pythonhosted.org/packages/8a/c9/17c400d0c29746162bd47fc719bf3212b2b031949d41d712e9bdef11ae03/glove-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7890930e2d401b63f0079ee812979ea2", "sha256": "b2e00cdcc3fa77a72f4e6ab89f73236da34feb0e38908b5aea8110cdb3b747c6" }, "downloads": -1, "filename": "glove-1.0.2.tar.gz", "has_sig": false, "md5_digest": "7890930e2d401b63f0079ee812979ea2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44867, "upload_time": "2017-10-29T04:15:21", "url": "https://files.pythonhosted.org/packages/8a/c9/17c400d0c29746162bd47fc719bf3212b2b031949d41d712e9bdef11ae03/glove-1.0.2.tar.gz" } ] }