Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,6 @@ tokenizer = tokenization.FullTokenizer(vocab_file,do_lower_case)
|
|
| 37 |
|
| 38 |
# Parameters
|
| 39 |
max_seq_length = 128
|
| 40 |
-
label_list = 424
|
| 41 |
dummy_label = 100
|
| 42 |
|
| 43 |
|
|
@@ -89,9 +88,6 @@ def launch(input):
|
|
| 89 |
# Decode the predictions
|
| 90 |
predicted_classes = [label_list[np.argmax(pred)] for pred in predictions]
|
| 91 |
|
| 92 |
-
# Print the predicted classes
|
| 93 |
-
print(predicted_classes)
|
| 94 |
-
|
| 95 |
# Calculate the highest probabilities
|
| 96 |
highest_probabilities = [max(instance) for instance in predictions]
|
| 97 |
|
|
@@ -100,6 +96,8 @@ def launch(input):
|
|
| 100 |
|
| 101 |
print("Most likely ISCO code is {} and probability is {}".format(decoded_labels,highest_probabilities))
|
| 102 |
|
|
|
|
|
|
|
| 103 |
|
| 104 |
iface = gr.Interface(
|
| 105 |
fn=launch,
|
|
|
|
| 37 |
|
| 38 |
# Parameters
|
| 39 |
max_seq_length = 128
|
|
|
|
| 40 |
dummy_label = 100
|
| 41 |
|
| 42 |
|
|
|
|
| 88 |
# Decode the predictions
|
| 89 |
predicted_classes = [label_list[np.argmax(pred)] for pred in predictions]
|
| 90 |
|
|
|
|
|
|
|
|
|
|
| 91 |
# Calculate the highest probabilities
|
| 92 |
highest_probabilities = [max(instance) for instance in predictions]
|
| 93 |
|
|
|
|
| 96 |
|
| 97 |
print("Most likely ISCO code is {} and probability is {}".format(decoded_labels,highest_probabilities))
|
| 98 |
|
| 99 |
+
return [decoded_labels,highest_probabilities]
|
| 100 |
+
|
| 101 |
|
| 102 |
iface = gr.Interface(
|
| 103 |
fn=launch,
|