Workflows
combine_answers(answers, research_question, use_gpt4=False, temperature=0.1)
Combines a list of answers into a concise literature review using OpenAI API. Args: answers (list): A list of answers to combine. research_question (str): The research question to use in the literature review. use_gpt4 (bool, optional): Whether to use GPT-4 for the literature review. Defaults to False. temperature (float, optional): The temperature to use for the OpenAI API. Defaults to 0.1. Returns: str: The literature review. Examples:
answers = ["Answer 1", "Answer 2"] research_question = "What is the impact of AI on society?" combine_answers(answers, research_question) "The impact of AI on society is significant. Answer 1...Answer 2..."
Source code in autoresearcher/workflows/literature_review/combine_answers.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
literature_review(research_question, output_file=None, use_gpt4=False)
Generates an academic literature review for a given research question. Args: research_question (str): The research question to generate a literature review for. output_file (str, optional): The file path to save the literature review to. use_gpt4 (bool, optional): Whether to use GPT-4 for generating the literature review. Defaults to False. Returns: str: The generated literature review. Examples:
literature_review('What is the impact of AI on healthcare?') Research question: What is the impact of AI on healthcare? Auto Researcher initiated! Generating keyword combinations... Keyword combinations generated! Fetching top 20 papers... Top 20 papers fetched! Extracting research findings from papers... Research findings extracted! Synthesizing answers... Literature review generated! Academic Literature Review: ... References: 1. ... Keyword combinations used to search for papers: 1. AI healthcare, 2. impact AI healthcare
Source code in autoresearcher/workflows/literature_review/literature_review.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
extract_answers_from_papers(papers, research_question, use_gpt4=False, temperature=0, max_tokens=150)
Extracts answers from paper abstracts. Args: papers (list): A list of papers. research_question (str): The research question to answer. use_gpt4 (bool, optional): Whether to use GPT-4 for answer extraction. Defaults to False. temperature (float, optional): The temperature for GPT-4 answer extraction. Defaults to 0. max_tokens (int, optional): The maximum number of tokens for GPT-4 answer extraction. Defaults to 150. Returns: list: A list of answers extracted from the paper abstracts. Examples:
extract_answers_from_papers(papers, research_question) ['Answer 1 SOURCE: Citation 1', 'Answer 2 SOURCE: Citation 2']
Source code in autoresearcher/workflows/literature_review/extract_answers_from_papers.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
extract_citations(answers)
Extracts bibliographical citations from a list of answers. Args: answers (list): A list of strings containing answers. Returns: list: A list of strings containing bibliographical citations. Examples:
answers = ["This is an answer. SOURCE: Smith, J. (2020).", ... "This is another answer. SOURCE: Jones, A. (2021)."] extract_citations(answers) ["Smith, J. (2020)", "Jones, A. (2021)"]
Source code in autoresearcher/workflows/literature_review/extract_citations.py
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|