зеркало из
				https://github.com/ssciwr/AMMICO.git
				synced 2025-10-31 05:56:05 +02:00 
			
		
		
		
	fix: update function call in notebook to conform with renaming
Этот коммит содержится в:
		
							родитель
							
								
									8487947f5d
								
							
						
					
					
						Коммит
						1f2642f1b4
					
				| @ -142,7 +142,7 @@ | ||||
|    "outputs": [], | ||||
|    "source": [ | ||||
|     "os.environ[\"GOOGLE_APPLICATION_CREDENTIALS\"] = (\n", | ||||
|     "    \"/home/inga/projects/misinformation-project/misinformation-notes/misinformation-campaign-981aa55a3b13.json\"\n", | ||||
|     "    \"../../data/misinformation-campaign-981aa55a3b13.json\"\n", | ||||
|     ")" | ||||
|    ] | ||||
|   }, | ||||
| @ -358,6 +358,11 @@ | ||||
|     "For the computationally demanding `SummaryDetector`, it is best to initialize the model first and then analyze each image while passing the model explicitly. This can be done in a separate loop or in the same loop as for text and emotion detection." | ||||
|    ] | ||||
|   }, | ||||
|   { | ||||
|    "cell_type": "markdown", | ||||
|    "metadata": {}, | ||||
|    "source": [] | ||||
|   }, | ||||
|   { | ||||
|    "cell_type": "code", | ||||
|    "execution_count": null, | ||||
| @ -370,7 +375,7 @@ | ||||
|     "    subdict=image_dict, summary_model=model\n", | ||||
|     ")\n", | ||||
|     "\n", | ||||
|     "image_summary_detector.analyse_images(analysis_type=\"summary\")" | ||||
|     "image_summary_detector.analyse_images_from_dict(analysis_type=\"summary\")" | ||||
|    ] | ||||
|   }, | ||||
|   { | ||||
| @ -387,9 +392,9 @@ | ||||
|    "outputs": [], | ||||
|    "source": [ | ||||
|     "# initialize the models\n", | ||||
|     "# currently this does not work because of the way the summary detector is implemented\n", | ||||
|     "image_summary_detector = ammico.SummaryDetector(\n", | ||||
|     "    subdict=image_dict, analysis_type=\"summary\", model_type=\"base\"\n", | ||||
|     "model = ammico.MultimodalSummaryModel()\n", | ||||
|     "image_summary_detector = ammico.ImageSummaryDetector(\n", | ||||
|     "    subdict=image_dict, summary_model=model\n", | ||||
|     ")\n", | ||||
|     "\n", | ||||
|     "for num, key in tqdm(\n", | ||||
| @ -399,9 +404,9 @@ | ||||
|     "        image_dict[key]\n", | ||||
|     "    ).analyse_image()  # analyse image with EmotionDetector and update dict\n", | ||||
|     "    image_dict[key] = ammico.TextDetector(\n", | ||||
|     "        image_dict[key], analyse_text=True\n", | ||||
|     "        image_dict[key]\n", | ||||
|     "    ).analyse_image()  # analyse image with TextDetector and update dict\n", | ||||
|     "    image_dict[key] = image_summary_detector.analyse_image(\n", | ||||
|     "    image_dict[key] = image_summary_detector.analyse_images_from_dict(\n", | ||||
|     "        subdict=image_dict[key], analysis_type=\"summary\"\n", | ||||
|     "    )  # analyse image with SummaryDetector and update dict\n", | ||||
|     "\n", | ||||
| @ -1553,7 +1558,7 @@ | ||||
|    "name": "python", | ||||
|    "nbconvert_exporter": "python", | ||||
|    "pygments_lexer": "ipython3", | ||||
|    "version": "3.11.13" | ||||
|    "version": "3.11.14" | ||||
|   } | ||||
|  }, | ||||
|  "nbformat": 4, | ||||
|  | ||||
		Загрузка…
	
	
			
			x
			
			
		
	
		Ссылка в новой задаче
	
	Block a user
	 Inga Ulusoy
						Inga Ulusoy