-1
如何從郵遞員傳遞list
以及如何訪問多個屬性無法訪問獲取URL的話傳遞的列表
@api.route('/Spacy/<input>/<texts>')
class Spacy(Resource):
if input == pos:
def get(self, input):
'''
Returns part-of speech.
'''
doc = nlp(texts)
return [(word.text, word.lemma_, word.pos_) for word in doc]
elif input == verb:
def get(self, input):
'''
Returns verbs and the stemmed verb.
'''
doc = nlp(texts)
return [(word.text, word.lemma_) for word in doc if word.pos_ == "VERB"]
elif input == synonyms:
def get(self, input):
'''
Returns the synonyms.
'''
synonyms = wordnet.synsets(input)
lemmas = set(chain.from_iterable([word.lemma_names() for word in synonyms]))
return jsonify([syn.replace("_"," ") for syn in list(lemmas)])
我傳遞/spacy?input=verb,synonyms&text=flower
我應該如何接受它,並通過
我使用spacy太
你可以舉一個例子,它會更有幫助 –