Files
visual_critical_discourse_a…/misc/total_annotated.py
T
2025-01-06 17:15:48 +00:00

24 lines
649 B
Python

from __future__ import annotations
import os
from pathlib import Path
from dotenv import load_dotenv
from shared.docstore import connect_mongodb, count_documents
if __name__ == '__main__':
# prepare env vars
env_path = Path(__file__).parent.parent / 'local.env'
assert env_path.exists()
load_dotenv(env_path)
os.environ['MONGO_HOST'] = 'localhost'
# connect to database
collection, db, client = connect_mongodb()
# get visual communication
num_docs = count_documents(
collection=collection,
only_with_annotation=True,
)
print(f"number of annotated documents in database: {num_docs}")