Spaces:
Sleeping
Sleeping
Varun Wadhwa
commited on
Logs
Browse files
app.py
CHANGED
|
@@ -86,10 +86,7 @@ def align_labels_with_tokens(label, word_ids):
|
|
| 86 |
aligned_label_ids.append(-100)
|
| 87 |
elif word_idx != previous_word_idx: # Only label the first token of a given word.
|
| 88 |
if label[word_idx].startswith("B-"):
|
| 89 |
-
print("B vs I")
|
| 90 |
-
print(label2id[label[word_idx]])
|
| 91 |
label[word_idx] = label[word_idx].replace("B-", "I-")
|
| 92 |
-
print(label2id[label[word_idx]])
|
| 93 |
aligned_label_ids.append(label2id[label[word_idx]])
|
| 94 |
else:
|
| 95 |
aligned_label_ids.append(-100)
|
|
|
|
| 86 |
aligned_label_ids.append(-100)
|
| 87 |
elif word_idx != previous_word_idx: # Only label the first token of a given word.
|
| 88 |
if label[word_idx].startswith("B-"):
|
|
|
|
|
|
|
| 89 |
label[word_idx] = label[word_idx].replace("B-", "I-")
|
|
|
|
| 90 |
aligned_label_ids.append(label2id[label[word_idx]])
|
| 91 |
else:
|
| 92 |
aligned_label_ids.append(-100)
|