Use attention as a model input

Add mention counts as a feature in a forecasting or classification model, next to your own variables.

You need: an API key (opens in a new tab), your own data and a notebook.

  1. Collect the daily mentions

    For each asset in your data call get_chart_data with kind mentions. Save the values daily, because one call returns up to 90 days.

    A Python example that asks for a daily series
  2. Make features

    Build simple features: the mentions, the change against the average of the previous days and the rank among your assets. Only use values known at the time of the prediction.

  3. Add them to your model

    Add the features next to your own variables. Split by time, not at random, so the test uses later days than the training.

  4. Compare with and without

    Compare the model with and without the attention features on the later days. Report the difference and its uncertainty.

  • What you will see

    A model with attention features and a fair comparison with and without them.

  • Data used

    get_chart_data with kind mentions, through the API (opens in a new tab). Store the daily values to build a longer history.

  • Limits

    • Leakage is easy: do not use a day's count to predict that same day.
    • Small histories overfit.