File size: 1,899 Bytes
e95cd86
10f485d
e95cd86
 
 
 
 
 
 
 
 
 
 
 
 
10f485d
 
e95cd86
10f485d
e95cd86
10f485d
e95cd86
10f485d
e95cd86
 
 
 
 
 
10f485d
e95cd86
10f485d
e95cd86
 
 
10f485d
e95cd86
 
 
10f485d
e95cd86
 
 
 
 
 
 
 
10f485d
e95cd86
 
 
 
10f485d
e95cd86
10f485d
e95cd86
 
 
 
 
 
 
10f485d
e95cd86
10f485d
e95cd86
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

---
language: en
license: apache-2.0
tags:
- text-classification
- branch-switching
- hospital-chatbot
- distilbert
datasets:
- branch_switch_classification
widget:
- text: "I want to switch to Mumbai branch"
- text: "What are your hospital timings?"
- text: "Can I change to the branch near my home?"
---

# Branch Switch Classification Model

This model classifies whether a user wants to switch hospital branches or is asking for general information.

## Model Description

- **Model**: DistilBERT for Sequence Classification
- **Task**: Binary Classification
- **Domain**: Hospital/Healthcare Chatbot
- **Classes**: 
  - `True`: User wants to switch branches
  - `False`: General query/information seeking

## Usage

```python
from transformers import DistilBertTokenizer, DistilBertForSequenceClassification
import torch

# Load model and tokenizer
tokenizer = DistilBertTokenizer.from_pretrained("hitty28/branch-switch-classifier")
model = DistilBertForSequenceClassification.from_pretrained("hitty28/branch-switch-classifier")

# Predict
def predict(text):
    inputs = tokenizer(text, truncation=True, padding='max_length', max_length=128, return_tensors='pt')
    with torch.no_grad():
        outputs = model(**inputs)
        predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
        predicted_class = torch.argmax(predictions, dim=-1).item()
    return bool(predicted_class)

# Example
result = predict("I want to switch to Delhi branch")
print(result)  # True
```

## Training Data

The model was trained on a comprehensive dataset including:
- Direct branch switch requests
- Location-specific switches  
- Facility-based switches
- Information queries about branches
- Medical service inquiries
- Edge cases and ambiguous statements

## Performance

The model achieves high accuracy in distinguishing between branch switching intents and general information queries.