(self, answer, point_annotations)
| 787 | return normalized_label # fallback |
| 788 | |
| 789 | def format_annotated_text(self, answer, point_annotations): |
| 790 | for point_annotation in point_annotations: |
| 791 | parts = answer.split("<|POINT|>", maxsplit=1) |
| 792 | # this is hard-coded for point-qa, which needs to be clipped and |
| 793 | # has a scale of 0 to 100 |
| 794 | points = np.array(point_annotation["points"]) |
| 795 | points = np.clip(points, 0, 100) |
| 796 | point_text = self._point_formatter.format_image_points( |
| 797 | points, 100, |
| 798 | point_annotation["inline_text"], point_annotation["alt_text"], |
| 799 | mode="point" |
| 800 | ) |
| 801 | answer = parts[0] + point_text + parts[1] |
| 802 | return answer |
| 803 | |
| 804 | def template_options(self, example, is_training, rng): |
| 805 | """Template a multiple choice questions""" |
no test coverage detected