Skip to main content
Loading navigation
Back to prompt library

Build an OCDS Procurement Release Language Normalization Pipeline — implementation

Linked challenge: Build an OCDS Procurement Release Language Normalization Pipeline

Prompt source

implementation79 lines11 sectionsNo variables1 code block
## Build
Parse Open Contracting Data Standard releases containing multi-lingual free-text fields. Extract default language tags, consolidate language-suffixed descriptions, and validate procurement party arrays for translation consistency.

## User
Public procurement risk officer

## Workflow
1. Ingest OCDS release packages containing planning and tender objects with multi-lingual suffixed fields.
2. Identify the declared default language tag from the OCDS release schema.
3. Extract and map suffixed fields (e.g., description_es) into a normalized translation map.
4. Generate a consolidated multi-lingual procurement summary for analyst review.

## Interface
Queue management view presenting contracting awards, supplier metadata, and consolidated translation maps.

## Data
Download standard public sample OCDS release packages featuring multi-lingual suffixed fields such as title_es and title_fr. Evaluate with simplified synthetic app records.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Open Contracting Data Standard](https://standard.open-contracting.org/latest/en/schema/reference/)
Extracts parties, language tags, and release structures from Open Contracting Data Standard schema reference 5.

## Tools
pydantic-ai, fastapi, pandas.
Pydantic AI enables strict schema validation and reliable LLM-driven parsing of diverse language-suffixed fields.
Local or hosted LLM compatible with Pydantic AI for schema extraction and normalization tasks.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Parses standard OCDS release package JSON without structural parsing errors.
- Extracts the default language tag and groups suffixed language fields accurately.
- Outputs a consolidated JSON translation map mapping fields by language code.

## Starter Examples
```json
[
  {
    "input": {
      "language": "en",
      "tender": {
        "title": "Road construction",
        "title_es": "Construcción de carreteras"
      }
    },
    "expected_output": {
      "default_language": "en",
      "translations": {
        "en": {
          "title": "Road construction"
        },
        "es": {
          "title": "Construcción de carreteras"
        }
      },
      "status": "VALID",
      "record_type": "Simplified synthetic app record, not complete official schema file"
    }
  },
  {
    "input": {
      "language": "es",
      "tender": {
        "description": "Servicios",
        "description_fr": "Services"
      }
    },
    "expected_output": {
      "default_language": "es",
      "translations": {
        "es": {
          "description": "Servicios"
        },
        "fr": {
          "description": "Services"
        }
      },
      "status": "VALID",
      "record_type": "Simplified synthetic app record, not complete official schema file"
    }
  }
]
```

## Safety
Procurement screening simulations only; does not cancel public tenders or disqualify real commercial vendors.
Use mock external writes. Require human review before any real deployment.