mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-24 08:14:15 +03:00
Update website model display (#9589)
* Remove vectors from core trf model descriptions * Update accuracy labels and exclude morph_acc for ja
This commit is contained in:
parent
6eee024ff6
commit
79cea03983
|
@ -31,7 +31,7 @@ const COMPONENT_LINKS = {
|
|||
|
||||
const MODEL_META = {
|
||||
core: 'Vocabulary, syntax, entities, vectors',
|
||||
core_sm: 'Vocabulary, syntax, entities',
|
||||
core_no_vectors: 'Vocabulary, syntax, entities',
|
||||
dep: 'Vocabulary, syntax',
|
||||
ent: 'Named entities',
|
||||
sent: 'Sentence boundaries',
|
||||
|
@ -41,14 +41,16 @@ const MODEL_META = {
|
|||
web: 'written text (blogs, news, comments)',
|
||||
news: 'written text (news, media)',
|
||||
wiki: 'Wikipedia',
|
||||
uas: 'Unlabelled dependencies',
|
||||
las: 'Labelled dependencies',
|
||||
dep_uas: 'Unlabelled dependencies',
|
||||
dep_las: 'Labelled dependencies',
|
||||
uas: 'Unlabeled dependencies',
|
||||
las: 'Labeled dependencies',
|
||||
dep_uas: 'Unlabeled dependencies',
|
||||
dep_las: 'Labeled dependencies',
|
||||
token_acc: 'Tokenization',
|
||||
tok: 'Tokenization',
|
||||
lemma: 'Lemmatization',
|
||||
morph: 'Morphological analysis',
|
||||
lemma_acc: 'Lemmatization',
|
||||
morph_acc: 'Morphological analysis',
|
||||
tags_acc: 'Part-of-speech tags (fine grained tags, Token.tag)',
|
||||
tag_acc: 'Part-of-speech tags (fine grained tags, Token.tag)',
|
||||
tag: 'Part-of-speech tags (fine grained tags, Token.tag)',
|
||||
|
@ -115,8 +117,8 @@ function formatVectors(data) {
|
|||
return `${abbrNum(keys)} keys, ${abbrNum(vectors)} unique vectors (${width} dimensions)`
|
||||
}
|
||||
|
||||
function formatAccuracy(data) {
|
||||
const exclude = ['speed']
|
||||
function formatAccuracy(data, lang) {
|
||||
const exclude = (lang !== "ja") ? ['speed'] : ['speed', 'morph_acc']
|
||||
if (!data) return []
|
||||
return Object.keys(data)
|
||||
.map(label => {
|
||||
|
@ -147,8 +149,7 @@ function formatModelMeta(data) {
|
|||
license: data.license,
|
||||
labels: isEmptyObj(data.labels) ? null : data.labels,
|
||||
vectors: formatVectors(data.vectors),
|
||||
// TODO: remove accuracy fallback
|
||||
accuracy: formatAccuracy(data.accuracy || data.performance),
|
||||
accuracy: formatAccuracy(data.performance, data.lang),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -196,7 +197,7 @@ const Model = ({
|
|||
const [isError, setIsError] = useState(true)
|
||||
const [meta, setMeta] = useState({})
|
||||
const { type, genre, size } = getModelComponents(name)
|
||||
const display_type = type === 'core' && size === 'sm' ? 'core_sm' : type
|
||||
const display_type = type === 'core' && (size === 'sm' || size === 'trf') ? 'core_no_vectors' : type
|
||||
const version = useMemo(() => getLatestVersion(name, compatibility, prereleases), [
|
||||
name,
|
||||
compatibility,
|
||||
|
|
Loading…
Reference in New Issue
Block a user