Downloads · 30 days
5
28% of all-time downloads
sourcerersupreme/athena-intent
athena-intent is a machine learning model from sourcerersupreme. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
Classifies intent of the query for Athena
Downloads · 30 days
5
28% of all-time downloads
All-time downloads
18
Public
Repo size
268 MB
Likes
0
Public
Click a slice to open those files.
.h5268 MB · 100%
From the Hugging Face model README
Classifies intent of the query for Athena
distilbert-base-uncased backbone, finetuned over a multiclass classification problem
Classifies user intent of queries into the following classes: 0: Keyword Search 1: Semantic Search 2: Direct Question Answering
This model is intended to be used in Athena for performing QA on enterprise document stores.
Dataset was generated using ChatGPT (gpt-3.5-turbo). It consists of 5000 English sentences and the nature of their intent, annotated manually.
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)]}")