MCPcopy Create free account

hub / github.com/TIGER-AI-Lab/LongRAG / functions

Functions74 in github.com/TIGER-AI-Lab/LongRAG

↓ 13 callersFunctionsave_dict_pickle
(dict, path)
utils/load_data_util.py:52
↓ 9 callersFunction_normalize
Normalize Unicode strings. Necessary for text which contains non-ASCII characters.
utils/wiki_util.py:7
↓ 6 callersFunctionload_dict_pickle
(path)
utils/load_data_util.py:57
↓ 4 callersMethodpredict
(self, prompt, temperature=0, max_tokens=1000, retry=3, delay=5)
utils/gpt_inference.py:26
↓ 4 callersMethodpredict
(self, system_prompt, prompt)
utils/claude_inference.py:13
↓ 4 callersMethodpredict
(self, prompt)
utils/gemini_inference.py:49
↓ 3 callersFunctionload_json_file
(file_path)
utils/load_data_util.py:9
↓ 2 callersMethodextract_answer
Extract the final short answer from the long answer.
utils/gpt_inference.py:93
↓ 2 callersMethodextract_answer
(self, question, long_answer)
utils/claude_inference.py:76
↓ 2 callersMethodextract_answer
(self, question, long_answer)
utils/gemini_inference.py:100
↓ 2 callersFunctionget_hyperlink
Get abstract of each page and hyperplinks within the whole page. :param text: wikipedia text, with hyperlinks
utils/wiki_util.py:21
↓ 2 callersFunctionhas_correct_answer
(retrieve_doc, answers)
utils/eval_util.py:65
↓ 2 callersFunctionnormalize_answer
(s)
utils/eval_util.py:49
↓ 2 callersMethodprocess_data
(self)
utils/mp_util.py:22
↓ 2 callersMethodtokenize
(self, text, uncased=False)
utils/eval_util.py:23
↓ 1 callersMethodcombine_results
Combine the results from all the chunks. It needs to be implemented by subclasses.
utils/mp_util.py:30
↓ 1 callersFunctioncompute_exact
(a_gold, a_pred)
utils/eval_util.py:53
↓ 1 callersFunctionconvert_html
Convert HTML entities entity back to character.
utils/wiki_util.py:14
↓ 1 callersMethodentities
Returns a list of named-entity-recognition tags of each token. Returns None if this annotation was not included.
utils/tokenizers.py:69
↓ 1 callersMethodgenerate_demo_examples
Generate in-context examples to extract the short answer from the long answer.
utils/gpt_inference.py:80
↓ 1 callersMethodgenerate_demo_examples
(self, num_demo=4)
utils/claude_inference.py:66
↓ 1 callersMethodgenerate_demo_examples
(self, num_demo=4)
utils/gemini_inference.py:90
↓ 1 callersFunctionget_adjacency
()
preprocess/process_wiki_page_abstract.py:56
↓ 1 callersFunctionget_adjacency
()
preprocess/process_wiki_page.py:58
↓ 1 callersFunctionget_degree_dict
()
preprocess/process_wiki_page_abstract.py:48
↓ 1 callersFunctionget_degree_dict
()
preprocess/process_wiki_page.py:50
↓ 1 callersFunctionget_doc_size
()
preprocess/process_wiki_page.py:87
↓ 1 callersFunctionload_dpr_wiki
(file_path)
utils/load_data_util.py:17
↓ 1 callersFunctionlower
(text)
utils/eval_util.py:45
↓ 1 callersMethodpost_process
(self, text)
utils/gpt_inference.py:19
↓ 1 callersMethodpost_process
(self, text)
utils/claude_inference.py:25
↓ 1 callersMethodpost_process
(self, text)
utils/gemini_inference.py:42
↓ 1 callersMethodpredict_hotpotqa
(self, context, question, titles)
utils/gpt_inference.py:67
↓ 1 callersMethodpredict_nq
(self, context, question, titles)
utils/gpt_inference.py:55
↓ 1 callersFunctionremove_articles
(text)
utils/eval_util.py:32
↓ 1 callersFunctionremove_hyperlink
Remove the hyperlink from the text. :param text: wikipedia text, with hyperlinks
utils/wiki_util.py:40
↓ 1 callersFunctionremove_punc
(text)
utils/eval_util.py:40
↓ 1 callersMethodshutdown
(self)
utils/tokenizers.py:137
↓ 1 callersFunctionsingle_ans_em
(pred, gold)
utils/eval_util.py:57
↓ 1 callersMethodslice
Return a view of the list of tokens from [i, j).
utils/tokenizers.py:28
↓ 1 callersMethoduntokenize
Returns the original text (with whitespace reinserted).
utils/tokenizers.py:34
↓ 1 callersFunctionupdate_degree_dict
(degree, corpus_title_set)
preprocess/group_documents.py:13
↓ 1 callersFunctionwhite_space_fix
(text)
utils/eval_util.py:36
↓ 1 callersMethodwords
Returns a list of the text of each token Args: uncased: lower cases text
utils/tokenizers.py:38
Method__del__
(self)
utils/tokenizers.py:140
Method__init__
(self, data, annotators, opts=None)
utils/tokenizers.py:19
Method__init__
Args: annotators: None or empty set (only tokenizes).
utils/tokenizers.py:148
Method__init__
(self)
utils/gpt_inference.py:13
Method__init__
(self)
utils/claude_inference.py:8
Method__init__
(self)
utils/gemini_inference.py:35
Method__init__
Args: annotators: None or empty set (only tokenizes).
utils/eval_util.py:13
Method__init__
:param func: The function to run in parallel. :param data: The data to be processed, as an iterable. :param chunk_size: The s
utils/mp_util.py:10
Method__len__
The number of tokens.
utils/tokenizers.py:24
Method_skip
(gram)
utils/tokenizers.py:88
Methodcombine_results
(self, result_chunks)
preprocess/process_wiki_page_abstract.py:17
Methodcombine_results
(self, result_chunks)
preprocess/process_wiki_page.py:18
Methodentity_groups
Group consecutive entity tokens with the same NER tag.
utils/tokenizers.py:107
Methodlemmas
Returns a list of the lemmatized text of each token. Returns None if this annotation was not included.
utils/tokenizers.py:61
Functionload_retrieval_txt
(file_path, n_retrieve=1)
utils/load_data_util.py:63
Functionload_tsv_file
(file_path)
utils/load_data_util.py:31
Methodngrams
Returns a list of all ngrams from length 1 to n. Args: n: upper limit of ngram length uncased: lower cases text
utils/tokenizers.py:77
Methodoffsets
Returns a list of [start, end) character offsets of each token.
utils/tokenizers.py:49
Methodpos
Returns a list of part-of-speech tags of each token. Returns None if this annotation was not included.
utils/tokenizers.py:53
Methodpredict_close_book
(self, question, demo_file_path, num_demo=16)
utils/gpt_inference.py:45
Methodpredict_close_book
(self, question, demo_file_path, num_demo=16)
utils/claude_inference.py:32
Methodpredict_close_book
(self, question, demo_file_path, num_demo=16)
utils/gemini_inference.py:80
Methodpredict_hotpotqa
(self, context, question, titles)
utils/claude_inference.py:53
Methodpredict_hotpotqa
(self, context, question, titles)
utils/gemini_inference.py:67
Methodpredict_nq
(self, context, question, titles)
utils/claude_inference.py:42
Methodpredict_nq
(self, context, question, titles)
utils/gemini_inference.py:56
Functionprocess_wiki
(file_paths)
preprocess/process_wiki_page_abstract.py:22
Functionprocess_wiki
(file_paths)
preprocess/process_wiki_page.py:23
Methodtokenize
(self, text)
utils/tokenizers.py:134
Methodtokenize
(self, text)
utils/tokenizers.py:163