This commit is contained in:
voje
2019-02-19 08:07:03 +01:00
parent f251c912e3
commit 142ad22ba3
18 changed files with 10831 additions and 4931 deletions

View File

@@ -109,7 +109,7 @@ class Parser:
return res_dict
def to_conll_2009_SRL(self, sentence_entry):
def to_conll_2009_SRL(self, sentence_entry, napreds=100):
def fillpred(pos, feat):
if pos == "V" and "main" in feat.split("|"):
@@ -135,10 +135,10 @@ class Parser:
print(sentence_entry["links"])
"""
more_underscores = "".join(["\t_" for x in range(9)])
apreds = "".join(["\t_" for x in range(napreds)])
# 1 3 4 5 6 7 8 9 10 11 12 13 14 15 n
out_str += "{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}{}\r\n".format(
# format: 14 + apreds
out_str += "{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}{}\n".format(
t_id, # id
token[2], # form
token[3], # lemma
@@ -153,7 +153,7 @@ class Parser:
sentence_entry["links"][t_id][0], # pdeprel
"Y" if fprd else "_", # fillpred
token[3] if fprd else "_", # pred
more_underscores,
apreds,
)
out_str += "\n"
# print(out_str)