File size: 878 Bytes
908351f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""
Retrieves the most likely paper to be cited by Paper A from a list of candidate papers based on user input.
Args:
    usr_input (str): A string containing the title and abstract of Paper A followed by the titles and abstracts of candidate papers.
    template (dict): A dictionary containing a template for formatting the prompt input.
Returns:
    str: A string containing the prompt input for the user.
"""

def paper_retrieval(usr_input, template, has_predefined_template=False):
    instruction = "Please select the paper that is more likely to be cited by paper A from candidate papers."

    if has_predefined_template:
        res = [
            {"role": "system", "content": instruction},
            {"role": "user", "content": usr_input},
        ]
    else:
        res = template["prompt_input"].format(instruction=instruction, input=usr_input)

    return res