Description
Count distinct nonnull targets aligned to one source token.
Language-processing records depend on tokenization, indexing, null sentinels and text representation. A UTF-8 byte offset, UTF-16 index, dependency link or literal feature label can be handled precisely without inferring linguistic correctness or semantic equivalence.
Count distinct nonnull targets aligned to one source token.
When to use this tool
Use Word Alignment Fertility Count when checking a supplied linguistic annotation, span, alignment or text-offset convention.
How to use the tool and how it works
- Enter sourceTokenId, alignedSourceIds, targetIds, nullAligned. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read fertility, hasNullAlignment. Inspect hasNullAlignment before interpreting the associated values.
Count distinct nonnull targets aligned to one source token. Require aligned arrays, nonempty sourceTokenId and nonempty nonnull target IDs; fertility deduplicates matching nonnull targets, hasNullAlignment separately checks matching null records.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| sourceTokenId | Source Token Id | Required. Text; maximum UTF-16 length 8192. |
| alignedSourceIds | Aligned Source Ids | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| targetIds | Target Ids | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| nullAligned | Null Aligned | Required. Array of boolean; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| fertility | Fertility | Required. Safe integer. |
| hasNullAlignment | Has Null Alignment | Required. Boolean. |
{
"input": {
"sourceTokenId": "s1",
"alignedSourceIds": [
"s1",
"s1",
"s1",
"s2"
],
"targetIds": [
"t1",
"t1",
"",
"t2"
],
"nullAligned": [
false,
false,
true,
false
]
},
"output": {
"fertility": 1,
"hasNullAlignment": true
}
} Limitations and assumptions
- Null labels and alignments are supplied; the count is not inferred from text or a complete alignment model.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use the appropriate tokenizer, Unicode and annotation-format conventions and validate the complete text or tree for full linguistic processing.
References
Similar or alternative tools
- Word Alignment Null Partner Flag
Return a word-alignment pair and null-partner flag.
- Alignment Null Support Share
Summarize alignment weight at supplied null indexes.