Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
qa_list = nlp(" ".join(
|
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]
|