yetessam commited on
Commit
92e3278
·
verified ·
1 Parent(s): 0cc6896

Update tools/polite_guard.py

Browse files
Files changed (1) hide show
  1. tools/polite_guard.py +9 -3
tools/polite_guard.py CHANGED
@@ -4,12 +4,18 @@ from transformers import pipeline
4
 
5
 
6
  class PoliteGuardTool(Tool):
7
- """Wrapper around a text tool that classifies text into politeness categories.
 
 
8
  Args:
9
- input_text: A string of English text.
 
 
 
10
  """
 
11
  name = "polite_guard"
12
- description = "Calls an tool to classifify text by 4 labels from polite to impolite"
13
  inputs = {'input_text': {'type': 'any', 'description': 'Enter text for assessing whether it is respectful'}}
14
  output_type = "any"
15
 
 
4
 
5
 
6
  class PoliteGuardTool(Tool):
7
+ """Takes the input text from the users and then evaluates it against Polite Guard to return specific information
8
+ about whether the content is polite.
9
+
10
  Args:
11
+ input_text: Text that the user inputs into the agent and should then be evaluated.
12
+
13
+ Returns:
14
+ A classification label about whether the content is polite, somewhat polite, neutral or impolite.
15
  """
16
+
17
  name = "polite_guard"
18
+ description = "Uses Polite guard to classify the user's input text by 4 labels from polite to impolite"
19
  inputs = {'input_text': {'type': 'any', 'description': 'Enter text for assessing whether it is respectful'}}
20
  output_type = "any"
21