connl2009 output for kres

This commit is contained in:
voje 2019-02-13 08:49:37 +01:00
parent 825f67a054
commit b3a39d74ef
8 changed files with 2219 additions and 11 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -301,7 +301,7 @@ class Msdmap():
category = pos[2]
attr = [self.pos_val_map(category, 1, m)
for m in msd[1:] if m != "-"]
return pos, attr
return (pos, attr)
if __name__ == "__main__":

File diff suppressed because it is too large Load Diff

View File

@ -122,30 +122,35 @@ def to_conll09(sentence_entry):
for token in sentence_entry["tokens"]:
if token[0] != "w":
continue
t_id = token[1]
msd = msdm.msd_from_slo(token[4])
fprd = fillpred("todo", "todo")
fprd = fillpred("TODO", "todo")
"""
print(t_id)
print("msd:")
print(msd)
print(token)
print(sentence_entry["links"])
t_id = token[1]
print(t_id)
"""
# 1 3 4 5 6 7 8 9 10 11 12 13 14
out_str += "{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\n".format(
t_id, # id
token[2], # form
token[3], # lemma
token[3], # plemma
"todo", # pos (TODO)
"todo", # ppos (TODO)
"todo", # feat (TODO)
"todo", # pfeat (TODO)
msd[0][3], # pos
msd[0][3], # ppos
"|".join([msd[0][2]] + [el[4] for el in msd[1]]), # feat
"|".join([msd[0][2]] + [el[4] for el in msd[1]]), # pfeat
sentence_entry["links"][t_id][2], # head
sentence_entry["links"][t_id][2], # phead
sentence_entry["links"][t_id][1], # deprel
sentence_entry["links"][t_id][1], # pdeprel
sentence_entry["links"][t_id][0], # deprel
sentence_entry["links"][t_id][0], # pdeprel
fprd, # fillpred
(token[3] if fprd == "Y" else "_"), # pred
"todo" # apredn...
)
out_str += "\n"
print(out_str)
return out_str