company names similarity sentence transformer

Vsevolod

Introduction

This model is a Sentence-Transformer designed to map sentences and paragraphs into a 384-dimensional dense vector space, facilitating tasks such as clustering and semantic search.

Architecture

The model architecture consists of a SentenceTransformer with the following components:

  • Transformer: Utilizes a BERT model with a maximum sequence length of 256 and case sensitivity.
  • Pooling: Averages token embeddings.
  • Normalize: Normalizes the embeddings.

Training

The model was trained with the following parameters:

  • DataLoader: Utilizes a PyTorch DataLoader with a batch size of 32 and a WeightedRandomSampler.
  • Loss Function: CosineSimilarityLoss from sentence_transformers.
  • Training Parameters: Trained for 1 epoch with a learning rate of 2e-5 using the AdamW optimizer. The scheduler was WarmupLinear with 100 warmup steps and a weight decay of 0.01.

Guide: Running Locally

  1. Install Dependencies:
    pip install -U sentence-transformers
    
  2. Load and Use the Model:
    from sentence_transformers import SentenceTransformer
    
    sentences = ["This is an example sentence", "Each sentence is converted"]
    model = SentenceTransformer('{MODEL_NAME}')
    embeddings = model.encode(sentences)
    print(embeddings)
    
  3. Hardware Recommendation: For optimal performance, especially on large datasets, consider using cloud GPUs such as AWS EC2, Google Cloud, or Azure.

License

Refer to the model documentation for specific licensing details.

More Related APIs in Sentence Similarity