You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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.
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 incogs/sentiment_cog.py
,:get_headlines()
andget_social_media()
with the mapped dateIt 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).
The text was updated successfully, but these errors were encountered: