Spaces:
Sleeping
Sleeping
matthewfarant
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -107,8 +107,9 @@ generate_prompt = PromptTemplate(
|
|
107 |
You are a fact-checker AI assistant that receives an information from the user, synthesizes web search results for that information, and verify whether the user's information is a fact or possibly a hoax.
|
108 |
Strictly use the following pieces of web search context to answer the question. If you don't know the answer, just give "Possibly Hoax" verdict. Only make direct references to material if provided in the context.
|
109 |
Return a JSON output with these keys, with no premable:
|
110 |
-
1.
|
111 |
-
2.
|
|
|
112 |
If the context does not relate with the information provided by user, you can give "Possibly Hoax" result and tell the user that based on web search, it seems that the provided information is a false information.
|
113 |
|
114 |
<|eot_id|>
|
@@ -117,7 +118,7 @@ generate_prompt = PromptTemplate(
|
|
117 |
|
118 |
User Information: {question}
|
119 |
Web Search Context: {context}
|
120 |
-
JSON
|
121 |
|
122 |
<|eot_id|>
|
123 |
|
@@ -151,11 +152,6 @@ def fact_check_flow(user_question):
|
|
151 |
|
152 |
return final_response
|
153 |
|
154 |
-
# Example Use
|
155 |
-
# user_question = "biden is not joining election in 2024"
|
156 |
-
# result = fact_check_flow(user_question)
|
157 |
-
# print(result)
|
158 |
-
|
159 |
demo = gr.Interface(fn=fact_check_flow, inputs="textbox", outputs="textbox")
|
160 |
|
161 |
if __name__ == "__main__":
|
|
|
107 |
You are a fact-checker AI assistant that receives an information from the user, synthesizes web search results for that information, and verify whether the user's information is a fact or possibly a hoax.
|
108 |
Strictly use the following pieces of web search context to answer the question. If you don't know the answer, just give "Possibly Hoax" verdict. Only make direct references to material if provided in the context.
|
109 |
Return a JSON output with these keys, with no premable:
|
110 |
+
1. user_information: the user's input
|
111 |
+
2. system_verdict: is the user question above a fact? choose only between "Fact" or "Possibly Hoax"
|
112 |
+
3. explanation: a short explanation on why the verdict was chosen
|
113 |
If the context does not relate with the information provided by user, you can give "Possibly Hoax" result and tell the user that based on web search, it seems that the provided information is a false information.
|
114 |
|
115 |
<|eot_id|>
|
|
|
118 |
|
119 |
User Information: {question}
|
120 |
Web Search Context: {context}
|
121 |
+
JSON output:
|
122 |
|
123 |
<|eot_id|>
|
124 |
|
|
|
152 |
|
153 |
return final_response
|
154 |
|
|
|
|
|
|
|
|
|
|
|
155 |
demo = gr.Interface(fn=fact_check_flow, inputs="textbox", outputs="textbox")
|
156 |
|
157 |
if __name__ == "__main__":
|