I have a file containing words, I want to read this file and add a label in front of all words. The label should be added on the right side of the words. eg. book - "O"
, Berlin - "O"
. How to do it in python? I have tried this code but not given my answer.
inp = open('Dari.pos', 'r')
out = open('DariNER.txt', 'w')
for line in iter(inp):
word= line.__add__("O")
out.write(word)
inp.close()
out.close()