SYMBOL INDEX (352 symbols across 50 files) FILE: prep_elastic.py function build_elasticsearch (line 8) | def build_elasticsearch( FILE: src/augment.py function load_popqa (line 15) | def load_popqa(data_path): function load_complexwebquestions (line 32) | def load_complexwebquestions(data_path): function load_2wikimultihopqa (line 54) | def load_2wikimultihopqa(data_path): function load_hotpotqa (line 88) | def load_hotpotqa(data_path): function load_default_format_data (line 121) | def load_default_format_data(data_path): function get_rewrite (line 139) | def get_rewrite(passage, model_name, model=None, tokenizer=None, generat... function fix_qa (line 157) | def fix_qa(qa): function get_qa (line 173) | def get_qa(passage, model_name, model=None, tokenizer=None, generation_c... function main (line 205) | def main(args): FILE: src/encode.py class TrainingData (line 25) | class TrainingData(Dataset): method __init__ (line 28) | def __init__(self, prompt_ids, tokenizer, max_length=3000): method __len__ (line 47) | def __len__(self): method __getitem__ (line 50) | def __getitem__(self, idx) -> Dict[str, list]: class TrainingDataCollator (line 54) | class TrainingDataCollator(DefaultDataCollator): method __init__ (line 55) | def __init__(self, tokenizer, device): method __call__ (line 60) | def __call__(self, examples: List[Dict[str, list]]) -> Dict[str, torch... function get_train_data (line 71) | def get_train_data(aug_model, augments, tokenizer, args): function train (line 94) | def train(question, augments, args, model, tokenizer, function main (line 124) | def main(args): FILE: src/get_warmup_data.py function create_direct (line 18) | def create_direct(): function load_2wikimultihopqa (line 35) | def load_2wikimultihopqa(data_path): function load_hotpotqa (line 71) | def load_hotpotqa(data_path): function create_cot (line 114) | def create_cot(): FILE: src/inference.py function main (line 13) | def main(args): FILE: src/prompt_template.py function _get_prompt (line 23) | def _get_prompt(question, passages=None, answer=None): function get_fewshot (line 42) | def get_fewshot(dataset): function get_prompt (line 59) | def get_prompt(tokenizer, question, passages=None, answer=None, with_cot... FILE: src/retrieve/beir/beir/datasets/data_loader.py class GenericDataLoader (line 10) | class GenericDataLoader: method __init__ (line 12) | def __init__(self, data_folder: str = None, prefix: str = None, corpus... method check (line 28) | def check(fIn: str, ext: str): method load_custom (line 35) | def load_custom(self) -> Tuple[Dict[str, Dict[str, str]], Dict[str, st... method load (line 59) | def load(self, split="test") -> Tuple[Dict[str, Dict[str, str]], Dict[... method load_corpus (line 84) | def load_corpus(self) -> Dict[str, Dict[str, str]]: method _load_corpus (line 96) | def _load_corpus(self): method _load_queries (line 107) | def _load_queries(self): method _load_qrels (line 114) | def _load_qrels(self): FILE: src/retrieve/beir/beir/datasets/data_loader_hf.py class HFDataLoader (line 10) | class HFDataLoader: method __init__ (line 12) | def __init__(self, hf_repo: str = None, hf_repo_qrels: str = None, dat... method check (line 38) | def check(fIn: str, ext: str): method load (line 45) | def load(self, split="test") -> Tuple[Dict[str, Dict[str, str]], Dict[... method load_corpus (line 77) | def load_corpus(self) -> Dict[str, Dict[str, str]]: method _load_corpus (line 89) | def _load_corpus(self): method _load_queries (line 100) | def _load_queries(self): method _load_qrels (line 111) | def _load_qrels(self, split): FILE: src/retrieve/beir/beir/generation/generate.py class PassageExpansion (line 8) | class PassageExpansion: method __init__ (line 9) | def __init__(self, model, **kwargs): method save (line 14) | def save(output_dir: str, corpus: Dict[str, str], prefix: str): method expand (line 22) | def expand(self, class QueryGenerator (line 57) | class QueryGenerator: method __init__ (line 58) | def __init__(self, model, **kwargs): method save (line 64) | def save(output_dir: str, queries: Dict[str, str], qrels: Dict[str, Di... method generate (line 78) | def generate(self, method generate_multi_process (line 135) | def generate_multi_process(self, FILE: src/retrieve/beir/beir/generation/models/auto_model.py class QGenModel (line 10) | class QGenModel: method __init__ (line 11) | def __init__(self, model_path: str, gen_prefix: str = "", use_fast: bo... method generate (line 19) | def generate(self, corpus: List[Dict[str, str]], ques_per_passage: int... method start_multi_process_pool (line 48) | def start_multi_process_pool(self, target_devices: List[str] = None): method stop_multi_process_pool (line 78) | def stop_multi_process_pool(pool): method _generate_multi_process_worker (line 93) | def _generate_multi_process_worker(target_device: str, model, tokenize... method generate_multi_process (line 121) | def generate_multi_process(self, corpus: List[Dict[str, str]], ques_pe... FILE: src/retrieve/beir/beir/generation/models/tilde.py class TILDE (line 12) | class TILDE: method __init__ (line 13) | def __init__(self, model_path: str, gen_prefix: str = "", use_fast: bo... method _clean_vocab (line 22) | def _clean_vocab(self, tokenizer, do_stopwords=True): method generate (line 55) | def generate(self, corpus: List[Dict[str, str]], top_k: int, max_lengt... FILE: src/retrieve/beir/beir/logging.py class LoggingHandler (line 4) | class LoggingHandler(logging.Handler): method __init__ (line 5) | def __init__(self, level=logging.NOTSET): method emit (line 8) | def emit(self, record): FILE: src/retrieve/beir/beir/losses/bpr_loss.py class BPRLoss (line 6) | class BPRLoss(torch.nn.Module): method __init__ (line 22) | def __init__(self, model: SentenceTransformer, scale: float = 1.0, sim... method convert_to_binary (line 39) | def convert_to_binary(self, input_repr: torch.Tensor) -> torch.Tensor: method forward (line 46) | def forward(self, sentence_features: Iterable[Dict[str, torch.Tensor]]... FILE: src/retrieve/beir/beir/losses/margin_mse_loss.py class MarginMSELoss (line 8) | class MarginMSELoss(nn.Module): method __init__ (line 19) | def __init__(self, model, scale: float = 1.0, similarity_fct = 'dot'): method forward (line 26) | def forward(self, sentence_features: Iterable[Dict[str, Tensor]], labe... FILE: src/retrieve/beir/beir/reranking/models/cross_encoder.py class CrossEncoder (line 5) | class CrossEncoder: method __init__ (line 6) | def __init__(self, model_path: str, **kwargs): method predict (line 9) | def predict(self, sentences: List[Tuple[str,str]], batch_size: int = 3... FILE: src/retrieve/beir/beir/reranking/models/mono_t5.py class QueryDocumentBatch (line 20) | class QueryDocumentBatch: method __len__ (line 25) | def __len__(self): class QueryDocumentBatchTokenizer (line 28) | class QueryDocumentBatchTokenizer: method __init__ (line 29) | def __init__(self, method encode (line 37) | def encode(self, strings: List[str]): method traverse_query_document (line 45) | def traverse_query_document( class T5BatchTokenizer (line 55) | class T5BatchTokenizer(QueryDocumentBatchTokenizer): method __init__ (line 56) | def __init__(self, *args, **kwargs): function greedy_decode (line 72) | def greedy_decode(model: PreTrainedModel, class MonoT5 (line 99) | class MonoT5: method __init__ (line 100) | def __init__(self, method get_model (line 115) | def get_model(model_path: str, *args, device: str = None, **kwargs) ->... method get_tokenizer (line 121) | def get_tokenizer(model_path: str, *args, **kwargs) -> T5BatchTokenizer: method get_prediction_tokens (line 127) | def get_prediction_tokens(model_path: str, tokenizer, token_false, tok... method predict (line 133) | def predict(self, sentences: List[Tuple[str,str]], batch_size: int = 3... FILE: src/retrieve/beir/beir/reranking/rerank.py class Rerank (line 7) | class Rerank: method __init__ (line 9) | def __init__(self, model, batch_size: int = 128, **kwargs): method rerank (line 14) | def rerank(self, FILE: src/retrieve/beir/beir/retrieval/custom_metrics.py function mrr (line 4) | def mrr(qrels: Dict[str, Dict[str, int]], function recall_cap (line 33) | def recall_cap(qrels: Dict[str, Dict[str, int]], function hole (line 60) | def hole(qrels: Dict[str, Dict[str, int]], function top_k_accuracy (line 89) | def top_k_accuracy( FILE: src/retrieve/beir/beir/retrieval/evaluation.py class EvaluateRetrieval (line 9) | class EvaluateRetrieval: method __init__ (line 11) | def __init__(self, retriever: BaseSearch = None, k_values: List[int] =... method retrieve (line 17) | def retrieve(self, corpus: Dict[str, Dict[str, str]], queries: Dict[st... method rerank (line 22) | def rerank(self, method evaluate_custom (line 94) | def evaluate_custom(qrels: Dict[str, Dict[str, int]], FILE: src/retrieve/beir/beir/retrieval/models/bpr.py class BinarySentenceBERT (line 6) | class BinarySentenceBERT: method __init__ (line 7) | def __init__(self, model_path: Union[str, Tuple] = None, sep: str = " ... method _convert_embedding_to_binary_code (line 19) | def _convert_embedding_to_binary_code(self, embeddings: List[Tensor]) ... method encode_queries (line 22) | def encode_queries(self, queries: List[str], batch_size: int = 16, **k... method encode_corpus (line 25) | def encode_corpus(self, corpus: List[Dict[str, str]], batch_size: int ... FILE: src/retrieve/beir/beir/retrieval/models/dpr.py class DPR (line 7) | class DPR: method __init__ (line 8) | def __init__(self, model_path: Union[str, Tuple] = None, **kwargs): method encode_queries (line 21) | def encode_queries(self, queries: List[str], batch_size: int = 16, **k... method encode_corpus (line 31) | def encode_corpus(self, corpus: List[Dict[str, str]], batch_size: int ... FILE: src/retrieve/beir/beir/retrieval/models/sentence_bert.py class SentenceBERT (line 13) | class SentenceBERT: method __init__ (line 14) | def __init__(self, model_path: Union[str, Tuple] = None, sep: str = " ... method start_multi_process_pool (line 25) | def start_multi_process_pool(self, target_devices: List[str] = None) -... method stop_multi_process_pool (line 40) | def stop_multi_process_pool(self, pool: Dict[str, object]): method encode_queries (line 45) | def encode_queries(self, queries: List[str], batch_size: int = 16, **k... method encode_corpus (line 48) | def encode_corpus(self, corpus: Union[List[Dict[str, str]], Dict[str, ... method encode_corpus_parallel (line 56) | def encode_corpus_parallel(self, corpus: Union[List[Dict[str, str]], D... FILE: src/retrieve/beir/beir/retrieval/models/sparta.py class SPARTA (line 8) | class SPARTA: method __init__ (line 9) | def __init__(self, model_path: str = None, sep: str = " ", sparse_vect... method initialization (line 18) | def initialization(self): method _bert_input_embeddings (line 23) | def _bert_input_embeddings(self): method _compute_sparse_embeddings (line 33) | def _compute_sparse_embeddings(self, documents): method encode_query (line 56) | def encode_query(self, query: str, **kwargs): method encode_corpus (line 59) | def encode_corpus(self, corpus: List[Dict[str, str]], batch_size: int ... FILE: src/retrieve/beir/beir/retrieval/models/splade.py class SPLADE (line 14) | class SPLADE: method __init__ (line 15) | def __init__(self, model_path: str = None, sep: str = " ", max_length:... method encode_queries (line 22) | def encode_queries(self, queries: List[str], batch_size: int, **kwargs... method encode_corpus (line 26) | def encode_corpus(self, corpus: List[Dict[str, str]], batch_size: int,... class SpladeNaver (line 33) | class SpladeNaver(torch.nn.Module): method __init__ (line 34) | def __init__(self, model_path): method forward (line 38) | def forward(self, **kwargs): method _text_length (line 42) | def _text_length(self, text: Union[List[int], List[List[int]]]): method encode_sentence_bert (line 57) | def encode_sentence_bert(self, tokenizer, sentences: Union[str, List[s... FILE: src/retrieve/beir/beir/retrieval/models/tldr.py class TLDR (line 11) | class TLDR: method __init__ (line 12) | def __init__(self, encoder_model: SentenceTransformer, model_path: Uni... method fit (line 32) | def fit(self, corpus: List[Dict[str, str]], batch_size: int = 8, epoch... method save (line 43) | def save(self, model_path: str, knn_path: str = None): method load (line 47) | def load(self, model_path: str): method encode_queries (line 51) | def encode_queries(self, queries: List[str], batch_size: int = 16, **k... method encode_corpus (line 54) | def encode_corpus(self, corpus: List[Dict[str, str]], batch_size: int ... FILE: src/retrieve/beir/beir/retrieval/models/unicoil.py class UniCOIL (line 8) | class UniCOIL: method __init__ (line 9) | def __init__(self, model_path: Union[str, Tuple] = None, sep: str = " ... method encode_query (line 21) | def encode_query(self, query: str, batch_size: int = 16, **kwargs): method encode_corpus (line 34) | def encode_corpus(self, corpus: List[Dict[str, str]], batch_size: int ... method encode (line 38) | def encode( class UniCoilEncoder (line 122) | class UniCoilEncoder(PreTrainedModel): method __init__ (line 127) | def __init__(self, config: BertConfig): method _init_weights (line 135) | def _init_weights(self, module): method init_weights (line 147) | def init_weights(self): method forward (line 151) | def forward( FILE: src/retrieve/beir/beir/retrieval/models/use_qa.py class UseQA (line 13) | class UseQA: method __init__ (line 14) | def __init__(self, hub_url=None, **kwargs): method initialisation (line 19) | def initialisation(): method encode_queries (line 29) | def encode_queries(self, queries: List[str], batch_size: int = 16, **k... method encode_corpus (line 39) | def encode_corpus(self, corpus: List[Dict[str, str]], batch_size: int ... FILE: src/retrieve/beir/beir/retrieval/search/base.py class BaseSearch (line 4) | class BaseSearch(ABC): method search (line 7) | def search(self, FILE: src/retrieve/beir/beir/retrieval/search/dense/exact_search.py class DenseRetrievalExactSearch (line 12) | class DenseRetrievalExactSearch(BaseSearch): method __init__ (line 14) | def __init__(self, model, batch_size: int = 128, corpus_chunk_size: in... method search (line 25) | def search(self, FILE: src/retrieve/beir/beir/retrieval/search/dense/exact_search_multi_gpu.py class DummyMetric (line 28) | class DummyMetric(EvaluationModule): method _info (line 31) | def _info(self): method _compute (line 40) | def _compute(self, cos_scores_top_k_values, cos_scores_top_k_idx, batc... method warmup (line 49) | def warmup(self): class DenseRetrievalParallelExactSearch (line 56) | class DenseRetrievalParallelExactSearch(BaseSearch): method __init__ (line 58) | def __init__(self, model, batch_size: int = 128, corpus_chunk_size: in... method search (line 82) | def search(self, method _encode_multi_process_worker (line 171) | def _encode_multi_process_worker(self, process_id, device, model, inpu... FILE: src/retrieve/beir/beir/retrieval/search/dense/faiss_index.py class FaissIndex (line 13) | class FaissIndex: method __init__ (line 14) | def __init__(self, index: faiss.Index, passage_ids: List[int] = None): method search (line 20) | def search(self, query_embeddings: np.ndarray, k: int, **kwargs) -> Tu... method save (line 28) | def save(self, fname: str): method build (line 32) | def build( method to_gpu (line 46) | def to_gpu(self): class FaissHNSWIndex (line 58) | class FaissHNSWIndex(FaissIndex): method search (line 59) | def search(self, query_embeddings: np.ndarray, k: int, **kwargs) -> Tu... method save (line 63) | def save(self, output_path: str): method build (line 67) | def build( class FaissTrainIndex (line 80) | class FaissTrainIndex(FaissIndex): method search (line 81) | def search(self, query_embeddings: np.ndarray, k: int, **kwargs) -> Tu... method save (line 84) | def save(self, output_path: str): method build (line 88) | def build( class FaissBinaryIndex (line 98) | class FaissBinaryIndex(FaissIndex): method __init__ (line 99) | def __init__(self, index: faiss.Index, passage_ids: List[int] = None, ... method search (line 109) | def search(self, query_embeddings: np.ndarray, k: int, binary_k: int =... method save (line 158) | def save(self, fname: str): method build (line 162) | def build( FILE: src/retrieve/beir/beir/retrieval/search/dense/faiss_search.py class DenseRetrievalFaissSearch (line 14) | class DenseRetrievalFaissSearch(BaseSearch): method __init__ (line 16) | def __init__(self, model, batch_size: int = 128, corpus_chunk_size: in... method _create_mapping_ids (line 30) | def _create_mapping_ids(self, corpus_ids): method _load (line 36) | def _load(self, input_dir: str, prefix: str, ext: str): method save (line 51) | def save(self, output_dir: str, prefix: str, ext: str): method _index (line 64) | def _index(self, corpus: Dict[str, Dict[str, str]], score_function: st... method search (line 102) | def search(self, class BinaryFaissSearch (line 134) | class BinaryFaissSearch(DenseRetrievalFaissSearch): method load (line 136) | def load(self, input_dir: str, prefix: str = "my-index", ext: str = "b... method index (line 146) | def index(self, corpus: Dict[str, Dict[str, str]], score_function: str... method save (line 153) | def save(self, output_dir: str, prefix: str = "my-index", ext: str = "... method search (line 156) | def search(self, method get_index_name (line 164) | def get_index_name(self): class PQFaissSearch (line 168) | class PQFaissSearch(DenseRetrievalFaissSearch): method __init__ (line 169) | def __init__(self, model, batch_size: int = 128, corpus_chunk_size: in... method load (line 177) | def load(self, input_dir: str, prefix: str = "my-index", ext: str = "p... method index (line 187) | def index(self, corpus: Dict[str, Dict[str, str]], score_function: str... method save (line 212) | def save(self, output_dir: str, prefix: str = "my-index", ext: str = "... method search (line 215) | def search(self, method get_index_name (line 223) | def get_index_name(self): class HNSWFaissSearch (line 227) | class HNSWFaissSearch(DenseRetrievalFaissSearch): method __init__ (line 228) | def __init__(self, model, batch_size: int = 128, corpus_chunk_size: in... method load (line 236) | def load(self, input_dir: str, prefix: str = "my-index", ext: str = "h... method index (line 247) | def index(self, corpus: Dict[str, Dict[str, str]], score_function: str... method save (line 265) | def save(self, output_dir: str, prefix: str = "my-index", ext: str = "... method search (line 268) | def search(self, method get_index_name (line 276) | def get_index_name(self): class HNSWSQFaissSearch (line 279) | class HNSWSQFaissSearch(DenseRetrievalFaissSearch): method __init__ (line 280) | def __init__(self, model, batch_size: int = 128, corpus_chunk_size: in... method load (line 290) | def load(self, input_dir: str, prefix: str = "my-index", ext: str = "h... method index (line 295) | def index(self, corpus: Dict[str, Dict[str, str]], score_function: str... method save (line 310) | def save(self, output_dir: str, prefix: str = "my-index", ext: str = "... method search (line 313) | def search(self, method get_index_name (line 321) | def get_index_name(self): class FlatIPFaissSearch (line 324) | class FlatIPFaissSearch(DenseRetrievalFaissSearch): method load (line 325) | def load(self, input_dir: str, prefix: str = "my-index", ext: str = "f... method index (line 335) | def index(self, corpus: Dict[str, Dict[str, str]], score_function: str... method save (line 345) | def save(self, output_dir: str, prefix: str = "my-index", ext: str = "... method search (line 348) | def search(self, method get_index_name (line 356) | def get_index_name(self): class PCAFaissSearch (line 359) | class PCAFaissSearch(DenseRetrievalFaissSearch): method __init__ (line 360) | def __init__(self, model, base_index: faiss.Index, output_dimension: i... method load (line 370) | def load(self, input_dir: str, prefix: str = "my-index", ext: str = "p... method index (line 381) | def index(self, corpus: Dict[str, Dict[str, str]], score_function: str... method save (line 401) | def save(self, output_dir: str, prefix: str = "my-index", ext: str = "... method search (line 404) | def search(self, method get_index_name (line 412) | def get_index_name(self): class SQFaissSearch (line 415) | class SQFaissSearch(DenseRetrievalFaissSearch): method __init__ (line 416) | def __init__(self, model, batch_size: int = 128, corpus_chunk_size: in... method load (line 422) | def load(self, input_dir: str, prefix: str = "my-index", ext: str = "s... method index (line 432) | def index(self, corpus: Dict[str, Dict[str, str]], score_function: str... method save (line 447) | def save(self, output_dir: str, prefix: str = "my-index", ext: str = "... method search (line 450) | def search(self, method get_index_name (line 458) | def get_index_name(self): FILE: src/retrieve/beir/beir/retrieval/search/dense/util.py function cos_sim (line 5) | def cos_sim(a: torch.Tensor, b: torch.Tensor): function dot_score (line 26) | def dot_score(a: torch.Tensor, b: torch.Tensor): function normalize (line 45) | def normalize(a: np.ndarray) -> np.ndarray: function save_dict_to_tsv (line 48) | def save_dict_to_tsv(_dict, output_path, keys=[]): function load_tsv_to_dict (line 56) | def load_tsv_to_dict(input_path, header=True): FILE: src/retrieve/beir/beir/retrieval/search/lexical/bm25_search.py function sleep (line 7) | def sleep(seconds): class BM25Search (line 10) | class BM25Search(BaseSearch): method __init__ (line 11) | def __init__(self, index_name: str, hostname: str = "localhost", keys:... method initialise (line 32) | def initialise(self): method search (line 37) | def search(self, corpus: Dict[str, Dict[str, str]], queries: Dict[str,... method index (line 66) | def index(self, corpus: Dict[str, Dict[str, str]]): FILE: src/retrieve/beir/beir/retrieval/search/lexical/elastic_search.py class ElasticSearch (line 11) | class ElasticSearch(object): method __init__ (line 13) | def __init__(self, es_credentials: Dict[str, object]): method check_language_supported (line 40) | def check_language_supported(self): method check_index_name (line 47) | def check_index_name(self): method create_index (line 68) | def create_index(self): method delete_index (line 96) | def delete_index(self): method bulk_add_to_index (line 105) | def bulk_add_to_index(self, generate_actions, progress): method lexical_search (line 119) | def lexical_search(self, text: str, top_hits: int, ids: List[str] = No... method lexical_multisearch (line 157) | def lexical_multisearch(self, texts: List[str], top_hits: int, skip: i... method generate_actions (line 203) | def generate_actions(self, dictionary: Dict[str, Dict[str, str]], upda... method hit_template (line 229) | def hit_template(self, es_res: Dict[str, object], hits: List[Tuple[str... FILE: src/retrieve/beir/beir/retrieval/search/sparse/sparse_search.py class SparseSearch (line 9) | class SparseSearch(BaseSearch): method __init__ (line 11) | def __init__(self, model, batch_size: int = 16, **kwargs): method search (line 17) | def search(self, FILE: src/retrieve/beir/beir/retrieval/train.py class TrainRetriever (line 16) | class TrainRetriever: method __init__ (line 18) | def __init__(self, model: SentenceTransformer, batch_size: int = 64): method load_train (line 22) | def load_train(self, corpus: Dict[str, Dict[str, str]], queries: Dict[... method load_train_triplets (line 43) | def load_train_triplets(self, triplets: List[Tuple[str, str, str]]) ->... method prepare_train (line 56) | def prepare_train(self, train_dataset: List[InputExample], shuffle: bo... method prepare_train_triplets (line 64) | def prepare_train_triplets(self, train_dataset: List[InputExample]) ->... method load_ir_evaluator (line 69) | def load_ir_evaluator(self, corpus: Dict[str, Dict[str, str]], queries... method load_dummy_evaluator (line 110) | def load_dummy_evaluator(self) -> SentenceEvaluator: method fit (line 113) | def fit(self, FILE: src/retrieve/beir/beir/util.py function dot_score (line 13) | def dot_score(a: torch.Tensor, b: torch.Tensor): function cos_sim (line 32) | def cos_sim(a: torch.Tensor, b: torch.Tensor): function download_url (line 53) | def download_url(url: str, save_path: str, chunk_size: int = 1024): function unzip (line 75) | def unzip(zip_file: str, out_dir: str): function download_and_unzip (line 80) | def download_and_unzip(url: str, out_dir: str, chunk_size: int = 1024) -... function write_to_json (line 96) | def write_to_json(output_file: str, data: Dict[str, str]): function write_to_tsv (line 115) | def write_to_tsv(output_file: str, data: Dict[str, str]): FILE: src/retrieve/beir/examples/beir-pyserini/config.py class IndexSettings (line 3) | class IndexSettings(BaseSettings): function hit_template (line 7) | def hit_template(hits): FILE: src/retrieve/beir/examples/beir-pyserini/main.py function upload (line 12) | async def upload(file: UploadFile = File(...)): function index (line 22) | def index(index_name: str, threads: Optional[int] = 8): function search (line 35) | def search(q: str, function batch_search (line 51) | def batch_search(queries: List[str], function batch_search_rm3 (line 65) | def batch_search_rm3(queries: List[str], FILE: src/retrieve/beir/examples/dataset/download_dataset.py function main (line 5) | def main(): FILE: src/retrieve/beir/examples/dataset/scrape_tweets.py function chunks (line 30) | def chunks(lst, n): function de_emojify (line 35) | def de_emojify(text): function preprocessing (line 44) | def preprocessing(text): function update_tweet_dict (line 47) | def update_tweet_dict(tweets, tweet_dict): function write_dict_to_file (line 58) | def write_dict_to_file(filename, dic): FILE: src/retrieve/beir/examples/retrieval/evaluation/custom/evaluate_custom_model.py class YourCustomModel (line 12) | class YourCustomModel: method __init__ (line 13) | def __init__(self, model_path=None, **kwargs): method encode_queries (line 19) | def encode_queries(self, queries: List[str], batch_size: int = 16, **k... method encode_corpus (line 25) | def encode_corpus(self, corpus: List[Dict[str, str]], batch_size: int ... FILE: src/retrieve/beir/examples/retrieval/evaluation/sparse/evaluate_anserini_docT5query_parallel.py function init_process (line 55) | def init_process(device, model_id): function _decide_device (line 70) | def _decide_device(cpu_procs): function _download_dataset (line 84) | def _download_dataset(dataset): function _generate_query (line 92) | def _generate_query(corpus_list): function _add_generated_queries_to_corpus (line 110) | def _add_generated_queries_to_corpus(num_procs, device, model_id, corpus): function _write_pyserini_corpus (line 124) | def _write_pyserini_corpus(pyserini_index_file, corpus): function _index_pyserini (line 139) | def _index_pyserini(pyserini_index_file, dataset): function _search_pyserini (line 148) | def _search_pyserini(queries, k): function _print_retrieval_examples (line 164) | def _print_retrieval_examples(corpus, queries, results): function main (line 177) | def main(): FILE: src/retrieve/beir/examples/retrieval/training/train_msmarco_v3.py class MSMARCODataset (line 106) | class MSMARCODataset(Dataset): method __init__ (line 107) | def __init__(self, queries, corpus): method __getitem__ (line 117) | def __getitem__(self, item): method __len__ (line 131) | def __len__(self): FILE: src/retrieve/beir/examples/retrieval/training/train_msmarco_v3_bpr.py class MSMARCODataset (line 110) | class MSMARCODataset(Dataset): method __init__ (line 111) | def __init__(self, queries, corpus): method __getitem__ (line 121) | def __getitem__(self, item): method __len__ (line 135) | def __len__(self): FILE: src/retrieve/beir/examples/retrieval/training/train_msmarco_v3_margin_MSE.py class MSMARCODataset (line 106) | class MSMARCODataset(Dataset): method __init__ (line 107) | def __init__(self, queries, corpus): method __getitem__ (line 117) | def __getitem__(self, item): method __len__ (line 133) | def __len__(self): FILE: src/retrieve/retriever.py function get_random_doc_id (line 22) | def get_random_doc_id(): class BM25 (line 25) | class BM25: method __init__ (line 26) | def __init__( method retrieve (line 42) | def retrieve( function bm25search_search (line 97) | def bm25search_search(self, corpus: Dict[str, Dict[str, str]], queries: ... function elasticsearch_lexical_multisearch (line 126) | def elasticsearch_lexical_multisearch(self, texts: List[str], top_hits: ... function elasticsearch_hit_template (line 173) | def elasticsearch_hit_template(self, es_res: Dict[str, object], hits: Li... function bm25_retrieve (line 204) | def bm25_retrieve(question, topk): FILE: src/utils.py class BaseDataset (line 16) | class BaseDataset: method normalize_answer (line 18) | def normalize_answer(cls, s): method exact_match_score (line 31) | def exact_match_score( method f1_score (line 45) | def f1_score( function load_data (line 78) | def load_data(data_name, data_type, model_name): function get_model_path (line 122) | def get_model_path(model_name): function get_model (line 133) | def get_model(model_name, max_new_tokens=20): function model_generate (line 154) | def model_generate(prompt, model, tokenizer, generation_config): function read_complete (line 176) | def read_complete(filepath): function evaluate (line 185) | def evaluate(pred, ground_truth, with_cot=False): function predict (line 221) | def predict(model, tokenizer, generation_config, question, with_cot, pas... FILE: src/warmup_lora.py class TrainingData (line 25) | class TrainingData(Dataset): method __init__ (line 28) | def __init__(self, origin_dataset, tokenizer, args): method __len__ (line 65) | def __len__(self): method __getitem__ (line 68) | def __getitem__(self, idx) -> Dict[str, list]: class TrainingDataCollator (line 72) | class TrainingDataCollator(DefaultDataCollator): method __init__ (line 73) | def __init__(self, tokenizer, device): method __call__ (line 78) | def __call__(self, examples: List[Dict[str, list]]) -> Dict[str, torch... function main (line 89) | def main(args):