AI/Machine Learning Services

Superdesk can interact with service analysing article using machine learning.

Analyzing an article

A text can be analyzed using following endpoint:

AI_SERVICE_ENDPOINT = 'ai'[source]

main endpoint to interact with AI Services

class AIService(datasource: str | None = None, backend=None)[source]

Service managing article analysis with machine learning/AI related services

When doing a POST request on this service, the following keys can be used (keys with a* are required)

key

explanation

service *

name of the service to use

item *

item metadata to be analyzed

e.g. to get autotagging with iMatrics service:

{
    "service": "imatrics",
    "item": {
        "guid": "some_id",
        "headline": "item headline",
        "body_html": "item content"
    }
}

Manipulating service data

Various data of the services may need to be manipulated, this is done following endpoint:

AI_DATA_OP_ENDPOINT = 'ai_data_op'[source]

endpoint to manipulate AI Services data

class AIDataOpService(datasource: str | None = None, backend=None)[source]

Service to manipulate AI service related data

When doing a POST request on this service, the following keys can be used (keys with a * are required):

key

explanation

service *

name of the service to use

operation *

operation that you want to do on the data (search, create, …)

data_name

type of data to manipulate (empty for default or when service only handle one type of data)

data

argument of use for the operation

e.g. to search for tags with iMatrics service:

{
    "service": "imatrics",
    "operation": "search",
    "data": {"term": "some_term"},
}

AI services

So far, Superdesk supports the following AI Services:

class IMatrics(*args, **kwargs)[source]

IMatrics autotagging service

The IMATRICS_BASE_URL, IMATRICS_USER and IMATRICS_KEY setting (or environment variable) must be set IMATRICS_AUTHOR can be used to set author of concept (which translates to source in Superdesk)