# Problems setting up Sentiment

**URL:** https://meta.discourse.org/t/problems-setting-up-sentiment/309270
**Category:** Support
**Tags:** ai, ai-sentiment
**Created:** [May 23, 2024, 3:48am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270 "2024-05-23T03:48:11Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [May 23, 2024, 3:48am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/1 "2024-05-23T03:48:11Z")

</div>

Why does this ‘Overall Sentiment’ query gives empty results:

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/e/5/fe55fc09455320e80af691736256af80e88c3410.png)

---

<div class="post-metadata">

### Author: ![jordan-violet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jordan-violet/32/281428_2.png) [@jordan-violet](https://meta.discourse.org/u/jordan-violet)
#### Post date: [May 23, 2024, 3:51am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/2 "2024-05-23T03:51:36Z")

</div>

I copied directly from Sara’s post and ran it and received results:

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/1/0/610acdc6e8f6b96bb30de800acd51748a7f8a54e.png)

Can you confirm if you have data in your `classification_results` table?

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [May 23, 2024, 5:11am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/3 "2024-05-23T05:11:36Z")

</div>

> [@jordan-violet](#):
>
> I copied directly from Sara’s post and ran it

I also just copied, pasted it as a ‘New Query’ and ran. No changes by me made at all.

> [@jordan-violet](#):
>
> Can you confirm if you have data in your `classification_results` table?

From where do I need to look for this? I’m admin of [my site](https://BathindaHelper.com).

My dashboards looks like this:

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/d/e/8de0a99adc220c873e3eb76524a4e214e8002421.png)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/6/9/6/696607a2a6b3004b0780ac04d117e244eef3b9d0.png)

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [May 23, 2024, 5:57am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/4 "2024-05-23T05:57:30Z")

</div>

> [@Bathinda](#):
>
> No changes by me made at all.

Did you change the dates that the query covered? Try refreshing the page and amending the date parameters if you haven’t already done so.

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [May 23, 2024, 7:10am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/5 "2024-05-23T07:10:58Z")

</div>

I’ve tried entering longer duration (and then 'Refresh) in the dashboard with no success:

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/a/3/ba324322ae95bc71932f1c957e590a58261723ee.png)

And also changed dates in the query, with no success:

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/9/6/a96138896e380d3468f73301c64cce2905687638.png)

My site is approx/minimum 5 years old.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [May 23, 2024, 7:59am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/6 "2024-05-23T07:59:55Z")

</div>

> [@Bathinda](#):
>
> My site is approx/minimum 5 years old.

Did you run a backfill?

> [@Discourse AI - Sentiment](https://meta.discourse.org/t/discourse-ai-sentiment/259599/1):
>
> ℹ Once enabled, Sentiment will classify all new posts going forward. To classify all of your site’s historical posts, a backfill task must be run from the console

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [May 23, 2024, 8:06am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/7 "2024-05-23T08:06:57Z")

</div>

> [@Moin](#):
>
> Did you run a backfill?

No. I didn’t. Nor did I read about this in (the first post of) this topic.

Can u pls tell how do/can I do that?  
Or if I don’t run backfill, when will this component get enough posts to work out the sentiment?

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [May 23, 2024, 8:15am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/8 "2024-05-23T08:15:07Z")

</div>

That’s explained in the [guide](https://meta.discourse.org/t/enable-sentiment-analysis/259599/1) I quoted.  
When did you enable the sentiment analysis? You chose February 2024 as an end date in your [data explorer](https://meta.discourse.org/t/32566?silent=true) query. Was the analysis enabled before that? Otherwise, since only new posts are classified, I’d expect it to return 0 results.

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [May 23, 2024, 8:18am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/9 "2024-05-23T08:18:44Z")

</div>

> [@Moin](#):
>
> That’s explained in the [guide](https://meta.discourse.org/t/enable-sentiment-analysis/259599/1) I quoted.

Ok, I had missed, but now I’d surely study and solve the problem.

Analysis was enabled in Feb or March, 2024, I don’t remember exact date. How many posts does it require (after its enabled, without running back-fill) to show something?

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [May 24, 2024, 8:51am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/10 "2024-05-24T08:51:08Z")

</div>

> [@Discourse AI - Sentiment](https://meta.discourse.org/t/discourse-ai-sentiment/259599/1):
>
> Once enabled, Sentiment will classify all new posts going forward. To classify all of your site’s historical posts, a backfill task must be run from the console.

I’m seeing ‘Site Sentiment’ in my Admin Dashboard for the past 2-3 months, but no sentiment is being shown.  
[![](https://global.discourse-cdn.com/meta/original/4X/6/9/6/696607a2a6b3004b0780ac04d117e244eef3b9d0.png) ](https://global.discourse-cdn.com/meta/original/4X/6/9/6/696607a2a6b3004b0780ac04d117e244eef3b9d0.png)

I even tried running the same as an Sql Query thru [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin and changed dates to approx 2 years, still only blank result.  
[![](https://global.discourse-cdn.com/meta/original/4X/f/e/5/fe55fc09455320e80af691736256af80e88c3410.png) ](https://global.discourse-cdn.com/meta/original/4X/f/e/5/fe55fc09455320e80af691736256af80e88c3410.png)

When I try run a ‘BackFill Task’ it gave the following error:

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/b/e/2bec4e9df7fc5f20a0ee1f22dc36780d863434ad.png)  
I took screenshot of almost 50% of the top area.

As shown in the ‘just-above’ post of mine that Back-Filling is failing, **can someone pls tell how many days/how many posts will it take for this ‘Sentiment Analysis’ to work or show something (i.e. wo backfill)**?

> I’ve searched ‘[Back-Fill-Failing](https://meta.discourse.org/t/encountering-error-in-sentiment-backfill-rake-task/297275/2)’ on meta, but no solution has been found anywhere.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [May 24, 2024, 9:31am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/11 "2024-05-24T09:31:22Z")

</div>

I’ve collected these up and split them into their own topic so they’re not cross-posted in multiple places. 👍

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [May 24, 2024, 9:47am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/12 "2024-05-24T09:47:52Z")

</div>

Have you posted something new for the Sentiment to run against? If it’s not picking up new things either then I think you have a problem with your configuration rather than just the backfill.

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [May 24, 2024, 10:05am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/13 "2024-05-24T10:05:36Z")

</div>

> [@JammyDodger](#):
>
> Have you posted something new for the Sentiment to run against?

Yes. Many topics were created since the ‘Sentiment Analysis’ appeared in my Admin Dashboard

> [@Bathinda](#):
>
> Analysis was enabled in Feb or March, 2024, I don’t remember exact date. How many posts does it require once its enabled (without running back-fill) to show sentiment? Or even one post is enough?

P.S.  
I filled the Open-AI api key here (same as I’m using in other fields in this settings neighbourhood), am I right or some else api key was needed:

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/c/5/6c556ec40aca46e0bc31d214e5d80c922280c995.png)

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [June 1, 2024, 1:46pm UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/14 "2024-06-01T13:46:21Z")

</div>

Sentiment Analysis is being shown blank constantly. Even though tens of topics have been created since this functionality was introduced around 2-3 months back. And I’ve expanded the dates to try to give it more data.

 ![This image displays various data visualization charts related to sentiment analysis, including a bar chart for post emotion scores across different trust levels and emotions like sadness, surprise, disgust, joy, fear, and anger, though there appears to be no data available for the overall sentiment line chart. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/a/a/3/aa309f35d8b6d6bc773e78f8eed9fa8fd8677183.png)

Report refreshed after changing dates:

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/d/4/4d4c78f7a896d0d638f1203276d030935a5d6372.png)

And even though BackFilling might not be culprit/required in my case, but when I tried, it too failed, as being discussed in its own topic [here](https://meta.discourse.org/t/problems-with-sentiment-backfill/309270/10).

What could go wrong, if somebody would?

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [March 14, 2026, 8:18pm UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/15 "2026-03-14T20:18:01Z")

</div>

I wonder how to backfill on 2026 in self-hosted instances?

```ruby
/var/www/discourse# rake ai:sentiment:populate
rake aborted!
Don't run this task in production!

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 14, 2026, 8:24pm UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/16 "2026-03-14T20:24:05Z")

</div>

Backfill for the last 60 days is automatic as soon as you enable the feature.

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [March 15, 2026, 2:28am UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/17 "2026-03-15T02:28:26Z")

</div>

I know it but I want to check the overall sentiment because our community (and forum) is on almost 2 years in dev progress.

By the way, I did not found errors nor sentiment on the last 60 days. How can I debug more than /logs or /sideqik (no pending tasks)?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 15, 2026, 6:13pm UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/18 "2026-03-15T18:13:36Z")

</div>

> [@satonotdead](#):
>
> By the way, I did not found errors nor sentiment on the last 60 days

Did you follow [Self-Hosting Sentiment and Emotion for DiscourseAI](https://meta.discourse.org/t/self-hosting-sentiment-and-emotion-for-discourseai/334451) ?

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [March 15, 2026, 10:32pm UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/19 "2026-03-15T22:32:13Z")

</div>

Thanks for your follow up. I just forgot to add my internal IP to `allowed internal hosts`.

After that, I executed the job via rails console again:

```ruby
Jobs::SentimentBackfill.new.execute({})

```

But it is still missing the complete backfill 🙂

Our forum and community has been in development (and still is) for a few years, so we really need to understand our historically dynamics.

Is this feasible without introducing issues?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 15, 2026, 11:22pm UTC](https://meta.discourse.org/t/problems-setting-up-sentiment/309270/20 "2026-03-15T23:22:18Z")

</div>

Did you get at least the last 60 days of data? Your post isn’t clear about that.

[Next page](https://meta.discourse.org/t/problems-setting-up-sentiment/309270.md?page=2)
