Browse Source
Merge pull request #264 from Gosicfly/master
出现非法格式catch住的时候,应该将sample清空
tags/v0.5.5
Yunfan Shao
GitHub
5 years ago
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
0 deletions
-
fastNLP/io/file_reader.py
|
|
@@ -117,6 +117,7 @@ def _read_conll(path, encoding='utf-8', indexes=None, dropna=True): |
|
|
|
except Exception as e: |
|
|
|
if dropna: |
|
|
|
logger.warning('Invalid instance which ends at line: {} has been dropped.'.format(line_idx)) |
|
|
|
sample = [] |
|
|
|
continue |
|
|
|
raise ValueError('Invalid instance which ends at line: {}'.format(line_idx)) |
|
|
|
elif line.startswith('#'): |
|
|
|