Skip to content

Create API to extract terminology matches from provided text #4512

Description

@flodolo

Terminology matches are particularly useful to get consistent translations when prompting LLMs.
Right now, we can search terminology via api/v2/search/terminology/, but that doesn't scale when translating a file in multiple locales, as it would require an absurd amount of calls (terms can be made of multiple words, so would need to get all combinations of 1–3 words in all strings, then send N queries, where N = num_locales x combinations)

Extract from string

Entrypoint: api/v2/terminology/extract-from-text.
Auth: Doesn't requires PAT, since it's only one string.

Accept a locale and text parameters. Returns a list of matching terms.
text should be capped, e.g. at 2k strings, and return an error if the string exceeds it.

{
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "definition": "string",
      "part_of_speech": "adjective",
      "text": "string",
      "translation_text": "string",
      "usage": "string",
      "notes": "string"
    }
  ]
}

Extract from file

Moved this to #4534

Activity

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

Metadata

Metadata

Assignees

Labels

APIP3Default, possibly shipping in the following two quartersdays

Fields

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions