{ "info": { "author": "Victor Zhong", "author_email": "victor@victorzhong.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5" ], "description": "Vocab\n=====\n\n.. image:: https://readthedocs.org/projects/vocab/badge/?version=latest\n :target: http://vocab.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n.. image:: https://travis-ci.org/vzhong/vocab.svg?branch=master\n :target: https://travis-ci.org/vzhong/vocab\n\nVocab is a python package that provides vocabulary objects for natural language processing.\n\n\nInstallation\n------------\n\n\n.. code-block:: sh\n\n pip install vocab\n pip install git+https://github.com/vzhong/vocab.git\n\n\nUsage\n-----\n\n.. code-block:: python\n\n >>> from vocab import Vocab, UnkVocab\n >>> v = Vocab()\n >>> v.word2index('hello', train=True)\n 0\n >>> v.word2index(['hello', 'world'], train=True)\n [0, 1]\n >>> v.index2word([1, 0])\n ['world', 'hello']\n >>> v.index2word(1)\n 'world'\n >>> small = v.prune_by_count(2)\n >>> small.to_dict()\n {'counts': {'hello': 2}, 'index2word': ['hello']}\n >>> u = UnkVocab()\n >>> u.word2index(['hello', 'world'], train=True)\n [1, 2]\n >>> u.word2index('hello friend !'.split())\n [1, 0, 0]\n >>> u.index2word(0)\n ''", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/vzhong/vocab", "keywords": "text nlp machine-learning", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "vocab", "package_url": "https://pypi.org/project/vocab/", "platform": "", "project_url": "https://pypi.org/project/vocab/", "project_urls": { "Homepage": "https://github.com/vzhong/vocab" }, "release_url": "https://pypi.org/project/vocab/0.0.4/", "requires_dist": null, "requires_python": "", "summary": "Vocabulary management for NLP in Python.", "version": "0.0.4" }, "last_serial": 4197798, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "751ec1b20805ac9ee66e35a69cc1aae6", "sha256": "6964556856fc31bd148e563d6144a8a353d600f71ffe6beef8d6a402795d6984" }, "downloads": -1, "filename": "vocab-0.0.2.tar.gz", "has_sig": false, "md5_digest": "751ec1b20805ac9ee66e35a69cc1aae6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5611, "upload_time": "2017-05-21T22:12:06", "url": "https://files.pythonhosted.org/packages/b9/e3/b86cc60bda9644244728e0946485ca68a07025e711f67ef2a2810b5c24a3/vocab-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "a709d671833c3f74246adac81debca2b", "sha256": "b5c8afb4c677760cc02aef4c8093af5e28c9c9149304c92781fef258e761050a" }, "downloads": -1, "filename": "vocab-0.0.3.tar.gz", "has_sig": false, "md5_digest": "a709d671833c3f74246adac81debca2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6909, "upload_time": "2018-04-19T21:05:17", "url": "https://files.pythonhosted.org/packages/61/c3/71b9e4123d10dc0ec55c5d19d7a3026890dd894dd6d326b01da0f5fdfecd/vocab-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "ab2b3d27a3f4feb616232d6ceb3e6d7f", "sha256": "bc4170497c76304e05c15b235fb290bba098f87188a387e24cd68a28b53e9d51" }, "downloads": -1, "filename": "vocab-0.0.4.tar.gz", "has_sig": false, "md5_digest": "ab2b3d27a3f4feb616232d6ceb3e6d7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7295, "upload_time": "2018-08-22T21:48:44", "url": "https://files.pythonhosted.org/packages/c2/75/6f312f7159f7353ce679b4e27296a77593e24cd266d6cd513ab37401450a/vocab-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ab2b3d27a3f4feb616232d6ceb3e6d7f", "sha256": "bc4170497c76304e05c15b235fb290bba098f87188a387e24cd68a28b53e9d51" }, "downloads": -1, "filename": "vocab-0.0.4.tar.gz", "has_sig": false, "md5_digest": "ab2b3d27a3f4feb616232d6ceb3e6d7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7295, "upload_time": "2018-08-22T21:48:44", "url": "https://files.pythonhosted.org/packages/c2/75/6f312f7159f7353ce679b4e27296a77593e24cd266d6cd513ab37401450a/vocab-0.0.4.tar.gz" } ] }