Skip to content

Feature req: Labels in multiple languages in REST API suggest method(s) #918

Description

@osma

We received this feature request for the Finto AI API, which is basically the Annif API:

"Is it possible to have your Finto AI API return all available language equivalents for a given term? Currently, for example, when using YSO EN, it only returns the term in the English language (or the language specified as a parameter), even though there are likely other translations available. The desired functionality would be for the API to return all available equivalents for a term across all supported languages. For example, if we send a project request using yso-en and specify Finnish (fi), Swedish (sv), and English (en) as the desired languages, we would like to receive suggestions for the term in all three of those languages within a single request."

(machine translated from the original Finnish)

One question is how the response data would look like. Currently the suggest response looks like this:

{
  "results": [
    {
      "uri": "http://example.org/subject1",
      "label": "Archaeology",
      "notation": "42.42",
      "score": 0.85
    }
  ]
}

Instead of a single string value for the label field, we could return something like:

      "label": {
          "en": "archaeology",
          "fi": "arkeologia",
          "sv": "arkeologi"
      }

Another option would be to use several language-specific fields like label_en , label_fi, label_sv.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions