I have django rest application and a model Task. I am absolutely new to natural processing and I want to build a function that returns me list of nouns and verbs. It looks something like this:
@api_view(['GET'])
def noun_verb_list(request):
nouns = []
verbs = []
"""
List all nouns and verbs from available tasks
"""
if request.query_params.get('projectId'):
# get a specific project
projectId = request.query_params.get('projectId')
project = Project.objects.get(id=projectId)
tasks = project.project_tasks.all()
# extract nouns and verbs from tasks here
return Response(# return appropriate nouns)
Could someone help me build this function? What to import and with logic?