rename misinformation to ammico

Этот коммит содержится в:
Petr Andriushchenko 2023-04-24 17:03:58 +02:00
родитель fae982bc8b
Коммит 622ba40964
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4C4A5DCF634115B6
70 изменённых файлов: 111 добавлений и 103 удалений

Просмотреть файл

@ -26,4 +26,4 @@ ENV GOOGLE_APPLICATION_CREDENTIALS=credentials.json
RUN echo ${GOOGLE_CREDS} > $GOOGLE_APPLICATION_CREDENTIALS RUN echo ${GOOGLE_CREDS} > $GOOGLE_APPLICATION_CREDENTIALS
# Bundle the pre-built models (that are downloaded on demand) into the # Bundle the pre-built models (that are downloaded on demand) into the
# Docker image. # Docker image.
RUN misinformation_prefetch_models RUN ammico_prefetch_models

Просмотреть файл

@ -1,10 +1,10 @@
# AMMICO - AI Media and Misinformation Content Analysis Tool # AMMICO - AI Media and Misinformation Content Analysis Tool
![License: MIT](https://img.shields.io/github/license/ssciwr/misinformation) ![License: MIT](https://img.shields.io/github/license/ssciwr/AMMICO)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ssciwr/misinformation/ci.yml?branch=main) ![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/misinformation) ![codecov](https://img.shields.io/codecov/c/github/ssciwr/AMMICO)
![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ssciwr_misinformation&metric=alert_status) ![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/misinformation) ![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. 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 ## 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 . pip install .
``` ```
@ -43,7 +43,7 @@ This will install the package and its dependencies locally.
## Usage ## 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.\ 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)** **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. Place the data files and google cloud vision API key in your google drive to access the data.

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -1,11 +1,11 @@
import ipywidgets import ipywidgets
from IPython.display import display from IPython.display import display
import misinformation.faces as faces import ammico.faces as faces
import misinformation.text as text import ammico.text as text
import misinformation.objects as objects import ammico.objects as objects
import misinformation.summary as summary import ammico.summary as summary
class JSONContainer: class JSONContainer:

Просмотреть файл

@ -11,8 +11,8 @@ from tensorflow.keras.preprocessing.image import img_to_array
from deepface import DeepFace from deepface import DeepFace
from retinaface import RetinaFace from retinaface import RetinaFace
from misinformation.utils import DownloadResource from ammico.utils import DownloadResource
import misinformation.utils as utils import ammico.utils as utils
DEEPFACE_PATH = ".deepface" DEEPFACE_PATH = ".deepface"

Просмотреть файл

@ -1,4 +1,4 @@
from misinformation.utils import AnalysisMethod from ammico.utils import AnalysisMethod
import torch import torch
import torch.nn.functional as Func import torch.nn.functional as Func
import requests import requests

Просмотреть файл

@ -1,6 +1,6 @@
from misinformation.utils import AnalysisMethod from ammico.utils import AnalysisMethod
from misinformation.objects_cvlib import ObjectCVLib from ammico.objects_cvlib import ObjectCVLib
from misinformation.objects_cvlib import init_default_objects from ammico.objects_cvlib import init_default_objects
class ObjectDetectorClient(AnalysisMethod): class ObjectDetectorClient(AnalysisMethod):

Просмотреть файл

Просмотреть файл

@ -1,4 +1,4 @@
from misinformation.utils import AnalysisMethod from ammico.utils import AnalysisMethod
from torch import device, cuda, no_grad from torch import device, cuda, no_grad
from PIL import Image from PIL import Image
from lavis.models import load_model_and_preprocess from lavis.models import load_model_and_preprocess

Просмотреть файл

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 10 MiB

После

Ширина:  |  Высота:  |  Размер: 10 MiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 1005 KiB

После

Ширина:  |  Высота:  |  Размер: 1005 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 801 KiB

После

Ширина:  |  Высота:  |  Размер: 801 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 758 KiB

После

Ширина:  |  Высота:  |  Размер: 758 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 788 KiB

После

Ширина:  |  Высота:  |  Размер: 788 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 1.4 MiB

После

Ширина:  |  Высота:  |  Размер: 1.4 MiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 1.3 MiB

После

Ширина:  |  Высота:  |  Размер: 1.3 MiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 1.2 MiB

После

Ширина:  |  Высота:  |  Размер: 1.2 MiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 58 KiB

После

Ширина:  |  Высота:  |  Размер: 58 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 37 KiB

После

Ширина:  |  Высота:  |  Размер: 37 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 42 KiB

После

Ширина:  |  Высота:  |  Размер: 42 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 307 KiB

После

Ширина:  |  Высота:  |  Размер: 307 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 1.3 MiB

После

Ширина:  |  Высота:  |  Размер: 1.3 MiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 671 KiB

После

Ширина:  |  Высота:  |  Размер: 671 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 272 KiB

После

Ширина:  |  Высота:  |  Размер: 272 KiB

Просмотреть файл

Просмотреть файл

@ -1,4 +1,4 @@
import misinformation.cropposts as crpo import ammico.cropposts as crpo
import numpy as np import numpy as np
from PIL import Image from PIL import Image

Просмотреть файл

@ -1,10 +1,10 @@
import json import json
import misinformation.display as misinf_display import ammico.display as ammico_display
def test_explore_analysis_faces(get_path): def test_explore_analysis_faces(get_path):
mydict = {"IMG_2746": {"filename": get_path + "IMG_2746.png"}} 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 temp = None # noqa
with open(get_path + "example_faces.json", "r") as file: with open(get_path + "example_faces.json", "r") as file:
outs = json.load(file) outs = json.load(file)
@ -17,7 +17,7 @@ def test_explore_analysis_faces(get_path):
def test_explore_analysis_objects(get_path): def test_explore_analysis_objects(get_path):
mydict = {"IMG_2809": {"filename": get_path + "IMG_2809.png"}} 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 temp = None # noqa
with open(get_path + "example_analysis_objects.json", "r") as file: with open(get_path + "example_analysis_objects.json", "r") as file:
outs = json.load(file) outs = json.load(file)

Просмотреть файл

@ -1,4 +1,4 @@
import misinformation.faces as fc import ammico.faces as fc
import json import json
import pytest import pytest

Просмотреть файл

@ -3,7 +3,7 @@ import math
from PIL import Image from PIL import Image
import numpy import numpy
from torch import device, cuda from torch import device, cuda
import misinformation.multimodal_search as ms import ammico.multimodal_search as ms
related_error = 1e-2 related_error = 1e-2
gpu_is_not_available = not cuda.is_available() gpu_is_not_available = not cuda.is_available()

Просмотреть файл

@ -1,7 +1,7 @@
import json import json
import pytest import pytest
import misinformation.objects as ob import ammico.objects as ob
import misinformation.objects_cvlib as ob_cvlib import ammico.objects_cvlib as ob_cvlib
OBJECT_1 = "cell phone" OBJECT_1 = "cell phone"
OBJECT_2 = "motorcycle" OBJECT_2 = "motorcycle"

Просмотреть файл

@ -2,7 +2,7 @@ import os
import pytest import pytest
from torch import device, cuda from torch import device, cuda
from lavis.models import load_model_and_preprocess 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"] IMAGES = ["d755771b-225e-432f-802e-fb8dc850fff7.png", "IMG_2746.png"]

Просмотреть файл

@ -1,7 +1,7 @@
import os import os
import pytest import pytest
import spacy import spacy
import misinformation.text as tt import ammico.text as tt
@pytest.fixture @pytest.fixture

Просмотреть файл

@ -1,6 +1,6 @@
import json import json
import pandas as pd import pandas as pd
import misinformation.utils as ut import ammico.utils as ut
def test_find_files(get_path): def test_find_files(get_path):

Просмотреть файл

@ -5,7 +5,7 @@ from spacytextblob.spacytextblob import SpacyTextBlob
from textblob import TextBlob from textblob import TextBlob
from textblob import download_corpora from textblob import download_corpora
import io import io
from misinformation import utils from ammico import utils
import grpc import grpc
import pandas as pd import pandas as pd
from bertopic import BERTopic from bertopic import BERTopic

Просмотреть файл

@ -9,7 +9,7 @@ class DownloadResource:
We use this as a wrapper to the pooch library. The wrapper registers We use this as a wrapper to the pooch library. The wrapper registers
each data file and allows prefetching through the CLI entry point 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 # We store a list of defined resouces in a class variable, allowing
@ -24,7 +24,7 @@ class DownloadResource:
return pooch.retrieve(**self.kwargs) return pooch.retrieve(**self.kwargs)
def misinformation_prefetch_models(): def ammico_prefetch_models():
"""Prefetch all the download resources""" """Prefetch all the download resources"""
for res in DownloadResource.resources: for res in DownloadResource.resources:
res.get() res.get()

Просмотреть файл

Просмотреть файл

@ -6,7 +6,7 @@
import os import os
import sys import sys
sys.path.insert(0, os.path.abspath("../../misinformation/")) sys.path.insert(0, os.path.abspath("../../ammico/"))
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------

Просмотреть файл

@ -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. sphinx-quickstart on Mon Dec 19 13:39:22 2022.
You can adapt this file completely to your liking, but it should at least You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive. contain the root `toctree` directive.

Просмотреть файл

@ -9,11 +9,12 @@
] ]
}, },
{ {
"attachments": {},
"cell_type": "markdown", "cell_type": "markdown",
"id": "51f8888b-d1a3-4b85-a596-95c0993fa192", "id": "51f8888b-d1a3-4b85-a596-95c0993fa192",
"metadata": {}, "metadata": {},
"source": [ "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": [], "outputs": [],
"source": [ "source": [
"import misinformation\n", "import ammico\n",
"from misinformation import utils as mutils\n", "from ammico import utils as mutils\n",
"from misinformation import display as mdisplay" "from ammico import display as mdisplay"
] ]
}, },
{ {
@ -130,7 +131,7 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"for key in mydict.keys():\n", "for key in mydict.keys():\n",
" mydict[key] = misinformation.faces.EmotionDetector(mydict[key]).analyse_image()" " mydict[key] = ammico.faces.EmotionDetector(mydict[key]).analyse_image()"
] ]
}, },
{ {

Просмотреть файл

@ -9,11 +9,12 @@
] ]
}, },
{ {
"attachments": {},
"cell_type": "markdown", "cell_type": "markdown",
"id": "9eeeb302-296e-48dc-86c7-254aa02f2b3a", "id": "9eeeb302-296e-48dc-86c7-254aa02f2b3a",
"metadata": {}, "metadata": {},
"source": [ "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": [], "outputs": [],
"source": [ "source": [
"import misinformation\n", "import ammico\n",
"import misinformation.multimodal_search as ms" "import ammico.multimodal_search as ms"
] ]
}, },
{ {
@ -46,7 +47,7 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"images = misinformation.utils.find_files(\n", "images = ammico.utils.find_files(\n",
" path=\"data/\",\n", " path=\"data/\",\n",
" limit=10,\n", " limit=10,\n",
")" ")"
@ -61,7 +62,7 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"mydict = misinformation.utils.initialize_dict(images)" "mydict = ammico.utils.initialize_dict(images)"
] ]
}, },
{ {
@ -276,8 +277,8 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"outdict = misinformation.utils.append_data_to_dict(mydict)\n", "outdict = ammico.utils.append_data_to_dict(mydict)\n",
"df = misinformation.utils.dump_df(outdict)" "df = ammico.utils.dump_df(outdict)"
] ]
}, },
{ {

Просмотреть файл

@ -8,10 +8,11 @@
] ]
}, },
{ {
"attachments": {},
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "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": [], "outputs": [],
"source": [ "source": [
"import misinformation\n", "import ammico\n",
"from misinformation import utils as mutils\n", "from ammico import utils as mutils\n",
"from misinformation import display as mdisplay\n", "from ammico import display as mdisplay\n",
"import misinformation.objects as ob" "import ammico.objects as ob"
] ]
}, },
{ {

Просмотреть файл

@ -8,10 +8,11 @@
] ]
}, },
{ {
"attachments": {},
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "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": [], "outputs": [],
"source": [ "source": [
"from misinformation import utils as mutils\n", "from ammico import utils as mutils\n",
"from misinformation import display as mdisplay\n", "from ammico import display as mdisplay\n",
"import misinformation.summary as sm" "import ammico.summary as sm"
] ]
}, },
{ {

Просмотреть файл

@ -26,8 +26,8 @@
" # update python version\n", " # update python version\n",
" # install setuptools\n", " # install setuptools\n",
" !pip install setuptools==61 -qqq\n", " !pip install setuptools==61 -qqq\n",
" # install misinformation\n", " # install ammico\n",
" !pip install git+https://github.com/ssciwr/misinformation.git -qqq\n", " !pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" # mount google drive for data and API key\n", " # mount google drive for data and API key\n",
" from google.colab import drive\n", " from google.colab import drive\n",
"\n", "\n",
@ -43,9 +43,9 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"import misinformation\n", "import ammico\n",
"from misinformation import utils as mutils\n", "from ammico import utils as mutils\n",
"from misinformation import display as mdisplay" "from ammico import display as mdisplay"
] ]
}, },
{ {
@ -133,7 +133,7 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"for key in mydict:\n", "for key in mydict:\n",
" mydict[key] = misinformation.text.TextDetector(\n", " mydict[key] = ammico.text.TextDetector(\n",
" mydict[key], analyse_text=True\n", " mydict[key], analyse_text=True\n",
" ).analyse_image()" " ).analyse_image()"
] ]

2
notebooks/cropposts.ipynb сгенерированный
Просмотреть файл

@ -24,7 +24,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"import misinformation.cropposts as crpo\n", "import ammico.cropposts as crpo\n",
"import numpy as np\n", "import numpy as np\n",
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt\n",
"from PIL import Image\n", "from PIL import Image\n",

15
notebooks/facial_expressions.ipynb сгенерированный
Просмотреть файл

@ -9,11 +9,12 @@
] ]
}, },
{ {
"attachments": {},
"cell_type": "markdown", "cell_type": "markdown",
"id": "51f8888b-d1a3-4b85-a596-95c0993fa192", "id": "51f8888b-d1a3-4b85-a596-95c0993fa192",
"metadata": {}, "metadata": {},
"source": [ "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", " # update python version\n",
" # install setuptools\n", " # install setuptools\n",
" !pip install setuptools==61 -qqq\n", " !pip install setuptools==61 -qqq\n",
" # install misinformation\n", " # install ammico\n",
" !pip install git+https://github.com/ssciwr/misinformation.git -qqq\n", " !pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" # mount google drive for data and API key\n", " # mount google drive for data and API key\n",
" from google.colab import drive\n", " from google.colab import drive\n",
"\n", "\n",
@ -46,9 +47,9 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"import misinformation\n", "import ammico\n",
"from misinformation import utils as mutils\n", "from ammico import utils as mutils\n",
"from misinformation import display as mdisplay" "from ammico import display as mdisplay"
] ]
}, },
{ {
@ -145,7 +146,7 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"for key in mydict.keys():\n", "for key in mydict.keys():\n",
" mydict[key] = misinformation.faces.EmotionDetector(mydict[key]).analyse_image()" " mydict[key] = ammico.faces.EmotionDetector(mydict[key]).analyse_image()"
] ]
}, },
{ {

16
notebooks/get-text-from-image.ipynb сгенерированный
Просмотреть файл

@ -24,8 +24,8 @@
" # update python version\n", " # update python version\n",
" # install setuptools\n", " # install setuptools\n",
" !pip install setuptools==61 -qqq\n", " !pip install setuptools==61 -qqq\n",
" # install misinformation\n", " # install ammico\n",
" !pip install git+https://github.com/ssciwr/misinformation.git -qqq\n", " !pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" # mount google drive for data and API key\n", " # mount google drive for data and API key\n",
" from google.colab import drive\n", " from google.colab import drive\n",
"\n", "\n",
@ -40,9 +40,9 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"import os\n", "import os\n",
"import misinformation\n", "import ammico\n",
"from misinformation import utils as mutils\n", "from ammico import utils as mutils\n",
"from misinformation import display as mdisplay" "from ammico import display as mdisplay"
] ]
}, },
{ {
@ -126,7 +126,7 @@
"source": [ "source": [
"for key in mydict:\n", "for key in mydict:\n",
" print(key)\n", " print(key)\n",
" mydict[key] = misinformation.text.TextDetector(\n", " mydict[key] = ammico.text.TextDetector(\n",
" mydict[key], analyse_text=True\n", " mydict[key], analyse_text=True\n",
" ).analyse_image()" " ).analyse_image()"
] ]
@ -198,7 +198,7 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"# make a list of all the text_english entries per analysed image from the mydict variable as above\n", "# 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", " mydict=mydict\n",
").analyse_topic()" ").analyse_topic()"
] ]
@ -220,7 +220,7 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"input_file_path = \"data_out.csv\"\n", "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", " use_csv=True, csv_path=input_file_path\n",
").analyse_topic(return_topics=10)" ").analyse_topic(return_topics=10)"
] ]

15
notebooks/image_summary.ipynb сгенерированный
Просмотреть файл

@ -8,10 +8,11 @@
] ]
}, },
{ {
"attachments": {},
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "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", " # update python version\n",
" # install setuptools\n", " # install setuptools\n",
" !pip install setuptools==61 -qqq\n", " !pip install setuptools==61 -qqq\n",
" # install misinformation\n", " # install ammico\n",
" !pip install git+https://github.com/ssciwr/misinformation.git -qqq\n", " !pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" # mount google drive for data and API key\n", " # mount google drive for data and API key\n",
" from google.colab import drive\n", " from google.colab import drive\n",
"\n", "\n",
@ -44,10 +45,10 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"import misinformation\n", "import ammico\n",
"from misinformation import utils as mutils\n", "from ammico import utils as mutils\n",
"from misinformation import display as mdisplay\n", "from ammico import display as mdisplay\n",
"import misinformation.summary as sm" "import ammico.summary as sm"
] ]
}, },
{ {

15
notebooks/multimodal_search.ipynb сгенерированный
Просмотреть файл

@ -9,11 +9,12 @@
] ]
}, },
{ {
"attachments": {},
"cell_type": "markdown", "cell_type": "markdown",
"id": "9eeeb302-296e-48dc-86c7-254aa02f2b3a", "id": "9eeeb302-296e-48dc-86c7-254aa02f2b3a",
"metadata": {}, "metadata": {},
"source": [ "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", " # update python version\n",
" # install setuptools\n", " # install setuptools\n",
" !pip install setuptools==61 -qqq\n", " !pip install setuptools==61 -qqq\n",
" # install misinformation\n", " # install ammico\n",
" !pip install git+https://github.com/ssciwr/misinformation.git -qqq\n", " !pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" # mount google drive for data and API key\n", " # mount google drive for data and API key\n",
" from google.colab import drive\n", " from google.colab import drive\n",
"\n", "\n",
@ -48,8 +49,8 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"import misinformation.utils as mutils\n", "import ammico.utils as mutils\n",
"import misinformation.multimodal_search as ms" "import ammico.multimodal_search as ms"
] ]
}, },
{ {
@ -373,8 +374,8 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"outdict = misinformation.utils.append_data_to_dict(mydict)\n", "outdict = ammico.utils.append_data_to_dict(mydict)\n",
"df = misinformation.utils.dump_df(outdict)" "df = ammico.utils.dump_df(outdict)"
] ]
}, },
{ {

15
notebooks/objects_expression.ipynb сгенерированный
Просмотреть файл

@ -8,10 +8,11 @@
] ]
}, },
{ {
"attachments": {},
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "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", " # update python version\n",
" # install setuptools\n", " # install setuptools\n",
" !pip install setuptools==61 -qqq\n", " !pip install setuptools==61 -qqq\n",
" # install misinformation\n", " # install ammico\n",
" !pip install git+https://github.com/ssciwr/misinformation.git -qqq\n", " !pip install git+https://github.com/ssciwr/ammico.git -qqq\n",
" # mount google drive for data and API key\n", " # mount google drive for data and API key\n",
" from google.colab import drive\n", " from google.colab import drive\n",
"\n", "\n",
@ -42,10 +43,10 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"import misinformation\n", "import ammico\n",
"from misinformation import utils as mutils\n", "from ammico import utils as mutils\n",
"from misinformation import display as mdisplay\n", "from ammico import display as mdisplay\n",
"import misinformation.objects as ob" "import ammico.objects as ob"
] ]
}, },
{ {

Просмотреть файл

@ -5,9 +5,9 @@ requires = [
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
[project] [project]
name = "misinformation" name = "ammico"
version = "0.0.1" version = "0.0.1"
description = "Misinformation campaign analysis" description = "AI Media and Misinformation Content Analysis Tool"
readme = "README.md" readme = "README.md"
maintainers = [ maintainers = [
{ name = "Inga Ulusoy", email = "ssc@iwr.uni-heidelberg.de" }, { name = "Inga Ulusoy", email = "ssc@iwr.uni-heidelberg.de" },
@ -55,7 +55,7 @@ dependencies = [
] ]
[project.scripts] [project.scripts]
misinformation_prefetch_models = "misinformation.utils:misinformation_prefetch_models" ammico_prefetch_models = "ammico.utils:ammico_prefetch_models"
[tool.setuptools] [tool.setuptools]
packages = ["misinformation"] packages = ["ammico"]