NealCaren commited on
Commit
6f16857
1 Parent(s): e11c7e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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": "boolean",
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 by 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,7 +73,7 @@ def process_article(text, local_input, solidarity_input,issue_input,policy_input
73
 
74
 
75
 
76
- client = OpenAI(api_key='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')
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(