|
|
--- |
|
|
tags: |
|
|
- sentence-transformers |
|
|
- sentence-similarity |
|
|
- feature-extraction |
|
|
- dense |
|
|
- generated_from_trainer |
|
|
- dataset_size:286816 |
|
|
- loss:SoftmaxLoss |
|
|
base_model: google-bert/bert-base-cased |
|
|
widget: |
|
|
- source_sentence: CC(C)C[C@H](NC(=O)[C@@H](N)Cc1ccccc1)C(=O)NCc1cc(=O)c(O)c[nH]1 |
|
|
sentences: |
|
|
- CC(=O)N1CCC(Cc2ccc(F)cc2)CC1 |
|
|
- C=CC(C)(C)c1cc(CCCc2cc(O)c(O)c(CC3OC3(C)C)c2CC=C(C)C)c(O)cc1O |
|
|
- COc1cc([N+](=O)[O-])ccc1/C=C/C(=N\O)c1cc2ccccc2cc1O |
|
|
- source_sentence: O=C(OCc1ccc(O)cc1)c1cc(O)c(O)c(O)c1 |
|
|
sentences: |
|
|
- COc1ccc(/C=C/C(=O)NCCCNC(=O)/C=C/c2ccc(OC)c(O)c2)cc1O |
|
|
- CCCCCCCCSCc1cc(=O)c(O)co1 |
|
|
- O=C(NCCc1c[nH]c2ccc(O)cc12)c1ccc(O)cc1O |
|
|
- source_sentence: O=C(/C=C/c1ccc(O)cc1)c1ccc(NS(=O)(=O)c2ccc([N+](=O)[O-])cc2)cc1 |
|
|
sentences: |
|
|
- Nc1ccc(S(=O)(=O)Nc2ccc(C(=O)/C=C/c3ccc(O)cc3)cc2)cc1 |
|
|
- O=C(NO)Nc1ccc(O)cc1 |
|
|
- COc1ccc(C(C)=O)c(OC(=O)/C=C/c2ccc(F)cc2)c1 |
|
|
- source_sentence: O=C(c1ccc2ccccc2c1)N1CCC(N2CCCCC2)CC1 |
|
|
sentences: |
|
|
- N[C@@H](Cc1ccccc1)C(=O)N[C@@H](Cc1ccccc1)C(=O)OCc1cc(=O)c(O)c[nH]1 |
|
|
- '[C-]#N' |
|
|
- COc1ccc(/C=C/C(=O)NCCCNC(=O)/C=C/c2ccc(OC)c(O)c2)cc1O |
|
|
- source_sentence: NC(=S)c1cccnc1 |
|
|
sentences: |
|
|
- COc1ccc(/C=C/C(=N\O)c2cc3ccccc3cc2O)c(OC)c1 |
|
|
- C/C(=N\NC(N)=S)c1cccc(NC(=O)C(F)(F)F)c1 |
|
|
- Cc1ccc(C(C)C)c(OC(=O)/C=C/c2ccc(O)cc2)c1 |
|
|
pipeline_tag: sentence-similarity |
|
|
library_name: sentence-transformers |
|
|
--- |
|
|
|
|
|
# SentenceTransformer based on google-bert/bert-base-cased |
|
|
|
|
|
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [google-bert/bert-base-cased](https://huggingface.co/google-bert/bert-base-cased) on the csv dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more. |
|
|
|
|
|
## Model Details |
|
|
|
|
|
### Model Description |
|
|
- **Model Type:** Sentence Transformer |
|
|
- **Base model:** [google-bert/bert-base-cased](https://huggingface.co/google-bert/bert-base-cased) <!-- at revision cd5ef92a9fb2f889e972770a36d4ed042daf221e --> |
|
|
- **Maximum Sequence Length:** 512 tokens |
|
|
- **Output Dimensionality:** 768 dimensions |
|
|
- **Similarity Function:** Cosine Similarity |
|
|
- **Training Dataset:** |
|
|
- csv |
|
|
<!-- - **Language:** Unknown --> |
|
|
<!-- - **License:** Unknown --> |
|
|
|
|
|
### Model Sources |
|
|
|
|
|
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net) |
|
|
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers) |
|
|
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers) |
|
|
|
|
|
### Full Model Architecture |
|
|
|
|
|
``` |
|
|
SentenceTransformer( |
|
|
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'BertModel'}) |
|
|
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True}) |
|
|
) |
|
|
``` |
|
|
|
|
|
## Usage |
|
|
|
|
|
### Direct Usage (Sentence Transformers) |
|
|
|
|
|
First install the Sentence Transformers library: |
|
|
|
|
|
```bash |
|
|
pip install -U sentence-transformers |
|
|
``` |
|
|
|
|
|
Then you can load this model and run inference. |
|
|
```python |
|
|
from sentence_transformers import SentenceTransformer |
|
|
|
|
|
# Download from the 🤗 Hub |
|
|
model = SentenceTransformer("Jimmy-Ooi/Tyrisonase_test_model") |
|
|
# Run inference |
|
|
sentences = [ |
|
|
'NC(=S)c1cccnc1', |
|
|
'Cc1ccc(C(C)C)c(OC(=O)/C=C/c2ccc(O)cc2)c1', |
|
|
'C/C(=N\\NC(N)=S)c1cccc(NC(=O)C(F)(F)F)c1', |
|
|
] |
|
|
embeddings = model.encode(sentences) |
|
|
print(embeddings.shape) |
|
|
# [3, 768] |
|
|
|
|
|
# Get the similarity scores for the embeddings |
|
|
similarities = model.similarity(embeddings, embeddings) |
|
|
print(similarities) |
|
|
# tensor([[1.0000, 0.9019, 0.8925], |
|
|
# [0.9019, 1.0000, 0.9356], |
|
|
# [0.8925, 0.9356, 1.0000]]) |
|
|
``` |
|
|
|
|
|
<!-- |
|
|
### Direct Usage (Transformers) |
|
|
|
|
|
<details><summary>Click to see the direct usage in Transformers</summary> |
|
|
|
|
|
</details> |
|
|
--> |
|
|
|
|
|
<!-- |
|
|
### Downstream Usage (Sentence Transformers) |
|
|
|
|
|
You can finetune this model on your own dataset. |
|
|
|
|
|
<details><summary>Click to expand</summary> |
|
|
|
|
|
</details> |
|
|
--> |
|
|
|
|
|
<!-- |
|
|
### Out-of-Scope Use |
|
|
|
|
|
*List how the model may foreseeably be misused and address what users ought not to do with the model.* |
|
|
--> |
|
|
|
|
|
<!-- |
|
|
## Bias, Risks and Limitations |
|
|
|
|
|
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.* |
|
|
--> |
|
|
|
|
|
<!-- |
|
|
### Recommendations |
|
|
|
|
|
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.* |
|
|
--> |
|
|
|
|
|
## Training Details |
|
|
|
|
|
### Training Dataset |
|
|
|
|
|
#### csv |
|
|
|
|
|
* Dataset: csv |
|
|
* Size: 286,816 training samples |
|
|
* Columns: <code>premise</code>, <code>hypothesis</code>, and <code>label</code> |
|
|
* Approximate statistics based on the first 1000 samples: |
|
|
| | premise | hypothesis | label | |
|
|
|:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:------------------------------------------------| |
|
|
| type | string | string | int | |
|
|
| details | <ul><li>min: 8 tokens</li><li>mean: 38.33 tokens</li><li>max: 213 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 37.78 tokens</li><li>max: 213 tokens</li></ul> | <ul><li>0: ~50.50%</li><li>2: ~49.50%</li></ul> | |
|
|
* Samples: |
|
|
| premise | hypothesis | label | |
|
|
|:-----------------------------------------------------------|:--------------------------------------------------------|:---------------| |
|
|
| <code>NC(=O)[C@H](Cc1ccccc1)NC(=O)OCc1cc(=O)c(O)co1</code> | <code>CNC(=S)N/N=C(\C)c1ccc(OC)cc1O</code> | <code>2</code> | |
|
|
| <code>CC/C(=N\NC(N)=S)c1ccc(C2CCCCC2)cc1</code> | <code>COc1cccc(C(=O)N2CCN(Cc3ccc(F)cc3)CC2)c1</code> | <code>2</code> | |
|
|
| <code>O=C(O)CSc1nnc(NC(=S)Nc2cccc(C(F)(F)F)c2)s1</code> | <code>CCCCOc1cccc2c1C(=O)c1c(OCCCC)cc(CO)cc1C2=O</code> | <code>0</code> | |
|
|
* Loss: [<code>SoftmaxLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#softmaxloss) |
|
|
|
|
|
### Evaluation Dataset |
|
|
|
|
|
#### csv |
|
|
|
|
|
* Dataset: csv |
|
|
* Size: 50,615 evaluation samples |
|
|
* Columns: <code>premise</code>, <code>hypothesis</code>, and <code>label</code> |
|
|
* Approximate statistics based on the first 1000 samples: |
|
|
| | premise | hypothesis | label | |
|
|
|:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:------------------------------------------------| |
|
|
| type | string | string | int | |
|
|
| details | <ul><li>min: 8 tokens</li><li>mean: 38.78 tokens</li><li>max: 213 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 39.23 tokens</li><li>max: 213 tokens</li></ul> | <ul><li>0: ~47.40%</li><li>2: ~52.60%</li></ul> | |
|
|
* Samples: |
|
|
| premise | hypothesis | label | |
|
|
|:---------------------------------------------------------------|:-----------------------------------------------------------------------|:---------------| |
|
|
| <code>O=Cc1ccoc1</code> | <code>Cn1c2ccccc2c2cc(/C=C/C(=O)c3cccc(NC(=O)c4ccccc4F)c3)ccc21</code> | <code>2</code> | |
|
|
| <code>COc1cc(C=O)ccc1OC(=O)CN1CCN(C)CC1</code> | <code>Oc1ccc(O)cc1</code> | <code>2</code> | |
|
|
| <code>O=C(c1cccc([N+](=O)[O-])c1)N1CCN(Cc2ccc(F)cc2)CC1</code> | <code>CNC(=S)N/N=C(\C)c1ccc(OC)cc1O</code> | <code>2</code> | |
|
|
* Loss: [<code>SoftmaxLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#softmaxloss) |
|
|
|
|
|
### Framework Versions |
|
|
- Python: 3.12.11 |
|
|
- Sentence Transformers: 5.1.1 |
|
|
- Transformers: 4.56.1 |
|
|
- PyTorch: 2.8.0+cu126 |
|
|
- Accelerate: 1.10.1 |
|
|
- Datasets: 4.0.0 |
|
|
- Tokenizers: 0.22.0 |
|
|
|
|
|
## Citation |
|
|
|
|
|
### BibTeX |
|
|
|
|
|
#### Sentence Transformers and SoftmaxLoss |
|
|
```bibtex |
|
|
@inproceedings{reimers-2019-sentence-bert, |
|
|
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks", |
|
|
author = "Reimers, Nils and Gurevych, Iryna", |
|
|
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing", |
|
|
month = "11", |
|
|
year = "2019", |
|
|
publisher = "Association for Computational Linguistics", |
|
|
url = "https://arxiv.org/abs/1908.10084", |
|
|
} |
|
|
``` |
|
|
|
|
|
<!-- |
|
|
## Glossary |
|
|
|
|
|
*Clearly define terms in order to be accessible across audiences.* |
|
|
--> |
|
|
|
|
|
<!-- |
|
|
## Model Card Authors |
|
|
|
|
|
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.* |
|
|
--> |
|
|
|
|
|
<!-- |
|
|
## Model Card Contact |
|
|
|
|
|
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.* |
|
|
--> |