# lambeq
[![lambeq logo](https://cqcl.github.io/lambeq/_static/lambeq_logo.png)](//cqcl.github.io/lambeq)
![Build status](https://github.com/CQCL/lambeq/actions/workflows/build_test.yml/badge.svg)
[![License](https://img.shields.io/github/license/CQCL/lambeq)](LICENSE)
[![PyPI version](https://img.shields.io/pypi/v/lambeq)](//pypi.org/project/lambeq)
[![PyPI downloads](https://img.shields.io/pypi/dm/lambeq)](//pypi.org/project/lambeq)
[![arXiv](https://img.shields.io/badge/arXiv-2110.04236-green)](//arxiv.org/abs/2110.04236)
## About
lambeq is a toolkit for quantum natural language processing (QNLP).
- Documentation: https://cqcl.github.io/lambeq/
- User support: <lambeq-support@cambridgequantum.com>
- Contributions: Please read [our guide](https://cqcl.github.io/lambeq/CONTRIBUTING.html).
- If you want to subscribe to lambeq's mailing list, let us know by sending an email to <lambeq-support@cambridgequantum.com>.
---
**Note:** Please do not try to read the documentation directly from the preview provided in the [repository](https://github.com/CQCL/lambeq/tree/main/docs), since some of the pages will not be rendered properly.
---
## Getting started
### Prerequisites
- Python 3.9+
### Installation
lambeq can be installed with the command:
```bash
pip install lambeq
```
The default installation of lambeq includes Bobcat parser, a state-of-the-art statistical parser (see [related paper](https://arxiv.org/abs/2109.10044)) fully integrated with the toolkit.
To install lambeq with optional dependencies for extra features, run:
```bash
pip install lambeq[extras]
```
To enable DepCCG support, you will need to install the external parser separately.
---
**Note:** The DepCCG-related functionality is no longer actively supported in `lambeq`, and may not work as expected. We strongly recommend using the default Bobcat parser which comes as part of `lambeq`.
---
If you still want to use DepCCG, for example because you plan to apply ``lambeq`` on Japanese, you can install DepCCG separately following the instructions on the [DepCCG homepage](//github.com/masashi-y/depccg). After installing DepCCG, you can download its model by using the script provided in the `contrib` folder of this repository:
```bash
python contrib/download_depccg_model.py
```
## Usage
The [docs/examples](//github.com/CQCL/lambeq/tree/main/docs/examples)
directory contains notebooks demonstrating usage of the various tools in
lambeq.
Example - parsing a sentence into a diagram (see
[docs/examples/ccg2discocat.ipynb](//github.com/CQCL/lambeq/blob/main/docs/examples/ccg2discocat.ipynb)):
```python
from lambeq import BobcatParser
parser = BobcatParser()
diagram = parser.sentence2diagram('This is a test sentence')
diagram.draw()
```
## Testing
Run all tests with the command:
```bash
pytest
```
Note: if you have installed in a virtual environment, remember to
install pytest in the same environment using pip.
## Building documentation
To build the documentation, first install the required dependencies:
```bash
pip install -r docs/requirements.txt
```
then run the commands:
```bash
cd docs
make clean
make html
```
the docs will be under `docs/_build`.
## License
Distributed under the Apache 2.0 license. See [`LICENSE`](LICENSE) for
more details.
## Citation
If you wish to attribute our work, please cite
[the accompanying paper](//arxiv.org/abs/2110.04236):
```
@article{kartsaklis2021lambeq,
title={lambeq: {A}n {E}fficient {H}igh-{L}evel {P}ython {L}ibrary for {Q}uantum {NLP}},
author={Dimitri Kartsaklis and Ian Fan and Richie Yeung and Anna Pearson and Robin Lorenz and Alexis Toumi and Giovanni de Felice and Konstantinos Meichanetzidis and Stephen Clark and Bob Coecke},
year={2021},
journal={arXiv preprint arXiv:2110.04236},
}
```
Raw data
{
"_id": null,
"home_page": "https://cqcl.github.io/lambeq",
"name": "lambeq",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "category theory, ccg, circuits, combinatory categorial grammar, diagrams, discocat, language, linguistics, natural language processing, nlp, qnlp, quantum, quantum computing, quantum natural language processing, quantum nlp",
"author": "Cambridge Quantum QNLP team",
"author_email": "lambeq-support@cambridgequantum.com",
"download_url": "https://files.pythonhosted.org/packages/9f/e2/216b427dd1dcafa8608743f8727469f4bb1584bc7a081ffdd9854f8dd99e/lambeq-0.4.1.tar.gz",
"platform": null,
"description": "# lambeq\n\n[![lambeq logo](https://cqcl.github.io/lambeq/_static/lambeq_logo.png)](//cqcl.github.io/lambeq)\n\n![Build status](https://github.com/CQCL/lambeq/actions/workflows/build_test.yml/badge.svg)\n[![License](https://img.shields.io/github/license/CQCL/lambeq)](LICENSE)\n[![PyPI version](https://img.shields.io/pypi/v/lambeq)](//pypi.org/project/lambeq)\n[![PyPI downloads](https://img.shields.io/pypi/dm/lambeq)](//pypi.org/project/lambeq)\n[![arXiv](https://img.shields.io/badge/arXiv-2110.04236-green)](//arxiv.org/abs/2110.04236)\n\n## About\n\nlambeq is a toolkit for quantum natural language processing (QNLP).\n\n- Documentation: https://cqcl.github.io/lambeq/\n- User support: <lambeq-support@cambridgequantum.com>\n- Contributions: Please read [our guide](https://cqcl.github.io/lambeq/CONTRIBUTING.html).\n- If you want to subscribe to lambeq's mailing list, let us know by sending an email to <lambeq-support@cambridgequantum.com>.\n\n---\n**Note:** Please do not try to read the documentation directly from the preview provided in the [repository](https://github.com/CQCL/lambeq/tree/main/docs), since some of the pages will not be rendered properly.\n\n---\n\n## Getting started\n\n### Prerequisites\n\n- Python 3.9+\n\n### Installation\n\nlambeq can be installed with the command:\n```bash\npip install lambeq\n```\n\nThe default installation of lambeq includes Bobcat parser, a state-of-the-art statistical parser (see [related paper](https://arxiv.org/abs/2109.10044)) fully integrated with the toolkit.\n\nTo install lambeq with optional dependencies for extra features, run:\n```bash\npip install lambeq[extras]\n```\n\nTo enable DepCCG support, you will need to install the external parser separately.\n\n---\n**Note:** The DepCCG-related functionality is no longer actively supported in `lambeq`, and may not work as expected. We strongly recommend using the default Bobcat parser which comes as part of `lambeq`.\n\n---\n\nIf you still want to use DepCCG, for example because you plan to apply ``lambeq`` on Japanese, you can install DepCCG separately following the instructions on the [DepCCG homepage](//github.com/masashi-y/depccg). After installing DepCCG, you can download its model by using the script provided in the `contrib` folder of this repository:\n\n```bash\npython contrib/download_depccg_model.py\n```\n\n## Usage\n\nThe [docs/examples](//github.com/CQCL/lambeq/tree/main/docs/examples)\ndirectory contains notebooks demonstrating usage of the various tools in\nlambeq.\n\nExample - parsing a sentence into a diagram (see\n[docs/examples/ccg2discocat.ipynb](//github.com/CQCL/lambeq/blob/main/docs/examples/ccg2discocat.ipynb)):\n\n```python\nfrom lambeq import BobcatParser\n\nparser = BobcatParser()\ndiagram = parser.sentence2diagram('This is a test sentence')\ndiagram.draw()\n```\n\n## Testing\n\nRun all tests with the command:\n```bash\npytest\n```\n\nNote: if you have installed in a virtual environment, remember to\ninstall pytest in the same environment using pip.\n\n## Building documentation\n\nTo build the documentation, first install the required dependencies:\n```bash\npip install -r docs/requirements.txt\n```\nthen run the commands:\n\n```bash\ncd docs\nmake clean\nmake html\n```\nthe docs will be under `docs/_build`.\n\n## License\n\nDistributed under the Apache 2.0 license. See [`LICENSE`](LICENSE) for\nmore details.\n\n## Citation\n\nIf you wish to attribute our work, please cite\n[the accompanying paper](//arxiv.org/abs/2110.04236):\n\n```\n@article{kartsaklis2021lambeq,\n title={lambeq: {A}n {E}fficient {H}igh-{L}evel {P}ython {L}ibrary for {Q}uantum {NLP}},\n author={Dimitri Kartsaklis and Ian Fan and Richie Yeung and Anna Pearson and Robin Lorenz and Alexis Toumi and Giovanni de Felice and Konstantinos Meichanetzidis and Stephen Clark and Bob Coecke},\n year={2021},\n journal={arXiv preprint arXiv:2110.04236},\n}\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A QNLP toolkit",
"version": "0.4.1",
"project_urls": {
"Download": "https://pypi.org/project/lambeq",
"Homepage": "https://cqcl.github.io/lambeq",
"Source Code": "https://github.com/CQCL/lambeq"
},
"split_keywords": [
"category theory",
" ccg",
" circuits",
" combinatory categorial grammar",
" diagrams",
" discocat",
" language",
" linguistics",
" natural language processing",
" nlp",
" qnlp",
" quantum",
" quantum computing",
" quantum natural language processing",
" quantum nlp"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3469a5deaa88af024aff1feeea6c7c18588d4cbaad1ed86aab89e95901f10879",
"md5": "0e1dd1006d71710cb872ff24ea5317f5",
"sha256": "39af748052ff69ff8522ee6488232e9fea22ee280fc8a3a0ced38b72620e1628"
},
"downloads": -1,
"filename": "lambeq-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0e1dd1006d71710cb872ff24ea5317f5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 208962,
"upload_time": "2024-04-11T10:35:07",
"upload_time_iso_8601": "2024-04-11T10:35:07.092133Z",
"url": "https://files.pythonhosted.org/packages/34/69/a5deaa88af024aff1feeea6c7c18588d4cbaad1ed86aab89e95901f10879/lambeq-0.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9fe2216b427dd1dcafa8608743f8727469f4bb1584bc7a081ffdd9854f8dd99e",
"md5": "2f24a7a2476c566953bb6d938c99862a",
"sha256": "15333d603c8304fd2d0ba8b6db2a42ff021e4e270ab37b9d8cdae812488e070b"
},
"downloads": -1,
"filename": "lambeq-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "2f24a7a2476c566953bb6d938c99862a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 3033832,
"upload_time": "2024-04-11T10:35:40",
"upload_time_iso_8601": "2024-04-11T10:35:40.318290Z",
"url": "https://files.pythonhosted.org/packages/9f/e2/216b427dd1dcafa8608743f8727469f4bb1584bc7a081ffdd9854f8dd99e/lambeq-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-11 10:35:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "CQCL",
"github_project": "lambeq",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "lambeq"
}