raminass commited on
Commit
f3b8201
·
verified ·
1 Parent(s): 29a81f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -11
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/SCOTUS_AI_14", top_k=14, padding=True, truncation=True)
8
- all = load_dataset("raminass/full_opinions_1994_2020")
9
- df = pd.DataFrame(all["train"])
10
  choices = []
11
- for index, row in df[df.category == "per_curiam"].iterrows():
12
- if len(row["text"]) > 1000:
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):