minoosh's picture
Upload folder using huggingface_hub
23f0477 verified
metadata
language: en
tags:
  - bert
  - classification
  - pytorch
pipeline_tag: text-classification

BiEncoder Classification Model

This model is a BiEncoder architecture based on BERT for text pair classification.

Model Details

  • Base Model: bert-base-uncased

  • Architecture: BiEncoder with BERT base

  • Number of classes: 4

Usage


from transformers import AutoTokenizer

import torch



# Load tokenizer

tokenizer = AutoTokenizer.from_pretrained("minoosh/bert-clf-biencoder-cross_entropy")



# Load model weights

state_dict = torch.load("pytorch_model.bin")



# Initialize model (you'll need the BiEncoderModel class)

model = BiEncoderModel(

    base_model=AutoModel.from_pretrained("bert-base-uncased"),

    num_classes=4

)

model.load_state_dict(state_dict)