resources/statistics/labels

Gets detailed summary of labels set on the segment and on the text in the specified language. Labels are colored "tags" that a user can attach to segments and translations.

The returned information includes the total labels found with their values.

URL

(POST) /resources/statistics/labels

PARAMETERS

The message body contains a JSON object:

scope

The scope object. This delimits the segments we aggregate to a project, a job, a resource etc.

Mandatory, object
queryA query object. To filter the data in scope. Permits to find, for example, all labels in erroneous segments. Mandatory, object
locales

An array of language to get labels for. The system always returns segment- and text-level labels.

A label attached to a segment is often used to confer information such as domain, category etc.

A label attached to a specific language is often used to flag translation errors, re-usability etc.

Mandatory, string[]

 

RESULTS

The message body contains a JSON object:

segmentsTotal segments in scope and query.long

counts

An array of found labels:

  • id: The unique label identifier (number)
  • value: The label value (number)
  • locale: Null if the label is attached to the segment. Otherwise the locale to which the label is attached.
  • segments: Total segments
  • words: Total words (note: this field may not be populated in your platform)
object[]
locales

The list of locales scanned (same as method parameter). Each item has these elements

  • v: The language code such as "en-US", "fr"...
  • t: The language name
object[]
labels

The list of all the labels defined in the platform. To configure labels in Wordbee Translator go to "Settings" and then "Labels".

See Label (Object) for the properties included with each label.

object[]


ACCESS RIGHTS

In Wordbee Translator a user can be given the right to view and to edit labels.

This method will return an error if the connected user is not authorized to view labels.


EXAMPLES

See this example:

{
  "segments": 6510,
  "counts": [
    {
      "id": 1,
      "value": 0,
      "locale": null,
      "segments": 626,
      "words": 3465
    },
    {
      "id": 1,
      "value": 1,
      "locale": null,
      "segments": 8,
      "words": 56
    },
    {
      "id": 1,
      "value": 1,
      "locale": "en",
      "segments": 60,
      "words": 340
    },
    {
      "id": 2,
      "value": 3,
      "locale": null,
      "segments": 26,
      "words": 132
    }
  ],
  "labels": [
    {
      "id": 2,
      "name": "Usefulness",
      "isSticky": false,
      "isStickyInLists": false,
      "options": [
        {
          "name": "High quality",
          "value": 4,
          "htmlColor": "#92D050"
        },
        {
          "name": "Medium quality",
          "value": 1,
          "htmlColor": "#FFCC00"
        },
        {
          "name": "Low quality",
          "value": 2,
          "htmlColor": "#CC6600"
        },
        {
          "name": "Do not use",
          "value": 3,
          "htmlColor": "#FF4F4F"
        }
      ]
    },
    {
      "id": 1,
      "name": "Errors",
      "isSticky": false,
      "isStickyInLists": false,
      "options": [
        {
          "name": "Grammar",
          "value": 0,
          "htmlColor": "#92D050"
        },
        {
          "name": "Terminology",
          "value": 1,
          "htmlColor": "#d0d0d0"
        }
      ]
    }
  ],
  "locales": [
    {
      "v": "en",
      "t": "Anglais"
    }
  ]
}



Copyright Wordbee - Buzzin' Outside the Box since 2008