Text Classification
Transformers
PyTorch
Safetensors
Vietnamese
roberta
transfomer
sbert
legaltext
vietnamese
Instructions to use hmthanh/VietnamLegalText-SBERT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hmthanh/VietnamLegalText-SBERT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="hmthanh/VietnamLegalText-SBERT")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("hmthanh/VietnamLegalText-SBERT") model = AutoModelForSequenceClassification.from_pretrained("hmthanh/VietnamLegalText-SBERT") - Notebooks
- Google Colab
- Kaggle
- Vietnamese Legal Text BERT
- Using Vietnamese Legal Text BERT
hmthanh/VietnamLegalText-SBERT
Vietnamese Legal Text BERT
Table of contents
Using Vietnamese Legal Text BERT hmthanh/VietnamLegalText-SBERT
Using Vietnamese Legal Text BERT transformers
Installation
- Install
transformerswith pip:
pip install transformers
- Install
tokenizerswith pip:
pip install tokenizers
Pre-trained models
| Model | #params | Arch. | Max length | Pre-training data |
|---|---|---|---|---|
hmthanh/VietnamLegalText-SBERT |
135M | base | 256 | 20GB of texts |
Example usage
import torch
from transformers import AutoModel, AutoTokenizer
phobert = AutoModel.from_pretrained("hmthanh/VietnamLegalText-SBERT")
tokenizer = AutoTokenizer.from_pretrained("hmthanh/VietnamLegalText-SBERT")
sentence = 'Vượt đèn đỏ bị phạt bao nhiêu tiền?'
input_ids = torch.tensor([tokenizer.encode(sentence)])
with torch.no_grad():
features = phobert(input_ids) # Models outputs are now tuples
- Downloads last month
- 8