{"id":17047608,"url":"https://github.com/residentmario/watsongraph","last_synced_at":"2025-04-12T15:31:34.159Z","repository":{"id":62588276,"uuid":"47804607","full_name":"ResidentMario/watsongraph","owner":"ResidentMario","description":"Concept discovery and recommendation library built on top of the IBM Watson cognitive API.","archived":false,"fork":false,"pushed_at":"2016-10-27T03:46:04.000Z","size":409,"stargazers_count":24,"open_issues_count":9,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T02:05:47.600Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/watsongraph/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ResidentMario.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-11T04:13:38.000Z","updated_at":"2019-01-28T03:20:13.000Z","dependencies_parsed_at":"2022-11-03T17:48:21.824Z","dependency_job_id":null,"html_url":"https://github.com/ResidentMario/watsongraph","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ResidentMario%2Fwatsongraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ResidentMario%2Fwatsongraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ResidentMario%2Fwatsongraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ResidentMario%2Fwatsongraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ResidentMario","download_url":"https://codeload.github.com/ResidentMario/watsongraph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248589554,"owners_count":21129635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T09:49:49.371Z","updated_at":"2025-04-12T15:31:33.434Z","avatar_url":"https://github.com/ResidentMario.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Documentation Status](https://readthedocs.org/projects/watsongraph/badge/?version=latest)](http://watsongraph.readthedocs.org/en/latest/?badge=latest)\n[![PyPi version](https://img.shields.io/pypi/v/watsongraph.svg)](https://pypi.python.org/pypi/watsongraph/)\n\n# watsongraph\n\n![Watsongraph Visualization](http://i.imgur.com/M1sahoT.png \"Watsongraph Visualization\")\n\n`watsongraph` is a concept discovery, graphing, and processing library written in `Python 3`. The library's\ncore facility is the `ConceptModel` object, a conceptual graph constructed out of the individual concept nodes\nassociated with labels from the IBM Watson `wikipedia/en-20120601` Wikipedia-derived conceptual graph. This graph is\nqueried using the [Concept Insights API](http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/concept-insights.html)\nand then reconstructed locally as a `networkx`-based weighted conceptual graph:\n\n```\n\u003e\u003e\u003e from watsongraph.conceptmodel import ConceptModel\n\u003e\u003e\u003e ibm = ConceptModel(['IBM'])\n\u003e\u003e\u003e ibm.explode()\n\u003e\u003e\u003e ibm.concepts()\n['.NET Framework', 'ARM architecture', 'Advanced Micro Devices', ...]\n\u003e\u003e\u003e len(ibm.concepts())\n37\n\u003e\u003e\u003e 'Server (computing)' in ibm.concepts()\nTrue\n\u003e\u003e\u003e ibm.augment('Server (computing)')\n\u003e\u003e\u003e len(ibm.concepts())\n58\n\u003e\u003e\u003e ibm.edges()\n[(0.89564085, 'IBM', 'Digital Equipment Corporation'),\n (0.8793883, 'Solaris (operating system)', 'Server (computing)'),\n ...\n]\n\n```\n\nThe `ConceptModel` can then be associated with any number of applications. Basic bindings are provided, in\nparticular, for a recommendation service using library-provided `Item` and `User` classes:\n\n```\n\u003e\u003e\u003e from watsongraph.user import User\n\u003e\u003e\u003e from watsongraph.item import Item\n\u003e\u003e\u003e Bob = User(user_id=\"Bob\")\n\u003e\u003e\u003e Bob.input_interests([\"Data science\", \"Machine learning\", \"Big data\", \"Cognitive science\"])\n\u003e\u003e\u003e meetup = Item(\"Meetup\", \"This is a description of a pretty awesome event...\")\n\u003e\u003e\u003e relay = Item(\"Relay\", \"This is a description of another pretty awesome event...\")\n\u003e\u003e\u003e Bob.interest_in(meetup)\n1.633861635\n\u003e\u003e\u003e Bob.interest_in(relay)\n1.54593405\n# Update the \"Bob\" model to account for our new information on Bob's preferences.\n\u003e\u003e\u003e Bob.express_interest(meetup)\n```\n\n## Setup\n\n`watsongraph` is [available on PyPi](https://pypi.python.org/pypi/watsongraph/) and can be downloaded locally with `pip\ninstall watsongraph`.\n\nHowever, in order to use IBM Watson cognitive APIs you **must** first register an account on\n[IBM Bluemix](https://console.ng.bluemix.net/). If you do not\nhave an account already you may [register](https://console.ng.bluemix.net/registration/) for a free trial account.\n\nOnce you are logged in, enter the catalog, scroll down to the \"IBM Watson\" section, and click through to create an\ninstance of the\n[Concept Insights](http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/concept-insights.html) service. Go\n back to the dashboard, click on the newly populated service, and click through to \"Service Credentials\" on the\n sidebar to get your service credentials: copy-paste this `json` output and save it locally as\n `concept_insight_credentials.json`. Your credentials should look like this:\n\n```\n{\n  \"credentials\": {\n    \"url\": \"https://gateway.watsonplatform.net/concept-insights/api\",\n    \"username\": \"........-....-....-....-............\",\n    \"password\": \"............\"\n  }\n}\n```\n\nAccount access is provided on a thirty-day free trial basis by default, however there is free monthly allotment\n(25,000 queries), more than enough for experimental purposes.\n\n## Documentation and examples\n\n* \"[Exploring the IBM Watson Concept Insights service using watsongraph](http://www.residentmar.io/2016/02/11/watsongraph-visualization.html)\"\nis a blog post on my personal website which explores the capacities and use cases for the `watsongraph` library. If\nyou are curious about how it works, the visualizations here are the best place to start!\n* The [ConceptModel Jupyter notebook](http://nbviewer.jupyter.org/github/ResidentMario/watsongraph/blob/master/watsongraph%20-%20Concept%20Modeling.ipynb)\nprovides a detailed walkthrough of basic `ConceptModel` operations. To learn how to use this library, start here,\nthen move on to the two notebooks below.\n* The [Advanced Concept Modeling Jupyter notebook](http://nbviewer.jupyter.org/github/ResidentMario/watsongraph/blob/master/watsongraph%20-%20Advanced%20Concept%20Modeling.ipynb)\nprovides a detailed walkthrough of advanced `ConceptModel` features as well as recommendations about how to use them\nfor modeling.\n* The [Recommendations Modeling Jupyter notebook](http://nbviewer.jupyter.org/github/ResidentMario/watsongraph/blob/master/watsongraph%20-%20Recommendations.ipynb)\napplies `watsongraph` to user recommendation modeling.\n* The [Sphinx documentation](http://watsongraph.readthedocs.org/en/latest/) is the reference manual for all\n`watsongraph` methods.\n* For further inspiration you can also try out IBM's own\n[example application](https://concept-insights-demo.mybluemix.net/) (which predates this library).\n\n## Contributing\n\nThe `watsongraph` library is currently in its first stable release, so it is still in a fairly early state of\ndevelopment: there are quite a large number of improvements and new features which could potentially be made. At the\nmoment I am waiting for work to finish on the [Watson Developer Cloud Python SDK](https://github.com/watson-developer-cloud/python-sdk)\nso that  I can make a large volume of low-level architectural improvements (and add a few new features) for the next\nplanned stable release, `0.3.0`. You can see the milestone composite issues in this repository's\n[issue tracker](https://github.com/ResidentMario/watsongraph/issues?q=is%3Aopen+is%3Aissue+milestone%3A0.3.0).\n\nTo pull the latest build onto your development machine, [clone](https://help.github.com/articles/cloning-a-repository/) this repository\n(`git clone https://github.com/ResidentMario/cultural-insight.git`) and follow the instructions in [setup](#Setup) to\npopulate your access credentials.\n\nTo submit a minor fix just submit a [pull request](https://help.github.com/articles/using-pull-requests/). Be sure\nto explain what problem your change addresses!\n\nIf you are interested in contributing new features or major enhancements, we should talk! You can submit an [issue](https://guides.github.com/features/issues/)\nor [pull request](https://help.github.com/articles/using-pull-requests/) summarizing the work using the \"Enhancement\"\n label. You can also [filter](https://github.com/ResidentMario/watsongraph/labels/enhancement)\nto enhancements to see what's already on the radar.\n\nI am very receptive to feedback and would defintely like to see this code reviewed by others, you can reach out to me\nat `aleksey@residentmar.io`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresidentmario%2Fwatsongraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fresidentmario%2Fwatsongraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresidentmario%2Fwatsongraph/lists"}