Spaces:
Sleeping
Sleeping
adding arguments to lmpredict()
Browse files
app.py
CHANGED
|
@@ -81,6 +81,9 @@ args = lm.get_args(pred_config)
|
|
| 81 |
device = lm.get_device(pred_config)
|
| 82 |
model = lm.load_model(pred_config, args, device)
|
| 83 |
|
|
|
|
|
|
|
|
|
|
| 84 |
# Convert input file to TensorDataset
|
| 85 |
pad_token_label_id = args.ignore_index
|
| 86 |
tokenizer = load_tokenizer(args)
|
|
@@ -115,7 +118,8 @@ def ner(text):
|
|
| 115 |
|
| 116 |
|
| 117 |
#################### IDSF #######################
|
| 118 |
-
prediction = lm.predict([fluency_sentence.strip().split()], pred_config, args, tokenizer, pad_token_label_id, model, device
|
|
|
|
| 119 |
words, slot_preds, intent_pred = prediction[0][0], prediction[1][0], prediction[2][0]
|
| 120 |
|
| 121 |
slot_tokens = []
|
|
|
|
| 81 |
device = lm.get_device(pred_config)
|
| 82 |
model = lm.load_model(pred_config, args, device)
|
| 83 |
|
| 84 |
+
intent_label_lst = get_intent_labels(args)
|
| 85 |
+
slot_label_lst = get_slot_labels(args)
|
| 86 |
+
|
| 87 |
# Convert input file to TensorDataset
|
| 88 |
pad_token_label_id = args.ignore_index
|
| 89 |
tokenizer = load_tokenizer(args)
|
|
|
|
| 118 |
|
| 119 |
|
| 120 |
#################### IDSF #######################
|
| 121 |
+
prediction = lm.predict([fluency_sentence.strip().split()], pred_config, args, tokenizer, pad_token_label_id, model, device,
|
| 122 |
+
intent_label_lst, slot_label_lst)
|
| 123 |
words, slot_preds, intent_pred = prediction[0][0], prediction[1][0], prediction[2][0]
|
| 124 |
|
| 125 |
slot_tokens = []
|