Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,6 +22,7 @@ def write_to_file(content, filename="./files/test.pdf"):
|
|
22 |
def ingest_documents():
|
23 |
reader = SimpleDirectoryReader("./")
|
24 |
documents = reader.load_data()
|
|
|
25 |
return documents
|
26 |
|
27 |
def load_data(documents):
|
@@ -33,7 +34,7 @@ def generate_summary(index, document_text):
|
|
33 |
query_engine = index.as_query_engine()
|
34 |
response = query_engine.query(f"""
|
35 |
You are a skilled legal analyst. Your task is to provide a comprehensive summary of the given legal document.
|
36 |
-
Analyze the following
|
37 |
{document_text}
|
38 |
|
39 |
Please cover the following aspects:
|
@@ -44,7 +45,7 @@ def generate_summary(index, document_text):
|
|
44 |
5. Potential legal implications
|
45 |
6. Any notable or unusual elements
|
46 |
|
47 |
-
Provide a clear, concise, and professional summary
|
48 |
""")
|
49 |
return response.response
|
50 |
|
|
|
22 |
def ingest_documents():
|
23 |
reader = SimpleDirectoryReader("./")
|
24 |
documents = reader.load_data()
|
25 |
+
print(documents)
|
26 |
return documents
|
27 |
|
28 |
def load_data(documents):
|
|
|
34 |
query_engine = index.as_query_engine()
|
35 |
response = query_engine.query(f"""
|
36 |
You are a skilled legal analyst. Your task is to provide a comprehensive summary of the given legal document.
|
37 |
+
Analyze the following document and summarize it:
|
38 |
{document_text}
|
39 |
|
40 |
Please cover the following aspects:
|
|
|
45 |
5. Potential legal implications
|
46 |
6. Any notable or unusual elements
|
47 |
|
48 |
+
Provide a clear, concise, and professional summary
|
49 |
""")
|
50 |
return response.response
|
51 |
|