arvind6599 commited on
Commit
8096fdc
·
1 Parent(s): f4069c7

fixed formatting error

Browse files
Files changed (1) hide show
  1. app.py +174 -174
app.py CHANGED
@@ -334,190 +334,190 @@ def build_interface():
334
  """
335
  with gr.Blocks() as demo:
336
  gr.Markdown("""
337
- # Applicant Task: Target Company & Law Firm Identification
338
-
339
- This task involves processing a user query to determine the relevance to the intended task, followed by analyzing textual data to extract information about law firms representing parties (Buyer, Seller, and Third Parties) and verifying the presence of a target company. For reference, see this sample agreement: [SEC Agreement Example](https://www.sec.gov/Archives/edgar/data/28452/000119312505012401/dex101.htm)
340
-
341
- > **Note:**
342
- > This evaluation system uses the `gpt-4o-mini` model with a temperature setting of `0.2` for all LLM steps.
343
-
344
- The system is designed to sequentially leverage three LLM functions:
345
-
346
- ### Step 1: LLM1
347
- - Determines if the user's query mentions any target company.
348
- - If no target company is found, LLM1 responds with a message wrapped in `<user_message></user_message>` XML tags to inform the user that the query is irrelevant to this task.
349
- - If the query contains a target company, LLM1 moves forward with a formatted acknowledgment of the identified target company.
350
-
351
- ### Step 2: LLM2
352
- - Examines four separate paragraphs independently.
353
- - For each paragraph, extracts:
354
- - Buyer's representative law firm
355
- - Seller's representative law firm
356
- - Any third-party law firm present
357
- - Whether the target company is mentioned in the paragraph
358
- - Each paragraph's results are formatted and concatenated for the next step.
359
-
360
- ### Step 3: LLM3
361
- - Compiles the information from all analyzed paragraphs and outputs a structured JSON object:
362
-
363
- ```json
364
- {
365
- "buyer_firm": "string",
366
- "seller_firm": "string",
367
- "third_party": "string",
368
- "contains_target_firm": boolean
369
- }
370
- ```
371
-
372
- | Field | Default Value if Missing | Type |
373
- | ---------------------- | ------------------------ | --------- |
374
- | `buyer_firm` | `"null"` | `string` |
375
- | `seller_firm` | `"null"` | `string` |
376
- | `third_party` | `"null"` | `string` |
377
- | `contains_target_firm` | `false` | `boolean` |
378
-
379
- The goal is to identify the representative law firms of involved parties and determine if the target company is mentioned, ensuring the results are structured and accurate.
380
-
381
- ---
382
-
383
- **Key Considerations:**
384
- - The output must adhere to the prescribed JSON format for the final step.
385
- - Ensure the system can accurately extract and classify relevant information from the input paragraphs.
386
- """
387
-
388
- # Example Inputs and Outputs in an Accordion
389
- with gr.Accordion("Example Workflow", open=False):
390
- gr.Markdown("""
391
- **User Query:**
392
- ```
393
- Is Kirkland & Ellis present in the agreement?
394
- ```
395
-
396
- **Document Provided:**
397
-
398
- **Paragraph 1:**
399
- ```
400
- This Stock and Asset Purchase Agreement is entered into as of October 28, 2021, among Purolite Corporation, a Delaware corporation, along with Stefan E. Brodie and Don B. Brodie (collectively referred to as the Sellers), and Ecolab Inc., a Delaware corporation, as the Purchaser. Additionally, Gibson, Dunn & Crutcher LLP, as an independent third-party representative, is engaged for specific advisory roles outlined in this Agreement.
401
- ```
402
-
403
- **Paragraph 2:**
404
- ```
405
- This Agreement shall be governed by and construed in accordance with the internal laws of the State of Delaware, without giving effect to any choice or conflict of law provision. Each clause within this Agreement shall be interpreted independently, and the invalidity of one clause shall not affect the enforceability of the remaining provisions. Headings are for convenience only and shall not affect the interpretation of this Agreement. Nothing herein shall be construed as limiting or waiving any rights or obligations under applicable law unless expressly stated.
406
- ```
407
-
408
- **Paragraph 3:**
409
- ```
410
- Such notices, demands, and other communications shall be directed to the Parties at their respective addresses. One Party may be contacted at:
411
- 1 Ecolab Place
412
- St. Paul, Minnesota 55102
413
- Attention: General Counsel
414
- with a copy (which shall not constitute notice) to:
415
- Shearman & Sterling LLP
416
- 599 Lexington Avenue
417
- New York, New York 10022
418
- Attention: Adam Miller
419
- Another Party may be reached at:
420
- Purolite Corporation
421
- 2201 Renaissance Boulevard
422
- King of Prussia, Pennsylvania 19406
423
- Attention: Stefan E. Brodie; Howard Brodie
424
- with a copy (which shall not constitute notice) to:
425
- Cleary Gottlieb Steen & Hamilton LLP
426
- One Liberty Plaza
427
- New York, New York 10006
428
- Attention: John Reynolds; Sarah Lee
429
- Additional communications relating to the role of the third-party representative shall be directed to:
430
- Gibson, Dunn & Crutcher LLP
431
- 200 Park Avenue
432
- New York, New York 10166
433
- Attention: Jane Smith
434
- ```
435
-
436
- **Paragraph 4:**
437
- ```
438
- All references to the singular include the plural and vice versa, and all references to any gender include all genders. The Parties agree that any ambiguities in the language of this Agreement shall not be construed against either Party. Section headings used in this Agreement are for reference only and shall not affect the meaning or interpretation of any provision.
439
- ```
440
-
441
- ---
442
-
443
- **Expected Steps and Outputs:**
444
-
445
- **Step 1 (LLM1):**
446
- - If no target company is identified:
447
- ```
448
- <user_message>Query is not relevant to the intended task.</user_message>
449
- ```
450
- - If a target company is identified:
451
- ```
452
- The target company is Kirkland & Ellis LLP.
453
- ```
454
-
455
- **Step 2 (LLM2 for Paragraphs):**
456
- - Example Input:
457
- ```
458
- This Stock and Asset Purchase Agreement is entered into as of October 28, 2021, among Purolite Corporation, a Delaware corporation, along with Stefan E. Brodie and Don B. Brodie (collectively referred to as the Sellers), and Ecolab Inc., a Delaware corporation, as the Purchaser. Additionally, Gibson, Dunn & Crutcher LLP, as an independent third-party representative, is engaged for specific advisory roles outlined in this Agreement.
459
- ```
460
-
461
- - Example Output:
462
- ```
463
- Buyer: Ecolab Inc.
464
- Buyer Representative: Not stated
465
- Seller: Purolite Corporation
466
- Seller Representative: Not stated
467
- Third-Party Representation: Advisory roles, Gibson, Dunn & Crutcher LLP
468
- Target Company Mentioned: No
469
- ```
470
-
471
- **Step 3 (LLM3 Final Output):**
472
- - Compiled JSON:
473
- ```json
474
- {
475
- "buyer_firm": "Shearman & Sterling LLP",
476
- "seller_firm": "Cleary Gottlieb Steen & Hamilton LLP",
477
- "third_party": "Gibson, Dunn & Crutcher LLP",
478
- "contains_target_firm": false
479
- }
480
- ```
481
-
482
- """)
483
 
484
  # Challenge instructions and testing guidance
485
  with gr.Accordion("Task Instructions and Testing", open=False):
486
  gr.Markdown("""
487
- ---
488
- **Task Instructions:**
489
- - Design prompts that ensure proper interaction between the three LLM systems, with each step contributing to the final output.
490
- - Ensure strict adherence to JSON formatting requirements (e.g., no extra characters that may cause JSON parsing errors).
491
- - Test extensively to verify accurate law firm and target company identification.
492
-
493
- **Output Requirements:**
494
- - Ensure final LLM3 JSON output has the following keys:
495
- - `"buyer_firm"`
496
- - `"seller_firm"`
497
- - `"third_party"`
498
- - `"contains_target_firm"`
499
- - Values must be accurately extracted or classified based on LLM2's parsed data.
500
-
501
- **Hints for Crafting System Prompts:**
502
- - Explicitly specify formatting requirements at each step.
503
- - Clarify the task definitions and expected classifications in each system prompt for LLM1, LLM2, and LLM3.
504
- - Test using diverse sample data for robustness.
505
- ---
506
- """)
507
 
508
  gr.Markdown("""
509
- ---
510
- ### Submission Instructions
511
 
512
- Enter your name and email below, as listed in your CV, and submit your designed prompts.
513
 
514
- You can only submit once, so validate your system prompts thoroughly using mock queries and example data before final submission.
515
 
516
- **Good Luck!**
517
 
518
- _Remember: Focus on clarity, accuracy, and structured responses to achieve a high score!_
519
- ---
520
- """)
521
 
522
  email_input = gr.Textbox(label="Email", placeholder="[email protected]")
523
  name_input = gr.Textbox(label="First Name, Last Name", placeholder="John, Smith")
 
334
  """
335
  with gr.Blocks() as demo:
336
  gr.Markdown("""
337
+ # Applicant Task: Target Company & Law Firm Identification
338
+
339
+ This task involves processing a user query to determine the relevance to the intended task, followed by analyzing textual data to extract information about law firms representing parties (Buyer, Seller, and Third Parties) and verifying the presence of a target company. For reference, see this sample agreement: [SEC Agreement Example](https://www.sec.gov/Archives/edgar/data/28452/000119312505012401/dex101.htm)
340
+
341
+ > **Note:**
342
+ > This evaluation system uses the `gpt-4o-mini` model with a temperature setting of `0.2` for all LLM steps.
343
+
344
+ The system is designed to sequentially leverage three LLM functions:
345
+
346
+ ### Step 1: LLM1
347
+ - Determines if the user's query mentions any target company.
348
+ - If no target company is found, LLM1 responds with a message wrapped in `<user_message></user_message>` XML tags to inform the user that the query is irrelevant to this task.
349
+ - If the query contains a target company, LLM1 moves forward with a formatted acknowledgment of the identified target company.
350
+
351
+ ### Step 2: LLM2
352
+ - Examines four separate paragraphs independently.
353
+ - For each paragraph, extracts:
354
+ - Buyer's representative law firm
355
+ - Seller's representative law firm
356
+ - Any third-party law firm present
357
+ - Whether the target company is mentioned in the paragraph
358
+ - Each paragraph's results are formatted and concatenated for the next step.
359
+
360
+ ### Step 3: LLM3
361
+ - Compiles the information from all analyzed paragraphs and outputs a structured JSON object:
362
+
363
+ ```json
364
+ {
365
+ "buyer_firm": "string",
366
+ "seller_firm": "string",
367
+ "third_party": "string",
368
+ "contains_target_firm": boolean
369
+ }
370
+ ```
371
+
372
+ | Field | Default Value if Missing | Type |
373
+ | ---------------------- | ------------------------ | --------- |
374
+ | `buyer_firm` | `"null"` | `string` |
375
+ | `seller_firm` | `"null"` | `string` |
376
+ | `third_party` | `"null"` | `string` |
377
+ | `contains_target_firm` | `false` | `boolean` |
378
+
379
+ The goal is to identify the representative law firms of involved parties and determine if the target company is mentioned, ensuring the results are structured and accurate.
380
+
381
+ ---
382
+
383
+ **Key Considerations:**
384
+ - The output must adhere to the prescribed JSON format for the final step.
385
+ - Ensure the system can accurately extract and classify relevant information from the input paragraphs.
386
+ """)
387
+
388
+ # Example Inputs and Outputs in an Accordion
389
+ with gr.Accordion("Example Workflow", open=False):
390
+ gr.Markdown("""
391
+ **User Query:**
392
+ ```
393
+ Is Kirkland & Ellis present in the agreement?
394
+ ```
395
+
396
+ **Document Provided:**
397
+
398
+ **Paragraph 1:**
399
+ ```
400
+ This Stock and Asset Purchase Agreement is entered into as of October 28, 2021, among Purolite Corporation, a Delaware corporation, along with Stefan E. Brodie and Don B. Brodie (collectively referred to as the Sellers), and Ecolab Inc., a Delaware corporation, as the Purchaser. Additionally, Gibson, Dunn & Crutcher LLP, as an independent third-party representative, is engaged for specific advisory roles outlined in this Agreement.
401
+ ```
402
+
403
+ **Paragraph 2:**
404
+ ```
405
+ This Agreement shall be governed by and construed in accordance with the internal laws of the State of Delaware, without giving effect to any choice or conflict of law provision. Each clause within this Agreement shall be interpreted independently, and the invalidity of one clause shall not affect the enforceability of the remaining provisions. Headings are for convenience only and shall not affect the interpretation of this Agreement. Nothing herein shall be construed as limiting or waiving any rights or obligations under applicable law unless expressly stated.
406
+ ```
407
+
408
+ **Paragraph 3:**
409
+ ```
410
+ Such notices, demands, and other communications shall be directed to the Parties at their respective addresses. One Party may be contacted at:
411
+ 1 Ecolab Place
412
+ St. Paul, Minnesota 55102
413
+ Attention: General Counsel
414
+ with a copy (which shall not constitute notice) to:
415
+ Shearman & Sterling LLP
416
+ 599 Lexington Avenue
417
+ New York, New York 10022
418
+ Attention: Adam Miller
419
+ Another Party may be reached at:
420
+ Purolite Corporation
421
+ 2201 Renaissance Boulevard
422
+ King of Prussia, Pennsylvania 19406
423
+ Attention: Stefan E. Brodie; Howard Brodie
424
+ with a copy (which shall not constitute notice) to:
425
+ Cleary Gottlieb Steen & Hamilton LLP
426
+ One Liberty Plaza
427
+ New York, New York 10006
428
+ Attention: John Reynolds; Sarah Lee
429
+ Additional communications relating to the role of the third-party representative shall be directed to:
430
+ Gibson, Dunn & Crutcher LLP
431
+ 200 Park Avenue
432
+ New York, New York 10166
433
+ Attention: Jane Smith
434
+ ```
435
+
436
+ **Paragraph 4:**
437
+ ```
438
+ All references to the singular include the plural and vice versa, and all references to any gender include all genders. The Parties agree that any ambiguities in the language of this Agreement shall not be construed against either Party. Section headings used in this Agreement are for reference only and shall not affect the meaning or interpretation of any provision.
439
+ ```
440
+
441
+ ---
442
+
443
+ **Expected Steps and Outputs:**
444
+
445
+ **Step 1 (LLM1):**
446
+ - If no target company is identified:
447
+ ```
448
+ <user_message>Query is not relevant to the intended task.</user_message>
449
+ ```
450
+ - If a target company is identified:
451
+ ```
452
+ The target company is Kirkland & Ellis LLP.
453
+ ```
454
+
455
+ **Step 2 (LLM2 for Paragraphs):**
456
+ - Example Input:
457
+ ```
458
+ This Stock and Asset Purchase Agreement is entered into as of October 28, 2021, among Purolite Corporation, a Delaware corporation, along with Stefan E. Brodie and Don B. Brodie (collectively referred to as the Sellers), and Ecolab Inc., a Delaware corporation, as the Purchaser. Additionally, Gibson, Dunn & Crutcher LLP, as an independent third-party representative, is engaged for specific advisory roles outlined in this Agreement.
459
+ ```
460
+
461
+ - Example Output:
462
+ ```
463
+ Buyer: Ecolab Inc.
464
+ Buyer Representative: Not stated
465
+ Seller: Purolite Corporation
466
+ Seller Representative: Not stated
467
+ Third-Party Representation: Advisory roles, Gibson, Dunn & Crutcher LLP
468
+ Target Company Mentioned: No
469
+ ```
470
+
471
+ **Step 3 (LLM3 Final Output):**
472
+ - Compiled JSON:
473
+ ```json
474
+ {
475
+ "buyer_firm": "Shearman & Sterling LLP",
476
+ "seller_firm": "Cleary Gottlieb Steen & Hamilton LLP",
477
+ "third_party": "Gibson, Dunn & Crutcher LLP",
478
+ "contains_target_firm": false
479
+ }
480
+ ```
481
+
482
+ """)
483
 
484
  # Challenge instructions and testing guidance
485
  with gr.Accordion("Task Instructions and Testing", open=False):
486
  gr.Markdown("""
487
+ ---
488
+ **Task Instructions:**
489
+ - Design prompts that ensure proper interaction between the three LLM systems, with each step contributing to the final output.
490
+ - Ensure strict adherence to JSON formatting requirements (e.g., no extra characters that may cause JSON parsing errors).
491
+ - Test extensively to verify accurate law firm and target company identification.
492
+
493
+ **Output Requirements:**
494
+ - Ensure final LLM3 JSON output has the following keys:
495
+ - `"buyer_firm"`
496
+ - `"seller_firm"`
497
+ - `"third_party"`
498
+ - `"contains_target_firm"`
499
+ - Values must be accurately extracted or classified based on LLM2's parsed data.
500
+
501
+ **Hints for Crafting System Prompts:**
502
+ - Explicitly specify formatting requirements at each step.
503
+ - Clarify the task definitions and expected classifications in each system prompt for LLM1, LLM2, and LLM3.
504
+ - Test using diverse sample data for robustness.
505
+ ---
506
+ """)
507
 
508
  gr.Markdown("""
509
+ ---
510
+ ### Submission Instructions
511
 
512
+ Enter your name and email below, as listed in your CV, and submit your designed prompts.
513
 
514
+ You can only submit once, so validate your system prompts thoroughly using mock queries and example data before final submission.
515
 
516
+ **Good Luck!**
517
 
518
+ _Remember: Focus on clarity, accuracy, and structured responses to achieve a high score!_
519
+ ---
520
+ """)
521
 
522
  email_input = gr.Textbox(label="Email", placeholder="[email protected]")
523
  name_input = gr.Textbox(label="First Name, Last Name", placeholder="John, Smith")