sourcerersupreme commited on
Commit
5aad6cd
·
verified ·
1 Parent(s): a197617

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +54 -0
README.md ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Athena- Intent
2
+
3
+ Classifies intent of the query for Athena
4
+
5
+ ## Architecture
6
+ distilbert-base-uncased backbone, finetuned over a multiclass classification problem
7
+
8
+ ### Description
9
+
10
+ Classifies user intent of queries into the following classes:
11
+ 0: Keyword Search
12
+ 1: Semantic Search
13
+ 2: Direct Question Answering
14
+
15
+
16
+ ## Uses
17
+
18
+ This model is intended to be used in Athena for performing QA on enterprise document stores.
19
+
20
+
21
+ ## Bias, Risks, and Limitations
22
+
23
+ Dataset was generated using ChatGPT (gpt-3.5-turbo). It consists of 5000 English sentences and the nature of their intent, annotated manually.
24
+
25
+ ## Usage
26
+
27
+ ```
28
+ from transformers import AutoTokenizer
29
+ from transformers import TFDistilBertForSequenceClassification
30
+ import tensorflow as tf
31
+
32
+ model = TFDistilBertForSequenceClassification.from_pretrained("sourcerersupreme/athena-intent")
33
+ tokenizer = AutoTokenizer.from_pretrained("sourcerersupreme/athena-intent")
34
+
35
+ class_semantic_mapping = {
36
+ 0: "Keyword",
37
+ 1: "Semantic",
38
+ 2: "QA"
39
+ }
40
+
41
+ # Get user input
42
+ user_query = "What is a CDP?"
43
+
44
+ # Encode the user input
45
+ inputs = tokenizer(user_query, return_tensors="tf", truncation=True, padding=True)
46
+
47
+ # Get model predictions
48
+ predictions = model(inputs)[0]
49
+
50
+ # Get predicted class
51
+ predicted_class = tf.math.argmax(predictions, axis=-1)
52
+
53
+ print(f"Predicted class: {class_semantic_mapping[int(predicted_class)]}")
54
+ ```