mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-15 02:20:40 +00:00
Custom Stopword List Settings
This commit is contained in:
@ -61,12 +61,6 @@ def build_corpus(corpus_id):
|
||||
@bp.route('/stopwords')
|
||||
@content_negotiation(produces='application/json')
|
||||
def get_stopwords():
|
||||
# data = request.json
|
||||
# if not isinstance(data, dict):
|
||||
# abort(400)
|
||||
# language = data.get('language')
|
||||
# if not isinstance(language, str):
|
||||
# abort(400)
|
||||
nltk.download('stopwords')
|
||||
languages = ["german", "english", "catalan", "greek", "spanish", "french", "italian", "russian", "chinese"]
|
||||
stopwords = {}
|
||||
@ -74,10 +68,7 @@ def get_stopwords():
|
||||
stopwords[language] = nltk.corpus.stopwords.words(language)
|
||||
stopwords['punctuation'] = list(punctuation) + ['—', '|']
|
||||
stopwords['user_stopwords'] = []
|
||||
print(stopwords)
|
||||
response_data = {
|
||||
'stopwords': stopwords
|
||||
}
|
||||
response_data = stopwords
|
||||
return response_data, 202
|
||||
|
||||
# @bp.route('/<hashid:corpus_id>/generate-share-link', methods=['POST'])
|
||||
|
Reference in New Issue
Block a user