From 79cea0398306142334a3e8c3ba9de29c00050ee7 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Wed, 3 Nov 2021 09:56:00 +0100 Subject: [PATCH] Update website model display (#9589) * Remove vectors from core trf model descriptions * Update accuracy labels and exclude morph_acc for ja --- website/src/templates/models.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/website/src/templates/models.js b/website/src/templates/models.js index 554823ebf..69cec3376 100644 --- a/website/src/templates/models.js +++ b/website/src/templates/models.js @@ -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,