# CodeBLEU

**Objective:**

CodeBLEU is a comprehensive metric for evaluating code generation, integrating BLEU with code-specific aspects such as syntax and dataflow. It measures both linguistic and structural similarity, making it suitable for assessing code accuracy beyond surface-level token matching.

**Required Columns in Dataset:**

`Generated Code`, `Reference Code`

**Interpretation:**

* **High CodeBLEU Score:** Indicates strong alignment with the reference solution in terms of both syntax and logic.
* **Low CodeBLEU Score:** Reflects potential deviations in code structure or logic, which may impact functionality.

**Execution via UI:**

<figure><img src="https://1811327582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbIiNdp1QbG4avl7VShw%2Fuploads%2Fo4vcsgikR48WeVLbS2lx%2FScreenshot%202024-10-28%20at%204.49.03%E2%80%AFPM.png?alt=media&#x26;token=0ce19529-c2de-4df6-837c-542fbbd903d1" alt=""><figcaption></figcaption></figure>

**Execution via SDK:**

```python
metrics=[
    {"name": "CodeBLEU", "schema_mapping": {"generated_code": "Generated Code", "reference_code": "Reference Code"}}
]

```
