ZongqianLi commited on
Commit
18a300b
·
verified ·
1 Parent(s): c4acede

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -119,13 +119,15 @@ if st.button('Extract the property'):
119
  st.markdown('## 🖥️ QA Dataset Auto Generation', unsafe_allow_html=True)
120
  st.markdown('### Algorithm Input', unsafe_allow_html=True)
121
 
122
- st.markdown("###### Example of the data record in the ChemDataExtractor generated database: ", unsafe_allow_html=True)
123
- with open("./CDE_properties.jsonl", 'r') as file:
 
 
124
  for line in file:
125
- json_data = json.loads(line.strip())
126
- json_string = json.dumps(json_data, indent=4)
127
- st.text_area("", value=json_string, height=200)
128
- break
129
 
130
  st.markdown('###### Example of the paper collection: ', unsafe_allow_html=True)
131
  with open("./reference_paper.json",'r+', encoding = "utf-8") as f:
@@ -156,6 +158,4 @@ with open(file_path, 'r', encoding="utf-8") as file:
156
  json_string = json.dumps(json_list, indent=4)
157
  st.text_area("", value=json_string, height=200)
158
 
159
- st.write("To be updated")
160
-
161
 
 
119
  st.markdown('## 🖥️ QA Dataset Auto Generation', unsafe_allow_html=True)
120
  st.markdown('### Algorithm Input', unsafe_allow_html=True)
121
 
122
+ st.markdown("###### Example of the ChemDataExtractor generated database: ", unsafe_allow_html=True)
123
+ file_path = "./CDE_properties.jsonl"
124
+ json_list = []
125
+ with open(file_path, 'r', encoding="utf-8") as file:
126
  for line in file:
127
+ json_dict = json.loads(line.strip())
128
+ json_list.append(json_dict)
129
+ json_string = json.dumps(json_list, indent=4)
130
+ st.text_area("", value=json_string, height=200)
131
 
132
  st.markdown('###### Example of the paper collection: ', unsafe_allow_html=True)
133
  with open("./reference_paper.json",'r+', encoding = "utf-8") as f:
 
158
  json_string = json.dumps(json_list, indent=4)
159
  st.text_area("", value=json_string, height=200)
160
 
 
 
161