def tag_sent(chunks, args):
	tagged_sent = []
	global_index = 0
	for chunk in chunks:
		if type(chunk) is Tree:
			tokens = chunk.leaves()
		else:
			tokens = [chunk]
			chunk_label = 'O'
		for c in range(global_index, global_index + len(tokens)):
			info_label = 'O'
			local_index = c - global_index
			word = tokens[local_index][0]
			tag = tokens[local_index][1]
			if type(chunk) is Tree and local_index == 0:
				chunk_label = 'B-' + chunk.label()
			elif type(chunk) is Tree:
				chunk_label = 'I-' + chunk.label()
			for arg1 in args[0]:
				if c in arg1:
					if c == arg1[0]:
						info_label = 'B-Arg1'
					else:
						info_label = 'I-Arg1'
			for arg2 in args[1]:
				if info_label == 'O' and c in arg2:
					if c == arg2[0]:
						info_label = 'B-Arg2'
					else:
						info_label = 'I-Arg2'
			for rel in args[2]:
				if info_label == 'O' and c in rel:
					if c == rel[0]:
						info_label = 'B-Rel'
					else:
						info_label = 'I-Rel'
			tagged_sent.append((word, tag, chunk_label, info_label))
		global_index += len(tokens)
	return tagged_sent
dataset/ETHPy150Open sobhe/baaz/200DadeganSents.py/tag_sent/original