Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ def process_article(text, local_input, solidarity_input,issue_input,policy_input
|
|
21 |
"properties": {
|
22 |
|
23 |
"Local": {
|
24 |
-
"type": "
|
25 |
"description": f"{local_input}"
|
26 |
},
|
27 |
"Solidarity": {
|
@@ -56,13 +56,13 @@ def process_article(text, local_input, solidarity_input,issue_input,policy_input
|
|
56 |
|
57 |
messages = [
|
58 |
{"role": "system", "content": "You are a helpful assistant that extracts summaries of newspaper articles about political protests as JSON for a database. "},
|
59 |
-
{"role": "user", "content": f'''Extract information about the reason
|
60 |
Only use information from the article.
|
61 |
|
62 |
Answers the following questions:
|
63 |
Is the topic of the protest a local victim of police brutality?
|
64 |
Is the topic of the protest solidarity with non-local victims of police brutality?
|
65 |
-
Is the topic of the protest police brutality
|
66 |
Is the topic of the protest a policy reform related to reducing police brutality?
|
67 |
What best describes the theme?
|
68 |
|
@@ -73,7 +73,7 @@ def process_article(text, local_input, solidarity_input,issue_input,policy_input
|
|
73 |
|
74 |
|
75 |
|
76 |
-
client = OpenAI(
|
77 |
|
78 |
|
79 |
completion = client.chat.completions.create(
|
|
|
21 |
"properties": {
|
22 |
|
23 |
"Local": {
|
24 |
+
"type": "string",
|
25 |
"description": f"{local_input}"
|
26 |
},
|
27 |
"Solidarity": {
|
|
|
56 |
|
57 |
messages = [
|
58 |
{"role": "system", "content": "You are a helpful assistant that extracts summaries of newspaper articles about political protests as JSON for a database. "},
|
59 |
+
{"role": "user", "content": f'''Extract information about the reason for a protest against police brutality from the following article.
|
60 |
Only use information from the article.
|
61 |
|
62 |
Answers the following questions:
|
63 |
Is the topic of the protest a local victim of police brutality?
|
64 |
Is the topic of the protest solidarity with non-local victims of police brutality?
|
65 |
+
Is the topic of the protest police brutality?
|
66 |
Is the topic of the protest a policy reform related to reducing police brutality?
|
67 |
What best describes the theme?
|
68 |
|
|
|
73 |
|
74 |
|
75 |
|
76 |
+
client = OpenAI()
|
77 |
|
78 |
|
79 |
completion = client.chat.completions.create(
|