Skip to main content

λambeq

Build status License PyPI version PyPI downloads arXiv

About

lambeq is a toolkit for quantum natural language processing (QNLP).

Getting started

Prerequisites

  • Python 3.10+

Installation

lambeq can be installed with the command:

pip install lambeq

The default installation of lambeq includes Bobcat parser, a state-of-the-art statistical parser (see related paper) fully integrated with the toolkit.

To install lambeq with optional dependencies for extra features, run:

pip install lambeq[extras]

To install lambeq with optional dependencies for experimental features, run:

pip install lambeq[experimental]

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. After installing DepCCG, you can download its model by using the script provided in the contrib folder of this repository:

python contrib/download_depccg_model.py

Usage

The docs/examples directory in lambeq's documentation repository contains notebooks demonstrating usage of the various tools in lambeq.

Example - parsing a sentence into a diagram (see docs/examples/parser.ipynb):

from lambeq import BobcatParser

parser = BobcatParser()
diagram = parser.sentence2diagram('This is a test sentence')
diagram.draw()

Testing

Run all tests with the command:

pytest

Note: if you have installed lambeq in a virtual environment, remember to install pytest in the same environment using pip.

License

Distributed under the Apache 2.0 license. See LICENSE for more details.

Citation

If you wish to attribute our work, please cite the accompanying paper:

@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},
}

Release files for lambeq 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lambeq 0.5.0
File Size Uploaded
lambeq-0.5.0.tar.gz 300.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lambeq 0.5.0
File Interpreter ABI Platform
lambeq-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 570.2 kB

Release files / lambeq-0.5.0.tar.gz

Download URL lambeq-0.5.0.tar.gz
Size 300.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e65f4aba57a4ad7c12374ecb06628427f0278fa67abe090308f844774bdf3eab
BLAKE2b-256 checksum
How to use checksums
631ad7cde8ac86c8a03e42f62ea7181a2aaff27e26fbc2f3cec4360ca83c4e5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / lambeq-0.5.0-py3-none-any.whl

Download URL lambeq-0.5.0-py3-none-any.whl
Size 269.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4801306b3e76d5e75a22af26194173ad2e61f04db2fedbc5423e71ab856b17aa
BLAKE2b-256 checksum
How to use checksums
2120f29ae24f89792c9029a259c2e087507a6918484b5d217e309b7122a66e50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page