helloHW5 is a short Python script that demonstrates the use of two new software capabilities: dense retrieval and answer generation. It requires i) a new or upgraded Conda environment, and ii) some additional files in your INPUT_DIR.
Depending on your platform, you may need to upgrade your Conda environment or install a new one. Updating is easiest, so try that first. If it fails, try installing the new environment.
Upgrade: pip install SentencePiece
You may upgrade your Python to 3.9, if that helps.
New environment:
conda env create -f 11x42-25S-b.yml
This is the environment that the homework testing service will use
for HW5.
Put helloHW5.py in the QryEval directory that you used for HW1, HW2, and HW4.
Add the following new files to your INPUT_DIR.
Run the software.
python helloHW5.py
==> Retrieval <==
Query: Do cigarettes cause cancer?
Internal docids: [225540 249847 166432 447714 155923 246000 489120 529022 451014 287559]
Scores: [178.26248 174.80592 174.6508 174.16243 173.93791 173.78023 173.71877
173.70064 173.60355 173.49403]
==> Retrieval augmented generation <==
Question: Do cigarettes cause cancer?
Answer 1 (no retrieval): no
Answer 2 (w/retrieval): Smoking may be a cause of breast cancer, argued Swiss medical expert Alfredo Mor
Please send Jamie a quick email (callan@cs.cmu.edu) that contains the following information.
Thanks for your help!
Copyright 2025, Carnegie Mellon University.
Updated on March 29, 2025