Working with See-Also and Classify

Hello, I’ve finally begun working towards training my Devonthink AI for See-Also and Classify. I was expecting to find a ‘Classify To’ submenu in the Data menu, which would be used to train the AI. However such does not exist. Does the Move To submenu in the Data menu do this ? Where is the Classify To ? There is Classify… but not ‘Classify To’. This is in DT 3.8.

Further question, … when using the See Also and Classify Inspector… when putting in a folder name in the search field, it doesn’t pick-up folder names that do exist in my database… Is the search field restricted in some way shape or form ? Is this deliberate ? Why is it so and why could I not force a folder name that exist by tying it explicitly ?

Do you have the See Also & Classify inspector open?
If so, what do you see in the Classify section when you only see Data > Classify?

I’m not seeing an issue searching for groups to match. A screen capture could be helpful.

The example here is that I am trying to classify an invoice for my Costco credit card, in in my ‘Bills’ Database, I have a Group called ‘CC’ and a SubGroup called ‘CostcoCC’. When I look into the Global Inbox, with the PDF of my Costco CC… I look at the ‘See Also and Classify’ inspector… then I see in the ‘See Also’ section, other PDFs which are ‘relevant’ and do exist in the ‘CostcoCC’ SubGroup. However, the ‘CostcoCC’ subfolder doesn’t appear in the ‘Classify’ area. And when I enter ‘CostcoCC’ in the search field, expecting it to ‘find’ the CostoCC SubGroup, it doesn’t find it either. And also, I was expecting there to be a ‘Classify To’ SubMenu in the Data Menu where I could force a classification into a folder manually … However, in the Data Menu, there is no ‘Classify To’… only a ‘Move To’ and a ‘Classify’. … Where is the ‘Classify To’ submenu in the ‘Data menu’ … does it exist ?

After Much Playing Around, what I am able to do is to Recreate an entirely new Group outside of my CC Group in my ‘Bills’ Database, call it ‘CapitalOneCostco’, then move all the files from my ‘CostcoCC’ subgroup to it, and move back that new ‘Subgroup’ back into my ‘CC’ Group. And the ‘Classify’ inspector ‘sees it’.

So this brings me to two almighty important questions … 1) What is the way Devonthink will try to go down the list of ‘subgroups’ across all groups across all databases 2) what happens if you have 3 subgroups called ‘CC Costco’, ‘CC Mastercard’ and ‘CC Visa’ with a nice space… can it punch through this ? and 3) where does the ‘Classify to’ intelligence gets stored and does it sync across CloudKit ?

Finally, one last question, is the logic behind in the ‘See also’ is to offer an ‘Alternative view’ on the Classify … for instance… shouldn’t DevonThink pick up ‘CC Costco’ as a ‘Subgroup’ with its AI to offer classifying into… but find a whole bunch of other PDFs that look just like it in the ‘See Also’… then would it not make sense to be able to drag and drop the file at the ‘Top of the List’ in the ‘See also’ section onto another file in the ‘See Also’ list stored in the Group/SubGroup/SubSubGroup where things should be classified into… with a goal of sending a clear instruction to Devonthink… ‘Please learn how Classify this file at the top of the list’ just like the file which I am drag and dropping right onto it ? For now, drag and dropping within the ‘container’ of the ‘See Also’, from the file at the top of the list, to a file below … doesn’t do anything… it bounces…

As I am making plans to entrench myself even more into Devonthink… it would be great if I could have a better feel on how to train the AI engine and how the training gets synced…


I took a look at both the manual and my menus, and can confirm that there does not seem to be a “Classify To” menu entry in DT 3.8’s Data menu. However, the manual only mentions a “Move (To)” and “Classify” menu entry, not “Classify To”. What’s the source you got that information from?

Also, be aware of two restrictions of the automatic classifier mentioned in the manual:

(Emphasis mine). So you may need to re-think your workflow and start to manually put things where they belong for a while; my normal way to do this is to

  • Open the “See also” inspector
  • Select one or more documents
  • Select or type the target group in the inspector
  • press CTRL-C to send the documents there

That seems odd and may be the source for your issues. Is it possible that your target database is closed?

Hello, in the help, it is mentioned:

On a related note, in the [Data](file:///Applications/ menu, you will find two menu items: Move to … again and Classify to… . The first provides you the option to classify the current document in the group into which you classified. If you filed into a particular group via the Groups section, this menu item would remember it and offer that group as a place to classify the current document. The second menu item offers its top ranked suggestion for classifying the current document, if you’d like to just follow the AI’s suggestions.

It is not ‘Classify To’ but rather ‘Classify’… the help is confusing … Classify To has both words in Italics… and now that I am thinking about it… it would great to have such a menu… its a SuperMove that guarantees and forces the training to a full list of folders… just like Move has the same full list of folders and not leaving it to a search to flaw and restrict the list of folders… makes sense ?

In principle, I am expecting that by manually entering a group name in search, search will find everything.

It would seem that the search for groups in the see also and classify inspector is failing to exhaustively list all groups and subgroups of all opened databases. As i am trying to investigate this, it would be great to get from the developers their actual design intent here.

Have you excluded any groups from searching in the Info inspector?

B.I.N.G.O … the sub-groups were not picked-up because the parent group had a property of ‘exclude from classification’. Thanks!

Is there a way to diagnose this … find which groups are excluded from classification in a database ?

But also … I find that my idea of drag and dropping in the ‘See Also’ pane of the inspector, from the file at the top over a ‘related’ file below, as a means to move that file to the same folder as that file … seems like a worthy feature to add!

In the same manner… having a ‘Classify To’ Submenu in the Data Menu, as opposed to a ‘Move To’ menu… unless the ‘Move’ submenu does ‘Classification’ implicitly, which is worth documenting :wink:

Happy camper here.

Glad to hear it.

Here’s a little code snippet you could run…

tell application id "DNtp"
	set currentDB to (current database)
	set excludeFromSearch to (parents of currentDB whose (exclude from search = true))
	if excludeFromSearch ≠ {} then
		set exclusionList to {}
		repeat with thisrecord in excludeFromSearch
			copy (("[" & name of thisrecord as string) & "](" & (reference URL of thisrecord) & ")  " & linefeed) to end of exclusionList
		end repeat
		set newDoc to create record with {name:"Groups Excluded From Search", source:exclusionList as string, type:markdown} in (root of currentDB)
		open tab for record newDoc
	end if
end tell
1 Like

How do you recommend I run this code ?

Paste it into a new document in Applications/Utilities/Script Editor.
Save the document to the ~/Library/Application Scripts/com.devon-technologies.think3/Menu directory.
The script will now be available for use in theScript menu in DEVONthink.

OK Folks … 4 ways to the same salvation of being to get the ‘See also and Classify’ pick up all possible groups… the first one requiring no code:

  1. Use the ‘Properties’ inspector to ‘toggle off’ a hybrid state.

Create a smart group set to ‘not exclude subgroups’ and kind is set to ‘groups’ and then select all groups and look at the classification property in the inspector for ‘all selected groups’. Then toggle of the ‘Classification’ from a ‘dash’ to ‘nothing’ - this requires NO CODE

  1. If you want to kill all ‘exclusions’ from Classification in one database run this:
tell application id "DNtp" to set properties of (every record of current database whose (exclude from classification is true)) to {exclude from classification:false}

However, I observe that it doesn’t work for subgroups…

  1. If you want to list all exclusions into a ‘Markdown’ document named ‘Groups Excluded From Classification’ in the root of the database, then run this:
tell application id "DNtp"
	set currentDB to (current database)
	set excludeFromClassification to (parents of currentDB whose (exclude from classification = true))
	if excludeFromClassification ≠ {} then
		set exclusionList to {}
		repeat with thisrecord in excludeFromClassification
			copy (("[" & name of thisrecord as string) & "](" & (reference URL of thisrecord) & ") " & linefeed) to end of exclusionList
		end repeat
		set newDoc to create record with {name:"Groups Excluded From Classification", source:exclusionList as string, type:markdown} in (root of currentDB)
		open tab for record newDoc
	end if
end tell
  1. You can do it with ‘Tags’ … however, Generally, the databases are set to exclude groups from Tagging, so creating ‘Tags’ for Groups that are set to be ‘Excluded from Classification’ is counter-intuitive. However, I could not get the script below to work and it should in principle…
property theExcludedFromClassificationTag : "_Excluded from Classification"

tell application id "DNtp"
		set theDatabase to current database
		set theContents to contents of theDatabase whose exclude from classification is true
		repeat with thisContent in theContents
			set tags of thisContent to (tags of thisContent) & {theExcludedFromClassificationTag}
		end repeat
		set theTagGroup to create location "/Tags/" & theExcludedFromClassificationTag in theDatabase
		open window for record theTagGroup
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
	end try
end tell
1 Like

Darn! I just realized that my target database for scientific articles had the ‘Exclude from Classification’ flag toggled on for most of the the target groups. Why did I ever set these groups as excluded from classification ??? For the last year, I piled up 288 articles in a yearly inbox… failing to be able to quickly dispatch in the proper groups. This is problematic enough that I think it would worthwhile for DT to add a checkmark like ‘Current Database Only’ with the feature ‘Override groups excluded from classification’.