mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 02:36:32 +03:00
* Use greedy NER parser
This commit is contained in:
parent
0d943ab358
commit
ff8989b63c
|
@ -7,6 +7,7 @@ from .typedefs cimport hash_t
|
||||||
from .tokens cimport Tokens
|
from .tokens cimport Tokens
|
||||||
from .lexeme cimport Lexeme
|
from .lexeme cimport Lexeme
|
||||||
from .tagger cimport Tagger
|
from .tagger cimport Tagger
|
||||||
|
from .ner.greedy_parser cimport NERParser
|
||||||
from .utf8string cimport StringStore
|
from .utf8string cimport StringStore
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,7 +43,7 @@ cdef class Language:
|
||||||
cpdef readonly Lexicon lexicon
|
cpdef readonly Lexicon lexicon
|
||||||
|
|
||||||
cpdef readonly Tagger pos_tagger
|
cpdef readonly Tagger pos_tagger
|
||||||
cpdef readonly Tagger ner_tagger
|
cpdef readonly NERParser ner_tagger
|
||||||
|
|
||||||
cdef object _prefix_re
|
cdef object _prefix_re
|
||||||
cdef object _suffix_re
|
cdef object _suffix_re
|
||||||
|
|
|
@ -24,6 +24,7 @@ from .util import read_lang_data
|
||||||
from .tokens import Tokens
|
from .tokens import Tokens
|
||||||
|
|
||||||
from .tagger cimport Tagger
|
from .tagger cimport Tagger
|
||||||
|
from .ner.greedy_parser cimport NERParser
|
||||||
|
|
||||||
|
|
||||||
cdef class Language:
|
cdef class Language:
|
||||||
|
@ -46,7 +47,7 @@ cdef class Language:
|
||||||
else:
|
else:
|
||||||
self.pos_tagger = None
|
self.pos_tagger = None
|
||||||
if path.exists(path.join(util.DATA_DIR, name, 'ner')):
|
if path.exists(path.join(util.DATA_DIR, name, 'ner')):
|
||||||
self.ner_tagger = Tagger(path.join(util.DATA_DIR, name, 'ner'))
|
self.ner_tagger = NERParser(path.join(util.DATA_DIR, name, 'ner'))
|
||||||
|
|
||||||
cpdef Tokens tokenize(self, unicode string):
|
cpdef Tokens tokenize(self, unicode string):
|
||||||
"""Tokenize a string.
|
"""Tokenize a string.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user