mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 01:04:34 +03:00
* Fix munge/read_ner
This commit is contained in:
parent
1515862861
commit
a8fc5f1285
|
@ -1,3 +1,4 @@
|
||||||
|
from __future__ import unicode_literals
|
||||||
import os
|
import os
|
||||||
from os import path
|
from os import path
|
||||||
import re
|
import re
|
||||||
|
@ -35,7 +36,6 @@ def parse(string, strip_bad_periods=False):
|
||||||
try:
|
try:
|
||||||
tag, open_tag = _get_tag(substr, open_tag)
|
tag, open_tag = _get_tag(substr, open_tag)
|
||||||
except:
|
except:
|
||||||
print string
|
|
||||||
raise
|
raise
|
||||||
tags.append(tag)
|
tags.append(tag)
|
||||||
return tokens, tags
|
return tokens, tags
|
||||||
|
@ -98,8 +98,7 @@ def tags_to_entities(tags):
|
||||||
entities.append((tag[2:], start, i))
|
entities.append((tag[2:], start, i))
|
||||||
start = None
|
start = None
|
||||||
else:
|
else:
|
||||||
print tags
|
raise Exception(tag)
|
||||||
raise StandardError(tag)
|
|
||||||
return entities
|
return entities
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user