Views
No views yet
1# Ensure your inference script and its dependencies are in the PYTHONPATH
2# from synthesis_predictor_hf_repo.src.inference import predict_synthesis_outcome, load_all_artifacts_once
3
4# Or, if running from a cloned repo where 'src' is a subdirectory:
5# from src.inference import predict_synthesis_outcome, load_all_artifacts_once
6
7# if not load_all_artifacts_once():
8# print("Failed to load model artifacts.")
9# else:
10# raw_input_example = {
11# 'target_formula_raw': "YBa2Cu3O7",
12# 'precursor_formulas_raw': ["Y2O3", "BaCO3", "CuO"],
13# 'operations_simplified_list': [
14# {'type': 'MixingOperation', 'string': 'Ball milling for 2h', 'conditions': {'duration': [{'value':2, 'unit':'h'}]}},
15# {'type': 'HeatingOperation', 'string': 'Calcined at 920C for 10h in air',
16# 'conditions': {'heating_temperature': [{'value':920}], 'heating_time': [{'value':10}], 'atmosphere':'air'}},
17# {'type': 'HeatingOperation', 'string': 'Sintered at 950C for 20h in O2',
18# 'conditions': {'heating_temperature': [{'value':950}], 'heating_time': [{'value':20}], 'atmosphere':'Oxygen'}}
19# ],
20# 'reactants_coeffs': [("Y2O3", 0.5), ("BaCO3", 2.0), ("CuO", 3.0)], # Example, adjust as needed
21# 'products_coeffs': [("YBa2Cu3O7", 1.0)] # Example
22# }
23# predictions = predict_synthesis_outcome(raw_input_example)
24# print(predictions)operations_simplified_list that can be parsed by the internal logic. The quality of these inputs directly affects prediction accuracy. precision recall f1-score support
TempBin_1_(1_to_900] 0.77 0.79 0.78 954
TempBin_2_(900_to_1100] 0.62 0.53 0.57 743
TempBin_3_(1100_to_1300] 0.58 0.58 0.58 768
TempBin_4_(1300_to_3000] 0.72 0.80 0.76 715
accuracy 0.68 3180
macro avg 0.67 0.68 0.67 3180
weighted avg 0.68 0.68 0.68 3180 precision recall f1-score support
Inert 0.59 0.38 0.46 139
Other_Atm_Target 1.00 0.44 0.62 9
Oxidizing 0.67 0.71 0.69 1552
Reducing 0.70 0.47 0.56 100
Unknown_Atm_Category 0.76 0.76 0.76 2098
accuracy 0.72 3898
macro avg 0.74 0.55 0.62 3898
weighted avg 0.72 0.72 0.72 3898