Spaces:
Running
Running
Update tools/polite_guard.py
Browse files- 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 |
-
|
|
|
|
|
8 |
Args:
|
9 |
-
input_text:
|
|
|
|
|
|
|
10 |
"""
|
|
|
11 |
name = "polite_guard"
|
12 |
-
description = "
|
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 |
|