AndySAnker commited on
Commit
9184a71
1 Parent(s): 4d9329e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -13
app.py CHANGED
@@ -2,7 +2,7 @@ from sklearn.preprocessing import OrdinalEncoder
2
  import xgboost as xgb
3
  import numpy as np
4
  import matplotlib.pyplot as plt
5
- import argparse, h5py, os, re, pkg_resources
6
  import streamlit as st
7
 
8
  def get_POMFinder():
@@ -79,19 +79,17 @@ def POMPredicter(POMFinder, Gr, y_onehotenc_cat):
79
  res = sorted(range(len(y_pred_proba)), key = lambda sub: y_pred_proba[sub]);
80
  res.reverse();
81
  st.markdown(f'<span style="font-size: 24px; color: green;">The 1st guess from the model is: <b>{str(y_onehotenc_cat.categories_[0][res[0]])[2:-2]+"cale.xyz"}</b></span> <hr/>',unsafe_allow_html=True,)
82
- #st.write("The 1st guess from the model is: ", str(y_onehotenc_cat.categories_[0][res[0]])[2:-2]+"cale.xyz")
83
- st.write("The 2nd guess from the model is: ", str(y_onehotenc_cat.categories_[0][res[1]])[2:-2]+"cale.xyz")
84
- st.write("The 3rd guess from the model is: ", str(y_onehotenc_cat.categories_[0][res[2]])[2:-2]+"cale.xyz")
85
- st.write("The 4th guess from the model is: ", str(y_onehotenc_cat.categories_[0][res[3]])[2:-2]+"cale.xyz")
86
- st.write("The 5th guess from the model is: ", str(y_onehotenc_cat.categories_[0][res[4]])[2:-2]+"cale.xyz")
87
 
88
  return res, y_pred_proba
89
 
90
 
91
  st.title('POMFinder')
92
-
93
- st.write('Welcome to DeepStruc that is a Deep Generative Model which has been trained to solve a mono-metallic structure (<200 atoms) based on a PDF!')
94
- st.write('Upload a PDF to use DeepStruc to predict the structure.')
95
 
96
  # Define the file upload widget
97
  pdf_file = st.file_uploader("Upload PDF file in .gr format", type=["gr"])
@@ -100,7 +98,7 @@ pdf_file = st.file_uploader("Upload PDF file in .gr format", type=["gr"])
100
  Qmin = st.number_input("Qmin value of the experimental PDF", min_value=0.0, max_value=2.0, value=0.7)
101
  Qmax = st.number_input("Qmax value of the experimental PDF", min_value=15.0, max_value=40.0, value=30.0)
102
  Qdamp = st.number_input("Qdamp value of the experimental PDF", min_value=0.00, max_value=0.08, value=0.04)
103
- nyquist = st.checkbox("Is the data nyquist sampled", value=True)
104
 
105
  parser = argparse.ArgumentParser(prog='POMFinder', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
106
  args = parser.parse_args()
@@ -129,10 +127,9 @@ else:
129
 
130
  st.subheader('Cite')
131
 
132
- st.write('If you use DeepStruc, our code or results, please consider citing our papers. Thanks in advance!')
133
 
134
- st.write('DeepStruc: Towards structure solution from pair distribution function data using deep generative models **2023** (https://pubs.rsc.org/en/content/articlehtml/2022/dd/d2dd00086e)')
135
- st.write('Characterising the atomic structure of mono-metallic nanoparticles from x-ray scattering data using conditional generative models **2020** (https://par.nsf.gov/biblio/10300745)')
136
 
137
  st.subheader('LICENSE')
138
 
 
2
  import xgboost as xgb
3
  import numpy as np
4
  import matplotlib.pyplot as plt
5
+ import argparse, h5py, os, re
6
  import streamlit as st
7
 
8
  def get_POMFinder():
 
79
  res = sorted(range(len(y_pred_proba)), key = lambda sub: y_pred_proba[sub]);
80
  res.reverse();
81
  st.markdown(f'<span style="font-size: 24px; color: green;">The 1st guess from the model is: <b>{str(y_onehotenc_cat.categories_[0][res[0]])[2:-2]+"cale.xyz"}</b></span> <hr/>',unsafe_allow_html=True,)
82
+ st.markdown(f'<span style="font-size: 24px; color: green;">The 2nd guess from the model is: <b>{str(y_onehotenc_cat.categories_[0][res[1]])[2:-2]+"cale.xyz"}</b></span> <hr/>',unsafe_allow_html=True,)
83
+ st.markdown(f'<span style="font-size: 24px; color: green;">The 3rd guess from the model is: <b>{str(y_onehotenc_cat.categories_[0][res[2]])[2:-2]+"cale.xyz"}</b></span> <hr/>',unsafe_allow_html=True,)
84
+ st.markdown(f'<span style="font-size: 24px; color: green;">The 4th guess from the model is: <b>{str(y_onehotenc_cat.categories_[0][res[3]])[2:-2]+"cale.xyz"}</b></span> <hr/>',unsafe_allow_html=True,)
85
+ st.markdown(f'<span style="font-size: 24px; color: green;">The 5th guess from the model is: <b>{str(y_onehotenc_cat.categories_[0][res[4]])[2:-2]+"cale.xyz"}</b></span> <hr/>',unsafe_allow_html=True,)
 
86
 
87
  return res, y_pred_proba
88
 
89
 
90
  st.title('POMFinder')
91
+ st.write('Welcome to POMFinder which is a tree-based supervised learning algorithm that can predict the polyoxometalate cluster from a Pair Distribution Function.
92
+ st.write('Upload a PDF to use POMFinder to predict the structure.')
 
93
 
94
  # Define the file upload widget
95
  pdf_file = st.file_uploader("Upload PDF file in .gr format", type=["gr"])
 
98
  Qmin = st.number_input("Qmin value of the experimental PDF", min_value=0.0, max_value=2.0, value=0.7)
99
  Qmax = st.number_input("Qmax value of the experimental PDF", min_value=15.0, max_value=40.0, value=30.0)
100
  Qdamp = st.number_input("Qdamp value of the experimental PDF", min_value=0.00, max_value=0.08, value=0.04)
101
+ nyquist = st.checkbox("Is the data nyquist sampled", value=False)
102
 
103
  parser = argparse.ArgumentParser(prog='POMFinder', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
104
  args = parser.parse_args()
 
127
 
128
  st.subheader('Cite')
129
 
130
+ st.write('If you use POMFinder, our code or results, please consider citing our paper. Thanks in advance!')
131
 
132
+ st.write('Title **2023** (Link)')
 
133
 
134
  st.subheader('LICENSE')
135