Spaces:
Build error
Build error
Commit
·
86ce30b
1
Parent(s):
42065ef
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def predict_label(text):
|
|
18 |
ensemble_span_scores = [score for scores in [span_scores, msa_span_scores] for score in scores]
|
19 |
ensemble_pooled_scores = pool_span_scores(ensemble_span_scores, ip_len)
|
20 |
ensemble_pred_tags = [entities_from_token_classes(sent_targs) for sent_targs in ensemble_pooled_scores]
|
21 |
-
|
22 |
ent_scores = extract_ent_scores(entity_model,ip,ensemble_pred_tags, pos_col=1, task_col=2)
|
23 |
combined_sequences, ent_pred_tags = pool_ent_scores(ent_scores, ip_len)
|
24 |
|
@@ -48,6 +48,6 @@ if __name__ == '__main__':
|
|
48 |
span_model = SpanNet.load_model(span_path)
|
49 |
msa_span_model = SpanNet.load_model(msa_span_path)
|
50 |
entity_model = EntNet.load_model(entity_path)
|
51 |
-
|
52 |
iface = gr.Interface(fn=predict_label, inputs="text", outputs="text")
|
53 |
iface.launch(show_api=False)
|
|
|
18 |
ensemble_span_scores = [score for scores in [span_scores, msa_span_scores] for score in scores]
|
19 |
ensemble_pooled_scores = pool_span_scores(ensemble_span_scores, ip_len)
|
20 |
ensemble_pred_tags = [entities_from_token_classes(sent_targs) for sent_targs in ensemble_pooled_scores]
|
21 |
+
print('ensemble_pred_tags: ', ensemble_pred_tags)
|
22 |
ent_scores = extract_ent_scores(entity_model,ip,ensemble_pred_tags, pos_col=1, task_col=2)
|
23 |
combined_sequences, ent_pred_tags = pool_ent_scores(ent_scores, ip_len)
|
24 |
|
|
|
48 |
span_model = SpanNet.load_model(span_path)
|
49 |
msa_span_model = SpanNet.load_model(msa_span_path)
|
50 |
entity_model = EntNet.load_model(entity_path)
|
51 |
+
iface= gr.base(primary_hue="green")
|
52 |
iface = gr.Interface(fn=predict_label, inputs="text", outputs="text")
|
53 |
iface.launch(show_api=False)
|