Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ from transformers import pipeline
|
|
11 |
from datasets import load_dataset
|
12 |
import fitz # PyMuPDF
|
13 |
|
14 |
-
#
|
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
|
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 |
-
|
198 |
-
return
|
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"]:
|