Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -48,17 +48,19 @@ def get_summary(text):
|
|
48 |
|
49 |
return completion.choices[0].message.content
|
50 |
|
|
|
51 |
|
52 |
-
|
53 |
-
st.write("\n")
|
54 |
-
|
55 |
-
|
56 |
-
if search_query:
|
57 |
|
58 |
-
|
59 |
-
if text:
|
60 |
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
48 |
|
49 |
return completion.choices[0].message.content
|
50 |
|
51 |
+
tab1, tab2, tab3 = st.tabs(["Summarize a case", "Find a case by facts", "Analyze a court brief"])
|
52 |
|
53 |
+
with tab1:
|
54 |
+
st.write("\n")
|
55 |
+
st.write("\n")
|
56 |
+
search_query = st.text_input("case name, e.g. brown v board supreme, 372 US 335, google v oracle appeal")
|
|
|
57 |
|
58 |
+
if search_query:
|
|
|
59 |
|
60 |
+
text = extract_text_from_api(search_query)
|
61 |
+
if text:
|
62 |
+
|
63 |
+
summary = get_summary(text)
|
64 |
+
st.write(summary)
|
65 |
+
else:
|
66 |
+
st.write("Failed to extract text from the external API.")
|