| @@ -40,7 +40,7 @@ semantic_specs = [ | |||
| { | |||
| "Data": {"Values": ["Tabular"], "Type": "Class"}, | |||
| "Task": {"Values": ["Classification"], "Type": "Class"}, | |||
| "Device": {"Values": ["GPU"], "Type": "Tag"}, | |||
| "Library": {"Values": ["Pytorch"], "Type": "Tag"}, | |||
| "Scenario": {"Values": ["Business"], "Type": "Tag"}, | |||
| "Description": {"Values": "", "Type": "String"}, | |||
| "Name": {"Values": "learnware_1", "Type": "String"}, | |||
| @@ -50,7 +50,7 @@ semantic_specs = [ | |||
| user_senmantic = { | |||
| "Data": {"Values": ["Tabular"], "Type": "Class"}, | |||
| "Task": {"Values": ["Classification"], "Type": "Class"}, | |||
| "Device": {"Values": ["GPU"], "Type": "Tag"}, | |||
| "Library": {"Values": ["Pytorch"], "Type": "Tag"}, | |||
| "Scenario": {"Values": ["Business"], "Type": "Tag"}, | |||
| "Description": {"Values": "", "Type": "String"}, | |||
| "Name": {"Values": "", "Type": "String"}, | |||
| @@ -17,7 +17,7 @@ semantic_specs = [ | |||
| { | |||
| "Data": {"Values": ["Tabular"], "Type": "Class"}, | |||
| "Task": {"Values": ["Classification"], "Type": "Class"}, | |||
| "Device": {"Values": ["GPU"], "Type": "Tag"}, | |||
| "Library": {"Values": ["Scikit-learn"], "Type": "Tag"}, | |||
| "Scenario": {"Values": ["Business"], "Type": "Tag"}, | |||
| "Description": {"Values": "", "Type": "String"}, | |||
| "Name": {"Values": "learnware_1", "Type": "String"}, | |||
| @@ -27,7 +27,7 @@ semantic_specs = [ | |||
| user_semantic = { | |||
| "Data": {"Values": ["Tabular"], "Type": "Class"}, | |||
| "Task": {"Values": ["Classification"], "Type": "Class"}, | |||
| "Device": {"Values": ["GPU"], "Type": "Tag"}, | |||
| "Library": {"Values": ["Scikit-learn"], "Type": "Tag"}, | |||
| "Scenario": {"Values": ["Business"], "Type": "Tag"}, | |||
| "Description": {"Values": "", "Type": "String"}, | |||
| "Name": {"Values": "", "Type": "String"}, | |||
| @@ -15,7 +15,7 @@ semantic_specs = [ | |||
| { | |||
| "Data": {"Values": ["Tabular"], "Type": "Class"}, | |||
| "Task": {"Values": ["Classification"], "Type": "Class"}, | |||
| "Device": {"Values": ["GPU"], "Type": "Tag"}, | |||
| "Library": {"Values": ["Scikit-learn"], "Type": "Tag"}, | |||
| "Scenario": {"Values": ["Nature"], "Type": "Tag"}, | |||
| "Description": {"Values": "", "Type": "String"}, | |||
| "Name": {"Values": "learnware_1", "Type": "String"}, | |||
| @@ -23,7 +23,7 @@ semantic_specs = [ | |||
| { | |||
| "Data": {"Values": ["Tabular"], "Type": "Class"}, | |||
| "Task": {"Values": ["Classification"], "Type": "Class"}, | |||
| "Device": {"Values": ["GPU"], "Type": "Tag"}, | |||
| "Library": {"Values": ["Scikit-learn"], "Type": "Tag"}, | |||
| "Scenario": {"Values": ["Business", "Nature"], "Type": "Tag"}, | |||
| "Description": {"Values": "", "Type": "String"}, | |||
| "Name": {"Values": "learnware_2", "Type": "String"}, | |||
| @@ -31,7 +31,7 @@ semantic_specs = [ | |||
| { | |||
| "Data": {"Values": ["Tabular"], "Type": "Class"}, | |||
| "Task": {"Values": ["Regression"], "Type": "Class"}, | |||
| "Device": {"Values": ["GPU"], "Type": "Tag"}, | |||
| "Library": {"Values": ["Scikit-learn"], "Type": "Tag"}, | |||
| "Scenario": {"Values": ["Business"], "Type": "Tag"}, | |||
| "Description": {"Values": "", "Type": "String"}, | |||
| "Name": {"Values": "learnware_3", "Type": "String"}, | |||
| @@ -17,7 +17,7 @@ semantic_specs = [ | |||
| { | |||
| "Data": {"Values": ["Tabular"], "Type": "Class"}, | |||
| "Task": {"Values": ["Classification"], "Type": "Class"}, | |||
| "Device": {"Values": ["GPU"], "Type": "Tag"}, | |||
| "Library": {"Values": ["Scikit-learn"], "Type": "Tag"}, | |||
| "Scenario": {"Values": ["Business"], "Type": "Tag"}, | |||
| "Description": {"Values": "", "Type": "String"}, | |||
| "Name": {"Values": "learnware_1", "Type": "String"}, | |||
| @@ -27,7 +27,7 @@ semantic_specs = [ | |||
| user_semantic = { | |||
| "Data": {"Values": ["Tabular"], "Type": "Class"}, | |||
| "Task": {"Values": ["Classification"], "Type": "Class"}, | |||
| "Device": {"Values": ["GPU"], "Type": "Tag"}, | |||
| "Library": {"Values": ["Scikit-learn"], "Type": "Tag"}, | |||
| "Scenario": {"Values": ["Business"], "Type": "Tag"}, | |||
| "Description": {"Values": "", "Type": "String"}, | |||
| "Name": {"Values": "", "Type": "String"}, | |||
| @@ -19,7 +19,7 @@ semantic_specs = [ | |||
| { | |||
| "Data": {"Values": ["Tabular"], "Type": "Class"}, | |||
| "Task": {"Values": ["Classification"], "Type": "Class"}, | |||
| "Device": {"Values": ["GPU"], "Type": "Tag"}, | |||
| "Library": {"Values": ["Scikit-learn"], "Type": "Tag"}, | |||
| "Scenario": {"Values": ["Business"], "Type": "Tag"}, | |||
| "Description": {"Values": "", "Type": "String"}, | |||
| "Name": {"Values": "learnware_1", "Type": "String"}, | |||
| @@ -32,7 +32,7 @@ user_semantic = { | |||
| "Values": ["Classification"], | |||
| "Type": "Class", | |||
| }, | |||
| "Device": {"Values": ["GPU"], "Type": "Tag"}, | |||
| "Library": {"Values": ["Scikit-learn"], "Type": "Tag"}, | |||
| "Scenario": {"Values": ["Business"], "Type": "Tag"}, | |||
| "Description": {"Values": "", "Type": "String"}, | |||
| "Name": {"Values": "", "Type": "String"}, | |||
| @@ -79,11 +79,16 @@ semantic_config = { | |||
| # "Generation", | |||
| "Segmentation", | |||
| "Object Detection", | |||
| "Others", | |||
| ], | |||
| "Type": "Class", # Choose only one class | |||
| }, | |||
| "Device": { | |||
| "Values": ["CPU", "GPU"], | |||
| # "Device": { | |||
| # "Values": ["CPU", "GPU"], | |||
| # "Type": "Tag", | |||
| # }, # Choose one or more tags | |||
| "Library": { | |||
| "Values": ["Scikit-learn", "PyTorch", "TensorFlow", "Others"], | |||
| "Type": "Tag", | |||
| }, # Choose one or more tags | |||
| "Scenario": { | |||
| @@ -128,7 +128,7 @@ class EasyMarket(BaseMarket): | |||
| if len(semantic_spec["Task"]["Values"]) == 0: | |||
| logger.warning("Illegal semantic specification, please choose Task.") | |||
| return None, False | |||
| if len(semantic_spec["Device"]["Values"]) == 0: | |||
| if len(semantic_spec["Library"]["Values"]) == 0: | |||
| logger.warning("Illegal semantic specification, please choose Device.") | |||
| return None, False | |||
| if len(semantic_spec["Name"]["Values"]) == 0: | |||
| @@ -140,7 +140,7 @@ class EasyMarket(BaseMarket): | |||
| if ( | |||
| semantic_spec["Data"]["Type"] != "Class" | |||
| or semantic_spec["Task"]["Type"] != "Class" | |||
| or semantic_spec["Device"]["Type"] != "Tag" | |||
| or semantic_spec["Library"]["Type"] != "Tag" | |||
| or semantic_spec["Scenario"]["Type"] != "Tag" | |||
| or semantic_spec["Name"]["Type"] != "String" | |||
| or semantic_spec["Description"]["Type"] != "String" | |||
| @@ -148,6 +148,7 @@ class EasyMarket(BaseMarket): | |||
| logger.warning("Illegal semantic specification, please provide the right type.") | |||
| return None, False | |||
| except: | |||
| print(semantic_spec) | |||
| logger.warning("Illegal semantic specification, some keys are missing.") | |||
| return None, False | |||