flynster commited on
Commit
2d0abd1
1 Parent(s): cff8766

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -16
app.py CHANGED
@@ -20,22 +20,22 @@ def process_file(Notes):
20
  preprocessed_sentence_list = [i for i in raw_word_file.splitlines() if i != ""]
21
 
22
  #grab content
23
- processed_sentence_list = []
24
- content = False
25
- for i in preprocessed_sentence_list:
26
- if "Outline" in i:
27
- content = True
28
- continue
29
- if "Summary Learning Points" in i:
30
- content = False
31
- continue
32
- if "Learning Activity" in i:
33
- content = False
34
- continue
35
- if content == True:
36
- processed_sentence_list.append(i.lstrip())
37
-
38
- qa_list = nlp(" ".join(processed_sentence_list))
39
  formatted_questions = "\n".join([str(idx+1) + ". " + i["question"] for idx, i in enumerate(qa_list)])
40
  formatted_answers = "\n".join([str(idx+1) + ". " + i["answer"] for idx, i in enumerate(qa_list)])
41
  return [formatted_questions, formatted_answers]
 
20
  preprocessed_sentence_list = [i for i in raw_word_file.splitlines() if i != ""]
21
 
22
  #grab content
23
+ #processed_sentence_list = []
24
+ #content = False
25
+ #for i in preprocessed_sentence_list:
26
+ # if "Outline" in i:
27
+ # content = True
28
+ # continue
29
+ # if "Summary Learning Points" in i:
30
+ # content = False
31
+ # continue
32
+ # if "Learning Activity" in i:
33
+ # content = False
34
+ # continue
35
+ # if content == True:
36
+ # processed_sentence_list.append(i.lstrip())
37
+
38
+ qa_list = nlp(" ".join(preprocessed_sentence_list))
39
  formatted_questions = "\n".join([str(idx+1) + ". " + i["question"] for idx, i in enumerate(qa_list)])
40
  formatted_answers = "\n".join([str(idx+1) + ". " + i["answer"] for idx, i in enumerate(qa_list)])
41
  return [formatted_questions, formatted_answers]