23f2002275
Data Extraction Environment - OpenEnv Hackathon
d0b1123
Raw
History Blame Contribute Delete
24.6 kB
"""
Task Bank for the Data Extraction Environment.
Each task has:
- id: unique identifier
- difficulty: easy / medium / hard
- description: what the agent needs to do
- raw_text: the messy unstructured text to extract from
- fields_to_extract: list of field names the agent must fill
- extraction_hints: format hints for each field
- ground_truth: the correct extracted values
- field_types: how to grade each field (exact/numeric/contains/fuzzy/list)
These texts are written to be realistic and messy — just like real-world data.
"""
TASKS = [
# ================================================================
# EASY TASKS — Clean-ish text, few fields, obvious values
# ================================================================
{
"id": "easy_1",
"difficulty": "easy",
"description": "Extract contact information from this business card text.",
"raw_text": """
Rajesh Kumar Verma
Senior Software Engineer
Tata Consultancy Services (TCS)
Email: rajesh.verma@tcs.com
Phone: +91 98765 43210
Office: Whitefield, Bangalore, Karnataka 560066
LinkedIn: linkedin.com/in/rajeshverma
""".strip(),
"fields_to_extract": ["name", "job_title", "company", "email", "phone", "city"],
"extraction_hints": (
"name: full name of the person. "
"job_title: their professional title. "
"company: the organization they work for. "
"email: their email address. "
"phone: phone number including country code. "
"city: the city they are based in."
),
"ground_truth": {
"name": "Rajesh Kumar Verma",
"job_title": "Senior Software Engineer",
"company": "Tata Consultancy Services (TCS)",
"email": "rajesh.verma@tcs.com",
"phone": "+91 98765 43210",
"city": "Bangalore",
},
"field_types": {
"name": "fuzzy",
"job_title": "fuzzy",
"company": "contains",
"email": "exact",
"phone": "numeric",
"city": "contains",
},
},
{
"id": "easy_2",
"difficulty": "easy",
"description": "Extract product details from this e-commerce listing.",
"raw_text": """
Samsung Galaxy S24 Ultra 5G (Titanium Black, 256 GB) (12 GB RAM)
Price: ₹1,29,999
MRP: ₹1,49,999 (13% off)
Rating: 4.5 out of 5 (23,847 reviews)
Brand: Samsung
Category: Smartphones
In Stock: Yes — Ships within 2 days
Seller: Appario Retail Private Ltd
""".strip(),
"fields_to_extract": [
"product_name", "price", "brand", "rating", "in_stock", "seller"
],
"extraction_hints": (
"product_name: the full name of the product. "
"price: the selling price as a number (not MRP). "
"brand: the manufacturer/brand name. "
"rating: the numerical rating (e.g. 4.5). "
"in_stock: 'Yes' or 'No'. "
"seller: the name of the seller."
),
"ground_truth": {
"product_name": "Samsung Galaxy S24 Ultra 5G",
"price": "129999",
"brand": "Samsung",
"rating": "4.5",
"in_stock": "Yes",
"seller": "Appario Retail Private Ltd",
},
"field_types": {
"product_name": "contains",
"price": "numeric",
"brand": "exact",
"rating": "numeric",
"in_stock": "exact",
"seller": "fuzzy",
},
},
{
"id": "easy_3",
"difficulty": "easy",
"description": "Extract event details from this invitation.",
"raw_text": """
You're Invited! 🎉
Annual Tech Meetup 2026 — "Building the Future with AI"
Date: Saturday, April 18, 2026
Time: 10:00 AM to 5:00 PM IST
Venue: Koramangala Indoor Stadium, 80 Feet Road, Koramangala, Bangalore
Organized by: Bangalore Developer Community
Entry Fee: Free (Registration Required)
Expected Attendees: 500+
RSVP: events@bangaloredev.org
Contact: Priya Nair — +91 87654 32109
""".strip(),
"fields_to_extract": [
"event_name", "date", "time", "venue", "organizer", "entry_fee", "contact_email"
],
"extraction_hints": (
"event_name: name of the event. "
"date: the date in any readable format. "
"time: the time range. "
"venue: the location/address. "
"organizer: who organized it. "
"entry_fee: the cost (or 'Free'). "
"contact_email: the email address for RSVP/contact."
),
"ground_truth": {
"event_name": "Annual Tech Meetup 2026",
"date": "April 18, 2026",
"time": "10:00 AM to 5:00 PM",
"venue": "Koramangala Indoor Stadium",
"organizer": "Bangalore Developer Community",
"entry_fee": "Free",
"contact_email": "events@bangaloredev.org",
},
"field_types": {
"event_name": "contains",
"date": "contains",
"time": "contains",
"venue": "contains",
"organizer": "fuzzy",
"entry_fee": "exact",
"contact_email": "exact",
},
},
# ================================================================
# MEDIUM TASKS — Messier text, more fields, some ambiguity
# ================================================================
{
"id": "medium_1",
"difficulty": "medium",
"description": "Extract job details from this job posting. The text is messy and has inconsistent formatting.",
"raw_text": """
🔥 HIRING NOW 🔥 We are looking for talented people to join our team!!
Position: Backend Developer (Python/Django)
Company: Flipkart Internet Pvt Ltd
Location: Bellandur, Bangalore (Hybrid — 3 days WFO)
About the role:
We need someone who can build scalable microservices, work with
PostgreSQL and Redis, and collaborate with a team of 15 engineers.
You'll report to the Engineering Manager.
Requirements:
- 3-5 years experience in Python
- Strong knowledge of Django or Flask
- Experience with cloud platforms (AWS preferred)
- Good communication skills
- BTech/BE in Computer Science or equivalent
Compensation: ₹18,00,000 - ₹28,00,000 per annum + stock options
Benefits include health insurance, meal coupons, and gym membership.
Apply before: 30 April 2026
Apply at: careers@flipkart.com or visit careers.flipkart.com
Posted by: HR Team, Flipkart
""".strip(),
"fields_to_extract": [
"job_title", "company", "location", "work_mode",
"experience_required", "min_salary", "max_salary",
"apply_by", "apply_email"
],
"extraction_hints": (
"job_title: the position title. "
"company: the hiring company's name. "
"location: the city/area. "
"work_mode: e.g. Remote, Hybrid, On-site. "
"experience_required: years of experience needed (e.g. '3-5 years'). "
"min_salary: minimum salary as a number. "
"max_salary: maximum salary as a number. "
"apply_by: application deadline date. "
"apply_email: email to apply."
),
"ground_truth": {
"job_title": "Backend Developer",
"company": "Flipkart",
"location": "Bangalore",
"work_mode": "Hybrid",
"experience_required": "3-5 years",
"min_salary": "1800000",
"max_salary": "2800000",
"apply_by": "30 April 2026",
"apply_email": "careers@flipkart.com",
},
"field_types": {
"job_title": "contains",
"company": "contains",
"location": "contains",
"work_mode": "contains",
"experience_required": "contains",
"min_salary": "numeric",
"max_salary": "numeric",
"apply_by": "contains",
"apply_email": "exact",
},
},
{
"id": "medium_2",
"difficulty": "medium",
"description": "Extract invoice details from this messy invoice text. Numbers use Indian formatting.",
"raw_text": """
TAX INVOICE
Invoice No: INV-2026-03847
Date: 22-Mar-2026
BILLED TO: SHIPPED TO:
Pradeep Machinery Works Same as billing address
45-B, Industrial Area Phase II
Peenya, Bangalore - 560058
GSTIN: 29AABCP1234F1ZV
FROM:
Mehta Steel Suppliers Pvt Ltd
Naroda GIDC, Ahmedabad, Gujarat
GSTIN: 24AAACM5678K1Z2
S.No | Description | HSN | Qty | Rate | Amount
-----+----------------------+-------+-----+----------+---------
1 | MS Round Bar 20mm | 7214 | 50 | 4,500.00 | 2,25,000
2 | MS Flat Bar 40x5mm | 7214 | 30 | 3,200.00 | 96,000
3 | SS Rod 12mm | 7222 | 20 | 8,750.00 | 1,75,000
Subtotal: ₹4,96,000.00
CGST (9%): ₹44,640.00
SGST (9%): ₹44,640.00
─────────────────────────
TOTAL: ₹5,85,280.00
Payment Terms: Net 30 days
Bank: HDFC Bank, A/c: 50100123456789, IFSC: HDFC0001234
""".strip(),
"fields_to_extract": [
"invoice_number", "invoice_date", "buyer_name", "buyer_city",
"seller_name", "seller_city", "subtotal", "total_amount",
"payment_terms"
],
"extraction_hints": (
"invoice_number: the invoice reference number. "
"invoice_date: the date of the invoice. "
"buyer_name: name of the company being billed. "
"buyer_city: city of the buyer. "
"seller_name: name of the company issuing the invoice. "
"seller_city: city of the seller. "
"subtotal: subtotal amount before tax, as a number. "
"total_amount: final total including tax, as a number. "
"payment_terms: the payment terms."
),
"ground_truth": {
"invoice_number": "INV-2026-03847",
"invoice_date": "22-Mar-2026",
"buyer_name": "Pradeep Machinery Works",
"buyer_city": "Bangalore",
"seller_name": "Mehta Steel Suppliers Pvt Ltd",
"seller_city": "Ahmedabad",
"subtotal": "496000",
"total_amount": "585280",
"payment_terms": "Net 30 days",
},
"field_types": {
"invoice_number": "exact",
"invoice_date": "contains",
"buyer_name": "fuzzy",
"buyer_city": "contains",
"seller_name": "contains",
"seller_city": "contains",
"subtotal": "numeric",
"total_amount": "numeric",
"payment_terms": "contains",
},
},
{
"id": "medium_3",
"difficulty": "medium",
"description": "Extract details from this restaurant review. The review is casual and rambling.",
"raw_text": """
just went to this place called The Bombay Canteen in Lower Parel, Mumbai
last night and honestly? BLOWN AWAY. 10/10 would go again.
ok so the cuisine is basically modern indian — they take classic desi dishes
and do this crazy fusion twist. we tried the Coorgi Pandi Curry (pork) and
the Charred Broccoli with sesame chutney. the pandi curry was probably the
best thing ive eaten this year ngl
price wise its def on the expensive side — we paid about 4500 for two people
including drinks. worth it tho for a special occasion. they also have a great
cocktail menu, tried the Old Monk cocktail and it slaps
ambiance is super chill, kinda industrial-chic vibe. reservations highly
recommended especially on weekends. we went on a Saturday and it was packed.
service was really good, our server Amit was super attentive and knew the
menu inside out. only downside is parking — lower parel is a nightmare for
parking lol
rating: 4.5/5
would recommend for: date nights, celebrations, foodies
""".strip(),
"fields_to_extract": [
"restaurant_name", "location", "cuisine_type", "price_for_two",
"rating", "ambiance", "recommended_for"
],
"extraction_hints": (
"restaurant_name: name of the restaurant. "
"location: area and city. "
"cuisine_type: type of cuisine (e.g. 'Modern Indian'). "
"price_for_two: approximate cost for two people as a number. "
"rating: numerical rating out of 5. "
"ambiance: description of the ambiance in a few words. "
"recommended_for: what occasions it's good for."
),
"ground_truth": {
"restaurant_name": "The Bombay Canteen",
"location": "Lower Parel, Mumbai",
"cuisine_type": "Modern Indian",
"price_for_two": "4500",
"rating": "4.5",
"ambiance": "industrial-chic",
"recommended_for": "date nights, celebrations, foodies",
},
"field_types": {
"restaurant_name": "fuzzy",
"location": "contains",
"cuisine_type": "contains",
"price_for_two": "numeric",
"rating": "numeric",
"ambiance": "contains",
"recommended_for": "contains",
},
},
# ================================================================
# HARD TASKS — Very messy, lots of noise, tricky edge cases
# ================================================================
{
"id": "hard_1",
"difficulty": "hard",
"description": "Extract property details from this real estate listing. The text is full of abbreviations and agent jargon.",
"raw_text": """
🏠 URGENT SALE — Below Market Price!! Owner Relocating Abroad
2BHK Semi-Furnished Flat in Prestige Lakeside Habitat, Whitefield
Blr East. Tower B, 14th floor, East facing. Vastu compliant.
Config: 2 Bed + 2 Bath + 1 Balcony, Servant Qtr available
Carpet Area: 1,180 sq.ft (Super Built-up: 1,650 sq.ft)
Possession: Immediate (OC received)
PRICE: ₹1.15 Cr (negotiable) — that's ₹6,970/sqft on carpet!!
Maintenance: ₹4.50/sqft/month (approx ₹5,300/month)
Parking: 1 Covered + 1 Open
Society amenities: Club house, Gym, Swimming pool, Tennis court,
Jogging track, Children play area, 24/7 security, Power backup
Near Whitefield Metro (800m), ITPL (2km), International Airport (35km)
Schools nearby: Oakridge, Delhi Public School, Inventure Academy
Contact: Suresh Reddy (Owner Direct — No Brokers!)
Mobile: +91 99001 22334
WhatsApp same number. Genuine buyers only. Available weekdays after 6 PM.
Ref: PROP-WF-2026-0892
""".strip(),
"fields_to_extract": [
"property_type", "bedrooms", "bathrooms", "project_name",
"location", "floor", "carpet_area_sqft", "price",
"price_per_sqft", "parking", "contact_name", "contact_phone",
"reference_id"
],
"extraction_hints": (
"property_type: e.g. 'Apartment', 'Flat', 'Villa'. "
"bedrooms: number of bedrooms as a number. "
"bathrooms: number of bathrooms as a number. "
"project_name: name of the residential project/society. "
"location: area name. "
"floor: which floor number. "
"carpet_area_sqft: carpet area in sq.ft as a number. "
"price: total price as a number (in rupees, not crores). "
"price_per_sqft: price per sqft as a number. "
"parking: description of parking spots. "
"contact_name: name of the contact person. "
"contact_phone: phone number. "
"reference_id: the property reference ID."
),
"ground_truth": {
"property_type": "Flat",
"bedrooms": "2",
"bathrooms": "2",
"project_name": "Prestige Lakeside Habitat",
"location": "Whitefield",
"floor": "14",
"carpet_area_sqft": "1180",
"price": "11500000",
"price_per_sqft": "6970",
"parking": "1 Covered + 1 Open",
"contact_name": "Suresh Reddy",
"contact_phone": "+91 99001 22334",
"reference_id": "PROP-WF-2026-0892",
},
"field_types": {
"property_type": "contains",
"bedrooms": "numeric",
"bathrooms": "numeric",
"project_name": "fuzzy",
"location": "contains",
"floor": "numeric",
"carpet_area_sqft": "numeric",
"price": "numeric",
"price_per_sqft": "numeric",
"parking": "contains",
"contact_name": "fuzzy",
"contact_phone": "contains",
"reference_id": "exact",
},
},
{
"id": "hard_2",
"difficulty": "hard",
"description": "Extract details from this messy resume text. The formatting is inconsistent and uses abbreviations.",
"raw_text": """
ANANYA KRISHNAN
ananya.k93@outlook.com | +91-70123-45678 | github.com/ananyak93
Hyderabad, Telangana
----
PROFESSIONAL SUMMARY
ML Engineer with 4.5 yrs exp in NLP & computer vision. Built prod systems
at scale handling 10M+ requests/day. Published at ACL 2025. Strong in
PyTorch, transformers, and MLOps.
EXPERIENCE
Machine Learning Engineer — Razorpay (Bangalore)
Jul 2023 – Present (2.5 yrs)
• Built fraud detection pipeline processing 10M txns/day, reduced fraud by 34%
• Fine-tuned LLMs for merchant category classification, F1 score 0.94
• Led team of 3 for real-time risk scoring system
Data Scientist — Swiggy (Hyderabad)
Jan 2022 – Jun 2023 (1.5 yrs)
• Developed demand forecasting model improving delivery partner allocation by 22%
• A/B tested recommendation engine changes, 15% increase in order value
EDUCATION
BTech Computer Science & Engineering
IIIT Hyderabad, 2018-2022
CGPA: 8.7/10
SKILLS: Python, PyTorch, TensorFlow, Hugging Face, FastAPI, Docker,
Kubernetes, PostgreSQL, Redis, AWS (SageMaker, EC2, S3), MLflow, Wandb
PUBLICATIONS
"Efficient Attention Mechanisms for Low-Resource NLP" — ACL 2025
CERTIFICATIONS
AWS Certified ML Specialty (2024)
""".strip(),
"fields_to_extract": [
"name", "email", "phone", "current_city",
"years_of_experience", "current_company", "current_role",
"previous_company", "degree", "college",
"cgpa", "publication_venue"
],
"extraction_hints": (
"name: full name. "
"email: email address. "
"phone: phone number. "
"current_city: city of residence. "
"years_of_experience: total years (as a number like '4.5'). "
"current_company: where they currently work. "
"current_role: current job title. "
"previous_company: the company before the current one. "
"degree: educational degree name. "
"college: name of the college/university. "
"cgpa: their CGPA as a number. "
"publication_venue: conference/journal name."
),
"ground_truth": {
"name": "Ananya Krishnan",
"email": "ananya.k93@outlook.com",
"phone": "+91-70123-45678",
"current_city": "Hyderabad",
"years_of_experience": "4.5",
"current_company": "Razorpay",
"current_role": "Machine Learning Engineer",
"previous_company": "Swiggy",
"degree": "BTech Computer Science",
"college": "IIIT Hyderabad",
"cgpa": "8.7",
"publication_venue": "ACL 2025",
},
"field_types": {
"name": "fuzzy",
"email": "exact",
"phone": "numeric",
"current_city": "contains",
"years_of_experience": "numeric",
"current_company": "exact",
"current_role": "contains",
"previous_company": "exact",
"degree": "contains",
"college": "contains",
"cgpa": "numeric",
"publication_venue": "contains",
},
},
{
"id": "hard_3",
"difficulty": "hard",
"description": "Extract key facts from this news article snippet. The article mixes facts with opinions and quotes.",
"raw_text": """
BENGALURU/NEW DELHI: In what industry analysts are calling a "landmark
moment for Indian tech," Wipro Ltd on Thursday announced it will acquire
UK-based cloud consulting firm CloudReach Technologies for an estimated
$620 million (approximately ₹5,160 crore at current exchange rates).
The deal, which is expected to close by Q2 FY2027 (July-September 2026),
will add roughly 2,800 employees to Wipro's workforce, primarily in the
UK, Germany, and the Netherlands. Wipro's CEO Thierry Delaporte said in
a press conference, "This acquisition strengthens our position in the
European cloud market significantly."
CloudReach, founded in 2009 by CEO James Wilman, reported revenues of
$180 million in FY2026 with a client base that includes three FTSE 100
companies. The firm specializes in multi-cloud architecture and has
partnerships with AWS, Azure, and Google Cloud.
Wipro shares rose 3.2% on BSE following the announcement, closing at
₹487.65. Market experts at ICICI Securities maintained a 'Buy' rating
with a target price of ₹540. Some analysts, however, expressed concerns
about the premium paid, noting the acquisition price represents roughly
3.4x CloudReach's annual revenue.
The Competition Commission of India (CCI) approval is still pending.
""".strip(),
"fields_to_extract": [
"acquiring_company", "target_company", "deal_value_usd",
"deal_value_inr_crore", "expected_close_date",
"employees_added", "acquiring_company_ceo",
"target_company_ceo", "target_revenue_usd",
"share_price_change_percent", "closing_share_price"
],
"extraction_hints": (
"acquiring_company: company making the acquisition. "
"target_company: company being acquired. "
"deal_value_usd: deal value in USD millions as a number. "
"deal_value_inr_crore: deal value in INR crore as a number. "
"expected_close_date: when the deal is expected to close. "
"employees_added: number of employees being added. "
"acquiring_company_ceo: CEO of the acquiring company. "
"target_company_ceo: CEO/founder of the target company. "
"target_revenue_usd: target company revenue in USD millions. "
"share_price_change_percent: percentage change in share price. "
"closing_share_price: the closing share price in INR."
),
"ground_truth": {
"acquiring_company": "Wipro",
"target_company": "CloudReach Technologies",
"deal_value_usd": "620",
"deal_value_inr_crore": "5160",
"expected_close_date": "Q2 FY2027",
"employees_added": "2800",
"acquiring_company_ceo": "Thierry Delaporte",
"target_company_ceo": "James Wilman",
"target_revenue_usd": "180",
"share_price_change_percent": "3.2",
"closing_share_price": "487.65",
},
"field_types": {
"acquiring_company": "contains",
"target_company": "contains",
"deal_value_usd": "numeric",
"deal_value_inr_crore": "numeric",
"expected_close_date": "contains",
"employees_added": "numeric",
"acquiring_company_ceo": "fuzzy",
"target_company_ceo": "fuzzy",
"target_revenue_usd": "numeric",
"share_price_change_percent": "numeric",
"closing_share_price": "numeric",
},
},
]
def get_tasks_by_difficulty(difficulty: str) -> list[dict]:
return [t for t in TASKS if t["difficulty"] == difficulty]
def get_task_by_id(task_id: str) -> dict | None:
for task in TASKS:
if task["id"] == task_id:
return task
return None
def get_all_task_ids() -> list[str]:
return [t["id"] for t in TASKS]