You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
withopen('#define path for important topics here', 'r') asfile:
13
-
important_topics=str(file.read())
14
-
withopen('#define path for reference paper here', 'r', encoding='latin-1') asfile:
15
-
reference_paper=str(file.read())
16
-
17
-
18
-
# Construct the prompt for question generation
19
-
prompt=f"generate 10 questions that are not in reference paper but similar \nSorted Previous Year Questions:\n{sorted_questions}\n\nNotebook Question List:\n{notebook_questions}\n\nImportant Topics:\n{important_topics}\n\nReference Paper:\n{reference_paper}\n\n"
20
-
21
-
22
-
# Generate questions using OpenAI API
23
-
response=openai.Completion.create(
24
-
engine="davinci",
25
-
prompt=prompt,
26
-
max_tokens=1000, # Adjust the max_tokens value as per your requirement
27
-
temperature=0.4, # Adjust the temperature value to control the creativity of the generated questions
28
-
top_p=1.0,
29
-
frequency_penalty=0.0,
30
-
presence_penalty=0.0,
31
-
n=5# Adjust the 'n' value to generate more or fewer questions
32
-
)
33
-
34
-
# Extract the generated questions from the API response
0 commit comments