> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/curator/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/curator/_mcp/server.

# nemo_curator.stages.text.experimental.translation.utils.metadata

Output helpers for translation metadata and message reconstruction.

## Module Contents

### Functions

| Name                                                                                                                                               | Description                                                  |
| -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| [`_parse_structured_messages`](#nemo_curator-stages-text-experimental-translation-utils-metadata-_parse_structured_messages)                       | Return translated messages when they are already structured. |
| [`_set_nested`](#nemo_curator-stages-text-experimental-translation-utils-metadata-_set_nested)                                                     | Set a nested value when the full path already exists.        |
| [`build_translation_metadata`](#nemo_curator-stages-text-experimental-translation-utils-metadata-build_translation_metadata)                       | Build translation metadata as JSON.                          |
| [`merge_faith_scores_into_metadata`](#nemo_curator-stages-text-experimental-translation-utils-metadata-merge_faith_scores_into_metadata)           | Merge FAITH scores into existing translation metadata.       |
| [`reconstruct_messages_with_translation`](#nemo_curator-stages-text-experimental-translation-utils-metadata-reconstruct_messages_with_translation) | Return a copy of messages with translated content inserted.  |

### API

```python
nemo_curator.stages.text.experimental.translation.utils.metadata._parse_structured_messages(
    translated_text: object
) -> list[dict[str, object]] | None
```

Return translated messages when they are already structured.

```python
nemo_curator.stages.text.experimental.translation.utils.metadata._set_nested(
    obj: dict[str, object],
    keys: list[str],
    value: object
) -> None
```

Set a nested value when the full path already exists.

```python
nemo_curator.stages.text.experimental.translation.utils.metadata.build_translation_metadata(
    target_lang: str,
    translated_text: str | None = None,
    translation_map: dict[str, object] | None = None,
    segmented_translation_map: dict[str, object] | None = None
) -> str
```

Build translation metadata as JSON.

```python
nemo_curator.stages.text.experimental.translation.utils.metadata.merge_faith_scores_into_metadata(
    metadata_json: str,
    faith_scores: dict[str, object]
) -> str
```

Merge FAITH scores into existing translation metadata.

```python
nemo_curator.stages.text.experimental.translation.utils.metadata.reconstruct_messages_with_translation(
    original_messages: list[dict[str, object]],
    translated_text: object,
    field_path: str = 'content'
) -> list[dict[str, object]]
```

Return a copy of messages with translated content inserted.