Text Classification
Adapters
Safetensors
Chinese
bert
Multi-label Text Classification
Eval Results (legacy)
Instructions to use scfengv/TVL_GeneralLayerClassifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Adapters
How to use scfengv/TVL_GeneralLayerClassifier with Adapters:
from adapters import AutoAdapterModel model = AutoAdapterModel.from_pretrained("undefined") model.load_adapter("scfengv/TVL_GeneralLayerClassifier", set_active=True) - Notebooks
- Google Colab
- Kaggle
| import torch | |
| from transformers import AutoModelForSequenceClassification, AutoTokenizer | |
| model = AutoModelForSequenceClassification.from_pretrained( | |
| "scfengv/TVL_GeneralLayerClassifier", | |
| id2label = {0: "Cheer", 1: "Game", 2: "Broadcast", 3: "Chat"}, | |
| label2id = {"Cheer": 0, "Game": 1, "Broadcast": 2, "Chat": 3} | |
| ) | |
| tokenizer = AutoTokenizer.from_pretrained("scfengv/TVL_GeneralLayerClassifier") | |
| inputs = tokenizer("地震", return_tensors = "pt") | |
| with torch.no_grad(): | |
| logits = model(**inputs).logits | |
| predicted_class_id = logits.argmax().item() | |
| print(f"Predicted class: {predicted_class_id}") |