Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TIGER-AI-Lab/LongRAG
/ functions
Functions
74 in github.com/TIGER-AI-Lab/LongRAG
⨍
Functions
74
◇
Types & classes
10
↓ 13 callers
Function
save_dict_pickle
(dict, path)
utils/load_data_util.py:52
↓ 9 callers
Function
_normalize
Normalize Unicode strings. Necessary for text which contains non-ASCII characters.
utils/wiki_util.py:7
↓ 6 callers
Function
load_dict_pickle
(path)
utils/load_data_util.py:57
↓ 4 callers
Method
predict
(self, prompt, temperature=0, max_tokens=1000, retry=3, delay=5)
utils/gpt_inference.py:26
↓ 4 callers
Method
predict
(self, system_prompt, prompt)
utils/claude_inference.py:13
↓ 4 callers
Method
predict
(self, prompt)
utils/gemini_inference.py:49
↓ 3 callers
Function
load_json_file
(file_path)
utils/load_data_util.py:9
↓ 2 callers
Method
extract_answer
Extract the final short answer from the long answer.
utils/gpt_inference.py:93
↓ 2 callers
Method
extract_answer
(self, question, long_answer)
utils/claude_inference.py:76
↓ 2 callers
Method
extract_answer
(self, question, long_answer)
utils/gemini_inference.py:100
↓ 2 callers
Function
get_hyperlink
Get abstract of each page and hyperplinks within the whole page. :param text: wikipedia text, with hyperlinks
utils/wiki_util.py:21
↓ 2 callers
Function
has_correct_answer
(retrieve_doc, answers)
utils/eval_util.py:65
↓ 2 callers
Function
normalize_answer
(s)
utils/eval_util.py:49
↓ 2 callers
Method
process_data
(self)
utils/mp_util.py:22
↓ 2 callers
Method
tokenize
(self, text, uncased=False)
utils/eval_util.py:23
↓ 1 callers
Method
combine_results
Combine the results from all the chunks. It needs to be implemented by subclasses.
utils/mp_util.py:30
↓ 1 callers
Function
compute_exact
(a_gold, a_pred)
utils/eval_util.py:53
↓ 1 callers
Function
convert_html
Convert HTML entities entity back to character.
utils/wiki_util.py:14
↓ 1 callers
Method
entities
Returns a list of named-entity-recognition tags of each token. Returns None if this annotation was not included.
utils/tokenizers.py:69
↓ 1 callers
Method
generate_demo_examples
Generate in-context examples to extract the short answer from the long answer.
utils/gpt_inference.py:80
↓ 1 callers
Method
generate_demo_examples
(self, num_demo=4)
utils/claude_inference.py:66
↓ 1 callers
Method
generate_demo_examples
(self, num_demo=4)
utils/gemini_inference.py:90
↓ 1 callers
Function
get_adjacency
()
preprocess/process_wiki_page_abstract.py:56
↓ 1 callers
Function
get_adjacency
()
preprocess/process_wiki_page.py:58
↓ 1 callers
Function
get_degree_dict
()
preprocess/process_wiki_page_abstract.py:48
↓ 1 callers
Function
get_degree_dict
()
preprocess/process_wiki_page.py:50
↓ 1 callers
Function
get_doc_size
()
preprocess/process_wiki_page.py:87
↓ 1 callers
Function
load_dpr_wiki
(file_path)
utils/load_data_util.py:17
↓ 1 callers
Function
lower
(text)
utils/eval_util.py:45
↓ 1 callers
Method
post_process
(self, text)
utils/gpt_inference.py:19
↓ 1 callers
Method
post_process
(self, text)
utils/claude_inference.py:25
↓ 1 callers
Method
post_process
(self, text)
utils/gemini_inference.py:42
↓ 1 callers
Method
predict_hotpotqa
(self, context, question, titles)
utils/gpt_inference.py:67
↓ 1 callers
Method
predict_nq
(self, context, question, titles)
utils/gpt_inference.py:55
↓ 1 callers
Function
remove_articles
(text)
utils/eval_util.py:32
↓ 1 callers
Function
remove_hyperlink
Remove the hyperlink from the text. :param text: wikipedia text, with hyperlinks
utils/wiki_util.py:40
↓ 1 callers
Function
remove_punc
(text)
utils/eval_util.py:40
↓ 1 callers
Method
shutdown
(self)
utils/tokenizers.py:137
↓ 1 callers
Function
single_ans_em
(pred, gold)
utils/eval_util.py:57
↓ 1 callers
Method
slice
Return a view of the list of tokens from [i, j).
utils/tokenizers.py:28
↓ 1 callers
Method
untokenize
Returns the original text (with whitespace reinserted).
utils/tokenizers.py:34
↓ 1 callers
Function
update_degree_dict
(degree, corpus_title_set)
preprocess/group_documents.py:13
↓ 1 callers
Function
white_space_fix
(text)
utils/eval_util.py:36
↓ 1 callers
Method
words
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
Method
combine_results
(self, result_chunks)
preprocess/process_wiki_page_abstract.py:17
Method
combine_results
(self, result_chunks)
preprocess/process_wiki_page.py:18
Method
entity_groups
Group consecutive entity tokens with the same NER tag.
utils/tokenizers.py:107
Method
lemmas
Returns a list of the lemmatized text of each token. Returns None if this annotation was not included.
utils/tokenizers.py:61
Function
load_retrieval_txt
(file_path, n_retrieve=1)
utils/load_data_util.py:63
Function
load_tsv_file
(file_path)
utils/load_data_util.py:31
Method
ngrams
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
Method
offsets
Returns a list of [start, end) character offsets of each token.
utils/tokenizers.py:49
Method
pos
Returns a list of part-of-speech tags of each token. Returns None if this annotation was not included.
utils/tokenizers.py:53
Method
predict_close_book
(self, question, demo_file_path, num_demo=16)
utils/gpt_inference.py:45
Method
predict_close_book
(self, question, demo_file_path, num_demo=16)
utils/claude_inference.py:32
Method
predict_close_book
(self, question, demo_file_path, num_demo=16)
utils/gemini_inference.py:80
Method
predict_hotpotqa
(self, context, question, titles)
utils/claude_inference.py:53
Method
predict_hotpotqa
(self, context, question, titles)
utils/gemini_inference.py:67
Method
predict_nq
(self, context, question, titles)
utils/claude_inference.py:42
Method
predict_nq
(self, context, question, titles)
utils/gemini_inference.py:56
Function
process_wiki
(file_paths)
preprocess/process_wiki_page_abstract.py:22
Function
process_wiki
(file_paths)
preprocess/process_wiki_page.py:23
Method
tokenize
(self, text)
utils/tokenizers.py:134
Method
tokenize
(self, text)
utils/tokenizers.py:163