nhathuy07 commited on
Commit
45d78a9
·
verified ·
1 Parent(s): 35be032

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -2
main.py CHANGED
@@ -214,6 +214,7 @@ async def __convert2md(inp):
214
  # Use gfm-raw_html to strip styling data from source file
215
  converted = await __convert_text(inp, "gfm-raw_html", "html")
216
  converted_without_link = convert_links_to_text(converted)
 
217
  return converted_without_link
218
 
219
  async def __convert2plain(inp):
@@ -559,6 +560,8 @@ async def generate_questions(request):
559
  seg_index = 0
560
  seg_index_map = ['Q', 'A', 'B', 'C', 'D', '']
561
  raw_segmented = []
 
 
562
 
563
  for seg in o['content'].split('\n'):
564
 
@@ -570,10 +573,11 @@ async def generate_questions(request):
570
  raw_segmented.append(seg)
571
  seg_index+=1
572
  if seg_index == 6:
573
- __parsed_outputs.extend(await parse_wh_question(raw_segmented.copy(), pgph_i))
574
  raw_segmented = []
575
  seg_index = 0
576
-
 
577
  seg_index = 0
578
 
579
  elif (o['style'] == QType.STMT):
 
214
  # Use gfm-raw_html to strip styling data from source file
215
  converted = await __convert_text(inp, "gfm-raw_html", "html")
216
  converted_without_link = convert_links_to_text(converted)
217
+ print("[CONVERT]:" converted_without_link)
218
  return converted_without_link
219
 
220
  async def __convert2plain(inp):
 
560
  seg_index = 0
561
  seg_index_map = ['Q', 'A', 'B', 'C', 'D', '']
562
  raw_segmented = []
563
+ raw_segmented_list = []
564
+
565
 
566
  for seg in o['content'].split('\n'):
567
 
 
573
  raw_segmented.append(seg)
574
  seg_index+=1
575
  if seg_index == 6:
576
+ raw_segmented_list.append(raw_segmented.copy())
577
  raw_segmented = []
578
  seg_index = 0
579
+
580
+ __parsed_outputs.extend(await parse_wh_questions(raw_segmented_list, pgph_i))
581
  seg_index = 0
582
 
583
  elif (o['style'] == QType.STMT):