SentenceTransformer based on google-bert/bert-base-cased
This is a sentence-transformers model finetuned from 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
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
- Training Dataset:
- csv
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
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:
pip install -U sentence-transformers
Then you can load this model and run inference.
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]])
Training Details
Training Dataset
csv
- Dataset: csv
- Size: 286,816 training samples
- Columns:
premise,hypothesis, andlabel - Approximate statistics based on the first 1000 samples:
premise hypothesis label type string string int details - min: 8 tokens
- mean: 38.33 tokens
- max: 213 tokens
- min: 8 tokens
- mean: 37.78 tokens
- max: 213 tokens
- 0: ~50.50%
- 2: ~49.50%
- Samples:
premise hypothesis label NC(=O)C@HNC(=O)OCc1cc(=O)c(O)co1CNC(=S)N/N=C(\C)c1ccc(OC)cc1O2CC/C(=N\NC(N)=S)c1ccc(C2CCCCC2)cc1COc1cccc(C(=O)N2CCN(Cc3ccc(F)cc3)CC2)c12O=C(O)CSc1nnc(NC(=S)Nc2cccc(C(F)(F)F)c2)s1CCCCOc1cccc2c1C(=O)c1c(OCCCC)cc(CO)cc1C2=O0 - Loss:
SoftmaxLoss
Evaluation Dataset
csv
- Dataset: csv
- Size: 50,615 evaluation samples
- Columns:
premise,hypothesis, andlabel - Approximate statistics based on the first 1000 samples:
premise hypothesis label type string string int details - min: 8 tokens
- mean: 38.78 tokens
- max: 213 tokens
- min: 8 tokens
- mean: 39.23 tokens
- max: 213 tokens
- 0: ~47.40%
- 2: ~52.60%
- Samples:
premise hypothesis label O=Cc1ccoc1Cn1c2ccccc2c2cc(/C=C/C(=O)c3cccc(NC(=O)c4ccccc4F)c3)ccc212COc1cc(C=O)ccc1OC(=O)CN1CCN(C)CC1Oc1ccc(O)cc12O=C(c1cccc(N+[O-])c1)N1CCN(Cc2ccc(F)cc2)CC1CNC(=S)N/N=C(\C)c1ccc(OC)cc1O2 - Loss:
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
@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",
}
- Downloads last month
- 2
Model tree for Jimmy-Ooi/Tyrisonase_test_model
Base model
google-bert/bert-base-cased