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

Tag voting #1195

Open
dfabulich opened this issue Dec 4, 2024 · 3 comments
Open

Tag voting #1195

dfabulich opened this issue Dec 4, 2024 · 3 comments
Labels
needs discussion It's not clear how to begin/finish this tagging Improvements in IFDB's tags

Comments

@dfabulich
Copy link
Collaborator

VNDB has a tag voting system. https://vndb.org/d10

Tags can be assigned a vote from 1 to 3. This vote should be interpreted as follows:

  • 1: The tag does apply to the visual novel, but is not too apparent or only plays a minor role.
  • 2: The tag certainly applies to the visual novel.
  • 3: The tag applies, is very apparent and plays a major role.
  • Additionally, if you believe that a tag does not apply at all you can also downvote it.

Tags are displayed in the UI with their average score. Tags with an average score of 2.0 or higher appear visible by default. Tags with an average score lower than that appear only on the "tags" tab. (In IFDB, we'd presumably have a "see more" section or something.)

@dfabulich dfabulich added needs discussion It's not clear how to begin/finish this tagging Improvements in IFDB's tags labels Dec 4, 2024
@dfabulich
Copy link
Collaborator Author

Actually, I'm not 100% sure how the final score is calculated on VNDB. e.g. for Steins;Gate I see that "Part Time Job" is listed with a score of 0.6. It has 7 votes for it at 1.0, and two -3 downvotes. https://vndb.org/g/links?v=v2002&t=g1800

The average of that would be 0.11. Perhaps the "-3" downvotes only count as -1? That would average to 0.5555 which would round to 0.6. 🤔

@salty-horse
Copy link
Collaborator

salty-horse commented Dec 5, 2024

VNDB is open source. I think this is the relevant file. The latest commit "adjusts tag scoring calculation" (warning: Elm)

@dfabulich
Copy link
Collaborator Author

I think that's the thing that displays the tag score. The score itself seems to be calculated in SQL.

(COALESCE(AVG(tv.vote) filter (where tv.vote > 0), 3) * SUM(sign(tv.vote)) / COUNT(tv.vote))::real

AVG() filter means taking the average of rows that pass the filter; in this case, we're taking the average of the positive votes.
COALESCE means returning the first non-null value.
sign returns +1 for positive values and -1 for negative values.

The average of the positive values is 1. The sum of the signs is 5. There are 9 votes, so the result is 5/9, 0.5555.

I find this formula confusing. Perhaps I'll spend more time with it later. There's also a data browser that we can use. https://query.vndb.org/?sql=select+*+from+tags_vn_inherit+order+by+rating+limit+10&tab=t

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion It's not clear how to begin/finish this tagging Improvements in IFDB's tags
Projects
None yet
Development

No branches or pull requests

2 participants