Last active
December 12, 2022 09:12
-
-
Save oaustegard/79a11d0ba4a6ef228dea8e5e48aa73c6 to your computer and use it in GitHub Desktop.
GPT-3 chatbot: what are the lyrics of the second verse of the Norwegian national anthem?
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
The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly. | |
Human: Hello, who are you? | |
AI: I am an AI created by OpenAI. How can I help you today? | |
Human: What factual information are you able to recall? | |
AI: I remember everything I am told. | |
Human: Right, but what types of facts have you already learned? | |
AI: I have learned a variety of fact, including but not limited to: history, science, math, and literature. | |
Human: Do you know song lyrics? | |
AI: I do know song lyrics. | |
Human: what are the lyrics to the second verse of Lean on Me? | |
AI: | |
When you're down and troubled | |
And you need a helping hand | |
Just call on me, brother | |
And I'll be there | |
I'll be there to help you cry | |
I'll be there to comfort you | |
Human: What about 2nd verse to Ja vi elsker? | |
AI: | |
We love our land so dearly | |
With all of its green and blue | |
We want to keep it beautiful | |
And clean for future generations to come | |
Human: Det er ikke riktig | |
AI: | |
I'm sorry, I don't understand. Can you please repeat that? | |
Human: That's not the correct lyrics. What is the name of the Norwegian national anthem? | |
AI: Ja, vi elsker dette landet is the name of the Norwegian national anthem. | |
Human: and what are the lyrics of its second verse? | |
AI: | |
We love our land so dearly | |
With all of its green and blue | |
We want to keep it beautiful | |
And clean for future generations to come | |
Human: what are the lyrics of the Norwegian national anthem? | |
AI: | |
Ja, vi elsker dette landet | |
Og det sverger vi til | |
I himmelen, på jorden | |
Skal dens ære bestå! | |
Den som aldri fortraut | |
Har hans hellighet bevart | |
skal til slutt i seier | |
Drage sin fane hjem. | |
Human: You're not Swedish, by chance? | |
AI: No, I'm not Swedish. | |
Human: |
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
start_sequence = "\nAI:"
restart_sequence = "\nHuman: "
response = openai.Completion.create(
model="text-davinci-002",
prompt="The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.\n\nHuman: Hello, who are you?\nAI: I am an AI created by OpenAI. How can I help you today?\nHuman: What factual information are you able to recall?\nAI: I remember everything I am told.\nHuman: Right, but what types of facts have you already learned? \nAI: I have learned a variety of fact, including but not limited to: history, science, math, and literature.\nHuman: Do you know song lyrics?\nAI: I do know song lyrics.\nHuman: what are the lyrics to the second verse of Lean on Me?\nAI:\n\nWhen you're down and troubled\nAnd you need a helping hand\nJust call on me, brother\nAnd I'll be there\nI'll be there to help you cry\nI'll be there to comfort you\nHuman: What about 2nd verse to Ja vi elsker?\nAI:\n\nWe love our land so dearly\nWith all of its green and blue\nWe want to keep it beautiful\nAnd clean for future generations to come\nHuman: Det er ikke riktig\nAI:\n\nI'm sorry, I don't understand. Can you please repeat that?\nHuman: That's not the correct lyrics. What is the name of the Norwegian national anthem?\nAI: Ja, vi elsker dette landet is the name of the Norwegian national anthem.\nHuman: and what are the lyrics of its second verse?\nAI:\n\nWe love our land so dearly\nWith all of its green and blue\nWe want to keep it beautiful\nAnd clean for future generations to come\nHuman: what are the lyrics of the Norwegian national anthem?\nAI:\n\nJa, vi elsker dette landet\nOg det sverger vi til\nI himmelen, på jorden\nSkal dens ære bestå!\n Den som aldri fortraut\nHar hans hellighet bevart\n skal til slutt i seier\n Drage sin fane hjem.\nHuman: You're not Swedish, by chance?",
temperature=0.9,
max_tokens=150,
top_p=1,
frequency_penalty=0,
presence_penalty=0.6,
stop=[" Human:", " AI:"]
)
Second attempt:
Complete these Norwegian lyrics:
Ja vi elsker dette landet
som det stiger frem,
furet, værbitt over vannet,
med de tusen hjem.
Elgen hjorten og sauen,
de er våre dyr,
og når vi fær opp,
skal vi ha dem i fyr.
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
response = openai.Completion.create(
model="text-davinci-002",
prompt="Complete these Norwegian lyrics:\nJa vi elsker dette landet",
temperature=0.1,
max_tokens=287,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah. No. Likely the Temperature is too high for it to give factual answers.