Picard / genre scripts / Wikidata Genre plugin

I’ve been noticing some unexpected results with a script regarding genres that I am using.
In trying to narrow down what is happening it seems it is related to this:

In Picard I have set ‘use genres from MusicBrainz’, and I have the wikidata genre plugin active.
That seems to work well, and I am assuming Picard retrieves both genres from MusicBrainz and wikidata, and assembles them together into the genre tag.

But now I create a custom secondary genre tag named genre2.
I have some complicated purpose and scripts for it, and while that seemed to work well, I have also been noticing some unexpected results in the sense that genres sometimes differed between the original genre tag and the output of my script.

Then I tried to narrow the issue down. Here is a very simple script, used on two tracks that indicate very well what seems to be the cause of the issue:


Using this simple script:
$set(genre2,%genre%)

The first track gets nothing for genre2, the second one only gets ‘Soul’


.

It’s not completely obvious to me where the genres get sourced from exactly, but I am guessing that only the ones from Wikidata don’t get ported over to genre2?
Is this some oversight in Picard or the Wikidata plugin, or am I missing something and am perhaps doing something wrong?

1 Like

No. If the wikidata plugin finds a genre it would overwrite the genre tag from MusicBrainz. If you use multiple genre plugins the behavior would be basically undefined at the moment, one of them would “win”.

As far as I can see Wikidata is not involved at all. The only entity involved (looking at release-goup, work, track artist and album artist) that has a wikidata link would be the artist “Bill Withers”, and I don’t think you have configured the Wikidata plugin to use artist genres as Wikidata has the grenres pop music, soul music and rhythm and blues.

What instead happens is that it loads the genres from MB, and Don’t Make Me Wait has no genres while Oh Yeah! has “soul”. There are not genres set on the release or release group, and artist genres again are not being used (due to your configuration).

2 Likes

Thanks for the fast and well-thought-through reply!
I’ll do some more testing, probably tonight or tomorrow.
This matter obviously is too complicated to rush to conclusions :wink:
(I did take a quick look at the Wikidata plugin settings and noticed I do have ‘use artist genres’ checked b.t.w.)

Small correction: The Wikidata plugin indeed merges its genres with the ones previously loaded (so the ones from MB in your case). But that’s indeed plugin specific, the last.fm or AcousticBrainz plugins overwrite.

Having the genre handling unified, to allow several sources to combine their data with central settings for final filtering, is on the todo list. This all comes from a time where there was no built-in support for genres for Picard and the only plugin that was commonly used was the last.fm one.

I also tried Wikidata plugin with your example with the Wikidata default configuration, and it loads genre as “Pop Music; Rhythm And Blues; Soul; Soul Music” for me (from the artist entry on Wikidata).

2 Likes

Huh, there’s also an AcousticBrainz genre plugin?
(with regards to genres, is that related to/same as ListenBrainz?)
Does AcousticBrainz contain genre data different from MusicBrainz?

Questions, questions, this is probably gonna take me weeks to figure out, not days :wink:

Hm, before I can figure this out further, it looks like I need to go back to some very basics:
I must admit I don’t even know where to find the genres for a release on MusicBrainz.

With all genre plugins disabled, only using Picard’s internal ‘use genres from MusicBrainz’ (with all it’s other options unchecked), I get this for this release:

But searching it’s MusicBrainz page, I can find no genres listed at all:

Where can find them?

Look on the release and release group:

And if you have configured it to also use release artist genres look there as well.

Yes, AcousticBrainz does acoustic analysis and classifies recordings based on this. I think it should be considered rather experimental.

You can see the results of such an analysis for the recording Jenny (Iowa Sunrise) you linked above by looking at:

https://acousticbrainz.org/4019f80d-7b7a-471a-a103-67cc4eb1929e

Depending on the analysis model it get classified as Jazz, Ambient, Electronic, Classical :smiley: I don’t know much about it, but I think the analysing models in use here are trained on specific subsets of musics, e.g. the genre_electronic model is meant to be used on electronic music, so it does give odd results on anything else.

It’s also linked on the recording page’s sidebar on the right. The key and bpm information is also taken from AB.

grafik

2 Likes

Ah thanks.
I did look at the release page which also says ‘genres none’.
But indeed drilling down to the release group page does show them.

Isn’t it a bit strange that they don’t display the same on genres?
Or could a release have different genres from the release group it belongs to?

The AcousticBrainz feature seems interesting, but indeed probably a bit too experimental to make serious use of.

On musicbrainz.org the folksonomy tags and genres on the right are for the entity you see. If you add something there it is added for that entity only.

1 Like

Are you sure that link is correct?
It leads me to some weird bitcoin landing page.

Just curious: I noticed my startpost was edited by @yvanzo, but I don’t see what was changed?
Was there something wrong?

I think it was a change to the topic tags.

I just moved it under MusicBrainz Picard category.

So I didn’t post it there?
I would have sworn I had. Sorry.

@outsidecontext I agree with this statement and I suggest that we set the following rules and implement them into Picard / plugins:

A. Picard and all genre plugins set hidden variables for the genres they provide;
B. Plugins always add to the genres rather than replacing them.

If we do this, then you don’t get plugins overwriting existing genre information, and people can script for any alternative approach that they want.

4 Likes

That brings me to another aspect I seem to have had a wrong and vague notion about; folksonomy tags.

I somehow always assumed folksonomy tags were also genre tags that were retrieved form some other source than MusicBrainz. Some third party database called ‘folksonomy’ that was much less curated but could provide useful genres.

But it looks like what is called ‘folksonomy tags’ in Picard, is the same as what is called ‘other tags’ on MusicBrainz?

Yes. The folksonomy tags are the original capability of how users could tag all entities on MB. This can be used for anything, including genres. See https://musicbrainz.org/doc/Folksonomy_Tagging.

MusicBrainz’ genre feature builds on the existing folksonomy tags. At it’s core it is a whitelist of tags that should be considered genres.

Before MusicBrainz had explicit genre support Picard already allowed you to use the folksonomy tags for genres.

2 Likes

Now that it has, and the genre database is getting better and better, I have some other food for thought:

Picard has a default setting of 90% match for tags to be retrieved.
I always left it like that since otherwise a lot of non-genre, or incorrect genre tags would get retrieved.

But doing some testing, setting it at 1% immensely improved the amount of valid and usable genres retrieved. (but of course that will also add many undesired ‘other’ tags)

So it seems that for the ‘genre’ tag the setting of 90% is much too high.
But for ‘folksonomy/other tags’, a high value is much more apropriate.
So it might be good (if possible) to separate them in Picard?
And maybe have the option to disable ‘other tags’ getting retrieved and mingled with ‘genre’ at all?

1 Like

Another question:
I would like to do more testing on how Picard retrieves genres with regards to how it retrieves them form recordings vs releases vs release groups etc. (what trumps what exactly?)

There is a MusicBrainz testing database that you can use to experiment with editing. So I am guessing you could test entering and editing genre tags there too.
Is there a way to get Picard retrieving the data from that test database instead of from the real database?

Or is there perhaps a testing release/release group in the real database that one can fool around with?

It depends on what you want to have. If your goal is to retrieve all genres anyone ever tagged this with, set it very low. If you want to filter out outliers a higher value (something between 60-90 %) is more appropriate. This is still subjective crowd sourced data, with the idea that given enough people tagging the most relevant genres will get visible, forming kind of a crowd consensus. The idea of the min genre usage value is to filter out those genres that got significantly less votes than the highest voted genre. If a hundred people tagged something as “Neoclassical metal” and one put in “Hopepunk” (just picking some stuff from recent discussions) I would give some trust that “Neoclassical metal” is a proper classification of this piece of music while “Hopepunk” isn’t (even if I have no idea what either of them actually is). But if 90 people had tagged it “Hopepunk” then probably both genres describe this music well.

I had written a bit how this works at Picard 2.x and genres. Good practices? Advice on plugins? - #12 by outsidecontext

But I agree that we could set this lower to maybe 70% now that we default to actual genres.

You can already do this, and actually it is the default on new install. Just disable “Use folksonomy tags as genres”.

The genres from recording, release and release group are combined (including their votes). If you have enabled artist genres the genres of the artist get also merged in.

Yes, set test.musicbrainz.org as the server address in Options > General.

3 Likes