This commit is contained in:
bwt09
2022-06-05 16:01:41 -07:00
parent 272ceeb28e
commit 694084a2a2

View File

@@ -54,6 +54,10 @@ class EntityTupleSearcher:
if cur_ent_idx == n_ents:
pred = [min(cur_logprobs), cur_ent_tuple]
# filter tuples with only very short entities
if sum([len(ent) for ent in cur_ent_tuple]) == 3 * n_ents:
return
for ent in cur_ent_tuple:
for word in ent.split():
if repeat_cnt.get(word, 0) + 1 > max_word_repeat: