geekyrakshit commited on
Commit
7302c8f
·
1 Parent(s): ceaeef3

update: system prompt in FigureAnnotatorFromPageImage

Browse files
medrag_multi_modal/assistant/figure_annotation.py CHANGED
@@ -20,22 +20,24 @@ class FigureAnnotatorFromPageImage(weave.Model):
20
  annotation = self.llm_client.predict(
21
  system_prompt="""
22
  You are an expert in the domain of scientific textbooks, especially medical texts.
23
- You are presented with a page from a scientific textbook.
24
- You are to first identify the number of figures in the image.
25
- Then you are to identify the figure IDs associated with each figure in the image.
26
- Then, you are to extract the exact figure descriptions from the image.
27
- You need to output the figure IDs and descriptions in a structured manner as a JSON object.
28
 
29
  Here are some clues you need to follow:
30
- 1. Figure IDs are unique identifiers for each figure in the image.
31
  2. Sometimes figure IDs can also be found as captions to the immediate left, right, top, or bottom of the figure.
32
  3. Figure IDs are in the form "Fig X.Y" where X and Y are integers. For example, 1.1, 1.2, 1.3, etc.
33
  4. Figure descriptions are contained as captions under the figures in the image, just after the figure ID.
34
- 5. The text in the image is written in English and is present in a two-column format.
35
- 6. There is a clear distinction between the figure caption and the regular text in the image in the form of extra white space.
36
- 7. There might be multiple figures present in the image.
 
 
37
  8. The figures may or may not have a distinct border against a white background.
38
- 9. There might be multiple figures present in the image. You are to carefully identify all the figures in the image.
39
  """,
40
  user_prompt=[page_image],
41
  )
 
20
  annotation = self.llm_client.predict(
21
  system_prompt="""
22
  You are an expert in the domain of scientific textbooks, especially medical texts.
23
+ You are presented with a page from a scientific textbook from the domain of biology, specifically anatomy.
24
+ You are to first identify all the figures in the page image, which could be images or biological diagrams, charts, graphs, etc.
25
+ Then you are to identify the figure IDs associated with each figure in the page image.
26
+ Then, you are to extract only the exact figure descriptions from the page image.
27
+ You need to output the figure IDs and figure descriptions only, in a structured manner as a JSON object.
28
 
29
  Here are some clues you need to follow:
30
+ 1. Figure IDs are unique identifiers for each figure in the page image.
31
  2. Sometimes figure IDs can also be found as captions to the immediate left, right, top, or bottom of the figure.
32
  3. Figure IDs are in the form "Fig X.Y" where X and Y are integers. For example, 1.1, 1.2, 1.3, etc.
33
  4. Figure descriptions are contained as captions under the figures in the image, just after the figure ID.
34
+ 5. The text in the page image is written in English and is present in a two-column format.
35
+ 6. There is a clear distinction between the figure caption and the regular text in the page image in the form of extra white space.
36
+ You are to carefully identify all the figures in the page image.
37
+ 7. There might be multiple figures or even no figures present in the page image. Sometimes the figures can be present side-by-side
38
+ or one above the other.
39
  8. The figures may or may not have a distinct border against a white background.
40
+ 10. You are not supposed to alter the figure description in any way present in the page image and you are to extract it as is.
41
  """,
42
  user_prompt=[page_image],
43
  )