marketing
Browse files- graphrag.py +3 -3
graphrag.py
CHANGED
|
@@ -93,8 +93,7 @@ def reasoning(text, question):
|
|
| 93 |
def marketing(text, question):
|
| 94 |
try:
|
| 95 |
print("Generate Knowledgegraph...")
|
| 96 |
-
graph, graph_documents_filtered = knowledge_graph(
|
| 97 |
-
marketing campaign that can improve customer acquisition, activation, retention and referral for this persona: {text}""")
|
| 98 |
|
| 99 |
print("GraphQAChain...")
|
| 100 |
graph_rag = GraphQAChain.from_llm(
|
|
@@ -104,7 +103,8 @@ def marketing(text, question):
|
|
| 104 |
)
|
| 105 |
|
| 106 |
print("Answering through GraphQAChain...")
|
| 107 |
-
answer = graph_rag.invoke(
|
|
|
|
| 108 |
return answer['result']
|
| 109 |
|
| 110 |
except Exception as e:
|
|
|
|
| 93 |
def marketing(text, question):
|
| 94 |
try:
|
| 95 |
print("Generate Knowledgegraph...")
|
| 96 |
+
graph, graph_documents_filtered = knowledge_graph(text)
|
|
|
|
| 97 |
|
| 98 |
print("GraphQAChain...")
|
| 99 |
graph_rag = GraphQAChain.from_llm(
|
|
|
|
| 103 |
)
|
| 104 |
|
| 105 |
print("Answering through GraphQAChain...")
|
| 106 |
+
answer = graph_rag.invoke(f"""Create
|
| 107 |
+
marketing campaign that can improve customer acquisition, activation, retention and referral for this persona: {question}""")
|
| 108 |
return answer['result']
|
| 109 |
|
| 110 |
except Exception as e:
|