diff --git a/backend/requirements.txt b/backend/requirements.txt index 53322872..1ea6c457 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,7 +1,7 @@ apache-beam~=2.41.0 boto3~=1.24.68 en_core_web_sm@https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.2.0/en_core_web_sm-3.2.0-py3-none-any.whl -explainaboard == 0.11.1 +explainaboard == 0.11.2 Flask-PyMongo~=2.3.0 google-cloud-storage~=2.5.0 iso-639~=0.4.5 diff --git a/backend/src/impl/db_utils/db_utils.py b/backend/src/impl/db_utils/db_utils.py index 9b98f5a4..37ff4fe9 100644 --- a/backend/src/impl/db_utils/db_utils.py +++ b/backend/src/impl/db_utils/db_utils.py @@ -19,10 +19,10 @@ class DBCollection: class DBUtils: # Names of DBs or collections - SYSTEM_OUTPUT_COLLECTION_DB = "system_output_collections_v011" + SYSTEM_OUTPUT_COLLECTION_DB = "system_output_collections_v012" SYSTEM_OUTPUT_COLLECTION_PREFIX = "system_outputs" DEV_SYSTEM_METADATA = DBCollection( - db_name="metadata", collection_name="system_metadata_v011" + db_name="metadata", collection_name="system_metadata_v012" ) @staticmethod diff --git a/backend/src/impl/db_utils/system_db_utils.py b/backend/src/impl/db_utils/system_db_utils.py index b6107925..0dd89622 100644 --- a/backend/src/impl/db_utils/system_db_utils.py +++ b/backend/src/impl/db_utils/system_db_utils.py @@ -5,15 +5,13 @@ import traceback import zlib from datetime import datetime -from inspect import getsource -from types import FunctionType from typing import Any from bson import ObjectId from explainaboard import DatalabLoaderOption, FileType, Source, get_processor from explainaboard.loaders.file_loader import FileLoaderReturn from explainaboard.loaders.loader_registry import get_loader_class -from explainaboard.utils.serialization import general_to_dict +from explainaboard.serialization.legacy import general_to_dict from explainaboard_web.impl.auth import get_user from explainaboard_web.impl.db_utils.dataset_db_utils import DatasetDBUtils from explainaboard_web.impl.db_utils.db_utils import DBUtils @@ -104,6 +102,7 @@ def system_from_dict( if "metric_stats" in document: metric_stats = document["metric_stats"] document["metric_stats"] = [] + system = System.from_dict(document) if include_metric_stats: # Unbinarize to numpy array and set explicitly @@ -486,12 +485,6 @@ def db_operations(session: ClientSession) -> str: # -- replace things that can't be returned through JSON for now system.metric_stats = [] - for analysis_level in system.system_info.analysis_levels: - for feature_name, feature in analysis_level.features.items(): - if isinstance(feature.func, FunctionType): - # Convert the function to a string, this is noqa to prevent a - # typing error - feature.func = getsource(feature.func) # noqa # -- return the system return system diff --git a/backend/src/impl/default_controllers_impl.py b/backend/src/impl/default_controllers_impl.py index 9a8c5c6f..9f9b96fb 100644 --- a/backend/src/impl/default_controllers_impl.py +++ b/backend/src/impl/default_controllers_impl.py @@ -14,8 +14,8 @@ from explainaboard.info import SysOutputInfo from explainaboard.loaders import get_loader_class from explainaboard.metrics.metric import SimpleMetricStats +from explainaboard.serialization.legacy import general_to_dict from explainaboard.utils.cache_api import get_cache_dir, open_cached_file, sanitize_path -from explainaboard.utils.serialization import general_to_dict from explainaboard.utils.typing_utils import narrow from explainaboard_web.impl.analyses.significance_analysis import ( pairwise_significance_test, diff --git a/frontend/src/components/Analysis/types.tsx b/frontend/src/components/Analysis/types.tsx index 7c2359c7..1a69d176 100644 --- a/frontend/src/components/Analysis/types.tsx +++ b/frontend/src/components/Analysis/types.tsx @@ -30,24 +30,6 @@ export interface ResultFineGrainedParsed { cases: number[][]; } -export interface SystemInfoFeatureBucketInfo { - method: string; - number: number; - setting: number | number[]; -} - -export interface SystemInfoFeature { - /** - * A single feature in the system info class. - */ - bucket_info: SystemInfoFeatureBucketInfo | null; - description: string | null; - dtype?: string; - is_bucket: boolean; - require_training_set: boolean; - _type: string; -} - export interface BucketIntervals { /** * Intervals over which to perform bucketing diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 099a19c1..43211803 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -2,7 +2,7 @@ openapi: "3.0.0" info: title: "ExplainaBoard" description: "Backend APIs for ExplainaBoard" - version: "0.2.5" + version: "0.2.6" contact: email: "explainaboard@gmail.com" license: @@ -628,15 +628,20 @@ components: properties: dtype: type: string + nullable: true cls_name: type: string description: type: string + nullable: true func: type: string + nullable: true require_training_set: type: boolean - required: [dtype, cls_name] + nullable: true + additionalProperties: true + required: [cls_name] SystemInfo: description: | @@ -666,7 +671,7 @@ components: example: en reload_stat: type: boolean - conf_value: + confidence_alpha: type: number system_details: type: object @@ -703,7 +708,7 @@ components: source_language, target_language, reload_stat, - conf_value, + confidence_alpha, source_tokenizer, target_tokenizer, analysis_levels,