from dataclasses import dataclass, field from typing import Optional, List @dataclass class QueryEncoderArgs: model_name_or_path: str = field( default="facebook/dpr-question_encoder-single-nq-base", metadata={ "help": "Path to pretrained model or model identifier from huggingface.co/models" }, ) cache_dir: str = field( default="/share/LMs", metadata={"help": "The path to save pretrain model."}, ) device: str = field( default="cuda:0", metadata={"help": "The device to run query encoder."}, ) @dataclass class SearcherArgs: index_dir: str = field( default="/share/ninglu_shao/code/Citation/faiss.wikipedia-dpr-100w.dpr_single-nq.20200115.cd5034", metadata={"help": "The path to index."}, ) doc_path: str = field( default="/share/ninglu_shao/data/Citation/psgs_w100.jsonl", metadata={"help": "The path to document."}, ) @dataclass class DataArgs: dataset_list: List[str] = field( default_factory=lambda: ["asqa"], metadata={"help": "The name of dataset."}, ) dataset_dir: str = field( default="/share/ninglu_shao/data/Citation", metadata={"help": "The path to dataset."}, ) save_dir: str = field( default="data/output", metadata={"help": "The path to save retrieved dataset."}, ) @dataclass class RetrieveArgs: k: int = field( default=5, metadata={"help": "The number of retrieved results."}, ) @dataclass class Args: trial_num: int = field( default=5, metadata={"help": "The number of trial."}, )