---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:2400
- loss:CosineSimilarityLoss
base_model: sentence-transformers/all-MiniLM-L6-v2
widget:
- source_sentence: 'banned / controlled drugs: heroin'
sentences:
- This webpage mentions 'jihad' in a context related to hate / extremism.
- This webpage mentions 'no kyc loan' in a context related to unlicensed lending
/ loans.
- This webpage mentions 'heroin' in a context related to banned / controlled drugs.
- source_sentence: 'online gambling / gaming: satta'
sentences:
- This webpage mentions 'xxx' in a context related to adult / porn / sex work.
- This webpage mentions 'torrent' in a context related to ip infringement / piracy
/ copyright.
- This webpage mentions 'satta' in a context related to online gambling / gaming.
- source_sentence: 'adult / porn / sex work: cam girl'
sentences:
- This webpage mentions 'cam girl' in a context related to adult / porn / sex work.
- This webpage mentions 'meth' in a context related to banned / controlled drugs.
- This webpage mentions 'ak-47' in a context related to weapons.
- source_sentence: 'financial fraud / scams: get rich quick'
sentences:
- This webpage mentions 'heroin' in a context related to banned / controlled drugs.
- This webpage mentions 'satta' in a context related to online gambling / gaming.
- This webpage mentions 'get rich quick' in a context related to financial fraud
/ scams.
- source_sentence: 'banned / controlled drugs: cocaine'
sentences:
- This webpage mentions 'cocaine' in a context related to banned / controlled drugs.
- This webpage mentions 'cracked software' in a context related to ip infringement
/ piracy / copyright.
- This webpage mentions 'get rich quick' in a context related to financial fraud
/ scams.
pipeline_tag: sentence-similarity
library_name: sentence-transformers
---
# SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2). It maps sentences & paragraphs to a 384-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:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
- **Maximum Sequence Length:** 256 tokens
- **Output Dimensionality:** 384 dimensions
- **Similarity Function:** Cosine Similarity
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/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': 256, 'do_lower_case': False, 'architecture': 'BertModel'})
(1): Pooling({'word_embedding_dimension': 384, '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})
(2): Normalize()
)
```
## 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("sentence_transformers_model_id")
# Run inference
sentences = [
'banned / controlled drugs: cocaine',
"This webpage mentions 'cocaine' in a context related to banned / controlled drugs.",
"This webpage mentions 'get rich quick' in a context related to financial fraud / scams.",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.9125, 0.0765],
# [0.9125, 1.0000, 0.2072],
# [0.0765, 0.2072, 1.0000]])
```
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 2,400 training samples
* Columns: sentence_0, sentence_1, and label
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 | label |
|:--------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details |
weapons: buy gun online | This webpage mentions 'buy gun online' in a context related to weapons. | 1.0 |
| pharma / prescription (unlicensed): cheap pills online | This webpage mentions 'cheap pills online' in a context related to pharma / prescription (unlicensed). | 1.0 |
| ip infringement / piracy / copyright: fake rolex | This webpage mentions 'fake rolex' in a context related to ip infringement / piracy / copyright. | 1.0 |
* Loss: [CosineSimilarityLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
```json
{
"loss_fct": "torch.nn.modules.loss.MSELoss"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 16
- `per_device_eval_batch_size`: 16
- `num_train_epochs`: 1
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters