Skip to content

ykaitao

**Project Description:** LinguaEnv is an interactive evaluation environment designed to test and train AI agents on **morphological disambiguation**, a core challenge in natural language understanding.

Core trick

Agent picks the correct morphological parse from a real linguistic dataset loaded via Hugging Face datasets and scored by reward.

Tags

Description

**Project Description:** LinguaEnv is an interactive evaluation environment designed to test and train AI agents on **morphological disambiguation**, a core challenge in natural language understanding. **Key Features** * OpenEnv-compatible environment API * Real linguistic dataset with ambiguous morphological parses * Reward-based evaluation for agent decisions * Hugging Face dataset integration for lightweight deployment * Baseline agents and evaluation scripts for rapid experimentation
ykaitao/lingua_env★ 00 forksJupyter NotebookCreated Mar 8, 2026 · last push Mar 8, 2026

README excerpt

---
title: Lingua Env Environment Server
emoji: 📟
colorFrom: yellow
colorTo: red
sdk: docker
pinned: false
app_port: 8000
base_path: /web
tags:
  - openenv
---

# Lingua Env Environment

A simple test environment that echoes back messages. Perfect for testing the env APIs as well as demonstrating environment usage patterns.

## Quick Start

The simplest way to use the Lingua Env environment is through the `LinguaEnv` class:

```python
from lingua_env import LinguaAction, LinguaEnv

try:
    # Create environment from Docker image
    lingua_envenv = LinguaEnv.from_docker_image("lingua_env-env:latest")

    # Reset
    result = lingua_envenv.reset()
    print(f"Reset: {result.observation.echoed_message}")

    # Send multiple messages
    messages = ["Hello, World!", "Testing echo", "Final message"]

    for msg in messages:
        result = lingua_envenv.step(LinguaAction(message=msg))
        print(f"Sent: '{msg}'")
        print(f"  → Echoed: '{result.observation.echoed_message}'")
        print(f"  → Length: {result.observation.message_length}")
        print(f"  → Reward: {result.reward}")

finally:
    # Always clean up
    lingua_envenv.close()
```

That's it! The `LinguaEnv.from_docker_image()` method handles:
- Starting the Docker container
- Waiting for the server to be ready
- Connecting to the environment
- Container cleanup when you call `close()`

## Building the Docker Image

Before using the environment, you need to build the Docker image:

```bash
# From projec

Team