{ "info": { "author": "Denis Newman-Griffis", "author_email": "denis.newman.griffis@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# pyemblib\n\nA module for reading, writing, and using trained word embeddings.\n\n## Installation\n\nInstall with pip!\n\n```bash\npip install pyemblib\n```\n\n## Usage\n\nThis package currently supports word embeddings trained by the following packages:\n\n- [word2vec](https://code.google.com/archive/p/word2vec/)\n- [GloVe](https://nlp.stanford.edu/projects/glove/)\n\n### Reading\n\nBoth text-format and binary embedding files are supported.\n\nThe example below shows reading each format of embedding:\n```python\n## import text embeddings\ntext_embs = pyemblib.read('/tmp/text_embeddings.txt', mode=pyemblib.Mode.Text)\n## import binary embeddings\nbin_embs = pyemblib.read('/tmp/bin_embeddings.bin', mode=pyemblib.Mode.Binary)\n```\n\nEmbeddings are read as a `pyemblib.Embeddings` object, which inherits from Python's dictionary class; keys are words, and values are the embedding arrays.\n\nTo get the word vector for \"python\", just use dictionary access:\n```python\nvec = embs['python']\nprint(vec)\n# [ 0.001 -0.237 ... ]\n```\n\n### Writing\n\nThe same text and binary modes can be used for writing out embedding files as for reading.\n\n```python\nembs = { 'a' : np.array([0.3 0.1 -0.2]), 'b' : np.array([-0.9, -0.2, -0.2]) }\n## write as text\npyemblib.write(embs, '/tmp/text_embeddings.txt', mode=pyemblib.Mode.Text)\n## write as binary\npyemblib.write(embs, '/tmp/bin_embeddings.bin', mode=pyemblib.Mode.Binary)\n```\n\n## Feedback\nPlease report any issues you encounter to the [Github Issues page](https://github.com/drgriffis/pyemblib/issues)!\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/drgriffis/pyemblib", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pyemblib", "package_url": "https://pypi.org/project/pyemblib/", "platform": "", "project_url": "https://pypi.org/project/pyemblib/", "project_urls": { "Homepage": "http://github.com/drgriffis/pyemblib" }, "release_url": "https://pypi.org/project/pyemblib/0.1.2/", "requires_dist": [ "numpy" ], "requires_python": "", "summary": "Lightweight package for reading/writing pre-trained word embedding files", "version": "0.1.2" }, "last_serial": 5277981, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "cd388b513367a51c74e96c5188ec1c35", "sha256": "9875d120d0de2f6f8f77ad393398f7e2dcf9cab8263c052f3cc94bd8d13c66e0" }, "downloads": -1, "filename": "pyemblib-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "cd388b513367a51c74e96c5188ec1c35", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12602, "upload_time": "2019-04-12T20:38:40", "url": "https://files.pythonhosted.org/packages/b3/17/96320d5a1b5211080b80b18967414cdbae9bf719c66ea495eda68f586b72/pyemblib-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0596e28fcaa102765a21a02f9a26682e", "sha256": "86426289e51cc09ec400fb3871c86a52ca975078e625609520c6ea304e0a7e20" }, "downloads": -1, "filename": "pyemblib-0.1.1.tar.gz", "has_sig": false, "md5_digest": "0596e28fcaa102765a21a02f9a26682e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8944, "upload_time": "2019-04-12T20:38:42", "url": "https://files.pythonhosted.org/packages/e7/86/d0461c5789fe96e6274798298a69c1bbac6b9040600eee35ebc30f03cae2/pyemblib-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "9bd8572fb3e636c9b8d6a0d01d1731c6", "sha256": "5310389e0b8c9b2b779e9520d8f63ce4f85b6ce15dee8ff816068d583b685f8c" }, "downloads": -1, "filename": "pyemblib-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9bd8572fb3e636c9b8d6a0d01d1731c6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12553, "upload_time": "2019-05-16T15:29:07", "url": "https://files.pythonhosted.org/packages/41/25/ea8557bddb839b2dd3541c98dff7c49bd46bed372b9ef542b2e3b8270a7c/pyemblib-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0188d820a35ff8785298cf04d00d8516", "sha256": "06bc1065538c08ae6432d3899b4e2efa145c194e2a1f8b8cfbedc2c1981e31c0" }, "downloads": -1, "filename": "pyemblib-0.1.2.tar.gz", "has_sig": false, "md5_digest": "0188d820a35ff8785298cf04d00d8516", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8767, "upload_time": "2019-05-16T15:29:08", "url": "https://files.pythonhosted.org/packages/bc/85/1755939056815f578861fd507bd79162fcd677e257e29d76f274578b7068/pyemblib-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9bd8572fb3e636c9b8d6a0d01d1731c6", "sha256": "5310389e0b8c9b2b779e9520d8f63ce4f85b6ce15dee8ff816068d583b685f8c" }, "downloads": -1, "filename": "pyemblib-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9bd8572fb3e636c9b8d6a0d01d1731c6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12553, "upload_time": "2019-05-16T15:29:07", "url": "https://files.pythonhosted.org/packages/41/25/ea8557bddb839b2dd3541c98dff7c49bd46bed372b9ef542b2e3b8270a7c/pyemblib-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0188d820a35ff8785298cf04d00d8516", "sha256": "06bc1065538c08ae6432d3899b4e2efa145c194e2a1f8b8cfbedc2c1981e31c0" }, "downloads": -1, "filename": "pyemblib-0.1.2.tar.gz", "has_sig": false, "md5_digest": "0188d820a35ff8785298cf04d00d8516", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8767, "upload_time": "2019-05-16T15:29:08", "url": "https://files.pythonhosted.org/packages/bc/85/1755939056815f578861fd507bd79162fcd677e257e29d76f274578b7068/pyemblib-0.1.2.tar.gz" } ] }