michaelmc1618 commited on
Commit
ef181e9
·
verified ·
1 Parent(s): c705ca2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -11,7 +11,7 @@ from transformers import pipeline
11
  from datasets import load_dataset
12
  import fitz # PyMuPDF
13
 
14
- # Load dataset
15
  dataset = load_dataset("ibunescu/qa_legal_dataset_train")
16
 
17
  # Different pipelines for different tasks
@@ -82,7 +82,7 @@ def determine_winner(outcome):
82
  else:
83
  return "No clear winner"
84
 
85
- # Custom CSS for a clean layout
86
  custom_css = """
87
  body {
88
  background-color: #ffffff;
@@ -194,8 +194,8 @@ def update_pdf_gallery_and_extract_text(pdf_files):
194
  return pdf_files, pdf_text
195
 
196
  def get_top_10_cases():
197
- summary = summarization_pipeline("Show 10 legal cases with names and numbers from any State Court of Appeals in the US.", max_length=150, min_length=50, do_sample=False)
198
- return summary[0]['summary_text']
199
 
200
  def add_message(history, message):
201
  for x in message["files"]:
 
11
  from datasets import load_dataset
12
  import fitz # PyMuPDF
13
 
14
+ # Loading datasets
15
  dataset = load_dataset("ibunescu/qa_legal_dataset_train")
16
 
17
  # Different pipelines for different tasks
 
82
  else:
83
  return "No clear winner"
84
 
85
+ # Custom CSS for white background and black text for input and output boxes
86
  custom_css = """
87
  body {
88
  background-color: #ffffff;
 
194
  return pdf_files, pdf_text
195
 
196
  def get_top_10_cases():
197
+ result = summarization_pipeline("Top 10 current legal cases in the country", max_length=150, min_length=50, do_sample=False)
198
+ return result[0]['summary_text']
199
 
200
  def add_message(history, message):
201
  for x in message["files"]: