Spaces:
Runtime error
Runtime error
update prompt and find_orgs_gpt function to work with json objects
Browse files
app.py
CHANGED
@@ -46,17 +46,17 @@ def find_orgs_gpt(sentence):
|
|
46 |
```
|
47 |
{sentence}
|
48 |
```
|
49 |
-
Your output should be a
|
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 = """
|