idiomify / explore /explore_list_index.py
eubinecto's picture
[#5] literal2idiomatic:d-1-3 done (annotating with special tokens). Some of the data however are erroneous
fca50f9
raw
history blame
289 Bytes
def main():
labels = ["O", "O", "B", "O", "I", "I" "O", "I", "O", "O"]
boi_idx = labels.index("B")
eoi_idx = -1 * (list(reversed(labels)).index("I") + 1)
print(boi_idx, eoi_idx)
print(labels[boi_idx])
print(labels[eoi_idx])
if __name__ == '__main__':
main()