Skip to content

SciPrompt: Knowledge-augmented Prompting for Fine-grained Categorization of Scientific Topics (EMNLP 2024)

License

Notifications You must be signed in to change notification settings

zhiwenyou103/SciPrompt

Repository files navigation

Conference Paper

SciPrompt

The official repository of our EMNLP 2024 Main conference paper: SciPrompt: Knowledge-augmented Prompting for Fine-grainedCategorization of Scientific Topics

This project is developed based on the OpenPrompt framework.

Fine-tuned filtering model: Bi-Encoder Model Cross-Encoder Model

Overall Framework

Installation

To install the necessary Python packages, run the following command:

conda create -n SciPrompt python=3.8.12
pip install -r requirements.txt

Prepare the Required Files and Directories

  • Replace the placeholder paths in the script with actual paths to your data and configuration files:
    • --data_dir should point to your data directory
    • --verbalizer_path should point to your arXiv_knowledgable_verbalizer.txt
    • --semantic_score_path should point to your arXiv_knowledgable_verbalizer_semantic_search_scores.txt
    • --doc_id_path should point to your doc_id.txt
    • --config_path should point to config/arxiv_label_mappings.json
  • Prepare your class label dictionary similar to the .json files in the label_mappings folder

Knowledge Retrieval and Filtering

  • Run our datasets:

    • Step 1: Change paths in run_retrieval.sh and run bash run_retrieval.sh
    • Step 2: Change paths of the filtering model, retrieved data (from Step 1), and output files in the run_knowledge_filtering.sh script
    • Step 3: Run the filtering script:
      bash run_knowledge_filtering.sh
  • Run using your own dataset:

    • Step 1 and 2 are the same as above
    • Step 3: Change your dataset name as custom and corresponding configs into the dataset_configs dictionary in knowledge_filtering.py Line 189
    • Run bash run_knowledge_filtering.sh in your terminal

Run the main script:

  • Execute scripts for each dataset:
bash run_arxiv.sh
bash run_s2orc.sh
bash run_sdpra.sh
  • Run on your own data (need two input files: one only contains data, one only has labels, as used in arXiv):
bash run_custom_script.sh

Note: Please modify the required data file paths inside each script before running.

Citation Information

@inproceedings{you-etal-2024-sciprompt,
    title = "{S}ci{P}rompt: Knowledge-augmented Prompting for Fine-grained Categorization of Scientific Topics",
    author = "You, Zhiwen  and
      Han, Kanyao  and
      Zhu, Haotian  and
      Ludaescher, Bertram  and
      Diesner, Jana",
    editor = "Al-Onaizan, Yaser  and
      Bansal, Mohit  and
      Chen, Yun-Nung",
    booktitle = "Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing",
    month = nov,
    year = "2024",
    address = "Miami, Florida, USA",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2024.emnlp-main.350",
    pages = "6087--6104",
}

About

SciPrompt: Knowledge-augmented Prompting for Fine-grained Categorization of Scientific Topics (EMNLP 2024)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published