Spaces:
Running
Running
HF test revert lang = qanastek
Browse files- modules/utils.py +3 -3
modules/utils.py
CHANGED
@@ -202,8 +202,8 @@ def process_data(uploaded_file, sens_level):
|
|
202 |
df['SECTOR1'] = [item['SECTOR1'] for item in sectors_dict]
|
203 |
df['SECTOR2'] = [item['SECTOR2'] for item in sectors_dict]
|
204 |
elif model_name == 'LANG':
|
205 |
-
|
206 |
-
df[model_name] = predict_category(df, model_name, progress_bar, repo='xlm-roberta-base-language-detection', profile='papluca')
|
207 |
|
208 |
logger.info(f"Completed: {model_name}")
|
209 |
model_progress.empty()
|
@@ -265,7 +265,7 @@ def process_data(uploaded_file, sens_level):
|
|
265 |
# labelling logic
|
266 |
df['pred_action'] = df.apply(lambda x:
|
267 |
'INELIGIBLE' if (('concept_count' in df.columns and x['concept_count'] > 6) or
|
268 |
-
x['LANG'] != 'en' or
|
269 |
x['ADAPMIT'] == 'Adaptation' or
|
270 |
not any(sector in [x['SECTOR1'], x['SECTOR2']] for sector in sector_classes) or
|
271 |
x['word_length_check'] == True)
|
|
|
202 |
df['SECTOR1'] = [item['SECTOR1'] for item in sectors_dict]
|
203 |
df['SECTOR2'] = [item['SECTOR2'] for item in sectors_dict]
|
204 |
elif model_name == 'LANG':
|
205 |
+
df[model_name] = predict_category(df, model_name, progress_bar, repo='51-languages-classifier', profile='qanastek')
|
206 |
+
# df[model_name] = predict_category(df, model_name, progress_bar, repo='xlm-roberta-base-language-detection', profile='papluca')
|
207 |
|
208 |
logger.info(f"Completed: {model_name}")
|
209 |
model_progress.empty()
|
|
|
265 |
# labelling logic
|
266 |
df['pred_action'] = df.apply(lambda x:
|
267 |
'INELIGIBLE' if (('concept_count' in df.columns and x['concept_count'] > 6) or
|
268 |
+
x['LANG'][0:2] != 'en' or
|
269 |
x['ADAPMIT'] == 'Adaptation' or
|
270 |
not any(sector in [x['SECTOR1'], x['SECTOR2']] for sector in sector_classes) or
|
271 |
x['word_length_check'] == True)
|