com3dian commited on
Commit
f30dea9
·
1 Parent(s): 6245d98

fix filename

Browse files
Files changed (1) hide show
  1. app.py +3 -16
app.py CHANGED
@@ -26,26 +26,13 @@ if uploaded_file is not None:
26
  client.process("processFulltextDocument",
27
  "./uploads/",
28
  n=20)
29
- folder_path = './uploads/'
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(folder_path + file)
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(saved_file_path)
 
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)