Spaces:
Runtime error
Runtime error
Dmitry Kirsanov commited on
Commit ·
0eecb35
1
Parent(s): bf23f98
fix newline
Browse files- understand.py +6 -4
understand.py
CHANGED
|
@@ -2,6 +2,8 @@ import parse
|
|
| 2 |
import llm
|
| 3 |
from versioneddict import VersionedDict
|
| 4 |
|
|
|
|
|
|
|
| 5 |
class Document():
|
| 6 |
|
| 7 |
def __init__(self, llm) -> None:
|
|
@@ -125,10 +127,10 @@ Compare the two lists:
|
|
| 125 |
- If you see some {what["singular"]} in the document that both lists missed, add it.
|
| 126 |
|
| 127 |
First list of {what["plural"]}:
|
| 128 |
-
{
|
| 129 |
|
| 130 |
Second list of {what["plural"]}:
|
| 131 |
-
{
|
| 132 |
|
| 133 |
Output the line "{what["plural"].upper()}:" followed by your combined list of {what["plural"]}, one per line.
|
| 134 |
|
|
@@ -161,8 +163,8 @@ Here's the document:
|
|
| 161 |
self.understand()
|
| 162 |
|
| 163 |
return (self.values.get("document type"), self.values.get("summary"),
|
| 164 |
-
"=== Concepts:\n"+
|
| 165 |
-
"=== Actors:\n"+
|
| 166 |
)
|
| 167 |
|
| 168 |
|
|
|
|
| 2 |
import llm
|
| 3 |
from versioneddict import VersionedDict
|
| 4 |
|
| 5 |
+
newline = "\n"
|
| 6 |
+
|
| 7 |
class Document():
|
| 8 |
|
| 9 |
def __init__(self, llm) -> None:
|
|
|
|
| 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 |
|
|
|
|
| 163 |
self.understand()
|
| 164 |
|
| 165 |
return (self.values.get("document type"), self.values.get("summary"),
|
| 166 |
+
"=== Concepts:\n"+newline.join(["- " + x for x in self.values.get("concepts")]),
|
| 167 |
+
"=== Actors:\n"+newline.join(["- " + x for x in self.values.get("actors")]),
|
| 168 |
)
|
| 169 |
|
| 170 |
|