Update arch docs WIP [ci skip]

This commit is contained in:
Ines Montani 2020-07-28 20:33:52 +02:00
parent 2c7a32cf12
commit 256b24b720
4 changed files with 39 additions and 6 deletions

View File

@ -2,15 +2,28 @@
title: Model Architectures
teaser: Pre-defined model architectures included with the core library
source: spacy/ml/models
menu:
- ['Tok2Vec', 'tok2vec']
- ['Parser & NER', 'parser']
- ['Text Classification', 'textcat']
- ['Entity Linking', 'entitylinker']
---
TODO: intro and how architectures work, link to
[`registry`](/api/top-level#registry),
[custom models](/usage/training#custom-models) usage etc.
## Parser architectures {source="spacy/ml/models/parser.py"}
## Tok2Vec architectures {#tok2vec source="spacy/ml/models/tok2vec.py"}}
### spacy.TransitionBasedParser.v1
### spacy.HashEmbedCNN.v1 {#HashEmbedCNN}
### spacy.HashCharEmbedCNN.v1 {#HashCharEmbedCNN}
### spacy.HashCharEmbedBiLSTM.v1 {#HashCharEmbedBiLSTM}
## Parser & NER architectures {#parser source="spacy/ml/models/parser.py"}
### spacy.TransitionBasedParser.v1 {#TransitionBasedParser}
<!-- TODO: intro -->
@ -35,3 +48,17 @@ TODO: intro and how architectures work, link to
| `maxout_pieces` | int | |
| `use_upper` | bool | |
| `nO` | int | |
## Text classification architectures {#textcat source="spacy/ml/models/textcat.py"}
### spacy.TextCatEnsemble.v1 {#TextCatEnsemble}
### spacy.TextCatBOW.v1 {#TextCatBOW}
### spacy.TextCatCNN.v1 {#TextCatCNN}
### spacy.TextCatLowData.v1 {#TextCatLowData}
## Entity linking architectures {#entitylinker source="spacy/ml/models/entity_linker.py"}
### spacy.EntityLinker.v1 {#EntityLinker}

View File

@ -21,6 +21,7 @@ import { ReactComponent as OfflineIcon } from '../images/icons/offline.svg'
import { ReactComponent as SearchIcon } from '../images/icons/search.svg'
import { ReactComponent as MoonIcon } from '../images/icons/moon.svg'
import { ReactComponent as ClipboardIcon } from '../images/icons/clipboard.svg'
import { ReactComponent as NetworkIcon } from '../images/icons/network.svg'
import classes from '../styles/icon.module.sass'
@ -45,6 +46,7 @@ const icons = {
search: SearchIcon,
moon: MoonIcon,
clipboard: ClipboardIcon,
network: NetworkIcon
}
const Icon = ({ name, width, height, inline, variant, className }) => {

View File

@ -31,19 +31,20 @@ const Link = ({
const dest = to || href
const external = forceExternal || /(http(s?)):\/\//gi.test(dest)
const isApi = !external && !hidden && !hideIcon && /^\/?api/.test(dest)
const isArch = !external && !hidden && !hideIcon && /^\/?api\/architectures#/.test(dest)
const isSource = external && !hidden && !hideIcon && /(github.com)/.test(dest)
const sourceWithText = (isSource || isApi) && isString(children)
const linkClassNames = classNames(classes.root, className, {
[classes.hidden]: hidden,
[classes.nowrap]: (isApi || isSource) && !sourceWithText,
[classes.withIcon]: isApi || isSource,
[classes.nowrap]: (isApi || isSource || isArch) && !sourceWithText,
[classes.withIcon]: isApi || isSource || isArch,
})
const Wrapper = ws ? Whitespace : Fragment
const icon = isArch ? 'network' : isApi ? 'docs' : isSource ? 'code' : null
const content = (
<>
{sourceWithText ? <span className={classes.sourceText}>{children}</span> : children}
{isApi && <Icon name="docs" width={16} inline className={classes.icon} />}
{isSource && <Icon name="code" width={16} inline className={classes.icon} />}
{icon && <Icon name={icon} width={16} inline className={classes.icon} />}
</>
)

View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width="20" height="20">
<path d="M18 14.824v-2.324c0-1.933-1.567-3.5-3.5-3.5h-2c-0.828 0-1.5-0.672-1.5-1.5v-2.324c0.825-0.38 1.4-1.208 1.4-2.176 0-1.326-1.074-2.4-2.4-2.4s-2.4 1.074-2.4 2.4c0 0.967 0.576 1.796 1.4 2.176v2.324c0 0.828-0.672 1.5-1.5 1.5h-2c-1.933 0-3.5 1.567-3.5 3.5v2.324c-0.825 0.38-1.4 1.209-1.4 2.176 0 1.326 1.074 2.4 2.4 2.4s2.4-1.075 2.4-2.4c0-0.967-0.576-1.796-1.4-2.176v-2.324c0-0.828 0.672-1.5 1.5-1.5h2c0.539 0 1.044-0.132 1.5-0.35v4.174c-0.825 0.38-1.4 1.209-1.4 2.176 0 1.326 1.074 2.4 2.4 2.4s2.4-1.075 2.4-2.4c0-0.967-0.576-1.796-1.4-2.176v-4.174c0.456 0.218 0.961 0.35 1.5 0.35h2c0.828 0 1.5 0.672 1.5 1.5v2.324c-0.825 0.38-1.4 1.208-1.4 2.176 0 1.326 1.074 2.4 2.4 2.4s2.4-1.075 2.4-2.4c0-0.967-0.575-1.796-1.4-2.176zM10 1.615c0.764 0 1.384 0.619 1.384 1.385 0 0.764-0.62 1.385-1.384 1.385s-1.384-0.621-1.384-1.385c0-0.766 0.619-1.385 1.384-1.385zM3 18.385c-0.766 0-1.385-0.621-1.385-1.385 0-0.766 0.619-1.385 1.385-1.385 0.764 0 1.384 0.619 1.384 1.385 0 0.764-0.62 1.385-1.384 1.385zM10 18.385c-0.766 0-1.385-0.621-1.385-1.385 0-0.766 0.619-1.385 1.385-1.385 0.764 0 1.384 0.619 1.384 1.385 0 0.764-0.62 1.385-1.384 1.385zM17 18.385c-0.766 0-1.385-0.621-1.385-1.385 0-0.766 0.619-1.385 1.385-1.385 0.764 0 1.384 0.619 1.384 1.385 0 0.764-0.62 1.385-1.384 1.385z"></path>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB