{"id":18818907,"url":"https://github.com/py-why/pywhy-llm","last_synced_at":"2025-03-14T16:07:06.957Z","repository":{"id":180907360,"uuid":"660777161","full_name":"py-why/pywhy-llm","owner":"py-why","description":"Experimental library integrating LLM capabilities to support causal analyses ","archived":false,"fork":false,"pushed_at":"2025-03-13T09:00:34.000Z","size":2371,"stargazers_count":115,"open_issues_count":10,"forks_count":18,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-13T09:37:12.579Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/py-why.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,"governance":"GOVERNANCE.md","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-30T20:24:30.000Z","updated_at":"2025-03-13T09:00:39.000Z","dependencies_parsed_at":"2024-07-08T18:24:45.827Z","dependency_job_id":"d85f3a0e-6785-4e1c-9979-d68d0d76f3b8","html_url":"https://github.com/py-why/pywhy-llm","commit_stats":null,"previous_names":["py-why/pywhy-llm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-why%2Fpywhy-llm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-why%2Fpywhy-llm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-why%2Fpywhy-llm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-why%2Fpywhy-llm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/py-why","download_url":"https://codeload.github.com/py-why/pywhy-llm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243606859,"owners_count":20318314,"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-11-08T00:19:23.533Z","updated_at":"2025-03-14T16:07:06.949Z","avatar_url":"https://github.com/py-why.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyWhy-LLM: Leveraging Large Language Models for Causal Analysis\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n## Introduction\n\nPyWhy-LLM is an innovative library designed to augment human expertise by seamlessly integrating Large Language Models (LLMs) into the causal analysis process. It empowers users with access to knowledge previously only available through domain experts. As part of the DoWhy community, we aim to investigate and harness the capabilities of LLMs for enhancing causal analysis process.\n\n## Documentation and Tutorials\n\nFor detailed usage instructions and tutorials, refer to [Notebook](link_here).\n\n## Installation\n\nTo install PyWhy-LLM, you can use pip:\n\n```bash\npip install pywhy-llm\n```\n\n## Usage\n\nPyWhy-LLM seamlessly integrates into your existing causal inference process. Import the necessary classes and start exploring the power of LLM-augmented causal analysis.\n\n```python\nfrom pywhy-llm import ModelSuggester, IdentificationSuggester, ValidationSuggester\n\n```\n\n\n### Modeler\n\n```python\n# Create instance of Modeler\nmodeler = Modeler()\n\n# Suggest a set of potential confounders\nsuggested_confounders = modeler.suggest_confounders(variables=_variables, treatment=treatment, outcome=outcome, llm=gpt4)\n\n# Suggest pair-wise relationship between variables\nsuggested_dag = modeler.suggest_relationships(variables=selected_variables, llm=gpt4)\n\nplt.figure(figsize=(10, 5))\nnx.draw(suggested_dag, with_labels=True, node_color='lightblue')\nplt.show()\n```\n\n\n\n### Identifier\n\n\n```python\n# Create instance of Identifier\nidentifier = Identifier()\n\n# Suggest a backdoor set, front door set, and iv set\nsuggested_backdoor = identifier.suggest_backdoor(llm=gpt4, treatment=treatment, outcome=outcome, confounders=suggested_confounders)\nsuggested_frontdoor = identifier.suggest_frontdoor(llm=gpt4, treatment=treatment, outcome=outcome,  confounders=suggested_confounders)\nsuggested_iv = identifier.suggest_iv(llm=gpt4, treatment=treatment, outcome=outcome,  confounders=suggested_confounders)\n\n# Suggest an estimand based on the suggester backdoor set, front door set, and iv set\nestimand = identifier.suggest_estimand(confounders=suggested_confounders, treatment=treatment, outcome=outcome, backdoor=suggested_backdoor, frontdoor=suggested_frontdoor, iv=suggested_iv, llm=gpt4)  \n```\n\n\n\n### Validator\n\n\n```python\n# Create instance of Validator\nvalidator = Validator()\n\n# Suggest a critique of the provided DAG\nsuggested_critiques_dag = validator.critique_graph(graph=suggested_dag, llm=gpt4)\n\n# Suggest latent confounders\nsuggested_latent_confounders = validator.suggest_latent_confounders(treatment=treatment, outcome=outcome, llm=gpt4)\n\n# Suggest negative controls\nsuggested_negative_controls = validator.suggest_negative_controls(variables=selected_variables, treatment=treatment, outcome=outcome, llm=gpt4)\n\nplt.figure(figsize=(10, 5))\nnx.draw(suggested_critiques_dag, with_labels=True, node_color='lightblue')\nplt.show()\n\n```\n\n## License\n\nPyWhy-LLM is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.\n\n## Contact\n\nFor any questions, feedback, or inquiries, please reach out to [Emre Kiciman](mailto:emrek@microsoft.com) and [Rose De Sicilia](mailto:t-rdesicilia@microsoft.com).\n\n---\n\nBy leveraging LLMs and formalizing human-LLM collaboration, PyWhy-LLM takes causal inference to new heights. Explore its potential and join us in making causal analysis more accessible and insightful.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/grace-sng7\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/108954669?v=4?s=100\" width=\"100px;\" alt=\"Grace Sng\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eGrace Sng\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/py-why/pywhy-llm/commits?author=grace-sng7\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/RoseDeSicilia26\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/72463845?v=4?s=100\" width=\"100px;\" alt=\"Rose De Sicilia\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRose De Sicilia\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/py-why/pywhy-llm/commits?author=RoseDeSicilia26\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpy-why%2Fpywhy-llm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpy-why%2Fpywhy-llm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpy-why%2Fpywhy-llm/lists"}