Spaces:
Build error
Build error
update test summary with themes
Browse files
planning_ai/chains/reduce_chain.py
CHANGED
@@ -11,30 +11,14 @@ reduce_prompt = ChatPromptTemplate([("human", reduce_template)])
|
|
11 |
reduce_chain = reduce_prompt | LLM | StrOutputParser()
|
12 |
|
13 |
if __name__ == "__main__":
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
19 |
|
20 |
-
|
21 |
-
"""
|
22 |
-
test_summary = BriefSummary(
|
23 |
-
summary="""
|
24 |
-
The author expresses concern over the proposed mass development north-west of
|
25 |
-
Cambridge, highlighting the significant growth in the area over the past twenty years,
|
26 |
-
particularly with the creation of Cambourne and the expansion of Papworth Everard.
|
27 |
-
""",
|
28 |
-
stance="OPPOSE",
|
29 |
-
themes=[
|
30 |
-
"Local growth",
|
31 |
-
"Development concerns",
|
32 |
-
"Impact on existing settlements",
|
33 |
-
],
|
34 |
-
rating=5,
|
35 |
-
)
|
36 |
-
|
37 |
-
result = reduce_chain.invoke({"context": test_document})
|
38 |
|
39 |
print("Generated Report:")
|
40 |
print(result)
|
|
|
11 |
reduce_chain = reduce_prompt | LLM | StrOutputParser()
|
12 |
|
13 |
if __name__ == "__main__":
|
14 |
+
test_summary = """
|
15 |
+
The author expresses concern over the proposed mass development north-west of Cambridge,
|
16 |
+
highlighting significant growth in the area over the past twenty years, particularly with
|
17 |
+
the creation of Cambourne and the expansion of Papworth Everard.
|
18 |
+
Related Aims: [Homes, Infrastructure]
|
19 |
+
"""
|
20 |
|
21 |
+
result = reduce_chain.invoke({"context": test_summary})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
print("Generated Report:")
|
24 |
print(result)
|