Spaces:
Sleeping
Sleeping
Update appStore/classifier.py
Browse files- appStore/classifier.py +9 -9
appStore/classifier.py
CHANGED
@@ -11,7 +11,7 @@ from setfit import SetFitModel
|
|
11 |
from utils.groups_classifier import load_groupsClassifier, groups_classification
|
12 |
#import logging
|
13 |
#logger = logging.getLogger(__name__)
|
14 |
-
|
15 |
#from utils.preprocessing import paraLengthCheck
|
16 |
#from io import BytesIO
|
17 |
#import xlsxwriter
|
@@ -20,19 +20,19 @@ from utils.groups_classifier import load_groupsClassifier, groups_classification
|
|
20 |
vg_model = SetFitModel.from_pretrained("leavoigt/vulnerable_groups")
|
21 |
|
22 |
|
23 |
-
#
|
24 |
classifier_identifier = 'group_classification'
|
25 |
params = get_classifier_params(classifier_identifier)
|
26 |
|
27 |
-
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
|
35 |
-
|
36 |
# if 'key1' in st.session_state:
|
37 |
# df = st.session_state.key1
|
38 |
|
|
|
11 |
from utils.groups_classifier import load_groupsClassifier, groups_classification
|
12 |
#import logging
|
13 |
#logger = logging.getLogger(__name__)
|
14 |
+
from utils.config import get_classifier_params
|
15 |
#from utils.preprocessing import paraLengthCheck
|
16 |
#from io import BytesIO
|
17 |
#import xlsxwriter
|
|
|
20 |
vg_model = SetFitModel.from_pretrained("leavoigt/vulnerable_groups")
|
21 |
|
22 |
|
23 |
+
# Retrieve the necessary paramaters
|
24 |
classifier_identifier = 'group_classification'
|
25 |
params = get_classifier_params(classifier_identifier)
|
26 |
|
27 |
+
def app():
|
28 |
|
29 |
+
### Main app code ###
|
30 |
+
with st.container():
|
31 |
+
|
32 |
+
# Classify groups
|
33 |
+
df = group_classification(haystack_doc=df, threshold= params['threshold'])
|
34 |
|
35 |
+
def groups_display():
|
36 |
# if 'key1' in st.session_state:
|
37 |
# df = st.session_state.key1
|
38 |
|