mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
small fixes, add package build step
This commit is contained in:
parent
9027cef3bc
commit
345dda6f53
|
@ -21,7 +21,9 @@ install:
|
|||
- "mv WordNet-3.0 wordnet"
|
||||
- "cd ../../"
|
||||
- "export PYTHONPATH=`pwd`"
|
||||
- "python bin/init_model.py en lang_data/ corpora/ spacy/en/data"
|
||||
- "python bin/init_model.py en lang_data/ corpora/ data"
|
||||
- "sputnik build ."
|
||||
- "sputnik install en_default-*.sputnik"
|
||||
|
||||
# run tests
|
||||
script:
|
||||
|
|
10
package.json
Normal file
10
package.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"name": "en_default",
|
||||
"version": "0.99.0",
|
||||
"description": "english default model",
|
||||
"license": "public domain",
|
||||
"include": ["data/**/*"],
|
||||
"compatibility": {
|
||||
"spacy": "==0.99.0"
|
||||
}
|
||||
}
|
|
@ -144,13 +144,15 @@ class Language(object):
|
|||
|
||||
@classmethod
|
||||
def default_parser(cls, package, vocab):
|
||||
data_dir = package.dir_path('data', 'deps')
|
||||
return Parser.from_dir(data_dir, vocab.strings, ArcEager)
|
||||
data_dir = package.dir_path('data', 'deps', require=False)
|
||||
if data_dir and path.exists(data_dir):
|
||||
return Parser.from_dir(data_dir, vocab.strings, ArcEager)
|
||||
|
||||
@classmethod
|
||||
def default_entity(cls, package, vocab):
|
||||
data_dir = package.dir_path('data', 'ner')
|
||||
return Parser.from_dir(data_dir, vocab.strings, BiluoPushDown)
|
||||
data_dir = package.dir_path('data', 'ner', require=False)
|
||||
if data_dir and path.exists(data_dir):
|
||||
return Parser.from_dir(data_dir, vocab.strings, BiluoPushDown)
|
||||
|
||||
def __init__(self, package=None, vocab=None, tokenizer=None, tagger=None,
|
||||
parser=None, entity=None, matcher=None, serializer=None,
|
||||
|
|
|
@ -155,7 +155,8 @@ cdef class Tagger:
|
|||
model = TaggerModel(vocab.morphology.n_tags,
|
||||
ConjunctionExtracter(N_CONTEXT_FIELDS, templates))
|
||||
|
||||
model.load(package.file_path('data', 'pos', 'model', require=False)) # TODO: really optional?
|
||||
if package.has_file('data', 'pos', 'model'): # TODO: really optional?
|
||||
model.load(package.file_path('data', 'pos', 'model'))
|
||||
|
||||
return cls(vocab, model)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user