crowd.dev icon indicating copy to clipboard operation
crowd.dev copied to clipboard

New sentiment

Open joanreyero opened this issue 7 months ago • 0 comments

Changes proposed ✍️

What

🤖 Generated by Copilot at a1f7fb9

This pull request introduces HuggingFace as a new sentiment analysis provider for the crowd.dev platform. It adds a feature flag NEW_SENTIMENT to toggle between the old and new providers. It also adds the axios library as a dependency for the sentiment module, which uses it to make requests to the HuggingFace service. It updates the configuration files, environment variables, and types to include the HuggingFace API key. It also modifies the tooltip component in the frontend to display the sentiment label instead of the score. ​

🤖 Generated by Copilot at a1f7fb9

Oh we're the crew of the data sink And we work with sentiment We've got a new provider to try It's called HuggingFace we bet

Why

How

🤖 Generated by Copilot at a1f7fb9

  • Add CROWD_HUGGINGFACE_API_KEY environment variable to configure the API key for the HuggingFace service, a new external provider for sentiment analysis (link, link, link)
  • Add axios dependency to the sentiment library to make HTTP requests to the HuggingFace service (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Add isNewSentimentEnabled parameter to the getSentiment function in the sentiment module and the data sink worker service to implement a feature flag mechanism that allows switching between the old and the new sentiment analysis providers (link, link, link, link)
  • Add NEW_SENTIMENT enum value to the FeatureFlag enum to represent the feature flag for the new sentiment analysis provider (link)
  • Add huggingfaceApiKey property to the ISentimentClientConfig interface to store the API key for the HuggingFace service in the configuration object for the sentiment module (link)
  • Modify the content attribute of the tooltip component in the frontend/src/modules/activity/components/activity-sentiment.vue file to display the sentiment label instead of the score (link)
  • Add tenantId parameter to the mergeActivityData function in the data sink worker service to pass the tenant identifier, which will be used to check the feature flag for the new sentiment analysis provider (link, link)

Checklist ✅

  • [ ] Label appropriately with Feature, Improvement, or Bug.
  • [ ] Add screenshots to the PR description for relevant FE changes
  • [ ] New backend functionality has been unit-tested.
  • [ ] API documentation has been updated (if necessary) (see docs on API documentation).
  • [ ] Quality standards are met.

joanreyero avatar Nov 13 '23 10:11 joanreyero