Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for different time intervals (sentiment analysis) #12

Open
jaARke opened this issue Mar 26, 2023 · 1 comment
Open

Add support for different time intervals (sentiment analysis) #12

jaARke opened this issue Mar 26, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jaARke
Copy link
Contributor

jaARke commented Mar 26, 2023

There is currently no way for a user to specify the interval of time they'd like the system to retrieve sentiment data for. By default, the bot just pulls data from the last 7 days and conducts its analysis. This functionality is already supported by our backend data retrieval functions (via the start parameter), it will just be a matter of adding frontend support. This will include doing the following (in each relevant command in cogs/sentiment_cog.py,:

  • Parse an interval argument before company name (these should look like: 1d, 10d, 1m, 3m, 1y)
  • Map the interval argument to a date of the form "Year-Month-Day" (so if the user enters "7d", and the current date is 03/26/2023, the mapped date should be 2023-03-19)
  • Call backend functions get_headlines() and get_social_media() with the mapped date

It may be useful to take a look at utils/sentiment/headlines.py to see how datetime objects can be manipulated, subtracted, and converted to strings.

Note: Due to API limitations, the maximum interval should be 1 year (1y). The default should still be 7 days, and we should allow users not to specify any interval for this default to be used. We do not need to add support for querying arbitrary intervals (i.e., the end of the interval should always be the current date).

@jaARke jaARke added the enhancement New feature or request label Mar 26, 2023
@jaARke
Copy link
Contributor Author

jaARke commented Oct 4, 2023

The user can now specify a time interval between 1 and 30 days.

I am of the opinion that we should add support for longer intervals, but this will require resolving the aforementioned API limitations and adding some more complex data cleansing.

@jaARke jaARke added help wanted Extra attention is needed and removed help wanted Extra attention is needed labels Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant