yetessam commited on
Commit
4f8dbe0
·
verified ·
1 Parent(s): 72d1980

Update tools/polite_guard.py

Browse files
Files changed (1) hide show
  1. tools/polite_guard.py +2 -3
tools/polite_guard.py CHANGED
@@ -30,12 +30,11 @@ class PoliteGuardTool(Tool):
30
  input_text: The text to classify.
31
 
32
  Returns:
33
- dictionary with label and score values
34
  """
35
  try:
36
  classifier = pipeline("text-classification", "Intel/polite-guard")
37
-
38
- return classifier['label']
39
 
40
  except Exception as e:
41
  return f"Error fetching classification for text '{input_text}': {str(e)}"
 
30
  input_text: The text to classify.
31
 
32
  Returns:
33
+ string with classification label
34
  """
35
  try:
36
  classifier = pipeline("text-classification", "Intel/polite-guard")
37
+ return classifier(input_text)
 
38
 
39
  except Exception as e:
40
  return f"Error fetching classification for text '{input_text}': {str(e)}"