Run the following commands to setup NeSyCoCo.
Make a new conda environment.
conda create -n nesycoco python=3.10
conda activate nesycoco
Install Jacinle.
git clone https://github.com/vacancy/Jacinle --recursive
export PATH=<PATH_TO_JACINLE>/bin:$PATH
Install Concepts.
git clone https://github.com/concepts-ai/Concepts.git
cd Concepts
pip install -e .
To download the Glove word embeddings and save them at word_embeds/glove
, you can follow these steps:
- Open a terminal or command prompt.
- Navigate to the directory where your NeSyCoCo project is located.
- Run the following command to download the Glove embeddings:
wget http://nlp.stanford.edu/data/glove.6B.zip
- Extract the downloaded zip file using the following command:
unzip glove.6B.zip
- Move the extracted files to the desired location using the following command:
mv glove.6B.* NeSyCoCo/word_embeds/glove
After completing these steps, you should have the Glove word embeddings saved at NeSyCoCo/word_embeds/glove
directory.
Please see the individual READMEs to train and evaluate models.
Install the following library to train models.
conda install tensorflow
pip install chardet
Note: Before running train & eval commands, set export PATH=<PATH_TO_JACINLE>/bin:$PATH
.
NeSyCoCo leverages a pre-trained large language model as its language interpreter, and hence, even though our prompts are general examples of first-order logic, we do not have direct control over the LLM's generation. The LLM may output harmful biases.
This code is based on the LEFT framework.