diff --git a/Dockerfile b/Dockerfile index 5727154..fdb5ba2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,4 +26,4 @@ ENV GOOGLE_APPLICATION_CREDENTIALS=credentials.json RUN echo ${GOOGLE_CREDS} > $GOOGLE_APPLICATION_CREDENTIALS # Bundle the pre-built models (that are downloaded on demand) into the # Docker image. -RUN misinformation_prefetch_models +RUN ammico_prefetch_models diff --git a/README.md b/README.md index 16ce16e..261d420 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # AMMICO - AI Media and Misinformation Content Analysis Tool -![License: MIT](https://img.shields.io/github/license/ssciwr/misinformation) -![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ssciwr/misinformation/ci.yml?branch=main) -![codecov](https://img.shields.io/codecov/c/github/ssciwr/misinformation) -![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ssciwr_misinformation&metric=alert_status) -![Language](https://img.shields.io/github/languages/top/ssciwr/misinformation) +![License: MIT](https://img.shields.io/github/license/ssciwr/AMMICO) +![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ssciwr/AMMICO/ci.yml?branch=main) +![codecov](https://img.shields.io/codecov/c/github/ssciwr/AMMICO) +![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ssciwr_ammico&metric=alert_status) +![Language](https://img.shields.io/github/languages/top/ssciwr/AMMICO) This package extracts data from images such as social media images, and the accompanying text/text that is included in the image. The analysis can extract a very large number of features, depending on the user input. @@ -34,7 +34,7 @@ Use pre-processed image files such as social media posts with comments and proce ## Installation -The `AMMICO` package can be installed using pip: Navigate into your package folder `misinformation/` and execute +The `AMMICO` package can be installed using pip: Navigate into your package folder `ammico/` and execute ``` pip install . ``` @@ -43,7 +43,7 @@ This will install the package and its dependencies locally. ## Usage -There are sample notebooks in the `misinformation/notebooks` folder for you to explore the package: +There are sample notebooks in the `notebooks` folder for you to explore the package: 1. Text extraction: Use the notebook `get-text-from-image.ipynb` to extract any text from the images. The text is directly translated into English. If the text should be further analysed, set the keyword `analyse_text` to `True` as demonstrated in the notebook.\ **You can run this notebook on google colab: [Here](https://colab.research.google.com/github/ssciwr/misinformation/blob/main/notebooks/get-text-from-image.ipynb)** Place the data files and google cloud vision API key in your google drive to access the data. diff --git a/misinformation/__init__.py b/ammico/__init__.py similarity index 100% rename from misinformation/__init__.py rename to ammico/__init__.py diff --git a/misinformation/cropposts.py b/ammico/cropposts.py similarity index 100% rename from misinformation/cropposts.py rename to ammico/cropposts.py diff --git a/misinformation/data/map_test_set.json b/ammico/data/map_test_set.json similarity index 100% rename from misinformation/data/map_test_set.json rename to ammico/data/map_test_set.json diff --git a/misinformation/display.py b/ammico/display.py similarity index 93% rename from misinformation/display.py rename to ammico/display.py index 72851a9..47352c8 100644 --- a/misinformation/display.py +++ b/ammico/display.py @@ -1,11 +1,11 @@ import ipywidgets from IPython.display import display -import misinformation.faces as faces -import misinformation.text as text -import misinformation.objects as objects +import ammico.faces as faces +import ammico.text as text +import ammico.objects as objects -import misinformation.summary as summary +import ammico.summary as summary class JSONContainer: diff --git a/misinformation/faces.py b/ammico/faces.py similarity index 99% rename from misinformation/faces.py rename to ammico/faces.py index 5f604e0..2c43a07 100644 --- a/misinformation/faces.py +++ b/ammico/faces.py @@ -11,8 +11,8 @@ from tensorflow.keras.preprocessing.image import img_to_array from deepface import DeepFace from retinaface import RetinaFace -from misinformation.utils import DownloadResource -import misinformation.utils as utils +from ammico.utils import DownloadResource +import ammico.utils as utils DEEPFACE_PATH = ".deepface" diff --git a/misinformation/multimodal_search.py b/ammico/multimodal_search.py similarity index 99% rename from misinformation/multimodal_search.py rename to ammico/multimodal_search.py index e7d7cdf..1532ace 100644 --- a/misinformation/multimodal_search.py +++ b/ammico/multimodal_search.py @@ -1,4 +1,4 @@ -from misinformation.utils import AnalysisMethod +from ammico.utils import AnalysisMethod import torch import torch.nn.functional as Func import requests diff --git a/misinformation/objects.py b/ammico/objects.py similarity index 86% rename from misinformation/objects.py rename to ammico/objects.py index 0c94d8d..f60e6ee 100644 --- a/misinformation/objects.py +++ b/ammico/objects.py @@ -1,6 +1,6 @@ -from misinformation.utils import AnalysisMethod -from misinformation.objects_cvlib import ObjectCVLib -from misinformation.objects_cvlib import init_default_objects +from ammico.utils import AnalysisMethod +from ammico.objects_cvlib import ObjectCVLib +from ammico.objects_cvlib import init_default_objects class ObjectDetectorClient(AnalysisMethod): diff --git a/misinformation/objects_cvlib.py b/ammico/objects_cvlib.py similarity index 100% rename from misinformation/objects_cvlib.py rename to ammico/objects_cvlib.py diff --git a/misinformation/summary.py b/ammico/summary.py similarity index 98% rename from misinformation/summary.py rename to ammico/summary.py index 18117c7..7e4d9d4 100644 --- a/misinformation/summary.py +++ b/ammico/summary.py @@ -1,4 +1,4 @@ -from misinformation.utils import AnalysisMethod +from ammico.utils import AnalysisMethod from torch import device, cuda, no_grad from PIL import Image from lavis.models import load_model_and_preprocess diff --git a/misinformation/test/conftest.py b/ammico/test/conftest.py similarity index 100% rename from misinformation/test/conftest.py rename to ammico/test/conftest.py diff --git a/misinformation/test/data/IMG_1730.png b/ammico/test/data/IMG_1730.png similarity index 100% rename from misinformation/test/data/IMG_1730.png rename to ammico/test/data/IMG_1730.png diff --git a/misinformation/test/data/IMG_2746.png b/ammico/test/data/IMG_2746.png similarity index 100% rename from misinformation/test/data/IMG_2746.png rename to ammico/test/data/IMG_2746.png diff --git a/misinformation/test/data/IMG_2750.png b/ammico/test/data/IMG_2750.png similarity index 100% rename from misinformation/test/data/IMG_2750.png rename to ammico/test/data/IMG_2750.png diff --git a/misinformation/test/data/IMG_2805.png b/ammico/test/data/IMG_2805.png similarity index 100% rename from misinformation/test/data/IMG_2805.png rename to ammico/test/data/IMG_2805.png diff --git a/misinformation/test/data/IMG_2806.png b/ammico/test/data/IMG_2806.png similarity index 100% rename from misinformation/test/data/IMG_2806.png rename to ammico/test/data/IMG_2806.png diff --git a/misinformation/test/data/IMG_2807.png b/ammico/test/data/IMG_2807.png similarity index 100% rename from misinformation/test/data/IMG_2807.png rename to ammico/test/data/IMG_2807.png diff --git a/misinformation/test/data/IMG_2808.png b/ammico/test/data/IMG_2808.png similarity index 100% rename from misinformation/test/data/IMG_2808.png rename to ammico/test/data/IMG_2808.png diff --git a/misinformation/test/data/IMG_2809.png b/ammico/test/data/IMG_2809.png similarity index 100% rename from misinformation/test/data/IMG_2809.png rename to ammico/test/data/IMG_2809.png diff --git a/misinformation/test/data/IMG_3755.jpg b/ammico/test/data/IMG_3755.jpg similarity index 100% rename from misinformation/test/data/IMG_3755.jpg rename to ammico/test/data/IMG_3755.jpg diff --git a/misinformation/test/data/IMG_3756.jpg b/ammico/test/data/IMG_3756.jpg similarity index 100% rename from misinformation/test/data/IMG_3756.jpg rename to ammico/test/data/IMG_3756.jpg diff --git a/misinformation/test/data/IMG_3757.jpg b/ammico/test/data/IMG_3757.jpg similarity index 100% rename from misinformation/test/data/IMG_3757.jpg rename to ammico/test/data/IMG_3757.jpg diff --git a/misinformation/test/data/IMG_3758.png b/ammico/test/data/IMG_3758.png similarity index 100% rename from misinformation/test/data/IMG_3758.png rename to ammico/test/data/IMG_3758.png diff --git a/misinformation/test/data/d755771b-225e-432f-802e-fb8dc850fff7.png b/ammico/test/data/d755771b-225e-432f-802e-fb8dc850fff7.png similarity index 100% rename from misinformation/test/data/d755771b-225e-432f-802e-fb8dc850fff7.png rename to ammico/test/data/d755771b-225e-432f-802e-fb8dc850fff7.png diff --git a/misinformation/test/data/example_analysis_objects.json b/ammico/test/data/example_analysis_objects.json similarity index 100% rename from misinformation/test/data/example_analysis_objects.json rename to ammico/test/data/example_analysis_objects.json diff --git a/misinformation/test/data/example_append_data_to_dict_in.json b/ammico/test/data/example_append_data_to_dict_in.json similarity index 100% rename from misinformation/test/data/example_append_data_to_dict_in.json rename to ammico/test/data/example_append_data_to_dict_in.json diff --git a/misinformation/test/data/example_append_data_to_dict_out.json b/ammico/test/data/example_append_data_to_dict_out.json similarity index 100% rename from misinformation/test/data/example_append_data_to_dict_out.json rename to ammico/test/data/example_append_data_to_dict_out.json diff --git a/misinformation/test/data/example_dump_df.csv b/ammico/test/data/example_dump_df.csv similarity index 100% rename from misinformation/test/data/example_dump_df.csv rename to ammico/test/data/example_dump_df.csv diff --git a/misinformation/test/data/example_faces.json b/ammico/test/data/example_faces.json similarity index 100% rename from misinformation/test/data/example_faces.json rename to ammico/test/data/example_faces.json diff --git a/misinformation/test/data/example_objects_cvlib.json b/ammico/test/data/example_objects_cvlib.json similarity index 100% rename from misinformation/test/data/example_objects_cvlib.json rename to ammico/test/data/example_objects_cvlib.json diff --git a/misinformation/test/data/example_summary.txt b/ammico/test/data/example_summary.txt similarity index 100% rename from misinformation/test/data/example_summary.txt rename to ammico/test/data/example_summary.txt diff --git a/misinformation/test/data/example_utils_init_dict.json b/ammico/test/data/example_utils_init_dict.json similarity index 100% rename from misinformation/test/data/example_utils_init_dict.json rename to ammico/test/data/example_utils_init_dict.json diff --git a/misinformation/test/data/pic1.png b/ammico/test/data/pic1.png similarity index 100% rename from misinformation/test/data/pic1.png rename to ammico/test/data/pic1.png diff --git a/misinformation/test/data/pic2.png b/ammico/test/data/pic2.png similarity index 100% rename from misinformation/test/data/pic2.png rename to ammico/test/data/pic2.png diff --git a/misinformation/test/data/test_data_out.csv b/ammico/test/data/test_data_out.csv similarity index 100% rename from misinformation/test/data/test_data_out.csv rename to ammico/test/data/test_data_out.csv diff --git a/misinformation/test/data/test_data_out_nokey.csv b/ammico/test/data/test_data_out_nokey.csv similarity index 100% rename from misinformation/test/data/test_data_out_nokey.csv rename to ammico/test/data/test_data_out_nokey.csv diff --git a/misinformation/test/data/text_IMG_3755.txt b/ammico/test/data/text_IMG_3755.txt similarity index 100% rename from misinformation/test/data/text_IMG_3755.txt rename to ammico/test/data/text_IMG_3755.txt diff --git a/misinformation/test/data/text_IMG_3756.txt b/ammico/test/data/text_IMG_3756.txt similarity index 100% rename from misinformation/test/data/text_IMG_3756.txt rename to ammico/test/data/text_IMG_3756.txt diff --git a/misinformation/test/data/text_IMG_3757.txt b/ammico/test/data/text_IMG_3757.txt similarity index 100% rename from misinformation/test/data/text_IMG_3757.txt rename to ammico/test/data/text_IMG_3757.txt diff --git a/misinformation/test/data/text_translated_IMG_3755.txt b/ammico/test/data/text_translated_IMG_3755.txt similarity index 100% rename from misinformation/test/data/text_translated_IMG_3755.txt rename to ammico/test/data/text_translated_IMG_3755.txt diff --git a/misinformation/test/data/text_translated_IMG_3756.txt b/ammico/test/data/text_translated_IMG_3756.txt similarity index 100% rename from misinformation/test/data/text_translated_IMG_3756.txt rename to ammico/test/data/text_translated_IMG_3756.txt diff --git a/misinformation/test/data/text_translated_IMG_3757.txt b/ammico/test/data/text_translated_IMG_3757.txt similarity index 100% rename from misinformation/test/data/text_translated_IMG_3757.txt rename to ammico/test/data/text_translated_IMG_3757.txt diff --git a/misinformation/test/data/topic_analysis_test.csv b/ammico/test/data/topic_analysis_test.csv similarity index 100% rename from misinformation/test/data/topic_analysis_test.csv rename to ammico/test/data/topic_analysis_test.csv diff --git a/misinformation/test/pytest.ini b/ammico/test/pytest.ini similarity index 100% rename from misinformation/test/pytest.ini rename to ammico/test/pytest.ini diff --git a/misinformation/test/test_cropposts.py b/ammico/test/test_cropposts.py similarity index 95% rename from misinformation/test/test_cropposts.py rename to ammico/test/test_cropposts.py index d75f385..bc1efdd 100644 --- a/misinformation/test/test_cropposts.py +++ b/ammico/test/test_cropposts.py @@ -1,4 +1,4 @@ -import misinformation.cropposts as crpo +import ammico.cropposts as crpo import numpy as np from PIL import Image diff --git a/misinformation/test/test_display.py b/ammico/test/test_display.py similarity index 81% rename from misinformation/test/test_display.py rename to ammico/test/test_display.py index 7d7d45f..47a8f79 100644 --- a/misinformation/test/test_display.py +++ b/ammico/test/test_display.py @@ -1,10 +1,10 @@ import json -import misinformation.display as misinf_display +import ammico.display as ammico_display def test_explore_analysis_faces(get_path): mydict = {"IMG_2746": {"filename": get_path + "IMG_2746.png"}} - temp = misinf_display.explore_analysis(mydict, identify="faces") # noqa + temp = ammico_display.explore_analysis(mydict, identify="faces") # noqa temp = None # noqa with open(get_path + "example_faces.json", "r") as file: outs = json.load(file) @@ -17,7 +17,7 @@ def test_explore_analysis_faces(get_path): def test_explore_analysis_objects(get_path): mydict = {"IMG_2809": {"filename": get_path + "IMG_2809.png"}} - temp = misinf_display.explore_analysis(mydict, identify="objects") # noqa + temp = ammico_display.explore_analysis(mydict, identify="objects") # noqa temp = None # noqa with open(get_path + "example_analysis_objects.json", "r") as file: outs = json.load(file) diff --git a/misinformation/test/test_faces.py b/ammico/test/test_faces.py similarity index 89% rename from misinformation/test/test_faces.py rename to ammico/test/test_faces.py index 6cf31ab..06d49b1 100644 --- a/misinformation/test/test_faces.py +++ b/ammico/test/test_faces.py @@ -1,4 +1,4 @@ -import misinformation.faces as fc +import ammico.faces as fc import json import pytest diff --git a/misinformation/test/test_multimodal_search.py b/ammico/test/test_multimodal_search.py similarity index 96% rename from misinformation/test/test_multimodal_search.py rename to ammico/test/test_multimodal_search.py index 1bfb954..4ba0733 100644 --- a/misinformation/test/test_multimodal_search.py +++ b/ammico/test/test_multimodal_search.py @@ -3,7 +3,7 @@ import math from PIL import Image import numpy from torch import device, cuda -import misinformation.multimodal_search as ms +import ammico.multimodal_search as ms related_error = 1e-2 gpu_is_not_available = not cuda.is_available() diff --git a/misinformation/test/test_objects.py b/ammico/test/test_objects.py similarity index 93% rename from misinformation/test/test_objects.py rename to ammico/test/test_objects.py index 32bd161..36b085a 100644 --- a/misinformation/test/test_objects.py +++ b/ammico/test/test_objects.py @@ -1,7 +1,7 @@ import json import pytest -import misinformation.objects as ob -import misinformation.objects_cvlib as ob_cvlib +import ammico.objects as ob +import ammico.objects_cvlib as ob_cvlib OBJECT_1 = "cell phone" OBJECT_2 = "motorcycle" diff --git a/misinformation/test/test_summary.py b/ammico/test/test_summary.py similarity index 95% rename from misinformation/test/test_summary.py rename to ammico/test/test_summary.py index c7ebf5c..1cb1fd7 100644 --- a/misinformation/test/test_summary.py +++ b/ammico/test/test_summary.py @@ -2,7 +2,7 @@ import os import pytest from torch import device, cuda from lavis.models import load_model_and_preprocess -import misinformation.summary as sm +import ammico.summary as sm IMAGES = ["d755771b-225e-432f-802e-fb8dc850fff7.png", "IMG_2746.png"] diff --git a/misinformation/test/test_text.py b/ammico/test/test_text.py similarity index 99% rename from misinformation/test/test_text.py rename to ammico/test/test_text.py index c0ec545..e2d1b1a 100644 --- a/misinformation/test/test_text.py +++ b/ammico/test/test_text.py @@ -1,7 +1,7 @@ import os import pytest import spacy -import misinformation.text as tt +import ammico.text as tt @pytest.fixture diff --git a/misinformation/test/test_utils.py b/ammico/test/test_utils.py similarity index 94% rename from misinformation/test/test_utils.py rename to ammico/test/test_utils.py index 9529a54..a74d88c 100644 --- a/misinformation/test/test_utils.py +++ b/ammico/test/test_utils.py @@ -1,6 +1,6 @@ import json import pandas as pd -import misinformation.utils as ut +import ammico.utils as ut def test_find_files(get_path): diff --git a/misinformation/text.py b/ammico/text.py similarity index 99% rename from misinformation/text.py rename to ammico/text.py index a3f927c..c70d528 100644 --- a/misinformation/text.py +++ b/ammico/text.py @@ -5,7 +5,7 @@ from spacytextblob.spacytextblob import SpacyTextBlob from textblob import TextBlob from textblob import download_corpora import io -from misinformation import utils +from ammico import utils import grpc import pandas as pd from bertopic import BERTopic diff --git a/misinformation/utils.py b/ammico/utils.py similarity index 94% rename from misinformation/utils.py rename to ammico/utils.py index 36c7690..4a4eae0 100644 --- a/misinformation/utils.py +++ b/ammico/utils.py @@ -9,7 +9,7 @@ class DownloadResource: We use this as a wrapper to the pooch library. The wrapper registers each data file and allows prefetching through the CLI entry point - misinformation_prefetch_models. + ammico_prefetch_models. """ # We store a list of defined resouces in a class variable, allowing @@ -24,7 +24,7 @@ class DownloadResource: return pooch.retrieve(**self.kwargs) -def misinformation_prefetch_models(): +def ammico_prefetch_models(): """Prefetch all the download resources""" for res in DownloadResource.resources: res.get() diff --git a/data/.keep b/data/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/docs/source/conf.py b/docs/source/conf.py index 7a6afb0..4672607 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -6,7 +6,7 @@ import os import sys -sys.path.insert(0, os.path.abspath("../../misinformation/")) +sys.path.insert(0, os.path.abspath("../../ammico/")) # -- Project information ----------------------------------------------------- diff --git a/docs/source/index.rst b/docs/source/index.rst index 4c3893d..b9cee17 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,4 +1,4 @@ -.. misinformation documentation master file, created by +.. ammico documentation master file, created by sphinx-quickstart on Mon Dec 19 13:39:22 2022. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. diff --git a/docs/source/notebooks/Example faces.ipynb b/docs/source/notebooks/Example faces.ipynb index 71e8798..ac49450 100644 --- a/docs/source/notebooks/Example faces.ipynb +++ b/docs/source/notebooks/Example faces.ipynb @@ -9,11 +9,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "51f8888b-d1a3-4b85-a596-95c0993fa192", "metadata": {}, "source": [ - "This notebooks shows some preliminary work on detecting facial expressions with DeepFace. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `misinformation` package that is imported here:" + "This notebooks shows some preliminary work on detecting facial expressions with DeepFace. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `ammico` package that is imported here:" ] }, { @@ -25,9 +26,9 @@ }, "outputs": [], "source": [ - "import misinformation\n", - "from misinformation import utils as mutils\n", - "from misinformation import display as mdisplay" + "import ammico\n", + "from ammico import utils as mutils\n", + "from ammico import display as mdisplay" ] }, { @@ -130,7 +131,7 @@ "outputs": [], "source": [ "for key in mydict.keys():\n", - " mydict[key] = misinformation.faces.EmotionDetector(mydict[key]).analyse_image()" + " mydict[key] = ammico.faces.EmotionDetector(mydict[key]).analyse_image()" ] }, { diff --git a/docs/source/notebooks/Example multimodal.ipynb b/docs/source/notebooks/Example multimodal.ipynb index e9030f2..d1fea3a 100644 --- a/docs/source/notebooks/Example multimodal.ipynb +++ b/docs/source/notebooks/Example multimodal.ipynb @@ -9,11 +9,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "9eeeb302-296e-48dc-86c7-254aa02f2b3a", "metadata": {}, "source": [ - "This notebooks shows some preliminary work on Image Multimodal Search with lavis library. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `misinformation` package that is imported here:" + "This notebooks shows some preliminary work on Image Multimodal Search with lavis library. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `ammico` package that is imported here:" ] }, { @@ -25,8 +26,8 @@ }, "outputs": [], "source": [ - "import misinformation\n", - "import misinformation.multimodal_search as ms" + "import ammico\n", + "import ammico.multimodal_search as ms" ] }, { @@ -46,7 +47,7 @@ }, "outputs": [], "source": [ - "images = misinformation.utils.find_files(\n", + "images = ammico.utils.find_files(\n", " path=\"data/\",\n", " limit=10,\n", ")" @@ -61,7 +62,7 @@ }, "outputs": [], "source": [ - "mydict = misinformation.utils.initialize_dict(images)" + "mydict = ammico.utils.initialize_dict(images)" ] }, { @@ -276,8 +277,8 @@ }, "outputs": [], "source": [ - "outdict = misinformation.utils.append_data_to_dict(mydict)\n", - "df = misinformation.utils.dump_df(outdict)" + "outdict = ammico.utils.append_data_to_dict(mydict)\n", + "df = ammico.utils.dump_df(outdict)" ] }, { diff --git a/docs/source/notebooks/Example objects.ipynb b/docs/source/notebooks/Example objects.ipynb index ab6b621..cbed55e 100644 --- a/docs/source/notebooks/Example objects.ipynb +++ b/docs/source/notebooks/Example objects.ipynb @@ -8,10 +8,11 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "This notebooks shows some preliminary work on detecting objects expressions with cvlib. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `misinformation` package that is imported here:" + "This notebooks shows some preliminary work on detecting objects expressions with cvlib. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `ammico` package that is imported here:" ] }, { @@ -22,10 +23,10 @@ }, "outputs": [], "source": [ - "import misinformation\n", - "from misinformation import utils as mutils\n", - "from misinformation import display as mdisplay\n", - "import misinformation.objects as ob" + "import ammico\n", + "from ammico import utils as mutils\n", + "from ammico import display as mdisplay\n", + "import ammico.objects as ob" ] }, { diff --git a/docs/source/notebooks/Example summary.ipynb b/docs/source/notebooks/Example summary.ipynb index 58a8688..ed03418 100644 --- a/docs/source/notebooks/Example summary.ipynb +++ b/docs/source/notebooks/Example summary.ipynb @@ -8,10 +8,11 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "This notebooks shows some preliminary work on Image Captioning and Visual question answering with lavis. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `misinformation` package that is imported here:" + "This notebooks shows some preliminary work on Image Captioning and Visual question answering with lavis. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `ammico` package that is imported here:" ] }, { @@ -22,9 +23,9 @@ }, "outputs": [], "source": [ - "from misinformation import utils as mutils\n", - "from misinformation import display as mdisplay\n", - "import misinformation.summary as sm" + "from ammico import utils as mutils\n", + "from ammico import display as mdisplay\n", + "import ammico.summary as sm" ] }, { diff --git a/docs/source/notebooks/Example text.ipynb b/docs/source/notebooks/Example text.ipynb index 27717bc..068a06b 100644 --- a/docs/source/notebooks/Example text.ipynb +++ b/docs/source/notebooks/Example text.ipynb @@ -26,8 +26,8 @@ " # update python version\n", " # install setuptools\n", " !pip install setuptools==61 -qqq\n", - " # install misinformation\n", - " !pip install git+https://github.com/ssciwr/misinformation.git -qqq\n", + " # install ammico\n", + " !pip install git+https://github.com/ssciwr/ammico.git -qqq\n", " # mount google drive for data and API key\n", " from google.colab import drive\n", "\n", @@ -43,9 +43,9 @@ }, "outputs": [], "source": [ - "import misinformation\n", - "from misinformation import utils as mutils\n", - "from misinformation import display as mdisplay" + "import ammico\n", + "from ammico import utils as mutils\n", + "from ammico import display as mdisplay" ] }, { @@ -133,7 +133,7 @@ "outputs": [], "source": [ "for key in mydict:\n", - " mydict[key] = misinformation.text.TextDetector(\n", + " mydict[key] = ammico.text.TextDetector(\n", " mydict[key], analyse_text=True\n", " ).analyse_image()" ] diff --git a/notebooks/cropposts.ipynb b/notebooks/cropposts.ipynb index a6955e0..2bd399e 100644 --- a/notebooks/cropposts.ipynb +++ b/notebooks/cropposts.ipynb @@ -24,7 +24,7 @@ "metadata": {}, "outputs": [], "source": [ - "import misinformation.cropposts as crpo\n", + "import ammico.cropposts as crpo\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from PIL import Image\n", diff --git a/notebooks/facial_expressions.ipynb b/notebooks/facial_expressions.ipynb index a35b1a4..b73d17b 100644 --- a/notebooks/facial_expressions.ipynb +++ b/notebooks/facial_expressions.ipynb @@ -9,11 +9,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "51f8888b-d1a3-4b85-a596-95c0993fa192", "metadata": {}, "source": [ - "This notebooks shows some preliminary work on detecting facial expressions with DeepFace. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `misinformation` package that is imported here:" + "This notebooks shows some preliminary work on detecting facial expressions with DeepFace. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `ammico` package that is imported here:" ] }, { @@ -31,8 +32,8 @@ " # update python version\n", " # install setuptools\n", " !pip install setuptools==61 -qqq\n", - " # install misinformation\n", - " !pip install git+https://github.com/ssciwr/misinformation.git -qqq\n", + " # install ammico\n", + " !pip install git+https://github.com/ssciwr/ammico.git -qqq\n", " # mount google drive for data and API key\n", " from google.colab import drive\n", "\n", @@ -46,9 +47,9 @@ "metadata": {}, "outputs": [], "source": [ - "import misinformation\n", - "from misinformation import utils as mutils\n", - "from misinformation import display as mdisplay" + "import ammico\n", + "from ammico import utils as mutils\n", + "from ammico import display as mdisplay" ] }, { @@ -145,7 +146,7 @@ "outputs": [], "source": [ "for key in mydict.keys():\n", - " mydict[key] = misinformation.faces.EmotionDetector(mydict[key]).analyse_image()" + " mydict[key] = ammico.faces.EmotionDetector(mydict[key]).analyse_image()" ] }, { diff --git a/notebooks/get-text-from-image.ipynb b/notebooks/get-text-from-image.ipynb index 9acb869..057f7c4 100644 --- a/notebooks/get-text-from-image.ipynb +++ b/notebooks/get-text-from-image.ipynb @@ -24,8 +24,8 @@ " # update python version\n", " # install setuptools\n", " !pip install setuptools==61 -qqq\n", - " # install misinformation\n", - " !pip install git+https://github.com/ssciwr/misinformation.git -qqq\n", + " # install ammico\n", + " !pip install git+https://github.com/ssciwr/ammico.git -qqq\n", " # mount google drive for data and API key\n", " from google.colab import drive\n", "\n", @@ -40,9 +40,9 @@ "outputs": [], "source": [ "import os\n", - "import misinformation\n", - "from misinformation import utils as mutils\n", - "from misinformation import display as mdisplay" + "import ammico\n", + "from ammico import utils as mutils\n", + "from ammico import display as mdisplay" ] }, { @@ -126,7 +126,7 @@ "source": [ "for key in mydict:\n", " print(key)\n", - " mydict[key] = misinformation.text.TextDetector(\n", + " mydict[key] = ammico.text.TextDetector(\n", " mydict[key], analyse_text=True\n", " ).analyse_image()" ] @@ -198,7 +198,7 @@ "outputs": [], "source": [ "# make a list of all the text_english entries per analysed image from the mydict variable as above\n", - "topic_model, topic_df, most_frequent_topics = misinformation.text.PostprocessText(\n", + "topic_model, topic_df, most_frequent_topics = ammico.text.PostprocessText(\n", " mydict=mydict\n", ").analyse_topic()" ] @@ -220,7 +220,7 @@ "outputs": [], "source": [ "input_file_path = \"data_out.csv\"\n", - "topic_model, topic_df, most_frequent_topics = misinformation.text.PostprocessText(\n", + "topic_model, topic_df, most_frequent_topics = ammico.text.PostprocessText(\n", " use_csv=True, csv_path=input_file_path\n", ").analyse_topic(return_topics=10)" ] diff --git a/notebooks/image_summary.ipynb b/notebooks/image_summary.ipynb index 4f2b884..9e118ff 100644 --- a/notebooks/image_summary.ipynb +++ b/notebooks/image_summary.ipynb @@ -8,10 +8,11 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "This notebooks shows some preliminary work on Image Captioning and Visual question answering with lavis. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `misinformation` package that is imported here:" + "This notebooks shows some preliminary work on Image Captioning and Visual question answering with lavis. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `ammico` package that is imported here:" ] }, { @@ -28,8 +29,8 @@ " # update python version\n", " # install setuptools\n", " !pip install setuptools==61 -qqq\n", - " # install misinformation\n", - " !pip install git+https://github.com/ssciwr/misinformation.git -qqq\n", + " # install ammico\n", + " !pip install git+https://github.com/ssciwr/ammico.git -qqq\n", " # mount google drive for data and API key\n", " from google.colab import drive\n", "\n", @@ -44,10 +45,10 @@ }, "outputs": [], "source": [ - "import misinformation\n", - "from misinformation import utils as mutils\n", - "from misinformation import display as mdisplay\n", - "import misinformation.summary as sm" + "import ammico\n", + "from ammico import utils as mutils\n", + "from ammico import display as mdisplay\n", + "import ammico.summary as sm" ] }, { diff --git a/notebooks/multimodal_search.ipynb b/notebooks/multimodal_search.ipynb index 6ff9b4f..3166984 100644 --- a/notebooks/multimodal_search.ipynb +++ b/notebooks/multimodal_search.ipynb @@ -9,11 +9,12 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "9eeeb302-296e-48dc-86c7-254aa02f2b3a", "metadata": {}, "source": [ - "This notebooks shows some preliminary work on Image Multimodal Search with lavis library. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `misinformation` package that is imported here:" + "This notebooks shows some preliminary work on Image Multimodal Search with lavis library. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `ammico` package that is imported here:" ] }, { @@ -31,8 +32,8 @@ " # update python version\n", " # install setuptools\n", " !pip install setuptools==61 -qqq\n", - " # install misinformation\n", - " !pip install git+https://github.com/ssciwr/misinformation.git -qqq\n", + " # install ammico\n", + " !pip install git+https://github.com/ssciwr/ammico.git -qqq\n", " # mount google drive for data and API key\n", " from google.colab import drive\n", "\n", @@ -48,8 +49,8 @@ }, "outputs": [], "source": [ - "import misinformation.utils as mutils\n", - "import misinformation.multimodal_search as ms" + "import ammico.utils as mutils\n", + "import ammico.multimodal_search as ms" ] }, { @@ -373,8 +374,8 @@ }, "outputs": [], "source": [ - "outdict = misinformation.utils.append_data_to_dict(mydict)\n", - "df = misinformation.utils.dump_df(outdict)" + "outdict = ammico.utils.append_data_to_dict(mydict)\n", + "df = ammico.utils.dump_df(outdict)" ] }, { diff --git a/notebooks/objects_expression.ipynb b/notebooks/objects_expression.ipynb index 7fc0070..5bf5c4b 100644 --- a/notebooks/objects_expression.ipynb +++ b/notebooks/objects_expression.ipynb @@ -8,10 +8,11 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "This notebooks shows some preliminary work on detecting objects expressions with cvlib. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `misinformation` package that is imported here:" + "This notebooks shows some preliminary work on detecting objects expressions with cvlib. It is mainly meant to explore its capabilities and to decide on future research directions. We package our code into a `ammico` package that is imported here:" ] }, { @@ -28,8 +29,8 @@ " # update python version\n", " # install setuptools\n", " !pip install setuptools==61 -qqq\n", - " # install misinformation\n", - " !pip install git+https://github.com/ssciwr/misinformation.git -qqq\n", + " # install ammico\n", + " !pip install git+https://github.com/ssciwr/ammico.git -qqq\n", " # mount google drive for data and API key\n", " from google.colab import drive\n", "\n", @@ -42,10 +43,10 @@ "metadata": {}, "outputs": [], "source": [ - "import misinformation\n", - "from misinformation import utils as mutils\n", - "from misinformation import display as mdisplay\n", - "import misinformation.objects as ob" + "import ammico\n", + "from ammico import utils as mutils\n", + "from ammico import display as mdisplay\n", + "import ammico.objects as ob" ] }, { diff --git a/pyproject.toml b/pyproject.toml index 87246a8..96056a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,9 +5,9 @@ requires = [ build-backend = "setuptools.build_meta" [project] -name = "misinformation" +name = "ammico" version = "0.0.1" -description = "Misinformation campaign analysis" +description = "AI Media and Misinformation Content Analysis Tool" readme = "README.md" maintainers = [ { name = "Inga Ulusoy", email = "ssc@iwr.uni-heidelberg.de" }, @@ -55,7 +55,7 @@ dependencies = [ ] [project.scripts] -misinformation_prefetch_models = "misinformation.utils:misinformation_prefetch_models" +ammico_prefetch_models = "ammico.utils:ammico_prefetch_models" [tool.setuptools] -packages = ["misinformation"] +packages = ["ammico"]