Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ import streamlit as st
|
|
10 |
from stqdm import stqdm
|
11 |
from ast import literal_eval
|
12 |
from tempfile import NamedTemporaryFile
|
|
|
13 |
|
14 |
import PyPDF2
|
15 |
import pdf2image
|
@@ -157,7 +158,7 @@ if uploaded_files:
|
|
157 |
chunkdf = []
|
158 |
for i, chunk in enumerate(text_chunk):
|
159 |
inp = chunk
|
160 |
-
df = pd.DataFrame(literal_eval(str(json.dumps(tablex_chain.run(inp)[0])).replace("\'", "\"")), index=[0]).fillna('')
|
161 |
chunkdf.append(df)
|
162 |
|
163 |
concat = pd.concat(chunkdf, axis=0).reset_index().drop('index', axis=1).fillna('')
|
|
|
10 |
from stqdm import stqdm
|
11 |
from ast import literal_eval
|
12 |
from tempfile import NamedTemporaryFile
|
13 |
+
from json_repair import repair_json
|
14 |
|
15 |
import PyPDF2
|
16 |
import pdf2image
|
|
|
158 |
chunkdf = []
|
159 |
for i, chunk in enumerate(text_chunk):
|
160 |
inp = chunk
|
161 |
+
df = pd.DataFrame(literal_eval(str(json.dumps(repair_json(tablex_chain.run(inp)[0]))).replace("\'", "\"")), index=[0]).fillna('')
|
162 |
chunkdf.append(df)
|
163 |
|
164 |
concat = pd.concat(chunkdf, axis=0).reset_index().drop('index', axis=1).fillna('')
|