Dmitry Kirsanov commited on
Commit
d199a11
·
1 Parent(s): df3e641
Files changed (1) hide show
  1. understand.py +10 -7
understand.py CHANGED
@@ -21,27 +21,30 @@ class Document():
21
  self.values.put("document type", self.query(
22
  f"""Please read this document carefully. Remember everything you know about the concepts it touches.
23
 
24
- Give a brief description of what this document is. Examples: "Textbook about interpersonal psychology", "State standard on oil rig equipment", "User manual for a smartphone app".
25
 
26
  Write just one line with the description.
27
 
28
- <document>{self.fad}</document>"""))
29
 
30
  def query_summary(self):
31
  self.values.put("summary", self.query(
32
- f"""Below is a document inside <document></document>. It is a {self.doctype}.
33
 
34
  Read it carefully. Remember everything you know about the concepts it touches.
35
 
36
  Give a one-paragraph summary of the document's content. Write just one paragraph with the summary.
37
 
38
- <document>{self.fad}</document>"""))
39
 
40
  def query_concepts(self):
41
  ret = self.query(
42
- f"""Below is a document inside <document></document>. It is a {self.doctype}.
 
 
 
43
 
44
- Read it carefully. Remember everything you know about the concepts it touches.
45
 
46
  Now, read it again, and compile a list of the main concepts that this document talks about. Output the line "CONCEPTS:" followed by a list of concepts, one per line.
47
 
@@ -61,7 +64,7 @@ ACTORS:
61
  - Children and bystanders
62
  ...
63
 
64
- <document>{self.fad}</document>""")
65
 
66
  self.values.put("concepts", [])
67
  self.values.put("actors", [])
 
21
  self.values.put("document type", self.query(
22
  f"""Please read this document carefully. Remember everything you know about the concepts it touches.
23
 
24
+ Give a brief description (a noun phrase, without article) of what this document is. Examples: "Textbook about interpersonal psychology", "State standard on oil rig equipment", "User manual for a smartphone app".
25
 
26
  Write just one line with the description.
27
 
28
+ <document>{self.values.get("FAD")}</document>"""))
29
 
30
  def query_summary(self):
31
  self.values.put("summary", self.query(
32
+ f"""Below is a document inside <document></document>. It is a {self.values.get("document type")}.
33
 
34
  Read it carefully. Remember everything you know about the concepts it touches.
35
 
36
  Give a one-paragraph summary of the document's content. Write just one paragraph with the summary.
37
 
38
+ <document>{self.values.get("FAD")}</document>"""))
39
 
40
  def query_concepts(self):
41
  ret = self.query(
42
+ f"""Below is a document inside <document></document>. It is a {self.values.get("document type")}.
43
+
44
+ Summary of the document:
45
+ {self.values.get("summary")}
46
 
47
+ Read the entire document carefully. Remember everything you know about the concepts it touches.
48
 
49
  Now, read it again, and compile a list of the main concepts that this document talks about. Output the line "CONCEPTS:" followed by a list of concepts, one per line.
50
 
 
64
  - Children and bystanders
65
  ...
66
 
67
+ <document>{self.values.get("FAD")}</document>""")
68
 
69
  self.values.put("concepts", [])
70
  self.values.put("actors", [])