Spaces:
Paused
Paused
update UI
Browse files
app.py
CHANGED
|
@@ -16,10 +16,15 @@ st.title('Paper2Slides')
|
|
| 16 |
|
| 17 |
st.subheader('Upload paper in pdf format')
|
| 18 |
uploaded_file = st.file_uploader("Choose a file")
|
|
|
|
| 19 |
if uploaded_file is not None:
|
| 20 |
st.write(uploaded_file.name)
|
| 21 |
bytes_data = uploaded_file.getvalue()
|
| 22 |
st.write(len(bytes_data), "bytes")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
saved_file_path = save_uploaded_file(uploaded_file)
|
| 24 |
|
| 25 |
client = GrobidClient(config_path="./grobidconfig.json")
|
|
@@ -29,7 +34,7 @@ if uploaded_file is not None:
|
|
| 29 |
tei_coordinates=True)
|
| 30 |
|
| 31 |
output_file_path = os.path.splitext(saved_file_path)[0] + ".grobid.tei.xml"
|
| 32 |
-
monkeyReader = reader.MonkeyReader(
|
| 33 |
outline = monkeyReader.readOutline(output_file_path)
|
| 34 |
for pre, fill, node in outline:
|
| 35 |
st.write("%s%s" % (pre, node.name))
|
|
|
|
| 16 |
|
| 17 |
st.subheader('Upload paper in pdf format')
|
| 18 |
uploaded_file = st.file_uploader("Choose a file")
|
| 19 |
+
|
| 20 |
if uploaded_file is not None:
|
| 21 |
st.write(uploaded_file.name)
|
| 22 |
bytes_data = uploaded_file.getvalue()
|
| 23 |
st.write(len(bytes_data), "bytes")
|
| 24 |
+
option = st.selectbox(
|
| 25 |
+
'Please select one of the parsing method.',
|
| 26 |
+
('monkey', 'x2d', 'lxml'))
|
| 27 |
+
|
| 28 |
saved_file_path = save_uploaded_file(uploaded_file)
|
| 29 |
|
| 30 |
client = GrobidClient(config_path="./grobidconfig.json")
|
|
|
|
| 34 |
tei_coordinates=True)
|
| 35 |
|
| 36 |
output_file_path = os.path.splitext(saved_file_path)[0] + ".grobid.tei.xml"
|
| 37 |
+
monkeyReader = reader.MonkeyReader(option)
|
| 38 |
outline = monkeyReader.readOutline(output_file_path)
|
| 39 |
for pre, fill, node in outline:
|
| 40 |
st.write("%s%s" % (pre, node.name))
|