Created
May 17, 2021 14:30
-
-
Save ikanez/55049f00075c61d240c580393f41142d to your computer and use it in GitHub Desktop.
Prompting the GPT-3 with "banking" context.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def call_openapi(question): | |
response = openai.Completion.create( | |
engine="davinci", | |
prompt=""" | |
This is a banking expert. | |
Q: What is interest rate? | |
A: The interest rate is the amount a lender charges for the use of assets expressed as a percentage of the principal. | |
Q: What is PD? | |
A: Probability of default. | |
Q: {question}? | |
A:""".format(question=question), | |
temperature=0.3, | |
max_tokens=60, | |
top_p=1.0, | |
frequency_penalty=0.0, | |
presence_penalty=0.0, | |
stop=["\n"] | |
) | |
return response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment