Update legal_document_analysis.py
Browse files- legal_document_analysis.py +15 -0
legal_document_analysis.py
CHANGED
@@ -418,6 +418,21 @@ def get_update_suggestion(update):
|
|
418 |
suggestion = generate_summary(prompt)
|
419 |
return suggestion if suggestion else "No suggestion available."
|
420 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
421 |
# Function to display feedback form
|
422 |
def display_feedback_form():
|
423 |
st.subheader("Feedback Form")
|
|
|
418 |
suggestion = generate_summary(prompt)
|
419 |
return suggestion if suggestion else "No suggestion available."
|
420 |
|
421 |
+
# Function to generate suggestions for improvement
|
422 |
+
def generate_suggestions(text):
|
423 |
+
suggestions = []
|
424 |
+
|
425 |
+
if "shall" in text.lower():
|
426 |
+
suggestions.append("Consider replacing 'shall' with 'must' for clarity.")
|
427 |
+
if "may" in text.lower():
|
428 |
+
suggestions.append("Clarify the conditions under which actions 'may' be taken.")
|
429 |
+
if "if" in text.lower() and "then" not in text.lower():
|
430 |
+
suggestions.append("Ensure conditional statements are clear and complete.")
|
431 |
+
if "not" in text.lower():
|
432 |
+
suggestions.append("Review negative clauses to ensure they are not overly restrictive.")
|
433 |
+
|
434 |
+
return suggestions
|
435 |
+
|
436 |
# Function to display feedback form
|
437 |
def display_feedback_form():
|
438 |
st.subheader("Feedback Form")
|