nopaque/app/contributions/spacy_nlp_pipeline_models/utils.py

14 lines
424 B
Python
Raw Normal View History

2023-03-14 10:13:35 +00:00
from flask import request, url_for
from app.models import SpaCyNLPPipelineModel
def spacy_nlp_pipeline_model_dlc():
snpm_id = request.view_args['spacy_nlp_pipeline_model_id']
2023-03-14 10:44:15 +00:00
snpm = SpaCyNLPPipelineModel.query.get_or_404(snpm_id)
2023-03-14 10:13:35 +00:00
return [
{
'text': f'{snpm.title} {snpm.version}',
'url': url_for('.spacy_nlp_pipeline_model', spacy_nlp_pipeline_model_id=snpm_id)
}
]