From 3331e26ce848aa2732cd38cded65c921aa5416de Mon Sep 17 00:00:00 2001 From: anonymousdouble <112695649+anonymousdouble@users.noreply.github.com> Date: Tue, 19 Dec 2023 16:36:13 +1100 Subject: [PATCH] Update evaluate.py refactor with chain constant value assignment to make code more Pythonic, concise and efficient. --- code/evaluate.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/evaluate.py b/code/evaluate.py index 779519d..9f225dd 100644 --- a/code/evaluate.py +++ b/code/evaluate.py @@ -15,8 +15,7 @@ def get_index_bio_dict(): index_bio={} for k in bio_dict: index_bio[bio_dict[k]]=k - index_bio[3]='O' - index_bio[4] = 'O' + index_bio[4] = index_bio[3]='O' return index_bio def get_entity(lable,index_bio): lable = [index_bio[i] for i in lable] @@ -161,4 +160,4 @@ def link_eval(y_ture,y_pred): if __name__ == '__main__': # link_eval('data/dev.json', 'data/tem_result.json') - pass \ No newline at end of file + pass