AruniAnkur commited on
Commit
491a9c7
·
verified ·
1 Parent(s): 4bcae31

added correct mapping

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -11,8 +11,10 @@ tokenizer = DistilBertTokenizer.from_pretrained('./fine_tuned_distilbert')
11
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
12
  model.to(device)
13
 
14
- # Reverse mapping of categories to class labels
15
- reverse_mapping = {0: "BT1", 1: "BT2", 2: "BT3", 3: "BT4", 4: "BT5", 5: "BT6"}
 
 
16
 
17
  def predict_with_loaded_model(text):
18
  # Tokenize the input text
 
11
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
12
  model.to(device)
13
 
14
+ mapping = {"Remembering": 0, "Understanding": 1, "Applying": 2, "Analyzing": 3, "Evaluating": 4, "Creating": 5}
15
+
16
+ # Reverse the mapping to get the class name from the index
17
+ reverse_mapping = {v: k for k, v in mapping.items()}
18
 
19
  def predict_with_loaded_model(text):
20
  # Tokenize the input text