MCPcopy Create free account

hub / github.com/chaitanyamalaviya/ExpertQA / functions

Functions120 in github.com/chaitanyamalaviya/ExpertQA

↓ 10 callersMethodrun
Convert the generation into a set of atomic facts. Return a total words cost if cost_estimate != None.
modeling/fact_score/break_down_to_atomic_claims.py:53
↓ 5 callersFunctionread_jsonl
Read jsonl file to a List of Dicts.
data_utils/jsonl_utils.py:4
↓ 4 callersFunctioncleanup_claim_and_evidence
Remove square brackets and urls in claim and evidence
modeling/auto_attribution/autoais.py:199
↓ 4 callersFunctionformat_example_for_autoais
(evidence, claim)
modeling/auto_attribution/autoais.py:58
↓ 4 callersMethodgenerate
(self, prompt, sample_idx=0, max_sequence_length=2048, max_output_length=128)
modeling/fact_score/load_lm.py:19
↓ 3 callersFunction_autoais_predict
(evidence, claim, model, tokenizer,
modeling/auto_attribution/autoais.py:72
↓ 2 callersFunction_add_to_entities
(text)
modeling/fact_score/break_down_to_atomic_claims.py:222
↓ 2 callersMethod_generate
(self, prompt, max_sequence_length=2048, max_output_length=128)
modeling/fact_score/load_open_ai_model.py:25
↓ 2 callersFunctiondetect_entities
(text, nlp)
modeling/fact_score/break_down_to_atomic_claims.py:218
↓ 2 callersFunctionfix_sentence_splitter
(curr_sentences, initials)
modeling/fact_score/break_down_to_atomic_claims.py:318
↓ 2 callersFunctioninit_searcher
Initialize the searcher
modeling/response_collection/post_hoc_cite_sphere.py:53
↓ 2 callersFunctionis_date
(text)
modeling/fact_score/break_down_to_atomic_claims.py:205
↓ 2 callersMethodload_cache
(self, allow_retry=True)
modeling/fact_score/load_lm.py:49
↓ 2 callersFunctionload_expertqa_for_autoais
(data_path)
modeling/auto_attribution/finetune_autoais.py:41
↓ 2 callersFunctionmain
()
modeling/lfqa/run_gen_qa.py:472
↓ 2 callersFunctionpreprocess_squad_batch
( examples, question_column: str, context_column: str, answer_column: str,
modeling/lfqa/run_gen_qa.py:665
↓ 1 callersFunction_softmax
(x)
modeling/auto_attribution/autoais.py:68
↓ 1 callersFunctionbest_demos
(query, bm25, demons_sents, k)
modeling/fact_score/break_down_to_atomic_claims.py:163
↓ 1 callersFunctioncalculate_qafacteval_score
(predictions, references)
eval/nlg_eval.py:23
↓ 1 callersFunctioncalculate_rouge
(predictions, references)
eval/nlg_eval.py:18
↓ 1 callersFunctioncall_ChatGPT
(message, model_name="gpt-3.5-turbo", max_len=1024, temp=0.7, verbose=False)
modeling/fact_score/load_open_ai_model.py:47
↓ 1 callersFunctioncall_GPT3
(prompt, model_name="text-davinci-003", max_len=512, temp=0.7, num_log_probs=0, echo=False, verbose=False)
modeling/fact_score/load_open_ai_model.py:73
↓ 1 callersFunctionchars_token_ratio
Estimate the average number of characters per token in the dataset.
modeling/lfqa/run_sft_qa.py:105
↓ 1 callersFunctionchat_completion_with_backoff
(**kwargs)
modeling/response_collection/fetch_openai_responses.py:36
↓ 1 callersFunctionchat_completion_with_backoff
(**kwargs)
modeling/response_collection/sphere_and_read.py:23
↓ 1 callersFunctionchat_completion_with_backoff
(**kwargs)
modeling/response_collection/retrieve_and_read.py:86
↓ 1 callersFunctioncompletion_with_backoff
(**kwargs)
modeling/response_collection/split_ans_to_claims.py:91
↓ 1 callersFunctioncreate_datasets
(tokenizer, script_args)
modeling/lfqa/run_sft_qa.py:128
↓ 1 callersFunctiondetect_initials
(text)
modeling/fact_score/break_down_to_atomic_claims.py:313
↓ 1 callersFunctiondid_abstain
(answer)
modeling/fact_score/compute_factuality_f1.py:11
↓ 1 callersFunctiondid_abstain
(answer)
modeling/auto_attribution/compute_autoais_score.py:10
↓ 1 callersMethodevaluate
( self, eval_dataset: Optional[Dataset] = None, eval_examples=None, ignore_key
modeling/lfqa/run_gen_qa.py:104
↓ 1 callersFunctionextract_numeric_values
(text)
modeling/fact_score/break_down_to_atomic_claims.py:212
↓ 1 callersFunctionextract_subset
(args)
modeling/auto_attribution/extract_subset.py:10
↓ 1 callersFunctionfind_urls
(citations)
modeling/response_collection/convert_bingchat_output_to_examples.py:12
↓ 1 callersFunctionfix_sentence_boundaries
(claim_sents)
modeling/response_collection/split_ans_to_claims.py:95
↓ 1 callersFunctiongenerate_input
(_question, _context)
modeling/lfqa/run_gen_qa.py:675
↓ 1 callersMethodget_atomic_facts_from_paragraph
(self, paragraphs, cost_estimate=None)
modeling/fact_score/break_down_to_atomic_claims.py:59
↓ 1 callersFunctionget_entail_label_ids
(tokenizer)
modeling/auto_attribution/autoais.py:62
↓ 1 callersMethodget_init_atomic_facts_from_sentence
Get the initial atomic facts from the sentences. Return a total words cost if cost_estimate != None.
modeling/fact_score/break_down_to_atomic_claims.py:111
↓ 1 callersFunctionget_response
(question)
modeling/response_collection/fetch_bingchat_responses.py:27
↓ 1 callersFunctionget_score
(topic, atomic_claim, atomic_evidence, lm)
modeling/fact_score/factscore.py:22
↓ 1 callersFunctiongoogle_search
Get top 10 webpages from Google search. Args: query: search query api_key: custom search engine api key cx: programmable
modeling/fact_score/retrieve_evidence_for_claims.py:57
↓ 1 callersFunctiongoogle_search
Get top 10 webpages from Google search. Args: query: search query Returns: top-10 search results in json format
modeling/response_collection/post_hoc_cite.py:59
↓ 1 callersFunctiongoogle_search
Get top 10 webpages from Google search. Args: query: search query api_key: custom search engine api key cx: programmable
modeling/response_collection/retrieve_and_read.py:90
↓ 1 callersFunctionhuman_corr
(input_file)
modeling/fact_score/compute_factuality_f1.py:79
↓ 1 callersFunctionhuman_corr
(autoais_test_file)
modeling/auto_attribution/compute_human_correlation.py:8
↓ 1 callersFunctioninfer_autoais
Runs inference for assessing AIS between a premise and hypothesis. Args: example: Dict with the example data. tokenizer: A huggin
modeling/auto_attribution/autoais.py:150
↓ 1 callersFunctioninit_searcher
Initialize the searcher
modeling/response_collection/sphere_and_read.py:41
↓ 1 callersFunctionis_num
(text)
modeling/fact_score/break_down_to_atomic_claims.py:198
↓ 1 callersFunctionis_void_claim
(claim)
modeling/fact_score/compute_factuality_f1.py:26
↓ 1 callersMethodload_model
(self)
modeling/fact_score/load_lm.py:15
↓ 1 callersFunctionlower
(text)
modeling/fact_score/break_down_to_atomic_claims.py:191
↓ 1 callersFunctionmain
()
modeling/fact_score/break_down_to_atomic_claims.py:352
↓ 1 callersFunctionmain
()
modeling/lfqa/run_sft_qa.py:176
↓ 1 callersFunctionmain
()
modeling/auto_attribution/finetune_autoais.py:245
↓ 1 callersFunctionmain
(args)
modeling/auto_attribution/compute_autoais_score.py:111
↓ 1 callersFunctionnormalize_answer
Lower text and remove punctuation, articles and extra whitespace.
modeling/fact_score/break_down_to_atomic_claims.py:181
↓ 1 callersFunctionparse_arge
Parse the arguments.
modeling/auto_attribution/finetune_autoais.py:212
↓ 1 callersFunctionpostprocess_atomic_facts
(_atomic_facts, para_breaks, nlp)
modeling/fact_score/break_down_to_atomic_claims.py:247
↓ 1 callersFunctionpostprocess_text
(preds, labels)
modeling/auto_attribution/finetune_autoais.py:93
↓ 1 callersMethodpredict
( self, predict_dataset, predict_examples, ignore_keys=None, metric_key_prefix: str = "test", **gen_kw
modeling/lfqa/run_gen_qa.py:192
↓ 1 callersFunctionprepare_sample_text
Prepare the text from a sample of the dataset.
modeling/lfqa/run_sft_qa.py:121
↓ 1 callersFunctionprint_autoais_for_system
(predictions)
modeling/auto_attribution/compute_autoais_score.py:24
↓ 1 callersFunctionremove_articles
(text)
modeling/fact_score/break_down_to_atomic_claims.py:183
↓ 1 callersFunctionremove_brackets
(input_string)
modeling/response_collection/post_hoc_cite_sphere.py:70
↓ 1 callersFunctionremove_brackets
(input_string)
modeling/response_collection/post_hoc_cite.py:146
↓ 1 callersFunctionremove_passage_numbers_and_ids
(string)
modeling/response_collection/split_ans_to_claims.py:114
↓ 1 callersFunctionremove_punc
(text)
modeling/fact_score/break_down_to_atomic_claims.py:188
↓ 1 callersFunctionrerank
(claim: str, retrieved_documents: List[Document], topk: int)
modeling/response_collection/post_hoc_cite.py:128
↓ 1 callersFunctionretrieval_gpt_generate
(query: str, paragraphs: List[str], prompt_template: str
modeling/response_collection/sphere_and_read.py:58
↓ 1 callersFunctionretrieval_gpt_generate
(query: str, retrieved_documents: List[Document], topk:
modeling/response_collection/retrieve_and_read.py:189
↓ 1 callersFunctionretrieve_topk_passages
(query: str, retrieved_documents: List[Document], topk:
modeling/fact_score/retrieve_evidence_for_claims.py:129
↓ 1 callersMethodsave_cache
(self)
modeling/fact_score/load_lm.py:38
↓ 1 callersFunctionscore_predictions
Scores model predictions using AutoAIS. Args: input_data: list of input example dicts with claim and evidence keys Returns:
modeling/auto_attribution/autoais.py:216
↓ 1 callersFunctionscrape_and_filter
(urls: list)
modeling/fact_score/retrieve_evidence_for_claims.py:114
↓ 1 callersFunctionscrape_and_filter
(urls: list)
modeling/response_collection/post_hoc_cite.py:113
↓ 1 callersFunctionscrape_and_filter
(urls: list)
modeling/response_collection/retrieve_and_read.py:174
↓ 1 callersFunctionscrape_and_parse
Scrape a webpage and parse it into a Document object
modeling/fact_score/retrieve_evidence_for_claims.py:99
↓ 1 callersFunctionscrape_and_parse
Scrape a webpage and parse it into a Document object
modeling/auto_attribution/convert_for_autoais.py:24
↓ 1 callersFunctionscrape_and_parse
Scrape a webpage and parse it into a Document object
modeling/response_collection/post_hoc_cite.py:98
↓ 1 callersFunctionscrape_and_parse
Scrape a webpage and parse it into a Document object
modeling/response_collection/retrieve_and_read.py:159
↓ 1 callersFunctionsphere_search
(query: str, searcher: Union[LuceneSearcher, FaissSearcher], top_k: int =
modeling/response_collection/post_hoc_cite_sphere.py:38
↓ 1 callersFunctionsphere_search
(query: str, searcher: Union[LuceneSearcher, FaissSearcher], top_k: int =
modeling/response_collection/sphere_and_read.py:27
↓ 1 callersFunctionstretch_nli_rerank
Slice evidence into smaller slices and re-rank the slices based on model confidence. See https://arxiv.org/abs/2204.07447 for details. Since
modeling/auto_attribution/autoais.py:102
↓ 1 callersFunctiontext_to_sentences
(text)
modeling/fact_score/break_down_to_atomic_claims.py:170
↓ 1 callersFunctiontraining_function
(args)
modeling/auto_attribution/finetune_autoais.py:104
↓ 1 callersFunctionwhite_space_fix
(text)
modeling/fact_score/break_down_to_atomic_claims.py:186
↓ 1 callersFunctionwrite_jsonl
Write a List of Dicts to jsonl file.
data_utils/jsonl_utils.py:23
Method__init__
(self, demon_dir, gpt3_cache_file=None)
modeling/fact_score/break_down_to_atomic_claims.py:36
Method__init__
(self, model_name, cache_file=None)
modeling/fact_score/load_open_ai_model.py:13
Method__init__
(self, cache_file)
modeling/fact_score/load_lm.py:9
Method__init__
(self, *args, eval_examples=None, post_process_function=None, **kwargs)
modeling/lfqa/run_gen_qa.py:98
Method__post_init__
(self)
modeling/lfqa/run_gen_qa.py:443
Function_mp_fn
(index)
modeling/lfqa/run_gen_qa.py:940
Functionchat_completion_with_backoff
(**kwargs)
modeling/response_collection/post_hoc_cite.py:55
Functioncompletion_with_backoff
(**kwargs)
modeling/response_collection/fetch_openai_responses.py:41
Functioncompute_metrics
(p: EvalPrediction)
modeling/lfqa/run_gen_qa.py:825
Functioncompute_metrics
(eval_preds)
modeling/auto_attribution/finetune_autoais.py:136
Functionfind_urls
(citations)
modeling/response_collection/fetch_bingchat_responses.py:36
next →1–100 of 120, ranked by callers