AmitGarage commited on
Commit
e1e950a
1 Parent(s): 8534b20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -22
app.py CHANGED
@@ -7,34 +7,25 @@ from scripts.torch_ner_pipe import make_torch_entity_recognizer
7
 
8
  def main(models: str = None, default_text: str = None):
9
  st.title('NER Predictor')
10
- st.header('Enter the characteristics of the diamond:')
11
-
12
- carat = st.number_input('Carat Weight:', min_value=0.1, max_value=10.0, value=1.0)
13
-
14
- cut = st.selectbox('Cut Rating:', ['Fair', 'Good', 'Very Good', 'Premium', 'Ideal'])
15
-
16
- color = st.selectbox('Color Rating:', ['J', 'I', 'H', 'G', 'F', 'E', 'D'])
17
-
18
- clarity = st.selectbox('Clarity Rating:', ['I1', 'SI2', 'SI1', 'VS2', 'VS1', 'VVS2', 'VVS1', 'IF'])
19
-
20
- depth = st.number_input('Diamond Depth Percentage:', min_value=0.1, max_value=100.0, value=1.0)
21
-
22
- table = st.number_input('Diamond Table Percentage:', min_value=0.1, max_value=100.0, value=1.0)
23
-
24
- x = st.number_input('Diamond Length (X) in mm:', min_value=0.1, max_value=100.0, value=1.0)
25
-
26
- y = st.number_input('Diamond Width (Y) in mm:', min_value=0.1, max_value=100.0, value=1.0)
27
-
28
- z = st.number_input('Diamond Height (Z) in mm:', min_value=0.1, max_value=100.0, value=1.0)
29
 
30
  models = "training_trf/model-best"
31
  default_text = "The patient had surgery."
32
  models = [name.strip() for name in models.split(",")]
33
  labels = ["person", "problem", "pronoun", "test", "treatment"]
34
 
35
- if st.button('Predict Price'):
36
- st.success(f'The predicted price of the diamond is USD')
37
- spacy_streamlit.visualize(models, default_text, visualizers=["ner"], ner_labels=labels)
38
 
39
 
40
  if __name__ == "__main__":
 
7
 
8
  def main(models: str = None, default_text: str = None):
9
  st.title('NER Predictor')
10
+ #st.header('Enter the characteristics of the diamond:')
11
+ #carat = st.number_input('Carat Weight:', min_value=0.1, max_value=10.0, value=1.0)
12
+ #cut = st.selectbox('Cut Rating:', ['Fair', 'Good', 'Very Good', 'Premium', 'Ideal'])
13
+ #color = st.selectbox('Color Rating:', ['J', 'I', 'H', 'G', 'F', 'E', 'D'])
14
+ #clarity = st.selectbox('Clarity Rating:', ['I1', 'SI2', 'SI1', 'VS2', 'VS1', 'VVS2', 'VVS1', 'IF'])
15
+ #depth = st.number_input('Diamond Depth Percentage:', min_value=0.1, max_value=100.0, value=1.0)
16
+ #table = st.number_input('Diamond Table Percentage:', min_value=0.1, max_value=100.0, value=1.0)
17
+ #x = st.number_input('Diamond Length (X) in mm:', min_value=0.1, max_value=100.0, value=1.0)
18
+ #y = st.number_input('Diamond Width (Y) in mm:', min_value=0.1, max_value=100.0, value=1.0)
19
+ #z = st.number_input('Diamond Height (Z) in mm:', min_value=0.1, max_value=100.0, value=1.0)
 
 
 
 
 
 
 
 
 
20
 
21
  models = "training_trf/model-best"
22
  default_text = "The patient had surgery."
23
  models = [name.strip() for name in models.split(",")]
24
  labels = ["person", "problem", "pronoun", "test", "treatment"]
25
 
26
+ #if st.button('Predict Price'):
27
+ # st.success(f'The predicted price of the diamond is USD')
28
+ spacy_streamlit.visualize(models, default_text, visualizers=["ner"], ner_labels=labels)
29
 
30
 
31
  if __name__ == "__main__":