# NOTE: # This is a starter layout for the redesigned MTQE demo. # Copy your existing evaluate() function and LANGUAGES dictionary into this file. import os import requests import gradio as gr API_URL = "https://api.pangeanic.com/mtqe/v2/score" API_KEY = os.environ.get("MTQE_API_Key", "") LANGUAGES = { "English": "en-us", "Spanish": "es-es", "French": "fr-fr", "German": "de-de", "Italian": "it-it", "Portuguese": "pt-pt", "Russian": "ru-ru", "Chinese": "zh-cn", "Japanese": "ja-jp", "Korean": "ko-kr", "Arabic": "ar-001", "Thai": "th-th", "Vietnamese": "vi-vn", "Lithuanian": "lt-lt", "Swedish": "sv-se", } def score_color(score): if score >= 90: return "#22C55E" # Green elif score >= 75: return "#84CC16" # Lime elif score >= 60: return "#FACC15" # Yellow elif score >= 40: return "#FB923C" # Orange else: return "#EF4444" # Red def evaluate(source_language, target_language, source, target): payload = { "source": source, "target": target, "source_language": LANGUAGES[source_language], "target_language": LANGUAGES[target_language], "ape": False, } headers = { "accept": "application/json", "Content-Type": "application/json", "X-API-Key": API_KEY, } r = requests.post(API_URL, json=payload, headers=headers, timeout=60) r.raise_for_status() j = r.json() score = j["score"] explanation = j["explanation"] color = score_color(score) html = f"""
This interactive demo showcases the core capabilities of Pangeanic MTQE v2 by estimating translation quality from a source sentence and its translation without requiring reference translations. The complete enterprise platform extends these capabilities with advanced features designed for production localization workflows.
Incorporate Translation Memory matches into quality estimation.
Detect terminology inconsistencies and enforce approved terminology.
Automatically improve low-quality translations before delivery.
Prioritize segments requiring human review to optimize post-editing effort.
Integrate MTQE directly into CAT tools and enterprise localization platforms.
Supports more than 70 languages and regional variants for multilingual enterprise workflows.
Pangeanic MTQE v2 was validated using a representative subset of the ACES multilingual benchmark, covering 6,006 deliberately incorrect translation segments, 16 language pairs, and 68 translation error categories.
The complete enterprise platform includes Translation Memory support, Glossary validation, Automatic and Human Post-Editing workflows, batch processing, REST API integration, and multilingual support for more than 70 languages and dialects.