Automatic tagging

Questions, comments, discussions. Over time certain topics might be moved to their own category.
Post Reply
MadHatter
Posts: 2
Joined: Sun May 02, 2021 3:28 pm

Automatic tagging

Post by MadHatter »

Hey dear Mayan community,
I'm quite new to Mayan, so please bear with me, if my question might be stupid.
I'm intending to use it for my personal documents and I had the idea to provide my document scans with names, that would enable Mayan to automatically extract custom metadata as well as tags, and I thought of something along this line:

Code: Select all

<doc_label>_<doc_type>_<doc_date>_<incremental_number>_TAGS_<tag1>_<tag2>...pdf
doc_label would be become the displayed name within Mayan, the doc_type would be the intended document type on upload, doc_date would be a metadata field telling the date represented in the document (e.g. letter dating 2021-01-01, in contrast to the upload date), incremental_number would be an integer >=0, and after "TAGS" I would list all the tags I want attached to the document joined by underscores.

With my limited experience, I thought, I could build a workflow, that would execute all these extractions automatically, whenever a document is uploaded e.g. via the watch folder. However, I'm not yet capable of building something like this. I found the documentation on the Wiki lacking in terms of practical usage of the system, the same holds true for the book. If someone could explain, how I could achieve this, I'd say rather basic, use case, it could also be used in the Wiki and book as practical example.

Thank you in advance to all the answers.
User avatar
michael
Developer
Developer
Posts: 89
Joined: Sun Apr 19, 2020 6:21 am

Re: Automatic tagging

Post by michael »

Hi, You are on the right track, the workflow was designed to this purpose. However this will require workflow actions that are not yet implemented.

Due to access control restrictions, a workflow cannot create new tags on the fly, they need to be created beforehand by a user with the proper permission. This is not critical in your case as you have control and knowledge of the documents and can create these before uploading the documents.

The workflow actions have the ability to parse different attributes of the document. This ability is used to condition the execution of the action. However right now the tag workflow action is only able to attach or remove a tag that was specified when the workflow was defined. It cannot attach or remove tags specified during runtime (dynamic tag labels in this case).

The documentation does contain several hundred pages as does the book. But it is impossible to have examples for every use case, and every use case will also have many variations and can be implemented in different ways. This is why we provide consultation services. In terms of the book, I believe Roberto is planning on releasing multiple versions of the next book to target different audiences.

The use case seems basic at surface level, but adapting it to the existing workflow actions is not straight forwards. Not all of this can be done dynamically and some actions (document type and tags) will have to be created with static values for each possible tag.
MadHatter
Posts: 2
Joined: Sun May 02, 2021 3:28 pm

Re: Automatic tagging

Post by MadHatter »

Hey Michael,
thank you for your answer. I figured, that I could only attach tags, that are known to the system, and my assumption would be, that I need one action per tag, as far as I understood actions so far. I'd argue, that it is even to be discouraged to create tags on the fly as typos would make the setup messy.

What I'm struggling with is the templating part, which is also the aspect, where I'm currently searching for examples in the documentation + book. Is there maybe an introduction somewhere on how to write these templates (for filter, lookup, etc.)?
For the described use case, what would/could the condition for the attach-tag action look like?

Thanks again for the help!
Post Reply