mirror of https://github.com/explosion/spaCy.git
Exclude models for non-stable versions [ci skip]
This commit is contained in:
parent
3dfc7f86be
commit
71bfc92913
|
@ -57,7 +57,7 @@ export default function(repo) {
|
||||||
},
|
},
|
||||||
orderedCompat() {
|
orderedCompat() {
|
||||||
return Object.keys(this.compat)
|
return Object.keys(this.compat)
|
||||||
.filter(v => !v.includes('a') && !v.includes('dev') && !v.includes('rc'));
|
.filter(v => this.$_isStableVersion(v));
|
||||||
},
|
},
|
||||||
hasAccuracy() {
|
hasAccuracy() {
|
||||||
return this.uas || this.las || this.tags_acc || this.ents_f || this.ents_p || this.ents_r;
|
return this.uas || this.las || this.tags_acc || this.ents_f || this.ents_p || this.ents_r;
|
||||||
|
@ -98,8 +98,8 @@ export default function(repo) {
|
||||||
},
|
},
|
||||||
|
|
||||||
$_getLatestVersion(modelId) {
|
$_getLatestVersion(modelId) {
|
||||||
for (let [spacy_v, models] of Object.entries(this.compat)) {
|
for (let [version, models] of Object.entries(this.compat)) {
|
||||||
if (models[modelId]) {
|
if (this.$_isStableVersion(version) && models[modelId]) {
|
||||||
return models[modelId][0];
|
return models[modelId][0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,6 +118,14 @@ export default function(repo) {
|
||||||
return `${nKeys} keys, ${nVectors} unique vectors (${width} dimensions)`;
|
return `${nKeys} keys, ${nVectors} unique vectors (${width} dimensions)`;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hacky check if a version number is stable and not alpha,
|
||||||
|
* dev or a release candidate
|
||||||
|
*/
|
||||||
|
$_isStableVersion(v) {
|
||||||
|
return !v.includes('a') && !v.includes('b') && !v.includes('dev') && !v.includes('rc');
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abbreviate a number, e.g. 14249930 --> 14.25m.
|
* Abbreviate a number, e.g. 14249930 --> 14.25m.
|
||||||
* @param {number|string} num - The number to convert.
|
* @param {number|string} num - The number to convert.
|
||||||
|
|
Loading…
Reference in New Issue