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

FEATURE: Order by emotion on /filter #913

Merged
merged 2 commits into from
Nov 14, 2024
Merged

FEATURE: Order by emotion on /filter #913

merged 2 commits into from
Nov 14, 2024

Conversation

xfalcox
Copy link
Member

@xfalcox xfalcox commented Nov 13, 2024

No description provided.

lib/sentiment/emotion_filter_order.rb Show resolved Hide resolved
emotions.each { |emotion| expect(filters).to include("order:emotion_#{emotion}") }
end

it "filters topics by emotion" do
Copy link
Contributor

@pmusaraj pmusaraj Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I am confused a bit about ordering vs filtering here. The admin report for a given emotion should point to a filtered list of topics where there is a match for that emotion, right? For that, would we need an explicit filter like emotion:disgust?

We certainly want order:emotion_disgust, no doubt, but I think we also need the filtering...

Copy link
Member Author

@xfalcox xfalcox Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will all be accessed from a link, they aren't supposed to be typed, so do we really need the double emotion:disgust order:emotion_disgust ?

Filter and Order here are a bit fuzzy. Ordering works, you simply show first topics where most posts have that emotion. But filter means you need to set a threshold, as every classification contains some of that emotion as an infinitesimal decimal. What do you suggest? Also worth noting that emotion is per post, while filter acts on topics, so we need a way to translate the concepts.

I'd go with a having clause limiting topics to where the emotion is presented with a score of at least 10% in at least 5% of the replies built-in into the ordering, at least for starters. Expect those to be adjusted over time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, not a fan of the double keywords. Not a fan of order:X filtering out results either because it goes against what order does in other places. I don't have a definitive answer, maybe in the short-run we go with the order: keyword only and accept it is exceptional.

Regarding the cutoff, I'm happy with your suggestion. The main thing is that we need to use the same threshold that we use in the admin report:

image

The graph here will likely change to accomodate the additional emotion dimensions, but, if it will still show a count per emotion, we need to respect that same count in the filtered view.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That graph is going the way of the dodo. We will replace it with a table that will contain the links to this new filter.

This PR is only adding the filter, but they won't be used yet.

Added the proposed filter in 38d14e4, see the updated tests.

Copy link
Contributor

@pmusaraj pmusaraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try it!

@xfalcox xfalcox merged commit 5026ab5 into main Nov 14, 2024
6 checks passed
@xfalcox xfalcox deleted the emotion-filter branch November 14, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants