product2vec


Nameproduct2vec JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryProduct2Vec model for finding complementary and fungible products
upload_time2023-10-06 16:06:32
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT License Copyright (c) 2023 Theo Vall Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords word2vec complementary goods fungible goods
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![pipeline](https://github.com/TheoVall-DS/product2vec/actions/workflows/python-app.yml/badge.svg)](https://github.com/TheoVall-DS/product2vec/actions/workflows/python-app.yml)
[![codecov](https://codecov.io/gh/TheoVall-DS/product2vec/graph/badge.svg?token=QYUC5D65PT)](https://codecov.io/gh/TheoVall-DS/product2vec)

# product2vec

product2vec is a Python library that implements Product2Vec model. It is capable of finding complements and substitutes among products given shopping baskets. Current implementation is based on the original paper: https://ssrn.com/abstract=3519358

# Installation

```
pip install product2vec
```

# Usage

```
>>> from product2vec import Product2Vec
>>> # toy dataset with two baskets and 4 products
>>> data = [
...     ['coffee', 'cookies', 'chocolate'],
...     ['tea', 'cookies', 'chocolate'],
... ]
>>> prod2vec = Product2Vec(vector_size=3, min_count=1, sample=0, seed=1, workers=1)
>>> _ = prod2vec.fit(data)
>>> prod2vec.show_substitutes(product='tea', topn=2)
[('coffee', 0.024425969), ('chocolate', 0.023691988)]
>>> prod2vec.show_complements(product='cookies', topn=2)
[('chocolate', 0.5030633), ('coffee', 0.5007087)]
```

Refer to `usage_example.ipynb` which can be found in GitHub repository for short model description and elaborate usage.

# Contributing

If you spot any bugs or have suggestions don't hesitate to open an issue.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "product2vec",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "Word2Vec,complementary goods,fungible goods",
    "author": "",
    "author_email": "Theo Vall <fedorvall.ds@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/61/1f/08b4129a2b85e28af93a0400be77e5709db9917b3fba540e5ea747b8fded/product2vec-0.1.0.tar.gz",
    "platform": null,
    "description": "[![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![pipeline](https://github.com/TheoVall-DS/product2vec/actions/workflows/python-app.yml/badge.svg)](https://github.com/TheoVall-DS/product2vec/actions/workflows/python-app.yml)\n[![codecov](https://codecov.io/gh/TheoVall-DS/product2vec/graph/badge.svg?token=QYUC5D65PT)](https://codecov.io/gh/TheoVall-DS/product2vec)\n\n# product2vec\n\nproduct2vec is a Python library that implements Product2Vec model. It is capable of finding complements and substitutes among products given shopping baskets. Current implementation is based on the original paper: https://ssrn.com/abstract=3519358\n\n# Installation\n\n```\npip install product2vec\n```\n\n# Usage\n\n```\n>>> from product2vec import Product2Vec\n>>> # toy dataset with two baskets and 4 products\n>>> data = [\n...     ['coffee', 'cookies', 'chocolate'],\n...     ['tea', 'cookies', 'chocolate'],\n... ]\n>>> prod2vec = Product2Vec(vector_size=3, min_count=1, sample=0, seed=1, workers=1)\n>>> _ = prod2vec.fit(data)\n>>> prod2vec.show_substitutes(product='tea', topn=2)\n[('coffee', 0.024425969), ('chocolate', 0.023691988)]\n>>> prod2vec.show_complements(product='cookies', topn=2)\n[('chocolate', 0.5030633), ('coffee', 0.5007087)]\n```\n\nRefer to `usage_example.ipynb` which can be found in GitHub repository for short model description and elaborate usage.\n\n# Contributing\n\nIf you spot any bugs or have suggestions don't hesitate to open an issue.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Theo Vall  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Product2Vec model for finding complementary and fungible products",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/TheoVall-DS/product2vec"
    },
    "split_keywords": [
        "word2vec",
        "complementary goods",
        "fungible goods"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1489bfdb8645b0d8d841fd60d65ce1e49d0d57b40238148ce02da5fdf08d156d",
                "md5": "855885b1f11d44d17a1a89a10eaa6a0f",
                "sha256": "b021baa8867ebaaf002d4ed333673025dea8ca5e50f2c0da72950753ad9512f7"
            },
            "downloads": -1,
            "filename": "product2vec-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "855885b1f11d44d17a1a89a10eaa6a0f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10129,
            "upload_time": "2023-10-06T16:06:30",
            "upload_time_iso_8601": "2023-10-06T16:06:30.796731Z",
            "url": "https://files.pythonhosted.org/packages/14/89/bfdb8645b0d8d841fd60d65ce1e49d0d57b40238148ce02da5fdf08d156d/product2vec-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "611f08b4129a2b85e28af93a0400be77e5709db9917b3fba540e5ea747b8fded",
                "md5": "397526cfc41db58c0aa8491bc8a2cbde",
                "sha256": "4bb9dfff76cd22cef23b5137d9513e72b3332cdd953f0c0efb1651eac043798c"
            },
            "downloads": -1,
            "filename": "product2vec-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "397526cfc41db58c0aa8491bc8a2cbde",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 11845,
            "upload_time": "2023-10-06T16:06:32",
            "upload_time_iso_8601": "2023-10-06T16:06:32.290049Z",
            "url": "https://files.pythonhosted.org/packages/61/1f/08b4129a2b85e28af93a0400be77e5709db9917b3fba540e5ea747b8fded/product2vec-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-06 16:06:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "TheoVall-DS",
    "github_project": "product2vec",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "product2vec"
}
        
Elapsed time: 0.12142s