Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ import sys
|
|
12 |
import os
|
13 |
import gradio as gr
|
14 |
|
15 |
-
model = load_model('ISCO-Coder-
|
16 |
|
17 |
bert_layer = hub.KerasLayer("https://kaggle.com/models/tensorflow/bert/TensorFlow2/en-uncased-l-12-h-768-a-12/1",trainable=True)
|
18 |
|
@@ -23,10 +23,12 @@ tokenizer = tokenization.FullTokenizer(vocab_file,do_lower_case)
|
|
23 |
# Parameters
|
24 |
max_seq_length = 128
|
25 |
dummy_label = 100
|
26 |
-
label_list = list(pd.read_excel('
|
27 |
|
28 |
map_data = pd.read_excel("ISCO-08 EN Structure and definitions.xlsx")
|
29 |
|
|
|
|
|
30 |
# Define a function to preprocess the new data
|
31 |
def get_feature_new(text, max_seq_length, tokenizer, dummy_label):
|
32 |
example = classifier_data_lib.InputExample(guid=None,
|
@@ -62,7 +64,7 @@ def preprocess_new_data(texts):
|
|
62 |
return dataset
|
63 |
def launch(text_input):
|
64 |
# Load the label encoder
|
65 |
-
label_encoder = joblib.load('
|
66 |
|
67 |
# Preprocess the new data
|
68 |
try:
|
|
|
12 |
import os
|
13 |
import gradio as gr
|
14 |
|
15 |
+
model = load_model('ISCO-Coder-BERTV2.h5', custom_objects={'KerasLayer': hub.KerasLayer})
|
16 |
|
17 |
bert_layer = hub.KerasLayer("https://kaggle.com/models/tensorflow/bert/TensorFlow2/en-uncased-l-12-h-768-a-12/1",trainable=True)
|
18 |
|
|
|
23 |
# Parameters
|
24 |
max_seq_length = 128
|
25 |
dummy_label = 100
|
26 |
+
label_list = list(pd.read_excel('label_listV2.xlsx')['label_list'])
|
27 |
|
28 |
map_data = pd.read_excel("ISCO-08 EN Structure and definitions.xlsx")
|
29 |
|
30 |
+
label_encoder = joblib.load('label_encoderV2.joblib')
|
31 |
+
|
32 |
# Define a function to preprocess the new data
|
33 |
def get_feature_new(text, max_seq_length, tokenizer, dummy_label):
|
34 |
example = classifier_data_lib.InputExample(guid=None,
|
|
|
64 |
return dataset
|
65 |
def launch(text_input):
|
66 |
# Load the label encoder
|
67 |
+
#label_encoder = joblib.load('label_encoderV2.joblib')
|
68 |
|
69 |
# Preprocess the new data
|
70 |
try:
|