diff --git a/spacy/about.py b/spacy/about.py index a441508f6..f95d391a6 100644 --- a/spacy/about.py +++ b/spacy/about.py @@ -1,6 +1,6 @@ # fmt: off -__title__ = "spacy" -__version__ = "3.0.0.dev13" +__title__ = "spacy_nightly" +__version__ = "3.0.0a0" __release__ = True __download_url__ = "https://github.com/explosion/spacy-models/releases/download" __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json" diff --git a/spacy/cli/train.py b/spacy/cli/train.py index 6fbb44d65..0853bfb56 100644 --- a/spacy/cli/train.py +++ b/spacy/cli/train.py @@ -332,13 +332,14 @@ def create_evaluation_callback(nlp, optimizer, corpus, cfg): ) n_words = sum(len(ex.predicted) for ex in dev_examples) + batch_size = cfg.get("evaluation_batch_size", 128) start_time = timer() if optimizer.averages: with nlp.use_params(optimizer.averages): - scorer = nlp.evaluate(dev_examples, batch_size=32) + scorer = nlp.evaluate(dev_examples, batch_size=batch_size) else: - scorer = nlp.evaluate(dev_examples, batch_size=32) + scorer = nlp.evaluate(dev_examples, batch_size=batch_size) end_time = timer() wps = n_words / (end_time - start_time) scores = scorer.scores diff --git a/spacy/gold/corpus.py b/spacy/gold/corpus.py index 42637ce5c..9a688987c 100644 --- a/spacy/gold/corpus.py +++ b/spacy/gold/corpus.py @@ -45,18 +45,22 @@ class Corpus: def make_examples(self, nlp, reference_docs, max_length=0): for reference in reference_docs: - if len(reference) >= max_length >= 1: - if reference.is_sentenced: - for ref_sent in reference.sents: - yield Example( - nlp.make_doc(ref_sent.text), - ref_sent.as_doc() - ) - else: + if len(reference) == 0: + continue + elif max_length == 0 or len(reference) < max_length: yield Example( nlp.make_doc(reference.text), reference ) + elif reference.is_sentenced: + for ref_sent in reference.sents: + if len(ref_sent) == 0: + continue + elif max_length == 0 or len(ref_sent) < max_length: + yield Example( + nlp.make_doc(ref_sent.text), + ref_sent.as_doc() + ) def make_examples_gold_preproc(self, nlp, reference_docs): for reference in reference_docs: @@ -65,7 +69,7 @@ class Corpus: else: ref_sents = [reference] for ref_sent in ref_sents: - yield Example( + eg = Example( Doc( nlp.vocab, words=[w.text for w in ref_sent], @@ -73,6 +77,8 @@ class Corpus: ), ref_sent ) + if len(eg.x): + yield eg def read_docbin(self, vocab, locs): """ Yield training examples as example dicts """ diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index ceaea3c9c..743b4ca1d 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -449,7 +449,7 @@ cdef class Parser: if component is self: break if hasattr(component, "pipe"): - doc_sample = list(component.pipe(doc_sample)) + doc_sample = list(component.pipe(doc_sample, batch_size=8)) else: doc_sample = [component(doc) for doc in doc_sample] if doc_sample: diff --git a/website/src/components/button.js b/website/src/components/button.js index 5e03ca312..410193a7e 100644 --- a/website/src/components/button.js +++ b/website/src/components/button.js @@ -27,7 +27,7 @@ Button.defaultProps = { } Button.propTypes = { - to: PropTypes.string.isRequired, + to: PropTypes.string, variant: PropTypes.oneOf(['primary', 'secondary', 'tertiary']), large: PropTypes.bool, icon: PropTypes.string, diff --git a/website/src/images/icon_nightly.png b/website/src/images/icon_nightly.png index 069c1b803..20326e46d 100644 Binary files a/website/src/images/icon_nightly.png and b/website/src/images/icon_nightly.png differ diff --git a/website/src/images/pattern_landing_nightly.jpg b/website/src/images/pattern_landing_nightly.jpg index 74f4cf7b6..6ff0d574d 100644 Binary files a/website/src/images/pattern_landing_nightly.jpg and b/website/src/images/pattern_landing_nightly.jpg differ diff --git a/website/src/images/pattern_nightly.jpg b/website/src/images/pattern_nightly.jpg index 685dffc02..a3fadd87b 100644 Binary files a/website/src/images/pattern_nightly.jpg and b/website/src/images/pattern_nightly.jpg differ diff --git a/website/src/images/social_nightly.jpg b/website/src/images/social_nightly.jpg index f7087fb54..29889df12 100644 Binary files a/website/src/images/social_nightly.jpg and b/website/src/images/social_nightly.jpg differ diff --git a/website/src/pages/404.js b/website/src/pages/404.js new file mode 100644 index 000000000..a25e8f553 --- /dev/null +++ b/website/src/pages/404.js @@ -0,0 +1,47 @@ +import React from 'react' +import { window } from 'browser-monads' +import { graphql } from 'gatsby' + +import Template from '../templates/index' +import { LandingHeader, LandingTitle } from '../components/landing' +import Button from '../components/button' + +export default ({ data, location }) => { + const { nightly } = data.site.siteMetadata + const pageContext = { title: '404 Error', searchExclude: true, isIndex: false } + return ( + + ) +} + +export const pageQuery = graphql` + query { + site { + siteMetadata { + nightly + title + description + navigation { + text + url + } + docSearch { + apiKey + indexName + } + } + } + } +` diff --git a/website/src/pages/404.md b/website/src/pages/404.md deleted file mode 100644 index 910b552b3..000000000 --- a/website/src/pages/404.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: 404 Error ---- - -import Error from 'widgets/404.js' - - diff --git a/website/src/widgets/404.js b/website/src/widgets/404.js deleted file mode 100644 index bc65e9f0d..000000000 --- a/website/src/widgets/404.js +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react' -import { window } from 'browser-monads' - -import { LandingHeader, LandingTitle } from '../components/landing' -import Button from '../components/button' - -export default () => ( - - - Ooops, this page -
- does not exist! -
-
- -
-)