Instructions to use vineetsharma/customer-support-intent-albert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vineetsharma/customer-support-intent-albert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="vineetsharma/customer-support-intent-albert")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("vineetsharma/customer-support-intent-albert") model = AutoModelForSequenceClassification.from_pretrained("vineetsharma/customer-support-intent-albert") - Notebooks
- Google Colab
- Kaggle
Third Class Model
#4
by SouravAhmed - opened
# https://huggingface.co/vineetsharma/customer-support-intent-albert
!pip install transformers torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("vineetsharma/customer-support-intent-albert")
model = AutoModelForSequenceClassification.from_pretrained("vineetsharma/customer-support-intent-albert")
# Set model to evaluation mode
model.eval()
import torch
# Sample input
customer_query = "show me the latest iphone"
# Tokenize the input
inputs = tokenizer(customer_query, return_tensors="pt")
# Perform inference
with torch.no_grad():
outputs = model(**inputs)
labels = model.config.id2label
print("outputs: ", outputs)
# Get predicted class
predicted_class = outputs.logits.argmax(-1).item()
predicted_label = labels[predicted_class]
print(f"Predicted intent: {predicted_label}")
print(f"Predicted class: {predicted_class}")
** i dont think am doing anything wrong. **

