elshehawy commited on
Commit
15c9ed1
Β·
1 Parent(s): cb8fae7

update prompt and find_orgs_gpt function to work with json objects

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -46,17 +46,17 @@ def find_orgs_gpt(sentence):
46
  ```
47
  {sentence}
48
  ```
49
- Your output should be a Python list that containes the extracted organizations.
50
  Output example 1:
51
- ["Organization 1", "Organization 2", "Organization 3"]
52
  Output example 2:
53
- []
54
  """
55
 
56
  sent_orgs_str = get_completion(prompt)
57
  sent_orgs = json.loads(sent_orgs_str)
58
 
59
- return sent_orgs
60
 
61
 
62
  example = """
 
46
  ```
47
  {sentence}
48
  ```
49
+ Your output should be a a json object that containes the extracted organizations.
50
  Output example 1:
51
+ {"Organizations": ["Organization 1", "Organization 2", "Organization 3"]}
52
  Output example 2:
53
+ {"Organizations": []}
54
  """
55
 
56
  sent_orgs_str = get_completion(prompt)
57
  sent_orgs = json.loads(sent_orgs_str)
58
 
59
+ return sent_orgs['Organizations']
60
 
61
 
62
  example = """