Spaces:
Paused
Paused
fix filename
Browse files
app.py
CHANGED
|
@@ -26,26 +26,13 @@ if uploaded_file is not None:
|
|
| 26 |
client.process("processFulltextDocument",
|
| 27 |
"./uploads/",
|
| 28 |
n=20)
|
| 29 |
-
|
| 30 |
-
files = os.listdir(folder_path)
|
| 31 |
-
|
| 32 |
-
for file in files:
|
| 33 |
-
if not file.endswith('.pdf'):
|
| 34 |
-
st.write(f"The other file in the 'uploads' folder is: {file}")
|
| 35 |
-
break
|
| 36 |
-
|
| 37 |
-
st.download_button(
|
| 38 |
-
label="Download File",
|
| 39 |
-
data=file_content,
|
| 40 |
-
file_name=folder_path+file,
|
| 41 |
-
mime='text/plain'
|
| 42 |
-
)
|
| 43 |
|
| 44 |
monkeyReader = reader.MonkeyReader('monkey')
|
| 45 |
-
outline = monkeyReader.readOutline(
|
| 46 |
|
| 47 |
for pre, fill, node in outline:
|
| 48 |
st.write("%s%s" % (pre, node.name))
|
| 49 |
|
| 50 |
# read paper content
|
| 51 |
-
essay = monkeyReader.readEssay(
|
|
|
|
| 26 |
client.process("processFulltextDocument",
|
| 27 |
"./uploads/",
|
| 28 |
n=20)
|
| 29 |
+
output_file = os.path.splitext(file_path)[0] + ".grobid.tei.xml"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
monkeyReader = reader.MonkeyReader('monkey')
|
| 32 |
+
outline = monkeyReader.readOutline(output_file)
|
| 33 |
|
| 34 |
for pre, fill, node in outline:
|
| 35 |
st.write("%s%s" % (pre, node.name))
|
| 36 |
|
| 37 |
# read paper content
|
| 38 |
+
essay = monkeyReader.readEssay(output_file)
|