Skip to content

Commit

Permalink
Bug fix uie utils (PaddlePaddle#3490)
Browse files Browse the repository at this point in the history
* fix bug the result variable is not defined

* update
  • Loading branch information
westfish authored Oct 17, 2022
1 parent 217a25c commit db915e7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions model_zoo/uie/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,16 @@ def reader(data_path, max_seq_len=512):
if len(content) <= max_content_len:
yield json_line
else:
if result['end'] - result['start'] > max_content_len:
logger.warn(
"result['end '] - result ['start'] exceeds max_content_len, which will result in no valid instance being returned"
)
result_list = json_line['result_list']
json_lines = []
accumulate = 0
while True:
cur_result_list = []

for result in result_list:
if result['end'] - result['start'] > max_content_len:
logger.warning(
"result['end'] - result ['start'] exceeds max_content_len, which will result in no valid instance being returned"
)
if result['start'] + 1 <= max_content_len < result[
'end'] and result['end'] - result[
'start'] <= max_content_len:
Expand Down

0 comments on commit db915e7

Please sign in to comment.