Introduction of Bert-base-uncased-intent-classification
Model Details of Bert-base-uncased-intent-classification
BERT-Base-Uncased Fine-Tuned Model for Intent Classification on CLINC150 Dataset
This repository hosts a fine-tuned BERT model for multi-class intent classification using the CLINC150 (plus) dataset. The model is trained to classify user queries into 150 in-scope intents and handle out-of-scope (OOS) queries.
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
# Load tokenizer and model
model_path = "bert-base-uncased"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path)
# Define test sentences
test_sentences = [
"Can you tell me the weather in New York?",
"I want to transfer money to my friend",
"Play some relaxing jazz music",
]
# Tokenize and predictdefpredict_intent(sentences, model, tokenizer, id2label_fn, device="cpu"):
ifisinstance(sentences, str):
sentences = [sentences]
model.eval()
model.to(device)
inputs = tokenizer(sentences, padding=True, truncation=True, return_tensors="pt").to(device)
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predictions = torch.argmax(logits, dim=-1)
return [id2label_fn(label.item()) for label in predictions]
Performance Metrics
Accuracy:
0.947097
Precision:
0.949821
Recall:
0.947097
F1 Score:
0.945876
Fine-Tuning Details
Dataset
The CLINC150 (plus) dataset contains 151 intent classes (150 in-scope + 1 out-of-scope) for intent classification in English utterances. It includes 15k training, 3k validation, and 4.5k test examples with diverse user queries.
Training
Epochs:
5
Batch size:
16
Learning rate:
2e-5
Evaluation strategy:
epoch
Quantization
Post-training quantization was applied using PyTorch’s
half()
precision (FP16) to reduce model size and inference time.
Repository Structure
.
├── quantized-model/ # Contains the quantized model files
│ ├── config.json
│ ├── model.safetensors
│ ├── tokenizer_config.json
│ ├── vocab.txt
│ └── special_tokens_map.json
├── README.md # Model documentation
Limitations
The model is trained specifically for multi classification on CLINIC150 Dataset.
FP16 quantization may result in slight numerical instability in edge cases.
Contributing
Feel free to open issues or submit pull requests to improve the model or documentation.
Runs of AventIQ-AI Bert-base-uncased-intent-classification on huggingface.co
6
Total runs
0
24-hour runs
2
3-day runs
2
7-day runs
0
30-day runs
More Information About Bert-base-uncased-intent-classification huggingface.co Model
Bert-base-uncased-intent-classification huggingface.co is an AI model on huggingface.co that provides Bert-base-uncased-intent-classification's model effect (), which can be used instantly with this AventIQ-AI Bert-base-uncased-intent-classification model. huggingface.co supports a free trial of the Bert-base-uncased-intent-classification model, and also provides paid use of the Bert-base-uncased-intent-classification. Support call Bert-base-uncased-intent-classification model through api, including Node.js, Python, http.
Bert-base-uncased-intent-classification huggingface.co is an online trial and call api platform, which integrates Bert-base-uncased-intent-classification's modeling effects, including api services, and provides a free online trial of Bert-base-uncased-intent-classification, you can try Bert-base-uncased-intent-classification online for free by clicking the link below.
AventIQ-AI Bert-base-uncased-intent-classification online free url in huggingface.co:
Bert-base-uncased-intent-classification is an open source model from GitHub that offers a free installation service, and any user can find Bert-base-uncased-intent-classification on GitHub to install. At the same time, huggingface.co provides the effect of Bert-base-uncased-intent-classification install, users can directly use Bert-base-uncased-intent-classification installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Bert-base-uncased-intent-classification install url in huggingface.co: