Downloads ยท 30 days
0
Platypus96/text-qa-openenv
text-qa-openenv is a machine learning model from Platypus96. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
๐ฎ A Robust Question Answering ENVIRONMENT for Meta PyTorch Hackathon 2026 - Round 1
Downloads ยท 30 days
0
Access
Public
Updated Apr 8, 2026
Repo size
โ
Likes
0
Public
Click a slice to open those files.
.py86.6 KB ยท 66%
From the Hugging Face model README
๐ฎ A Robust Question Answering ENVIRONMENT for Meta PyTorch Hackathon 2026 - Round 1
Built for Environment Evaluation, Not Agent Training!
This is a production-grade RL environment (the "playground") that provides standardized question-answering tasks for AI agents. Focus is on environment robustness, not agent implementation.
This environment implements ALL required components for Round 1:
{
'question': str, # The question to answer
'context': str, # Context containing the answer
'question_id': int # Unique question identifier
}
+1.0: Correct answer (exact match)+0.5: Partial match (contains key information)-0.1: Incorrect answerpip install -r requirements.txt
Build time: ~2 minutes | Size: ~100MB
This includes only the essentials:
pip install -r requirements-full.txt
Build time: ~60 minutes | Size: ~2GB
Additional features:
pip install -e .
python validate_environment.py
This runs comprehensive tests to ensure the environment:
from text_qa_env import TextQAEnv
# Create environment
env = TextQAEnv(difficulty='easy')
# Reset to get initial observation
observation, info = env.reset()
# Agent takes an action (provides an answer)
action = "Paris"
observation, reward, terminated, truncated, info = env.step(action)
# Check results
print(f"Reward: {reward}")
print(f"Correct: {info['correct']}")
from text_qa_env import TextQAEnv
# Use SQuAD dataset with 10,000+ questions
env = TextQAEnv(
difficulty='external',
external_dataset='squad', # or 'squad_v2', 'trivia_qa'
max_questions=1000
)
observation, info = env.reset()
action = "agent's answer"
observation, reward, terminated, truncated, info = env.step(action)
from text_qa_env import run_automated_grading
# Define your agent
class MyAgent:
def select_action(self, observation):
# Your agent logic here
return "answer"
# Run automated grading
agent = MyAgent()
report = run_automated_grading(agent, difficulty='easy')
# Results include:
# - Pass/Fail status
# - Accuracy metrics
# - Detailed per-question results
# - Letter grade (A+ to F)
Note: Agent training is for Round 2. Round 1 focuses on environment quality.
# This is optional - shows the environment can be used for training
from examples.train_agent import train_simple_agent
agent = train_simple_agent(episodes=100, difficulty='easy')
question: String - The question to answercontext: String - Context containing the answerquestion_id: Integer - Unique question identifier+1.0: Correct answer (exact match)+0.5: Partial match (contains correct keywords)-0.1: Incorrect answerUsage:
# SQuAD (recommended for research)
env = TextQAEnv(difficulty='external', external_dataset='squad')
# TriviaQA (larger dataset)
env = TextQAEnv(difficulty='external', external_dataset='trivia_qa', max_questions=1000)
Open-Env/
โโโ text_qa_env/
โ โโโ __init__.py
โ โโโ environment.py # Main Gymnasium environment
โ โโโ dataset.py # Built-in QA questions
โ โโโ external_datasets.py # SQuAD/TriviaQA integration ๐
โ โโโ grader.py # Automated grading system โ
โโโ examples/
โ โโโ basic_usage.py # Simple usage example
โ โโโ train_agent.py # Training script with Q-learning agent
โ โโโ test_grader.py # Grader demonstration
โ โโโ external_dataset_demo.py # SQuAD integration demo ๐
โโโ Dockerfile
โโโ requirements.txt
โโโ setup.py
โโโ README.md
This environment fully implements all Meta PyTorch Hackathon Round 1 requirements:
reset, step, render)Round 1 Focus: Environment quality, not agent training!
This project was created for the Meta PyTorch Hackathon. Contributions are welcome!
MIT License
Built with โค๏ธ for Meta PyTorch Hackathon 2026