Spaces:
Runtime error
Runtime error
AmitGarage
commited on
Commit
•
8534b20
1
Parent(s):
246ed34
Update app.py
Browse files
app.py
CHANGED
@@ -8,13 +8,33 @@ from scripts.torch_ner_pipe import make_torch_entity_recognizer
|
|
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 |
models = "training_trf/model-best"
|
12 |
-
|
13 |
models = [name.strip() for name in models.split(",")]
|
14 |
labels = ["person", "problem", "pronoun", "test", "treatment"]
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
18 |
|
19 |
|
20 |
if __name__ == "__main__":
|
|
|
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__":
|