TymaaHammouda commited on
Commit
a9d4261
·
1 Parent(s): 10cf1a1

Update entity names

Browse files
Files changed (1) hide show
  1. IBO_to_XML.py +4 -4
IBO_to_XML.py CHANGED
@@ -93,7 +93,7 @@ def sortTags(entities):
93
  for word in tags:
94
  if tag.split("-")[1] in word:
95
  counter_of_this_tag+=1
96
- for word in temp_entities[temp_counter-1][1].split():
97
  if tag.split("-")[1] in word:
98
  counter_of_previous_tag+=1
99
  # if the counter of previous tag is bigger than counter of this tag, then we
@@ -107,7 +107,7 @@ def sortTags(entities):
107
  # If the counter is not 0 then we can complete
108
  if temp_counter != 0:
109
  this_tags = tags
110
- previous_tags = temp_entities[temp_counter - 1][1].split()
111
  sorted_tags = list()
112
 
113
  # Check if the this tag is not O and previous tags is not O, then will complete,
@@ -130,6 +130,6 @@ def sortTags(entities):
130
  str_tag = " "
131
  str_tag = str_tag.join(tags)
132
  str_tag = str_tag.strip()
133
- temp_entities[temp_counter][1] = str_tag
134
  temp_counter += 1
135
- return temp_entities
 
93
  for word in tags:
94
  if tag.split("-")[1] in word:
95
  counter_of_this_tag+=1
96
+ for word in entity[temp_counter-1][1].split():
97
  if tag.split("-")[1] in word:
98
  counter_of_previous_tag+=1
99
  # if the counter of previous tag is bigger than counter of this tag, then we
 
107
  # If the counter is not 0 then we can complete
108
  if temp_counter != 0:
109
  this_tags = tags
110
+ previous_tags = entity[temp_counter - 1][1].split()
111
  sorted_tags = list()
112
 
113
  # Check if the this tag is not O and previous tags is not O, then will complete,
 
130
  str_tag = " "
131
  str_tag = str_tag.join(tags)
132
  str_tag = str_tag.strip()
133
+ entity[temp_counter][1] = str_tag
134
  temp_counter += 1
135
+ return entity