def read_tokens(self, path, is_infer=False):
with open(path, "r", encoding="utf-8") as f:
dom_tree = minidom.parse(f)
docs = dom_tree.documentElement.getElementsByTagName("DOC")
for doc in docs:
if is_infer:
// Input the error text
sentence = doc.getElementsByTagName("TEXT")[0]. \
childNodes[0].data.strip()
else:
// Input the correct text