This is an implementation of RSA from Presupposition Triggering Reflects Pragmatic Reasoning About Utterance Utility using probabilitic programming to achieve greater scalability of the examples with respect to world, context, utterance and qud sizes.
The examples and the code are adapted/guided from the original codebase from the above linked paper, which can be here.
The search_inference library is taken from the pyro package. The original source can be found here.
The inference_algorithms contains: Exact Search, Best-First Search, Importance Sampling, Stochastic Variational Inference.
Make sure you have python installed. The codebase is tested with python 3.12, but should work with earlier versions too.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
To make use of the library, a config file representing the presupposition to be studied must be created.
Some examples can be found in the sample_configs folder.
Explanations of different class methods are documented within the class.
rsa = RSA(<path_to_config_file>)
You can find example usage in notebooks in the examples folder.