QpxDesign / TREC-iKAT

An attempt of the iKAT (Interactive Knowledge Assistance Track) Track of the 2023 run of the NIST's TREC.
2 stars 1 forks source link
ai bert fastchat-t5 information-retrieveal llama2 llm nist sentance-transformers trec-ikat

TREC-iKAT

Official Page

Resources

Notes:

install pip dependencies: pip install -r requirements.txt MacOS instructions of llama.cpp python

run bash scripts/install-data.sh to install llama model (13B-Chat) from my server (~8 GB)

run python3 -m fastchat.serve.cli --model-path lmsys/fastchat-t5-3b-v1.0 to install fastchat-t5 model (~7 GB)

running ptkb_similarity or rank_passage_sentances (both are run in full-run) will download several BERT models (a few GB total)

set PYTHON_PATH variable: export PYTHONPATH=$PWD:$PYTHONPATH

install wikitext-103 from Cloudflare Einstien (~600MB Uncompressed), unzip it, and drag it into data/text-classification (used to train passage classifier)

install news articles corpus from Kaggle (~2GB) and place it in data/news-articles (used to train 'less strict' passage classifier)

if you're using ChatGPT instead of Llama, generate an OPENAI API Key, create a .env in the main dir, and put your key in it: OPENAI_API_KEY=<KEY GOES HERE> please note that a full-run using ChatGPT may use ~$1-3 of credit

System Requirements

This was tested/developed/ran from a computer running Ubuntu 22.04 with an RTX 3080 (10GB Version), an Intel i7-11700K (16 total CPU threads). Runs took between 3 and 28 hours, depending mostly on which LLM was used to generate the final responses. There are some tweaks you may need to make if you have different hardware:

Running Pyserini with clueweb22

  1. Place ikat collections (named ikat_collection_2023_0n.json) into /data/clueweb/
  2. Format by running bash scripts/format_ikat_collection.sh (this will take a long time)
  3. Generate the index: python -m pyserini.index.lucene --collection JsonCollection --input ~/TREC-iKAT/data/clueweb --index indexes/ikat_collection_2023 --generator DefaultLuceneDocumentGenerator --threads 1 --storePositions --storeDocvectors --storeRaw

Helpful Commands

Format large output JSON files with cat output/SEP1_RUN_1-2.json | python -m json.tool > output/STAR3.json

Runs We're Submitting (SUBJECT TO CHANGE) (IN ORDER)

  1. (Automatic) 2 shot approach
  2. (Automatic) 1 shot approach
  3. (Automatic) 1 shot approach without TF-IDF Reliability Model
  4. (Manual, using provided PTKBs and resolved_utterance) using 1 shot approach, same as (1)