cancel
Showing results for 
Search instead for 
Did you mean: 

AI custom model does not appear in digital workspace

miroslav
Star Contributor
Star Contributor

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

image

And this is the result:

image

image

1 REPLY 1

RogMagog
Champ in-the-making
Champ in-the-making

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.