Update app.py
Browse files
app.py
CHANGED
@@ -4,18 +4,11 @@ from utils import *
|
|
4 |
from datasets import load_dataset
|
5 |
import json
|
6 |
|
7 |
-
pipe = pipeline(model="raminass/
|
8 |
-
|
9 |
-
df = pd.DataFrame(all["train"])
|
10 |
choices = []
|
11 |
-
for index, row in df
|
12 |
-
|
13 |
-
choices.append((f"""{row["case_name"]}""", [row["text"], row["year_filed"]]))
|
14 |
-
|
15 |
-
with open("j_year.json", "r") as j:
|
16 |
-
judges_by_year = json.loads(j.read())
|
17 |
-
judges_by_year = {int(k): v for k, v in judges_by_year.items()}
|
18 |
-
|
19 |
|
20 |
# https://www.gradio.app/guides/controlling-layout
|
21 |
def greet(opinion, judges_l):
|
|
|
4 |
from datasets import load_dataset
|
5 |
import json
|
6 |
|
7 |
+
pipe = pipeline(model="raminass/british", top_k=2, padding=True, truncation=True)
|
8 |
+
df = pd.read_csv('data.csv', sep='\t')
|
|
|
9 |
choices = []
|
10 |
+
for index, row in df.iterrows():
|
11 |
+
choices.append((f"""{row["case"]}""", [row["text"], row["author"]]))
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
# https://www.gradio.app/guides/controlling-layout
|
14 |
def greet(opinion, judges_l):
|