|
742 | 742 | " questions: list[str],\n", |
743 | 743 | " links: list[str],\n", |
744 | 744 | " ) -> dict[str, Any]:\n", |
745 | | - " \"\"\"Structred data extraction from image analysis.\"\"\"\n", |
| 745 | + " \"\"\"Structured data extraction from image analysis.\"\"\"\n", |
746 | 746 | " return {\n", |
747 | 747 | " 'title': title,\n", |
748 | 748 | " 'key_words': key_words,\n", |
|
774 | 774 | " function_declarations=[glm.FunctionDeclaration(\n", |
775 | 775 | " name=\"structured_data_extraction\",\n", |
776 | 776 | " description=textwrap.dedent(\"\"\"\\\n", |
777 | | - " Structred data extraction from image analysis.\n", |
| 777 | + " Structured data extraction from image analysis.\n", |
778 | 778 | " \"\"\"),\n", |
779 | 779 | " parameters=glm.Schema(\n", |
780 | 780 | " type=glm.Type.OBJECT,\n", |
|
815 | 815 | " \"\"\"Extracts metadata from the image provided and returns it in a structured dict.\"\"\"\n", |
816 | 816 | " prompt = textwrap.dedent(f\"\"\"\n", |
817 | 817 | " You are an expert image analyzer. Given an image of a PDF page, your job is to write the following for each and every image.\n", |
818 | | - " 1. Generate key-words that matches the content from the image. (at most 10.)\n", |
| 818 | + " 1. Generate key-words that match the content from the image. (at most 10.)\n", |
819 | 819 | " 2. Suggest a one-word title for the image.\n", |
820 | 820 | " 3. Generate 1-2 short questions from the image.\n", |
821 | 821 | " 4. Extract links that are present in the image.\n", |
822 | 822 | "\n", |
823 | 823 | " Your answer should follow the following format.\n", |
824 | 824 | " ** 1. Key-words**\n", |
825 | | - " [list of relevant key-words to descibe the content of the image]\n", |
| 825 | + " [list of relevant key-words to describe the content of the image]\n", |
826 | 826 | "\n", |
827 | 827 | " **2. Title**\n", |
828 | 828 | " Suggest a one-word title based on the content here.\n", |
829 | 829 | "\n", |
830 | 830 | " **3. Questions**\n", |
831 | | - " [lst of generated questions here...]\n", |
| 831 | + " [list of generated questions here...]\n", |
832 | 832 | " ....\n", |
833 | 833 | "\n", |
834 | 834 | " **4. Links**\n", |
|
952 | 952 | "id": "-1q_v21t2E94" |
953 | 953 | }, |
954 | 954 | "source": [ |
955 | | - "Neat! The models were successfuly able to extract your custom metadata from the given information sources!" |
| 955 | + "Neat! The models were successfully able to extract your custom metadata from the given information sources!" |
956 | 956 | ] |
957 | 957 | }, |
958 | 958 | { |
|
1019 | 1019 | " is_separator_regex=False,\n", |
1020 | 1020 | " )\n", |
1021 | 1021 | "\n", |
1022 | | - " # iter through all PDF files.\n", |
| 1022 | + " # iterate through all PDF files.\n", |
1023 | 1023 | " for filename, file_bytes in pdfs.items():\n", |
1024 | 1024 | " print(f\"Extracting data from file: {filename}\")\n", |
1025 | 1025 | "\n", |
|
1239 | 1239 | "id": "vZl-A8EMVCZu" |
1240 | 1240 | }, |
1241 | 1241 | "source": [ |
1242 | | - "`relevant_chunks` has chunks that matched our search results. Each chunk returned has a `chunk_relevance_score` and `chunk`. Where `chunk_relevance_score` deontes the degree to which the `user_query` is semantically similar to the contents from `chunk`." |
| 1242 | + "`relevant_chunks` has chunks that matched our search results. Each chunk returned has a `chunk_relevance_score` and `chunk`. Where `chunk_relevance_score` denotes the degree to which the `user_query` is semantically similar to the contents from `chunk`." |
1243 | 1243 | ] |
1244 | 1244 | }, |
1245 | 1245 | { |
|
0 commit comments