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
#pip install openai | |
import os | |
import openai | |
openai.api_key = "use you key provided" | |
response = openai.Completion.create( | |
model="text-davinci-003", | |
prompt="Extract keywords from this text:\n\Zoo...every kid gets enthused about it. Decently maintained park. One can spend half a day here and if done leisurely a full day. Cycle, battery car will make your trip easier. But if you are young and energetic take the cycle or by walk. The big cat enclosures are heavily barricaded, which makes it difficult to have a good look. Kids will enjoy but have lots of water.", | |
temperature=0.5, | |
max_tokens=60, | |
top_p=1, | |
frequency_penalty=0.8, | |
presence_penalty=0 | |
) | |
print(response) | |
#"text": "\n\n- Zoo\n- Park\n- Cycle\n- Battery car\n- Big cat enclosures\n- Kids \n- Water" | |
import os | |
import openai | |
openai.api_key = "use you key provided" | |
response = openai.Completion.create( | |
model="text-davinci-003", | |
prompt="Write a review based on these notes:\n\nName: \n\n- Zoo\n- Park\n- Cycle\n- Battery car\n- Big cat enclosures\n- Kids \n- Water", | |
temperature=0.5, | |
max_tokens=256, | |
top_p=1, | |
frequency_penalty=0, | |
presence_penalty=0 | |
) | |
print(response) | |
#"text": " play area\n\nI recently visited the Zoo and it was a great experience. The park was beautiful, with plenty of cycle and battery car options for the kids. The big cat enclosures were especially impressive, and the kids had a great time exploring the water play area. Overall, I would highly recommend this Zoo for a fun and educational family outing." |
Keep Exploring!!!
No comments:
Post a Comment