saicharan2804
adding scscore
9b06241
raw
history blame
1.05 kB
# import evaluate
# from evaluate.utils import launch_gradio_widget
# import gradio as gr
# module = evaluate.load("saicharan2804/molgenevalmetric")
# # launch_gradio_widget(module)
# iface = gr.Interface(
# fn = module,
# inputs=[
# gr.File(label="Generated SMILES"),
# gr.File(label="Training Data", value=None),
# ],
# outputs="text"
# )
# iface.launch()
# import pandas as pd
# df = pd.read_csv('/home/saicharan/Downloads/chembl.csv')
# df = df.rename(columns={'canonical_smiles': 'SMILES'})
# df = df[0:10000]
# print(df[['SMILES']].to_csv('/home/saicharan/Downloads/chembl_10000.csv'))
from scscore.scscore.standalone_model_numpy import SCScorer
import pandas as pd
model = SCScorer()
model.restore()
pubchem = pd.read_csv('/home/saicharan/Downloads/chembl_10000.csv')
# smis = ['CCCOCCC', 'CCCNc1ccccc1']
smis = pubchem['SMILES'].tolist()
smis = smis[0:1000]
print('computing')
average_score = model.get_avg_score(smis)
# Print the average score
print('Average score:', average_score)