Update models directory [ci skip]

This commit is contained in:
Ines Montani 2020-09-24 14:53:34 +02:00
parent 3f751e68f5
commit 6bc5058d13
1 changed files with 11 additions and 2 deletions

View File

@ -32,11 +32,17 @@ const MODEL_META = {
las: 'Labelled dependencies', las: 'Labelled dependencies',
token_acc: 'Tokenization', token_acc: 'Tokenization',
tok: 'Tokenization', tok: 'Tokenization',
lemma: 'Statistical lemmatization',
morph: 'Morphological analysis',
tags_acc: 'Part-of-speech tags (fine grained tags, Token.tag)', tags_acc: 'Part-of-speech tags (fine grained tags, Token.tag)',
tag: 'Part-of-speech tags (fine grained tags, Token.tag)', tag: 'Part-of-speech tags (fine grained tags, Token.tag)',
pos: 'Part-of-speech tags (coarse grained tags, Token.pos)',
ents_f: 'Named entities (F-score)', ents_f: 'Named entities (F-score)',
ents_p: 'Named entities (precision)', ents_p: 'Named entities (precision)',
ents_r: 'Named entities (recall)', ents_r: 'Named entities (recall)',
ner_f: 'Named entities (F-score)',
ner_p: 'Named entities (precision)',
ner_r: 'Named entities (recall)',
sent_f: 'Sentence segmentation (F-score)', sent_f: 'Sentence segmentation (F-score)',
sent_p: 'Sentence segmentation (precision)', sent_p: 'Sentence segmentation (precision)',
sent_r: 'Sentence segmentation (recall)', sent_r: 'Sentence segmentation (recall)',
@ -88,11 +94,12 @@ function formatVectors(data) {
} }
function formatAccuracy(data) { function formatAccuracy(data) {
const exclude = ['speed']
if (!data) return [] if (!data) return []
return Object.keys(data) return Object.keys(data)
.map(label => { .map(label => {
const value = data[label] const value = data[label]
return isNaN(value) return isNaN(value) || exclude.includes(label)
? null ? null
: { : {
label, label,
@ -109,6 +116,7 @@ function formatModelMeta(data) {
version: data.version, version: data.version,
sizeFull: data.size, sizeFull: data.size,
pipeline: data.pipeline, pipeline: data.pipeline,
components: data.components,
notes: data.notes, notes: data.notes,
description: data.description, description: data.description,
sources: data.sources, sources: data.sources,
@ -117,7 +125,8 @@ function formatModelMeta(data) {
license: data.license, license: data.license,
labels: isEmptyObj(data.labels) ? null : data.labels, labels: isEmptyObj(data.labels) ? null : data.labels,
vectors: formatVectors(data.vectors), vectors: formatVectors(data.vectors),
accuracy: formatAccuracy(data.performance), // TODO: remove accuracy fallback
accuracy: formatAccuracy(data.accuracy || data.performance),
} }
} }