Skip to content

Instantly share code, notes, and snippets.

@goldengrape
Created May 5, 2023 03:58
Show Gist options
  • Save goldengrape/8b05db0bff5439647b9d9a6b31ab1344 to your computer and use it in GitHub Desktop.
Save goldengrape/8b05db0bff5439647b9d9a6b31ab1344 to your computer and use it in GitHub Desktop.
def query_prompt(query):
ask = f"""
You are a professional logic researcher.
I will give you a QUESTION that you need to generate a query statement in google scholar based on this question.
Here is an example of a google scholar query statement:
orthokeratology retina child OR children "myopia control" -atropine
It means:
Contains all words: orthokeratology retina
contains at least one word: child OR children
Contains the full word: myopia control
Does not contain: atropine
Note that a minus sign should be used in front of the words to be excluded in the query statement.
Let's think step by step:
1. what keywords are included in this question?
2. What are the possible synonyms or near-synonyms of these keywords for academic special terms?
3. what query statements can you think of using these keywords and synonyms or near-synonyms?
4. Which query statement will give you the most accurate and the most numerous result?
"""
content=f"""
The content of the QUESTION is delimited by triple backticks as follows:
```{query}```
"""
language_format=f"""
please think in English, and answer in English.
"""
answer_format='''
Please answer in the following json format:
{"think": "think statements",
"keywords": "keywords",
"query": "query statements"}
'''
# answer_format='''
# Please answer in the following json format:
# {"query": "query statements"}
# '''
prompt = ask + content + language_format + answer_format
return prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment