fixed imports
This commit is contained in:
@@ -6,10 +6,9 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import requests
|
import requests
|
||||||
|
from classes import Instagram
|
||||||
from retry import retry
|
from retry import retry
|
||||||
|
|
||||||
from image_download.classes import Instagram
|
|
||||||
|
|
||||||
|
|
||||||
def get_sources() -> pd.DataFrame:
|
def get_sources() -> pd.DataFrame:
|
||||||
"""Get sources dateframe."""
|
"""Get sources dateframe."""
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ if __name__ == '__main__':
|
|||||||
in range(3)
|
in range(3)
|
||||||
]
|
]
|
||||||
# generate random predictions
|
# generate random predictions
|
||||||
[vis_com.generate_random_prediction() for vis_com in vis_com_list]
|
[
|
||||||
|
vis_com.generate_random_prediction()
|
||||||
|
for vis_com in vis_com_list
|
||||||
|
] # type: ignore
|
||||||
for vis_com in vis_com_list:
|
for vis_com in vis_com_list:
|
||||||
print(vis_com)
|
print(vis_com)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from pathlib import Path
|
|||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
from core.database import connect
|
from core.database import connect
|
||||||
from core.database import upsert_predictions
|
from core.database import upsert_prediction
|
||||||
from core.database.classes import VisualCommunication
|
from core.database.classes import VisualCommunication
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
@@ -45,7 +45,7 @@ if __name__ == '__main__':
|
|||||||
for vis_com in vis_com_list:
|
for vis_com in vis_com_list:
|
||||||
if vis_com.prediction is None:
|
if vis_com.prediction is None:
|
||||||
continue
|
continue
|
||||||
upsert_predictions(
|
upsert_prediction(
|
||||||
collection=collection,
|
collection=collection,
|
||||||
vis_com_name=vis_com.name,
|
vis_com_name=vis_com.name,
|
||||||
predictions=vis_com.prediction,
|
predictions=vis_com.prediction,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from pathlib import Path
|
|||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
from core.database import connect
|
from core.database import connect
|
||||||
from core.database import total_documents
|
from core.database import count_documents
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# prepare env vars
|
# prepare env vars
|
||||||
@@ -17,7 +17,8 @@ if __name__ == '__main__':
|
|||||||
# connect to database
|
# connect to database
|
||||||
collection, db, client = connect()
|
collection, db, client = connect()
|
||||||
# get visual communication
|
# get visual communication
|
||||||
num_docs = total_documents(
|
num_docs = count_documents(
|
||||||
collection=collection,
|
collection=collection,
|
||||||
|
only_with_annotation=True,
|
||||||
)
|
)
|
||||||
print(f"number of annotated documents in database: {num_docs}")
|
print(f"number of annotated documents in database: {num_docs}")
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from pathlib import Path
|
|||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
from core.database import connect
|
from core.database import connect
|
||||||
from core.database import total_documents
|
from core.database import count_documents
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# prepare env vars
|
# prepare env vars
|
||||||
@@ -17,7 +17,8 @@ if __name__ == '__main__':
|
|||||||
# connect to database
|
# connect to database
|
||||||
collection, db, client = connect()
|
collection, db, client = connect()
|
||||||
# get visual communication
|
# get visual communication
|
||||||
num_docs = total_documents(
|
num_docs = count_documents(
|
||||||
collection=collection,
|
collection=collection,
|
||||||
|
only_with_annotation=False,
|
||||||
)
|
)
|
||||||
print(f"total number of documents in database: {num_docs}")
|
print(f"total number of documents in database: {num_docs}")
|
||||||
|
|||||||
Reference in New Issue
Block a user