yetessam commited on
Commit
8643744
·
verified ·
1 Parent(s): 01fb156

Update tools/polite_guard.py

Browse files
Files changed (1) hide show
  1. tools/polite_guard.py +4 -3
tools/polite_guard.py CHANGED
@@ -30,15 +30,16 @@ class PoliteGuardTool(Tool):
30
  input_text: The text to classify.
31
 
32
  Returns:
33
- dictionary with
34
  a. A in result['label'] which is one of the four classifications
35
  b. A score in result['score']
36
  """
37
  try:
38
  classifier = pipeline("text-classification", "Intel/polite-guard")
 
39
  return {
40
- "label": result['label'],
41
- "score": result['score']
42
  }
43
 
44
  except Exception as e:
 
30
  input_text: The text to classify.
31
 
32
  Returns:
33
+ string with
34
  a. A in result['label'] which is one of the four classifications
35
  b. A score in result['score']
36
  """
37
  try:
38
  classifier = pipeline("text-classification", "Intel/polite-guard")
39
+
40
  return {
41
+ "label": classifier['label'],
42
+ "score": classifier['score']
43
  }
44
 
45
  except Exception as e: