mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 18:26:30 +03:00
Fix formatting and remove unused imports
This commit is contained in:
parent
d310b0aab3
commit
992559bf9a
|
@ -1,9 +1,8 @@
|
||||||
from __future__ import unicode_literals, print_function
|
from __future__ import unicode_literals, print_function
|
||||||
import json
|
|
||||||
import pathlib
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
import spacy.lang.en
|
from spacy.lang.en import English
|
||||||
from spacy.gold import GoldParse, biluo_tags_from_offsets
|
from spacy.gold import GoldParse, biluo_tags_from_offsets
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,7 +33,7 @@ def main(model_dir=None):
|
||||||
(len('I like London and '), len('I like London and Berlin'), 'LOC')]
|
(len('I like London and '), len('I like London and Berlin'), 'LOC')]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
nlp = spacy.lang.en.English(pipeline=['tensorizer', 'ner'])
|
nlp = English(pipeline=['tensorizer', 'ner'])
|
||||||
get_data = lambda: reformat_train_data(nlp.tokenizer, train_data)
|
get_data = lambda: reformat_train_data(nlp.tokenizer, train_data)
|
||||||
optimizer = nlp.begin_training(get_data)
|
optimizer = nlp.begin_training(get_data)
|
||||||
for itn in range(100):
|
for itn in range(100):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user