connl2009 output for kres
This commit is contained in:
parent
825f67a054
commit
b3a39d74ef
BIN
tools/parser/__pycache__/__init__.cpython-35.pyc
Normal file
BIN
tools/parser/__pycache__/__init__.cpython-35.pyc
Normal file
Binary file not shown.
BIN
tools/parser/__pycache__/msdmap.cpython-35.pyc
Normal file
BIN
tools/parser/__pycache__/msdmap.cpython-35.pyc
Normal file
Binary file not shown.
BIN
tools/parser/__pycache__/parser.cpython-35.pyc
Normal file
BIN
tools/parser/__pycache__/parser.cpython-35.pyc
Normal file
Binary file not shown.
|
@ -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__":
|
||||
|
|
2203
tools/parser/msds_with_predicate.txt
Normal file
2203
tools/parser/msds_with_predicate.txt
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user