From 1ed7029d476cbae390ee44ff868fd7a9a9347222 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Wed, 27 Jan 2021 12:39:47 +1100 Subject: [PATCH] Update website for v3 launch --- website/docs/usage/layers-architectures.md | 20 +++++---- website/docs/usage/training.md | 9 ++-- website/docs/usage/v3.md | 10 +++++ website/src/components/embed.js | 4 +- website/src/components/landing.js | 22 +++++----- website/src/components/navigation.js | 10 ++++- website/src/styles/navigation.module.sass | 23 ++++++++++ website/src/templates/index.js | 7 ++++ website/src/widgets/landing.js | 49 +++++++--------------- 9 files changed, 93 insertions(+), 61 deletions(-) diff --git a/website/docs/usage/layers-architectures.md b/website/docs/usage/layers-architectures.md index 13e474bfe..d7a7d3ce8 100644 --- a/website/docs/usage/layers-architectures.md +++ b/website/docs/usage/layers-architectures.md @@ -537,15 +537,17 @@ two major steps required: pass through the `nlp` pipeline. -Run this example use-case by using our project template. It includes all the +Run this example use-case by using our project template. It includes all the code to create the ML model and the pipeline component from scratch. -It also contains two config files to train the model: +It also contains two config files to train the model: one to run on CPU with a Tok2Vec layer, and one for the GPU using a transformer. -The project applies the relation extraction component to identify biomolecular -interactions in a sample dataset, but you can easily swap in your own dataset +The project applies the relation extraction component to identify biomolecular +interactions in a sample dataset, but you can easily swap in your own dataset for your experiments in any other domain. + + #### Step 1: Implementing the Model {#component-rel-model} We need to implement a [`Model`](https://thinc.ai/docs/api-model) that takes a @@ -824,7 +826,7 @@ will predict scores for each label. We add convenience methods to easily retrieve and add to them. ```python -### The constructor (continued) +### The constructor (continued) def __init__(self, vocab, model, name="rel"): """Create a component instance.""" # ... @@ -1041,11 +1043,11 @@ def make_relation_extractor(nlp, name, model): ``` -Run this example use-case by using our project template. It includes all the +Run this example use-case by using our project template. It includes all the code to create the ML model and the pipeline component from scratch. -It contains two config files to train the model: +It contains two config files to train the model: one to run on CPU with a Tok2Vec layer, and one for the GPU using a transformer. -The project applies the relation extraction component to identify biomolecular -interactions, but you can easily swap in your own dataset for your experiments +The project applies the relation extraction component to identify biomolecular +interactions, but you can easily swap in your own dataset for your experiments in any other domain. diff --git a/website/docs/usage/training.md b/website/docs/usage/training.md index 16b2b0f5a..019ef16ed 100644 --- a/website/docs/usage/training.md +++ b/website/docs/usage/training.md @@ -193,6 +193,8 @@ available for the different architectures are documented with the + + ### Config lifecycle at runtime and training {#config-lifecycle} A pipeline's `config.cfg` is considered the "single source of truth", both at @@ -423,9 +425,10 @@ frozen_components = ["parser", "custom"] When the components in your pipeline [share an embedding layer](/usage/embeddings-transformers#embedding-layers), the -**performance** of your frozen component will be **degraded** if you continue training -other layers with the same underlying `Tok2Vec` instance. As a rule of thumb, -ensure that your frozen components are truly **independent** in the pipeline. +**performance** of your frozen component will be **degraded** if you continue +training other layers with the same underlying `Tok2Vec` instance. As a rule of +thumb, ensure that your frozen components are truly **independent** in the +pipeline. diff --git a/website/docs/usage/v3.md b/website/docs/usage/v3.md index 5aa5507f7..402da21f6 100644 --- a/website/docs/usage/v3.md +++ b/website/docs/usage/v3.md @@ -67,6 +67,16 @@ improvements**. The [API docs](/api) include additional deprecation notes. New methods and functions that were introduced in this version are marked with the tag 3. + + + + + + + + + + ### Transformer-based pipelines {#features-transformers} > #### Example diff --git a/website/src/components/embed.js b/website/src/components/embed.js index 90a640fe2..dc25ae079 100644 --- a/website/src/components/embed.js +++ b/website/src/components/embed.js @@ -8,8 +8,8 @@ import { markdownToReact } from './util' import classes from '../styles/embed.module.sass' -const YouTube = ({ id, ratio = '16x9' }) => { - const embedClassNames = classNames(classes.root, classes.responsive, { +const YouTube = ({ id, ratio = '16x9', className }) => { + const embedClassNames = classNames(classes.root, classes.responsive, className, { [classes.ratio16x9]: ratio === '16x9', [classes.ratio4x3]: ratio === '4x3', }) diff --git a/website/src/components/landing.js b/website/src/components/landing.js index 96f9640ce..9c000f152 100644 --- a/website/src/components/landing.js +++ b/website/src/components/landing.js @@ -109,16 +109,18 @@ export const LandingBanner = ({ return (
- - {label && ( -
- {label} -
- )} - - {title} - -
+ {(title || label) && ( + + {label && ( +
+ {label} +
+ )} + + {title} + +
+ )}

{children}

diff --git a/website/src/components/navigation.js b/website/src/components/navigation.js index f7264f0f5..10bcb4d30 100644 --- a/website/src/components/navigation.js +++ b/website/src/components/navigation.js @@ -26,12 +26,18 @@ const NavigationDropdown = ({ items = [], section }) => { ) } -export default function Navigation({ title, items = [], section, search, children }) { +export default function Navigation({ title, items = [], section, search, alert, children }) { return (