This commit is contained in:
2019-02-27 16:58:04 +01:00
parent bcaf226b9e
commit 577c8418d2
10 changed files with 67 additions and 23 deletions

View File

@@ -114,7 +114,7 @@ class Parser:
return res_dict
def to_conll_2009_SRL(self, sentence_entry, napreds=9):
def to_conll_2009_SRL(self, sentence_entry):
def fillpred(tsv_row):
mrow = build_model_row(tsv_row)
@@ -122,8 +122,6 @@ class Parser:
y = self.fillpred_model.predict([x])
return y[0] # bool
apreds_string = '\t'.join(["_" for x in range(napreds)])
# works with kres, with parsed links
out_str = ""
for token in sentence_entry["tokens"]:
@@ -136,7 +134,7 @@ class Parser:
[t_id] +
[form for x in range(7)] +
["0", "0", "modra", "modra", "_", "_"] +
[apreds_string, "\n"]
["\n"]
)
continue
@@ -165,7 +163,6 @@ class Parser:
sentence_entry["links"][t_id][0], # pdeprel
"_", # fillpred
"_", # pred
apreds_string,
"\n",
]
fprd = fillpred(row_list)