Hello guys,
I'm trying to create my own AI model by
https://docs.alfresco.com/intelligence/concepts/custom-config-textract.html
I followed the documentation and checked it several times, created a custom AI content model, model context, property mapping, updated the share-config-custom.xml and digital worspace json file. No error in logs.
Unfortunately, the digital workspace does not display custom metadata. I must have missed something. Could you give me some advice?
I want to extract text from pdf invoices using AWS textract. I've started default recognition (e.g AI Text Lines, AI Dates aspects working) and try to add a custom model.
1) My custom model
<?xml version="1.0" encoding="UTF-8"?> <model name="my:contentModel" xmlns="http://www.alfresco.org/model/dictionary/1.0"> <description>Custom Content Model for Artificial Intelligence extension</description> <version>1.0</version> <imports> <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" /> <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" /> <import uri="http://www.alfresco.org/model/site/1.0" prefix="st" /> <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" /> <import uri="http://www.alfresco.org/model/ai/1.0" prefix="ai"/> </imports> <namespaces> <namespace uri="http://mymodel.org" prefix="my" /> </namespaces> <aspects> <aspect name="my:invoice"> <title>Invoice Info</title> <parent>ai:textract</parent> <properties> <property name="my:varsymbol"> <title>Variabilni symbol</title> <type>d:text</type> <multiple>true</multiple> <index enabled="true" /> </property> <property name="my:splatnost"> <title>Datum splatnosti</title> <type>d:text</type> <multiple>true</multiple> <index enabled="true" /> </property> <property name="my:ico"> <title>ICO</title> <type>d:text</type> <multiple>true</multiple> <index enabled="true" /> </property> <property name="my:dic"> <title>DIC</title> <type>d:text</type> <multiple>true</multiple> <index enabled="true" /> </property> </properties> </aspect> </aspects> </model>
2) AI property mapping
{ "keyValueMapping":[ { "aiTextract":[ { "key":"Variabilni symbol:", "aspect":"my:invoice", "property":"my:varsymbol" }, { "key":"Datum splatnosti:", "aspect":"my:invoice", "property":"my:splatnost" }, { "key":"ICO:", "aspect":"my:invoice", "property":"my:ico" }, { "key":"DIC:", "aspect":"my:invoice", "property":"my:dic" } ] } ] }
3) Update app.extension.json for digital workspace
"content-metadata-presets": [ { "id": "app.content.metadata.custom", "custom": [ { "id": "ai.metadata.features", "title": "AI Data", "items": [ { "id": "ai:products", "aspect": "ai:products", "properties": "*" }, { "id": "ai:dates", "aspect": "ai:dates", "properties": "*" }, ... { "id": "my:invoice", "aspect": "my:invoice", "properties": "*" } ... ] },
3) Update share-config-custom.xml
<?xml version="1.0" encoding="UTF-8"?> <alfresco-config> <config evaluator="string-compare" condition="DocumentLibrary"> <!-- Aspects that a user can see --> <aspects> <visible> <aspect name="my:invoice"/> </visible> </aspects> </config> </alfresco-config>
4) add rule and aspect to folder
And this is the result:
I’ve run into similar issues with getting new models to show up in digital workspaces. I once had trouble integrating a custom model for a project where I was using AI tools for business to automate document processing. I found that re-checking all the file paths and ensuring the model was correctly referenced in every config file helped. Also, sometimes clearing the cache or restarting the service can push through the changes.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.