File size: 1,425 Bytes
de86483 5aad6cd | 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 | ---
license: mit
language:
- en
library_name: pytorch
---
# Athena- Intent
Classifies intent of the query for Athena
## Architecture
distilbert-base-uncased backbone, finetuned over a multiclass classification problem
### Description
Classifies user intent of queries into the following classes:
0: Keyword Search
1: Semantic Search
2: Direct Question Answering
## Uses
This model is intended to be used in Athena for performing QA on enterprise document stores.
## Bias, Risks, and Limitations
Dataset was generated using ChatGPT (gpt-3.5-turbo). It consists of 5000 English sentences and the nature of their intent, annotated manually.
## Usage
```
from transformers import AutoTokenizer
from transformers import TFDistilBertForSequenceClassification
import tensorflow as tf
model = TFDistilBertForSequenceClassification.from_pretrained("sourcerersupreme/athena-intent")
tokenizer = AutoTokenizer.from_pretrained("sourcerersupreme/athena-intent")
class_semantic_mapping = {
0: "Keyword",
1: "Semantic",
2: "QA"
}
# Get user input
user_query = "What is a CDP?"
# Encode the user input
inputs = tokenizer(user_query, return_tensors="tf", truncation=True, padding=True)
# Get model predictions
predictions = model(inputs)[0]
# Get predicted class
predicted_class = tf.math.argmax(predictions, axis=-1)
print(f"Predicted class: {class_semantic_mapping[int(predicted_class)]}")
``` |