Spaces:
Running
on
T4
Running
on
T4
Update ppt_chunker.py
Browse files- ppt_chunker.py +6 -5
ppt_chunker.py
CHANGED
@@ -87,8 +87,9 @@ def ppt_chunk(file_like, nlp):
|
|
87 |
chunk = process_chunk(chunk, nlp)
|
88 |
|
89 |
tables = []
|
90 |
-
|
91 |
-
|
|
|
92 |
new_sub_chunks = []
|
93 |
only_tables = True
|
94 |
|
@@ -101,10 +102,10 @@ def ppt_chunk(file_like, nlp):
|
|
101 |
only_tables = False
|
102 |
|
103 |
if only_tables:
|
104 |
-
del chunks[
|
105 |
else:
|
106 |
-
chunks[
|
107 |
-
|
108 |
|
109 |
er = time.time()
|
110 |
fr = er - s
|
|
|
87 |
chunk = process_chunk(chunk, nlp)
|
88 |
|
89 |
tables = []
|
90 |
+
j = 0
|
91 |
+
|
92 |
+
while j < len(chunks):
|
93 |
new_sub_chunks = []
|
94 |
only_tables = True
|
95 |
|
|
|
102 |
only_tables = False
|
103 |
|
104 |
if only_tables:
|
105 |
+
del chunks[j]
|
106 |
else:
|
107 |
+
chunks[j] = [chunk[0], new_sub_chunks]
|
108 |
+
j += 1
|
109 |
|
110 |
er = time.time()
|
111 |
fr = er - s
|