text2vec large chinese

GanymedeNil

Introduction

The text2vec-large-chinese model, developed by GanymedeNil, is designed for sentence similarity tasks in Chinese. It builds on the architecture of the text2vec-base-chinese model, with MacBERT replaced by LERT, while maintaining other training conditions.

Architecture

The model leverages the Transformers library and is implemented in PyTorch. It supports various tasks like feature extraction and text embeddings inference, optimized for sentence similarity in Chinese. The model is also available in the ONNX format for enhanced runtime performance.

Training

The model is a derivative of the text2vec-base-chinese model. Training involves replacing the MacBERT component with LERT, while the rest of the training conditions remain unchanged. This modification aims to improve performance in sentence similarity tasks.

Guide: Running Locally

To run the model locally:

  1. Set Up Environment: Ensure you have Python installed, along with the Hugging Face Transformers library and PyTorch.
  2. Install Dependencies:
    pip install transformers torch safetensors
    
  3. Download the Model: Use the Transformers library to load the model:
    from transformers import AutoModel, AutoTokenizer
    
    tokenizer = AutoTokenizer.from_pretrained("GanymedeNil/text2vec-large-chinese")
    model = AutoModel.from_pretrained("GanymedeNil/text2vec-large-chinese")
    
  4. Inference: Tokenize your input text and pass it through the model to get embeddings.
  5. Cloud GPU Recommendation: For optimal performance, consider using cloud-based GPUs such as AWS EC2 with GPU instances, Google Cloud Platform, or Azure.

License

The text2vec-large-chinese model is licensed under the Apache 2.0 License, allowing for both personal and commercial use, distribution, and modification.

More Related APIs in Sentence Similarity