{ "info": { "author": "Kakao.corp", "author_email": "recotech.kakao@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Cython", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "N2\n==\n\nN2 - approximate **N**\\ earest **N**\\ eighbor\n\n.. code:: python\n\n import numpy as np\n from n2 import HnswIndex\n\n N, dim = 10240, 20\n samples = np.arange(N * dim).reshape(N, dim)\n\n index = HnswIndex(dim)\n for sample in samples:\n index.add_data(sample)\n index.build(m=5, n_threads=4)\n print(index.search_by_id(0, 10))\n # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n\nInstall\n-------\n\nTo install:\n\n.. code:: bash\n\n sudo pip install n2\n\nFor more detail, see `the installation`_ for instruction on how to build N2 from source.\n\nIntroduce\n---------\n\nN2 is an approximate nearest neighborhoods algorithm library written in\nC++ (including Python/Go bindings). N2 provides a much faster search\nspeed than other implementations when modeling large dataset. Also, N2\nsupports multi-core CPUs for index building.\n\nBackground\n----------\n\nThere are great approximate nearest neighborhoods libraries such as\n`annoy`_ and `nmslib`_, but they did not fully meet the requirments to\nhandle Kakao\u2019s dataset. Therefore, we decided to implement a library\nthat improves usability and performs better based on `nmslib`_. And\nfinally, we release N2 to the world.\n\nFeatures\n--------\n\n- Efficient implementations. N2 is a lightweight library which runs faster even with large datasets.\n- Support multi-core CPUs for index building.\n- Support a mmap feature by default for handling large index files\n efficiently.\n- Support Python/Go bindings.\n\nPerformance\n-----------\n\nIf you want to read about detail benchmark explanation. See `the\nbenchmark`_ for more experiments.\n\nIndex build times\n~~~~~~~~~~~~~~~~~\n\n|image0|\n\nSearch speed\n~~~~~~~~~~~~\n\n|image1|\n\nMemory usage\n~~~~~~~~~~~~\n\n|image2|\n\n.. install-1:\n\nBindings\n--------\n\nThe following guides explain how to use N2 with basic examples and API.\n\n- `Python`_\n- `C++`_\n- `Go`_\n\nReferences\n----------\n\n- \u201cEfficient and robust approximate nearest neighbor search using\n Hierarchical Navigable Small World graphs\u201d by Yu. A. Malkov, D. A.\n Yashunin (available on arxiv: http://arxiv.org/abs/1603.09320)\n- nmslib: https://github.com/searchivarius/NMSLIB\n- annoy: https://github.com/spotify/annoy\n\nLicense\n-------\n\nThis software is licensed under the `Apache 2 license`_, quoted below.\n\nCopyright 2017 Kakao Corp. http://www.kakaocorp.com\n\nLicensed under the Apache License, Version 2.0 (the \u201cLicense\u201d); you may\nnot use this project except in compliance with the License. You may\nobtain a copy of the License at\nhttp://www.apache.org/licenses/LICENSE-2.0.\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \u201cAS IS\u201d BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n.. _annoy: https://github.com/spotify/annoy\n.. _nmslib: https://github.com/searchivarius/nmslib\n.. _the benchmark: docs/benchmark.rst\n.. _the installation: INSTALL.rst\n.. _Python: docs/Python_API.rst\n.. _C++: docs/Cpp_API.rst\n.. _Go: docs/Go_API.rst\n.. _Apache 2 license: LICENSE.txt\n\n.. |image0| image:: docs/imgs/build_time/build_time.png\n.. |image1| image:: docs/imgs/search_time/search_speed.png\n.. |image2| image:: docs/imgs/mem/memory_usage.png", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "Approximate Nearest Neighbor", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "n2", "package_url": "https://pypi.org/project/n2/", "platform": "", "project_url": "https://pypi.org/project/n2/", "project_urls": null, "release_url": "https://pypi.org/project/n2/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "Approximate Nearest Neighbor library", "version": "0.1.4" }, "last_serial": 3376671, "releases": { "0.1.4": [ { "comment_text": "", "digests": { "md5": "bc9401ed516b7bc39c72dfa0f928dd1d", "sha256": "c2aec91e7baf4e4fda25a2d0617229d1192cfe73e4ae625101526e2981eb18f4" }, "downloads": -1, "filename": "n2-0.1.4.tar.gz", "has_sig": false, "md5_digest": "bc9401ed516b7bc39c72dfa0f928dd1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1504526, "upload_time": "2017-11-30T08:22:15", "url": "https://files.pythonhosted.org/packages/ac/e7/1758cd0973aa2b1a46ad3556bf37c7a625eec7f603f3389a4908d0f70a14/n2-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bc9401ed516b7bc39c72dfa0f928dd1d", "sha256": "c2aec91e7baf4e4fda25a2d0617229d1192cfe73e4ae625101526e2981eb18f4" }, "downloads": -1, "filename": "n2-0.1.4.tar.gz", "has_sig": false, "md5_digest": "bc9401ed516b7bc39c72dfa0f928dd1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1504526, "upload_time": "2017-11-30T08:22:15", "url": "https://files.pythonhosted.org/packages/ac/e7/1758cd0973aa2b1a46ad3556bf37c7a625eec7f603f3389a4908d0f70a14/n2-0.1.4.tar.gz" } ] }