Assign existing tags / suggested tags

I’m trying to understand how the “Assign existing tags” and the “suggested tags” features work, in particular compared to the “Tags - Assign” script from DT3.

With the DT3 script, by default it assigned up to 5 tags (which could be changed by editing the script). If there were less tags that matched, it would assign less then 5; if there were more, it would assign the 5 most relevant tags. This was the behaviour no matter if the script was executed manually via Batch Process or via a smart rule upon import.

In the DT4 beta, I tried adding a sample document with “Assign existing tags” turned on in Settings > Files > Tags > Import. Upon import, 3 tags were assigned. When looking at the Tags section in the AI Inspector, it showed 7 additional tag suggestions. I then manually ran Data > Tags > Assign Existing Tags on the same document, and it assigned 3 more tags, leaving 4 unassigned suggested tags.

When I tried manually running Assign Existing Tags on existing documents that already had tags assigned (usually five, as I ran the DT3 script on them before) and additional suggested tags shown in DT4, sometimes all of the remaining suggested tags were added in addition to the existing tags and sometimes only some of them.

How does DT4 determine how many tags to suggest and how many to assign?

1 Like

Did you read the explanatory text in the Files > Tags settings?

It’s right there in the interface.

I did, and it added to my confusion. So the “Assign existing tags” feature doesn’t always assign existing tags, but first attempts a classification of the document and only assigns existing tags if the classification fails? Doesn’t “classify” mean assigning a document to a group? How is that related to tags?

In any case, how does that explain the behaviour described above, i.e., the discrepancy between the number of suggested tags, tags assigned upon import, and tags assigned when manually running the feature from Data > Tags > Assign Existing Tags?

but first attempts a classification of the document and only assigns existing tags if the classification fails? Doesn’t “classify” mean assigning a document to a group? How is that related to tags?

Because the classification is assessing potentially appropriate tags in the same ways as it handles assessing groups.

In any case, how does that explain the behaviour described above, i.e., the discrepancy between the number of suggested tags, tags assigned upon import, and tags assigned when manually running the feature from Data > Tags > Assign Existing Tags?

Development would have to comment on any technical aspects but I wouldn’t expect parity between the commands and the Tags inspector.

1 Like

The Tags inspector uses all possible ways and merges the results (as it’s up to the user to choose the desired tags in the end), the command Data > Tags > Assign Existing Tags has its own priorities.

1 Like

So, if I understand it correctly, the difference between classification and assigning tags from the title and text is that classification is “smarter” and takes into account other things such as other documents already assigned that tag.

And when manually running the command Data > Tags > Assign Existing Tags, it doesn’t first attempt a classification but directly assigns tags from the title and text, so this command is more like the old “Tags - Assign” external script from DT3?

The reason I am asking so many questions about this is that I heavily use the “Tags - Assign” script to assign tags to indexed files from the Bookends attachments folder, so I am keen on fully understanding how this works or will work in DT4 and whether it may even be an improvement on an already great feature.

And to ask yet another follow-up question, is there still a limit like before, where only the 5 most relevant tags were assigned?

Yes, that’s the internal limit. But you could of course still use the customizable script of version 3 in a smart rule.

That still works indeed, thanks.

However, I noticed that when running the command Data > Tags > Assign Existing Tags on a document without tags assigned, the tags that are assigned were among the suggested tags in the Tags inspector. I then ran the script of DT3 on the same document from within DT4 and additional tags were added that weren’t even among the suggested tags.

Does the command Data > Tags > Assign Existing Tags do further prioritization rather than just assigning the 5 extracted keywords with the most occurrences, like the script does? And shouldn’t the keywords/existing tags with the most occurrences be among the suggested tags?

The command of V4 uses not only the name & text but also the comments of documents. This might also make a difference.

Is there any way (via the UI, AppleScript or otherwise) to search for and list all records for which a given tag is suggested, but not yet assigned?

After some experimenting, I tend to get mixed results from the new Assign Existing Tags feature under Data > Tags (which I will abbreviate with “AET” in the following). When first removing all existing tags from my Bookends attachments and then running AET, for some of my tags it assigns very few or even no matching records and fails to assign the tag to documents that have the tag in their name and as their main subject. I tend to get better first results from initially running the V3 script in DT4 via Batch Process.

If I then subsequently run AET, it tends to find additional matching records for each tag, which were probably not assigned the tag due to the limit of 5 tags of the V3 script. These, however, I would prefer to manually triage to avoid potential overtagging, which is where the ability to search for suggested tags would come in handy.

A customized version of the V3 script could compare the suggestions to the current tags.

Do you mean by using extract keywords from record theRecord with existing tags without setting pMaxTags and then comparing the results to the current tags?

Or is there a way to actually lookup records for which a tag is suggested, as displayed in the Tags inspector?

Exactly.

I will try that then, thank you.

I think a proper reverse search for suggested tags (or, in other words, a way to show “suggested records” for a given tag) would be a useful feature, though. The tag suggestions are already a great addition, but going through >1000 records to find those for which a given tag is suggested isn’t all that feasible.

Thanks for the suggestion! Actually this would require a lot of time to process lots of documents, definitely not something that could be display on the fly.

1 Like

Which is why I would prefer DEVONthink doing it over doing it myself. :grinning_face_with_smiling_eyes: