Creates a new random sample for a given segments scope: A project, a job, a resource etc. Use cases:
- Evaluate quality of translations done in a specific project
- Evaluate quality of a specific job
- Evaluate quality of a translation memory
- Evaluate quality of any work done in any project over a period of time
URL
(POST) /resources/segments/randomsample/new
PARAMETERS
The parameters are a JSON object included in the request body:
type | Value must be: Scope | Mandatory, string |
scope | The scope object. The sample will be taken from the segments within this scope (project, job, resource...). | Mandatory, object |
layout | Optionally specify the segments' fields to include in the results. This is done using a layout JSON object. If not specified, the system will include the most relevant properties (including revision history). This should be just fine in almost all cases. | Optional, object |
src | The source locale (language code). | Mandatory, string |
trg | The target locale (language code). | Mandatory, string |
size | The expected sample size. Default is 10. This must be a value between 1 and 50. | Optional, int? |
persist | Optional boolean. Default is false. Only set to true if required. If true, then the results are temporarily saved and assigned a token (see sampletoken in results). | Optional, bool? |
includeresults | Optional boolean. Default is true. If true then the returned JSON includes the result node. Otherwise only the summary statistics are returned. If you further process results using the sampletoken you may not need the results with this call. | Optional, bool? |
You can further fine tune the sample with these additional parameters: Optional filter on the initial translation done. Values are: Optional filter on the current translation. Values are: Optional filter on the date of last translation edit. If set, the sample will include translations edited at or after this date only. boostWordsMin boostWordsMax This option lets you express a preferred word count of the segments to retain. The sample will then contain segments with similar word count at a higher probability than segments with less or more words (of the source text - not the translated text!). Explanation: If min is 10 and max is 15, the system will sample more segments with words in the range than other segments. Mathematically, the decrease of probability below min and above max is a Gaussian whereby the probability drops to below 0.2 beyond a certain range beyond the limits (between 3 words and twice the range width). Optional, int?Filter options editorInitial Optional, string? editorCurrent Optional, string? dteditfrom Optional, datetime? Scoring options
int?
RESULTS
A JSON with these properties:
samples | An array of samples. The present method produces a single sample, so there is always exactly 1 element in the array. See table below for properties. | int |
sampletoken | If assigntoken was set to true, then this field is a token. It is required to push the sample into a QA evaluation workflow (see related API methods). | string? |
layout | The layout for the columns included with the samples (see result.rows property below). See method parameter. The layout is explained here: Spreadsheet Layout (Object) | object |
Each samples array element has these properties:
segments | Total segments in sample. Note that this number will be less than the expected sample count if there is no or not enough data or the filter is too restrictive. | int |
words | Total source text words in sample. | int |
src | The source language of the sample | string |
trg | The target language of the sample | string |
result | Contains all the segments in the sample, information on the resources to which the segments belong as well as worker names.
| object[] |
result.rows | The list of segments. Includes main segment properties as well as the data columns specified in the layout parameter. The format is explained further down in this page. | object[] |
result.docs | A dictionary with all documents that appear in the results. This permits to show document names and more information per segment (see the did property of a segment). The format is explained further down in this page. | object |
result.users | A dictionary with all users/persons that are referenced by the segments included with the results. A segment references the persons that have last changed a text, a status, a bookmark etc. The format is explained further down in this page. | object |
ACCESS RIGHTS
The user must be authorized to access the scope.
EXAMPLE
-