Spaces:
Runtime error
Runtime error
Dmitry Kirsanov commited on
Commit ·
f09d6be
1
Parent(s): 0eecb35
fix quotes
Browse files- understand.py +12 -12
understand.py
CHANGED
|
@@ -108,37 +108,37 @@ Here's the document:
|
|
| 108 |
|
| 109 |
#reconcile two lists
|
| 110 |
for what in [
|
| 111 |
-
{
|
| 112 |
-
{
|
| 113 |
]:
|
| 114 |
|
| 115 |
-
if set(two_attempts[0][what[
|
| 116 |
ret = self.query(
|
| 117 |
f"""Below is a document inside <document></document>. It is a {self.values.get("document type")}.
|
| 118 |
|
| 119 |
Summary of the document:
|
| 120 |
{self.values.get("summary")}
|
| 121 |
|
| 122 |
-
Two different readers have read this document and created different lists of the {what[
|
| 123 |
|
| 124 |
Compare the two lists:
|
| 125 |
-
- If they have the same {what[
|
| 126 |
-
- If any of the {what[
|
| 127 |
-
- If you see some {what[
|
| 128 |
|
| 129 |
-
First list of {what[
|
| 130 |
{newline.join(["- " + x for x in two_attempts[0]["concepts"]])}
|
| 131 |
|
| 132 |
-
Second list of {what[
|
| 133 |
{newline.join(["- " + x for x in two_attempts[1]["concepts"]])}
|
| 134 |
|
| 135 |
-
Output the line "{what[
|
| 136 |
|
| 137 |
Here's the document:
|
| 138 |
|
| 139 |
<document>{self.values.get("FAD")}</document>""")
|
| 140 |
-
self.parse_lists(ret, what[
|
| 141 |
-
print(f"===Reconciled {what[
|
| 142 |
|
| 143 |
|
| 144 |
self.values.put("concepts", two_attempts[0]["concepts"])
|
|
|
|
| 108 |
|
| 109 |
#reconcile two lists
|
| 110 |
for what in [
|
| 111 |
+
{'plural': "concepts", 'singular': "concept", 'full': "concepts that this document talks about"},
|
| 112 |
+
{'plural': "actors", 'singular': "actor", 'full': "actors described or implied in the document"}
|
| 113 |
]:
|
| 114 |
|
| 115 |
+
if set(two_attempts[0][what['plural']]) != set(two_attempts[1][what['plural']]):
|
| 116 |
ret = self.query(
|
| 117 |
f"""Below is a document inside <document></document>. It is a {self.values.get("document type")}.
|
| 118 |
|
| 119 |
Summary of the document:
|
| 120 |
{self.values.get("summary")}
|
| 121 |
|
| 122 |
+
Two different readers have read this document and created different lists of the {what['full']}. Your goal is to read these lists and the entire document carefully and then create a new combined list of the document's {what['plural']}.
|
| 123 |
|
| 124 |
Compare the two lists:
|
| 125 |
+
- If they have the same {what['singular']} but expressed differently, add a better expression of that {what['singular']} to your final list.
|
| 126 |
+
- If any of the {what['plural']} in these lists is actually irrelevant or confusing, drop it.
|
| 127 |
+
- If you see some {what['singular']} in the document that both lists missed, add it.
|
| 128 |
|
| 129 |
+
First list of {what['plural']}:
|
| 130 |
{newline.join(["- " + x for x in two_attempts[0]["concepts"]])}
|
| 131 |
|
| 132 |
+
Second list of {what['plural']}:
|
| 133 |
{newline.join(["- " + x for x in two_attempts[1]["concepts"]])}
|
| 134 |
|
| 135 |
+
Output the line "{what['plural'].upper()}:" followed by your combined list of {what['plural']}, one per line.
|
| 136 |
|
| 137 |
Here's the document:
|
| 138 |
|
| 139 |
<document>{self.values.get("FAD")}</document>""")
|
| 140 |
+
self.parse_lists(ret, what['plural'], two_attempts[0][what['plural']])
|
| 141 |
+
print(f"===Reconciled {what['plural']}: {two_attempts[0][what['plural']]}")
|
| 142 |
|
| 143 |
|
| 144 |
self.values.put("concepts", two_attempts[0]["concepts"])
|