mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-14 16:55:42 +00:00
Some updates regarding contributions
This commit is contained in:
parent
3004334d05
commit
821571e97f
@ -30,7 +30,7 @@
|
||||
pipeline_name: 'el_core_news_md'
|
||||
version: '3.2.0'
|
||||
compatible_service_versions:
|
||||
- '0.1.0'
|
||||
- '0.1.0'
|
||||
- title: 'English'
|
||||
description: 'English pipeline optimized for CPU. Components: tok2vec, tagger, parser, senter, ner, attribute_ruler, lemmatizer.'
|
||||
url: 'https://github.com/explosion/spacy-models/releases/download/en_core_web_md-3.2.0/en_core_web_md-3.2.0.tar.gz'
|
||||
@ -42,7 +42,6 @@
|
||||
version: '3.2.0'
|
||||
compatible_service_versions:
|
||||
- '0.1.0'
|
||||
- 'test'
|
||||
- title: 'Spanish'
|
||||
description: 'Spanish pipeline optimized for CPU. Components: tok2vec, morphologizer, parser, senter, ner, attribute_ruler, lemmatizer.'
|
||||
url: 'https://github.com/explosion/spacy-models/releases/download/es_core_news_md-3.2.0/es_core_news_md-3.2.0.tar.gz'
|
||||
|
@ -1,6 +1,5 @@
|
||||
from datetime import datetime, timedelta
|
||||
from enum import Enum, IntEnum
|
||||
import re
|
||||
from flask import current_app, url_for
|
||||
from flask_hashids import HashidMixin
|
||||
from flask_login import UserMixin
|
||||
@ -550,6 +549,10 @@ class TesseractOCRPipelineModel(FileMixin, HashidMixin, db.Model):
|
||||
str(self.id)
|
||||
)
|
||||
|
||||
@property
|
||||
def jsonpatch_path(self):
|
||||
return f'{self.user.jsonpatch_path}/tesseract_ocr_pipeline_models/{self.hashid}'
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
return url_for(
|
||||
@ -557,6 +560,10 @@ class TesseractOCRPipelineModel(FileMixin, HashidMixin, db.Model):
|
||||
tesseract_ocr_pipeline_model_id=self.id
|
||||
)
|
||||
|
||||
@property
|
||||
def user_hashid(self):
|
||||
return self.user.hashid
|
||||
|
||||
@staticmethod
|
||||
def insert_defaults():
|
||||
nopaque_user = User.query.filter_by(username='nopaque').first()
|
||||
@ -665,6 +672,10 @@ class SpaCyNLPPipelineModel(FileMixin, HashidMixin, db.Model):
|
||||
str(self.id)
|
||||
)
|
||||
|
||||
@property
|
||||
def jsonpatch_path(self):
|
||||
return f'{self.user.jsonpatch_path}/spacy_nlp_pipeline_models/{self.hashid}'
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
return url_for(
|
||||
@ -672,6 +683,10 @@ class SpaCyNLPPipelineModel(FileMixin, HashidMixin, db.Model):
|
||||
spacy_nlp_pipeline_model_id=self.id
|
||||
)
|
||||
|
||||
@property
|
||||
def user_hashid(self):
|
||||
return self.user.hashid
|
||||
|
||||
@staticmethod
|
||||
def insert_defaults():
|
||||
nopaque_user = User.query.filter_by(username='nopaque').first()
|
||||
|
@ -123,12 +123,7 @@ class SpaCyNLPPipelineModelList extends RessourceList {
|
||||
let spaCyNLPPipelineModelId = spaCyNLPPipelineModelElement.dataset.id;
|
||||
switch (action) {
|
||||
case 'share-request': {
|
||||
let shared;
|
||||
if (actionSwitchElement.querySelector('input').checked) {
|
||||
shared = true;
|
||||
} else {
|
||||
shared = false;
|
||||
}
|
||||
let shared = actionSwitchElement.querySelector('input').checked;
|
||||
Utils.shareSpaCyNLPPipelineModelRequest(this.userId, spaCyNLPPipelineModelId, shared);
|
||||
break;
|
||||
}
|
||||
|
@ -123,12 +123,7 @@ class TesseractOCRPipelineModelList extends RessourceList {
|
||||
let tesseractOCRPipelineModelId = tesseractOCRPipelineModelElement.dataset.id;
|
||||
switch (action) {
|
||||
case 'share-request': {
|
||||
let shared;
|
||||
if (actionSwitchElement.querySelector('input').checked) {
|
||||
shared = true;
|
||||
} else {
|
||||
shared = false;
|
||||
}
|
||||
let shared = actionSwitchElement.querySelector('input').checked;
|
||||
Utils.shareTesseractOCRPipelineModelRequest(this.userId, tesseractOCRPipelineModelId, shared);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user