RXNBERT fingerprints
model, tokenizer = get_default_model_and_tokenizer()
rxnfp_generator = RXNBERTFingerprintGenerator(model, tokenizer)
example_rxn = "Nc1cccc2cnccc12.O=C(O)c1cc([N+](=O)[O-])c(Sc2c(Cl)cncc2Cl)s1>>O=C(Nc1cccc2cnccc12)c1cc([N+](=O)[O-])c(Sc2c(Cl)cncc2Cl)s1"
fp = rxnfp_generator.convert(example_rxn)
print(len(fp))
print(fp[:5])
fps = rxnfp_generator.convert_batch([example_rxn, example_rxn])
print(len(fps), len(fps[0]))
model, tokenizer = get_default_model_and_tokenizer()
rxnmhfp_generator = RXNBERTMinhashFingerprintGenerator(model, tokenizer)
example_rxn = "Nc1cccc2cnccc12.O=C(O)c1cc([N+](=O)[O-])c(Sc2c(Cl)cncc2Cl)s1>>O=C(Nc1cccc2cnccc12)c1cc([N+](=O)[O-])c(Sc2c(Cl)cncc2Cl)s1"
fp = rxnmhfp_generator.convert(example_rxn)
print(len(fp))
print(fp[:5])