ZongqianLi commited on
Commit
d2c74ff
·
verified ·
1 Parent(s): 8d650c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -3
app.py CHANGED
@@ -19,14 +19,27 @@ paper_lst = ["./reference_paper.json"]
19
 
20
  st.session_state['cde'] = "./CDE_properties.jsonl"
21
  st.session_state['cde'] = st.selectbox("ChemDataExtractor generated database path:", cde_lst)
22
- st.write("Example of the ChemDataExtractor generated database: ")
23
  with open(st.session_state['cde'], 'r') as file:
24
  for line in file:
25
  json_data = json.loads(line.strip())
26
  json_string = json.dumps(json_data, indent=4)
27
- st.text_area("", value=json_string, height=100)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- paper = st.selectbox("Paper collection path:", paper_lst)
30
 
31
  databases = []
32
  with open(args.databases_location,'r+', encoding = "utf-8") as f:
 
19
 
20
  st.session_state['cde'] = "./CDE_properties.jsonl"
21
  st.session_state['cde'] = st.selectbox("ChemDataExtractor generated database path:", cde_lst)
22
+ st.write("Example of the data record in the ChemDataExtractor generated database: ")
23
  with open(st.session_state['cde'], 'r') as file:
24
  for line in file:
25
  json_data = json.loads(line.strip())
26
  json_string = json.dumps(json_data, indent=4)
27
+ st.text_area("", value=json_string, height=200)
28
+ break
29
+
30
+ st.session_state['paper'] = "./reference_paper.json"
31
+ st.session_state['paper'] = st.selectbox("Paper collection path:", paper_lst)
32
+ st.write("Example of the paper in collection: ")
33
+ with open(st.session_state['paper'],'r+', encoding = "utf-8") as f:
34
+ string = f.read()
35
+ extractions = json.loads(string)
36
+ for extraction in extractions:
37
+ json_data = json.loads(extraction .strip())
38
+ json_string = json.dumps(json_data, indent=4)
39
+ st.text_area("", value=json_string, height=200)
40
+ break
41
+
42
 
 
43
 
44
  databases = []
45
  with open(args.databases_location,'r+', encoding = "utf-8") as f: