kawadou commited on
Commit
382c8fb
1 Parent(s): 79a7b9c

Add application file

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -39,10 +39,10 @@ def get_answer_from_document(question, context):
39
  result = qa_pipeline(question=question, context=context)
40
  return result
41
 
42
- def generate_questions(text, num_questions=5):
43
  question_generation_pipeline = pipeline("text2text-generation", model="valhalla/t5-base-qg-hl")
44
  input_text = "generate questions: " + text
45
- questions = question_generation_pipeline(input_text, max_length=512, num_return_sequences=num_questions)
46
  return [q['generated_text'] for q in questions]
47
 
48
  def evaluate_responses(user_responses, correct_answers):
@@ -91,3 +91,4 @@ if uploaded_file is not None:
91
  training_plan = generate_training_plan(scores)
92
  for step in training_plan:
93
  st.write(step)
 
 
39
  result = qa_pipeline(question=question, context=context)
40
  return result
41
 
42
+ def generate_questions(text, num_questions=5, num_beams=5):
43
  question_generation_pipeline = pipeline("text2text-generation", model="valhalla/t5-base-qg-hl")
44
  input_text = "generate questions: " + text
45
+ questions = question_generation_pipeline(input_text, max_length=512, num_beams=num_beams, num_return_sequences=num_questions)
46
  return [q['generated_text'] for q in questions]
47
 
48
  def evaluate_responses(user_responses, correct_answers):
 
91
  training_plan = generate_training_plan(scores)
92
  for step in training_plan:
93
  st.write(step)
94
+