* Use greedy NER parser

This commit is contained in:
Matthew Honnibal 2014-11-11 21:08:35 +11:00
parent 0d943ab358
commit ff8989b63c
2 changed files with 4 additions and 2 deletions

View File

@ -7,6 +7,7 @@ from .typedefs cimport hash_t
from .tokens cimport Tokens
from .lexeme cimport Lexeme
from .tagger cimport Tagger
from .ner.greedy_parser cimport NERParser
from .utf8string cimport StringStore
@ -42,7 +43,7 @@ cdef class Language:
cpdef readonly Lexicon lexicon
cpdef readonly Tagger pos_tagger
cpdef readonly Tagger ner_tagger
cpdef readonly NERParser ner_tagger
cdef object _prefix_re
cdef object _suffix_re

View File

@ -24,6 +24,7 @@ from .util import read_lang_data
from .tokens import Tokens
from .tagger cimport Tagger
from .ner.greedy_parser cimport NERParser
cdef class Language:
@ -46,7 +47,7 @@ cdef class Language:
else:
self.pos_tagger = None
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):
"""Tokenize a string.