Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -63,36 +63,34 @@ def extract_text_from_link(url):
|
|
63 |
|
64 |
@st.cache_data(ttl=3600)
|
65 |
def get_summary(text):
|
66 |
-
|
67 |
message = client.messages.create(
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
{
|
72 |
-
"role": "user",
|
73 |
-
"content": [
|
74 |
{
|
75 |
-
"
|
76 |
-
"
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
}
|
94 |
]
|
|
|
95 |
return message.content
|
|
|
96 |
|
97 |
search_query = st.text_input("case name, e.g. brown v board supreme, 372 US 335, google v oracle appeal")
|
98 |
|
|
|
63 |
|
64 |
@st.cache_data(ttl=3600)
|
65 |
def get_summary(text):
|
|
|
66 |
message = client.messages.create(
|
67 |
+
model="claude-3-opus-20240229",
|
68 |
+
max_tokens_to_sample=2000,
|
69 |
+
messages=[
|
|
|
|
|
|
|
70 |
{
|
71 |
+
"role": "user",
|
72 |
+
"content": f'''
|
73 |
+
You are a law professor specialized in legal writing and legal research.
|
74 |
+
Summarize the case in {text} in json format according to the following requirements:
|
75 |
+
Facts (name of the case and its parties, what happened factually).
|
76 |
+
Procedural history (what happened in the past procedurally, what were prior judgements).
|
77 |
+
Issues (what is in dispute).
|
78 |
+
Holding (the applied rule of law).
|
79 |
+
Rationale (reasons for the holding).
|
80 |
+
Decision (what did the court decide, e.g. affirmed, overruled).
|
81 |
+
Other opinions (if there are any dissenting or concurring opinions, summarize majority opinion, dissenting opinion and concurring opinion).
|
82 |
+
Cases cited (which cases the court cited and how it treated them):
|
83 |
+
- 'red flag' means some negative treatment — such as a cited case is being overruled, superseded, or not followed by this court for some reason.
|
84 |
+
- 'yellow flag' means the case has some negative treatment by this court but has not been reversed or overruled. For example, the reasoning of the decision was criticized or its holding was limited to a specific set of facts.
|
85 |
+
- 'blue flag' means the case has been appealed to the U.S. Court of Appeals or the U.S. Supreme Court (excluding appeals originating from agencies).
|
86 |
+
|
87 |
+
Present the summary in json format.
|
88 |
+
'''
|
89 |
+
}
|
90 |
]
|
91 |
+
)
|
92 |
return message.content
|
93 |
+
|
94 |
|
95 |
search_query = st.text_input("case name, e.g. brown v board supreme, 372 US 335, google v oracle appeal")
|
96 |
|