mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-14 11:36:24 +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"
|
- "mv WordNet-3.0 wordnet"
|
||||||
- "cd ../../"
|
- "cd ../../"
|
||||||
- "export PYTHONPATH=`pwd`"
|
- "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
|
# run tests
|
||||||
script:
|
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
|
@classmethod
|
||||||
def default_parser(cls, package, vocab):
|
def default_parser(cls, package, vocab):
|
||||||
data_dir = package.dir_path('data', 'deps')
|
data_dir = package.dir_path('data', 'deps', require=False)
|
||||||
return Parser.from_dir(data_dir, vocab.strings, ArcEager)
|
if data_dir and path.exists(data_dir):
|
||||||
|
return Parser.from_dir(data_dir, vocab.strings, ArcEager)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def default_entity(cls, package, vocab):
|
def default_entity(cls, package, vocab):
|
||||||
data_dir = package.dir_path('data', 'ner')
|
data_dir = package.dir_path('data', 'ner', require=False)
|
||||||
return Parser.from_dir(data_dir, vocab.strings, BiluoPushDown)
|
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,
|
def __init__(self, package=None, vocab=None, tokenizer=None, tagger=None,
|
||||||
parser=None, entity=None, matcher=None, serializer=None,
|
parser=None, entity=None, matcher=None, serializer=None,
|
||||||
|
|
|
@ -155,7 +155,8 @@ cdef class Tagger:
|
||||||
model = TaggerModel(vocab.morphology.n_tags,
|
model = TaggerModel(vocab.morphology.n_tags,
|
||||||
ConjunctionExtracter(N_CONTEXT_FIELDS, templates))
|
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)
|
return cls(vocab, model)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user