Skip to content

Latest commit

 

History

History
61 lines (37 loc) · 1.27 KB

README.md

File metadata and controls

61 lines (37 loc) · 1.27 KB

To run a generation experiment (either conceptnet or atomic), follow these instructions:

Installing Dependencies

First clone, the repo:

git clone https://github.com/allenai/comet-public.git
cd comet

Then run the setup scripts to acquire the pretrained model files from OpenAI, as well as the ATOMIC and ConceptNet datasets

bash scripts/setup/get_atomic_data.sh
bash scripts/setup/get_conceptnet_data.sh

Then install dependencies (assuming you already have Python 3.6 and Pytorch >= 1.0:

pip install -r requirements.txt
python -m spacy download en

Installing the Package

You should now be able to use most COMeT functionality!

Launching a demo

First, download the pretrained models from the following link:

wget https://storage.googleapis.com/ai2-mosaic/public/comet/models.zip
unzip models.zip

Then to launch the demo, do the following:

from comet.interactive.atomic_demo import DemoModel

demo_model = DemoModel("/path/to/pretrained_model")

demo_model.predict("PersonX goes to the mall", "xEffect", "beam-10")

Or for ConceptNet

from comet.interactive.conceptnet_demo import DemoModel

demo_model = DemoModel("/path/to/pretrained_model")

demo_model.predict("man with axe", "CapableOf", "beam-10")