Update BertForJointParsing.py
Browse files- BertForJointParsing.py +4 -0
BertForJointParsing.py
CHANGED
@@ -458,6 +458,10 @@ def convert_output_to_ud(output_sentences, model_cfg, style: Literal['htb', 'iah
|
|
458 |
# for HTB, if the function is poss, then add a shel pointing to the next word
|
459 |
if func == 'nmod:poss' and s_lex != '砖诇':
|
460 |
intermediate_output.append(dict(word='_砖诇_', lex='砖诇', pos='ADP', dep=len(intermediate_output) + 2, func='case', feats='_', absolute_dep=True))
|
|
|
|
|
|
|
|
|
461 |
# add the main suffix in
|
462 |
intermediate_output.append(dict(word=suf, lex='讛讜讗', pos='PRON', dep=dep, func=func, feats='|'.join(f'{k}={v}' for k,v in word['morph']['suffix_feats'].items())))
|
463 |
if entry_to_assign_suf_dep:
|
|
|
458 |
# for HTB, if the function is poss, then add a shel pointing to the next word
|
459 |
if func == 'nmod:poss' and s_lex != '砖诇':
|
460 |
intermediate_output.append(dict(word='_砖诇_', lex='砖诇', pos='ADP', dep=len(intermediate_output) + 2, func='case', feats='_', absolute_dep=True))
|
461 |
+
# if the function is obj, then add a 讗转 pointing to the next word
|
462 |
+
elif func == 'obj' and s_lex != '讗转':
|
463 |
+
intermediate_output.append(dict(word='_讗转_', lex='讗转', pos='ADP', dep=len(intermediate_output) + 2, func='case', feats='_', absolute_dep=True))
|
464 |
+
|
465 |
# add the main suffix in
|
466 |
intermediate_output.append(dict(word=suf, lex='讛讜讗', pos='PRON', dep=dep, func=func, feats='|'.join(f'{k}={v}' for k,v in word['morph']['suffix_feats'].items())))
|
467 |
if entry_to_assign_suf_dep:
|