DS Bug: sentiment analysis
randynobx opened this issue · 0 comments
randynobx commented
Issue:
The application of sentiment.py/sentiment_rank
is inconsistent and duplicated across the DS API codebase.
Description:
The analysis and addition of sentiment_rank to Feedback objects occur in both app/routers/feedback_router.py
and data_generators/seeds.py
. They are applied to different keys in the feedback dictionary before being passed to MongoDB. One saves the analysis to the vader_score
field, and the other to the sentiment
field of the dictionary.
This behavior will cause issues when attempting to retrieve the sentiment analysis from the database and should be addressed.
ToDo:
- Consolidate the application of
sentiment_rank
to Feedback dictionaries into a new function located inapp/sentiment.py
.- The
run_sentiment()
indata_generators/seeds.py
should be removed - New function should take a feedback dictionary, run
sentiment_rank()
on thetext
field, and return the dict with an additionalsentiment
field containing the output fromsentiment_rank()
- The
- Replace current applications of
sentiment_rank
in theseeds.py
andfeedback_router.py
modules with the new function.- Ensure consistency across the API and data_generator code behavior.