CoolFace
Apppublic

BHaritha/msme-openenv

sourceHugging Faceupdated 6mo agoView on Hugging Face
1likes
tasks.py94 linesDownload Raw Back to env
1"""2tasks.py - MSME Payment Dispute OpenEnv Tasks3Three tasks of increasing difficulty.4"""5import random6 7TASK1_SCENARIOS = [8    {"id":"t1_001","email":{"subject":"Invoice #1042 not paid for 45 days","body":"We raised Invoice #1042 for Rs. 80,000 on 1st March 2024. Payment was due by 31st March. It is now 45 days overdue and we have not received any payment despite three reminders. Please clear the dues immediately."},"label":"delayed_payment"},9    {"id":"t1_002","email":{"subject":"Only partial amount received against Invoice #2201","body":"We sent Invoice #2201 for Rs. 1,50,000 to your company on 15th February 2024. You have paid only Rs. 60,000 so far. The remaining Rs. 90,000 has not been received. Kindly settle the balance at the earliest."},"label":"partial_payment"},10    {"id":"t1_003","email":{"subject":"Payment refused without valid reason","body":"We delivered all goods as per Purchase Order #PO-5510 on 10th January 2024. Our invoice for Rs. 2,20,000 was submitted on the same date. Your accounts team has informed us that the payment will not be processed, without providing any valid reason. We formally dispute this refusal."},"label":"payment_denial"},11    {"id":"t1_004","email":{"subject":"Invoice overdue by 60 days - urgent","body":"This is a follow-up for Invoice #3390 worth Rs. 45,000 submitted on 5th January 2024. The due date was 4th February 2024. As of today it is 60 days past due. No payment has been credited to our account. We request immediate clearance."},"label":"delayed_payment"},12    {"id":"t1_005","email":{"subject":"Dispute - invoice paid in part only","body":"Invoice #INV-0089 for Rs. 3,00,000 was issued on 20th March 2024. You have transferred Rs. 1,00,000 to our account. We have not received the remaining Rs. 2,00,000. Please explain the deduction and release the balance amount."},"label":"partial_payment"},13    {"id":"t1_006","email":{"subject":"Unjustified rejection of valid invoice","body":"We provided IT services per contract SOW-2024-07 and raised Invoice #INV-512 for Rs. 95,000 on 28th February 2024. Your team has returned the invoice stating it will not be honoured claiming the work was not completed, which is factually incorrect. We formally reject this denial."},"label":"payment_denial"},14    {"id":"t1_007","email":{"subject":"No response on payment - invoice 90 days old","body":"We are writing regarding Invoice #4402 for Rs. 1,10,000 raised on 1st December 2023. The payment was due on 31st December 2023. Despite multiple calls and emails, no payment has been made and no explanation has been provided. This is now 90 days overdue."},"label":"delayed_payment"},15    {"id":"t1_008","email":{"subject":"Short payment on supply invoice","body":"Please note that Invoice #SUP-2230 for goods worth Rs. 75,000 was submitted on 10th March 2024. We received a payment of Rs. 50,000 on 25th March. The shortfall of Rs. 25,000 has not been credited or explained. Kindly resolve this immediately."},"label":"partial_payment"},16    {"id":"t1_009","email":{"subject":"Invoice #887 unpaid for 30 days","body":"Invoice #887 for consulting services rendered in February 2024 amounting to Rs. 55,000 remains unpaid. Due date was 15th March 2024. Today is 15th April. We have sent two reminders with no response. Please treat this as an urgent payment request."},"label":"delayed_payment"},17    {"id":"t1_010","email":{"subject":"Company refusing to acknowledge our invoice","body":"We completed civil construction work under Contract #CIVIL-44 and raised Invoice #INV-9901 for Rs. 4,50,000 on 1st February 2024. Your company has refused to acknowledge receipt of the invoice and your accounts team states no such vendor is registered. We have all documentation to prove the engagement."},"label":"payment_denial"},18]19 20TASK2_SCENARIOS = [21    {"id":"t2_001","email":{"subject":"Demand notice - Invoice #1042","body":"M/s Sharma Textiles hereby serves formal notice on M/s Bharat Exports for non-payment of Invoice #1042 amounting to Rs. 80,000. The invoice was raised on 1st March 2024 with a due date of 31st March 2024. As of today 14th April 2024, the amount is 14 days overdue. Immediate payment is demanded."},"ground_truth":{"claimant":"Sharma Textiles","opponent":"Bharat Exports","amount":80000,"due_date":"31st March 2024","days_overdue":14}},22    {"id":"t2_002","email":{"subject":"Legal notice for outstanding dues","body":"This notice is issued by M/s Patel Engineering Works against M/s Sunrise Builders Pvt Ltd for non-payment of Invoice #PE-2201 for Rs. 2,50,000. The invoice was submitted on 1st January 2024, payment due by 31st January 2024. As of 15th April 2024, the amount is 75 days overdue."},"ground_truth":{"claimant":"Patel Engineering Works","opponent":"Sunrise Builders Pvt Ltd","amount":250000,"due_date":"31st January 2024","days_overdue":75}},23    {"id":"t2_003","email":{"subject":"Demand for payment - IT services","body":"M/s TechSoft Solutions issues this notice to M/s Global Retail Ltd for recovery of Rs. 1,20,000 against Invoice #TS-512. Services were rendered as per SOW dated 15th February 2024. Payment was due by 15th March 2024. As of 10th April 2024, the invoice is 26 days past due."},"ground_truth":{"claimant":"TechSoft Solutions","opponent":"Global Retail Ltd","amount":120000,"due_date":"15th March 2024","days_overdue":26}},24    {"id":"t2_004","email":{"subject":"Outstanding payment notice - supply of goods","body":"M/s Verma Packaging hereby demands payment from M/s Metro Foods Pvt Ltd for Invoice #VP-330 of Rs. 65,000. Goods were delivered on 5th February 2024, invoice due by 5th March 2024. Current date is 14th April 2024, making the payment 40 days overdue."},"ground_truth":{"claimant":"Verma Packaging","opponent":"Metro Foods Pvt Ltd","amount":65000,"due_date":"5th March 2024","days_overdue":40}},25    {"id":"t2_005","email":{"subject":"Formal demand - construction invoice unpaid","body":"M/s Rajiv Construction Co. serves this notice upon M/s Capital Infra Ltd for recovery of Rs. 5,00,000 against Invoice #RC-9901. Work was completed by 31st December 2023, payment due by 31st January 2024. As of 14th April 2024, the dues are 74 days overdue."},"ground_truth":{"claimant":"Rajiv Construction Co.","opponent":"Capital Infra Ltd","amount":500000,"due_date":"31st January 2024","days_overdue":74}},26]27 28TASK3_SCENARIOS = [29    {"id":"t3_001","context":{"claimant":"Sharma Textiles","opponent":"Bharat Exports","amount":80000,"invoice_no":"1042","invoice_date":"1st March 2024","due_date":"31st March 2024","days_overdue":14,"dispute_type":"delayed_payment","evidence":["Invoice copy","Delivery challan","2 email reminders"]},"grading_criteria":{"must_mention":["Sharma Textiles","Bharat Exports","80,000","Invoice #1042"],"legal_elements":["legal action","interest","MSME","demand"],"tone_keywords_bad":["please kindly","if possible","whenever you can"]}},30    {"id":"t3_002","context":{"claimant":"Patel Engineering Works","opponent":"Sunrise Builders Pvt Ltd","amount":250000,"invoice_no":"PE-2201","invoice_date":"1st January 2024","due_date":"31st January 2024","days_overdue":75,"dispute_type":"delayed_payment","evidence":["Invoice copy","Work completion certificate","3 reminder emails"]},"grading_criteria":{"must_mention":["Patel Engineering Works","Sunrise Builders","2,50,000","PE-2201"],"legal_elements":["legal proceedings","interest","MSME Act","notice period"],"tone_keywords_bad":["hope you will","please consider","we humbly request"]}},31    {"id":"t3_003","context":{"claimant":"TechSoft Solutions","opponent":"Global Retail Ltd","amount":120000,"invoice_no":"TS-512","invoice_date":"15th February 2024","due_date":"15th March 2024","days_overdue":26,"dispute_type":"partial_payment","evidence":["Invoice copy","SOW document","Payment receipt for partial amount"]},"grading_criteria":{"must_mention":["TechSoft Solutions","Global Retail","1,20,000","TS-512"],"legal_elements":["legal action","balance amount","MSME","demand"],"tone_keywords_bad":["sorry to bother","if convenient","as a favour"]}},32]33 34def get_scenario(task_id: int, seed: int = None) -> dict:35    rng = random.Random(seed)36    if task_id == 1: return rng.choice(TASK1_SCENARIOS)37    elif task_id == 2: return rng.choice(TASK2_SCENARIOS)38    elif task_id == 3: return rng.choice(TASK3_SCENARIOS)39    else: raise ValueError(f"Invalid task_id: {task_id}")40 41# FIX 2: 5 additional Task 3 scenarios (total: 8)42TASK3_SCENARIOS_EXTRA = [43    {"id":"t3_004","context":{"claimant":"Verma Packaging","opponent":"Metro Foods Pvt Ltd","amount":65000,"invoice_no":"VP-330","invoice_date":"5th February 2024","due_date":"5th March 2024","days_overdue":40,"dispute_type":"delayed_payment","evidence":["Invoice copy","Delivery receipt","WhatsApp reminders"]},"grading_criteria":{"must_mention":["Verma Packaging","Metro Foods","65,000","VP-330"],"legal_elements":["legal action","MSME","interest","demand"],"tone_keywords_bad":["please kindly","if possible","sorry to disturb"]}},44    {"id":"t3_005","context":{"claimant":"Rajiv Construction Co.","opponent":"Capital Infra Ltd","amount":500000,"invoice_no":"RC-9901","invoice_date":"31st December 2023","due_date":"31st January 2024","days_overdue":74,"dispute_type":"payment_denial","evidence":["Invoice copy","Signed work completion certificate","Site photographs","Contract agreement"]},"grading_criteria":{"must_mention":["Rajiv Construction","Capital Infra","5,00,000","RC-9901"],"legal_elements":["legal proceedings","MSME Act","interest","arbitration"],"tone_keywords_bad":["humbly request","if you can","whenever convenient"]}},45    {"id":"t3_006","context":{"claimant":"Sri Lakshmi Garments","opponent":"Fashion Hub Retail Ltd","amount":175000,"invoice_no":"SLG-441","invoice_date":"10th January 2024","due_date":"10th February 2024","days_overdue":63,"dispute_type":"delayed_payment","evidence":["Invoice copy","Lorry receipt","3 written reminders"]},"grading_criteria":{"must_mention":["Sri Lakshmi","Fashion Hub","1,75,000","SLG-441"],"legal_elements":["MSME","interest","legal action","demand notice"],"tone_keywords_bad":["please try","hope you will","at your convenience"]}},46    {"id":"t3_007","context":{"claimant":"Gupta Auto Parts","opponent":"National Motors Pvt Ltd","amount":230000,"invoice_no":"GAP-882","invoice_date":"20th February 2024","due_date":"20th March 2024","days_overdue":25,"dispute_type":"partial_payment","evidence":["Invoice copy","Bank statement showing partial credit","Purchase order copy"]},"grading_criteria":{"must_mention":["Gupta Auto","National Motors","2,30,000","GAP-882"],"legal_elements":["balance amount","MSME","interest","legal notice"],"tone_keywords_bad":["kindly do the needful","please oblige","if possible"]}},47    {"id":"t3_008","context":{"claimant":"Meenakshi Textiles","opponent":"Southern Exports Ltd","amount":320000,"invoice_no":"MT-7721","invoice_date":"1st November 2023","due_date":"1st December 2023","days_overdue":135,"dispute_type":"delayed_payment","evidence":["Invoice copy","Shipping bill","6 reminder emails","Legal notice draft"]},"grading_criteria":{"must_mention":["Meenakshi Textiles","Southern Exports","3,20,000","MT-7721"],"legal_elements":["MSME Facilitation Council","compound interest","legal proceedings","final notice"],"tone_keywords_bad":["we hope","please consider","if possible"]}},48]49 50# FIX 3: Elite Tier Data Augmentation - Edge Cases and Scaling51TASK1_SCENARIOS_EXTRA = [52    # Government Buyer Edge Case53    {"id":"t1_011","email":{"subject":"Re: Invoice #GOV-99 on GeM Portal","body":"We acknowledge receipt of Invoice #GOV-99 for Rs. 5,50,000 via the Govt e-Marketplace. However, due to budget allocation delays from the Ministry, your payment is pending. We cannot give a firm date. Do not send further reminders."},"label":"delayed_payment"},54    # International Buyer Edge Case55    {"id":"t1_012","email":{"subject":"Payment for Export Order #EX-442","body":"Regarding Invoice #EX-442, our USA headquarters has rejected the payment. They claim the fabrics do not meet ASTM standards. We will not be releasing the $4,500 (approx Rs. 3,75,000) under any circumstances."},"label":"payment_denial"},56    # Forged/Disputed Invoice Edge Case57    {"id":"t1_013","email":{"subject":"Fraudulent billing claim - INV-0010","body":"Your demand for Rs. 1,20,000 against INV-0010 is completely baseless. We never signed any such PO with your agency. We consider this a forged invoice and flatly refuse to pay. If you press this, we will report you for fraud."},"label":"payment_denial"},58    # Partial Payment regarding tax59    {"id":"t1_014","email":{"subject":"TDS deduction and short payment","body":"Against your invoice of Rs. 2,00,000, we have released Rs. 1,70,000. We withheld Rs. 30,000 claiming it as penalty for late delivery, which was never in our contract. Please clear the pending Rs. 30,000 balance."},"label":"partial_payment"},60    {"id":"t1_015","email":{"subject":"Delayed clearance of hardware invoice","body":"The laptops attached to Invoice #HW-84 were delivered 40 days ago. The due date was last week. Still waiting on the accounts team to process the Rs. 8,00,000 transfer."},"label":"delayed_payment"},61    {"id":"t1_016","email":{"subject":"Discrepancy in monthly retainer","body":"For the April retainer (Rs. 85,000), we only received Rs. 40,000 in our bank. The narrative says 'part payment'. We need the remaining amount credited before next week to continue services."},"label":"partial_payment"},62    {"id":"t1_017","email":{"subject":"Refusal to pay maintenance charges","body":"We are cancelling the AMC contract immediately and refusing to pay the outstanding Rs. 65,000. Your engineer was late by 2 hours last Tuesday, which we find unacceptable."},"label":"payment_denial"},63    {"id":"t1_018","email":{"subject":"Overdue transport charges - Urgent","body":"Trip #442 for Rs. 35,000 from Mumbai to Pune is now 60 days overdue. We are a small logistics MSME and cannot afford these delays. Please pay immediately."},"label":"delayed_payment"},64    {"id":"t1_019","email":{"subject":"Short receipt of Rs. 10,000","body":"We received the NEFT today but it's short by Rs. 10,000. Our invoice was for Rs. 1,50,000. Let us know when the remaining 10k will be processed."},"label":"partial_payment"},65    {"id":"t1_020","email":{"subject":"Account closed - no payment will be made","body":"The management has decided to shut down the branch. We will not be honoring any pending invoices from last month, including yours for Rs. 2,25,000."},"label":"payment_denial"},66]67 68TASK2_SCENARIOS_EXTRA = [69    # Government edge case70    {"id":"t2_006","email":{"subject":"Notice to Municipal Corporation","body":"M/s GreenTech Solutions formally demands Rs. 8,50,000 from the Pune Municipal Corporation. Despite deliveries on 1st November 2023 and due date of 1st December 2023, the amount is unpaid. As of 15th April 2024, it is 136 days overdue."},"ground_truth":{"claimant":"GreenTech Solutions","opponent":"Pune Municipal Corporation","amount":850000,"due_date":"1st December 2023","days_overdue":136}},71    # Hostile edge case72    {"id":"t2_007","email":{"subject":"Final Warning - Pay Up Now","body":"Listen M/s Ruthless Retail, we at M/s Spark Traders are tired of your excuses. You owe us Rs. 45,000 for Invoice #99. It was due on 15th January 2024. Today is 15th April 2024. That is 91 days overdue. Pay it or face court."},"ground_truth":{"claimant":"Spark Traders","opponent":"Ruthless Retail","amount":45000,"due_date":"15th January 2024","days_overdue":91}},73    # International edge case74    {"id":"t2_008","email":{"subject":"International Default Notice","body":"M/s Indian Craftsmen Export demands payment from M/s London Boutique Ltd for Invoice #UK-01 for Rs. 6,20,000. The invoice was strictly due on 10th February 2024. It is now 15th April 2024, making it 65 days overdue."},"ground_truth":{"claimant":"Indian Craftsmen Export","opponent":"London Boutique Ltd","amount":620000,"due_date":"10th February 2024","days_overdue":65}},75    {"id":"t2_009","email":{"subject":"Pending software license fees","body":"This is a formal intimation by M/s CodeCrafters LLP to M/s Healthcare Tech. The amount of Rs. 1,80,000 for annual licenses was due on 5th March 2024. Currently, the delay stands at 41 days (as of 15th April)."},"ground_truth":{"claimant":"CodeCrafters LLP","opponent":"Healthcare Tech","amount":180000,"due_date":"5th March 2024","days_overdue":41}},76    {"id":"t2_010","email":{"subject":"Demand Notice - Equipment Supply","body":"M/s HeavyMachinery MSME formally notifies M/s Continental Builders regarding an unpaid sum of Rs. 12,00,000. The agreed due date was 20th December 2023. As of 15th April 2024, the payment is 117 days overdue."},"ground_truth":{"claimant":"HeavyMachinery MSME","opponent":"Continental Builders","amount":1200000,"due_date":"20th December 2023","days_overdue":117}},77]78 79TASK3_SCENARIOS_EDGE = [80    # Government Buyer Edge Case81    {"id":"t3_009","context":{"claimant":"GreenTech Solutions","opponent":"Pune Municipal Corporation","amount":850000,"invoice_no":"GT-001","invoice_date":"1st November 2023","due_date":"1st December 2023","days_overdue":136,"dispute_type":"delayed_payment","evidence":["GeM Portal upload receipt","Delivery acknowledgement"]},"grading_criteria":{"must_mention":["GreenTech","Pune Municipal","8,50,000","GT-001"],"legal_elements":["government buyer","GeM","MSMED Act 2006","interest"],"tone_keywords_bad":["we are small","please favor","begging"]}},82    # Hostile Denied Payment (Forged accusation)83    {"id":"t3_010","context":{"claimant":"Spark Traders","opponent":"Ruthless Retail","amount":120000,"invoice_no":"INV-101","invoice_date":"10th February 2024","due_date":"10th March 2024","days_overdue":36,"dispute_type":"payment_denial","evidence":["Signed PO","Email approving delivery","Counter-claim against forgery assertion"]},"grading_criteria":{"must_mention":["Spark Traders","Ruthless Retail","1,20,000","INV-101"],"legal_elements":["defamation","baseless","evidence acts","MSME Facilitation","legal action"],"tone_keywords_bad":["maybe","sorry","apologize"]}},84    # International Dispute85    {"id":"t3_011","context":{"claimant":"Indian Craftsmen Export","opponent":"London Boutique Ltd","amount":620000,"invoice_no":"UK-01","invoice_date":"10th January 2024","due_date":"10th February 2024","days_overdue":65,"dispute_type":"partial_payment","evidence":["Customs clearance","Signed BoL","Email confirming receipt"]},"grading_criteria":{"must_mention":["Indian Craftsmen","London Boutique","6,20,000","UK-01"],"legal_elements":["international arbitration","jurisdiction","MSME Export protection","interest"],"tone_keywords_bad":["please adjust","sorry for inconvenience"]}},86    # Massive amount edge case87    {"id":"t3_012","context":{"claimant":"HeavyMachinery MSME","opponent":"Continental Builders","amount":25000000,"invoice_no":"HM-MAX","invoice_date":"1st August 2023","due_date":"1st September 2023","days_overdue":227,"dispute_type":"delayed_payment","evidence":["Site installation sign-off","Multiple board-level emails"]},"grading_criteria":{"must_mention":["HeavyMachinery","Continental Builders","2,50,00,000","HM-MAX"],"legal_elements":["NCLT","insolvency","bankruptcy","MSME Act","interest"],"tone_keywords_bad":["kindly","requesting","amicable"]}},88]89 90# Merge into main lists91TASK1_SCENARIOS = TASK1_SCENARIOS + TASK1_SCENARIOS_EXTRA92TASK2_SCENARIOS = TASK2_SCENARIOS + TASK2_SCENARIOS_EXTRA93TASK3_SCENARIOS = TASK3_SCENARIOS + TASK3_SCENARIOS_EXTRA + TASK3_SCENARIOS_EDGE94