Spaces:
Running
Running
Update tools/polite_guard.py
Browse files- tools/polite_guard.py +10 -10
tools/polite_guard.py
CHANGED
@@ -4,20 +4,20 @@ from transformers import pipeline
|
|
4 |
|
5 |
|
6 |
class PoliteGuardTool(Tool):
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
Args:
|
12 |
-
input_text: Text that the user inputs into the agent and should then be evaluated.
|
13 |
-
|
14 |
-
Returns:
|
15 |
-
A classification label about whether the content is polite, somewhat polite, neutral or impolite.
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
"""
|
18 |
|
19 |
name = "polite_guard"
|
20 |
-
description = "Uses Polite guard to classify
|
21 |
inputs = {'input_text': {'type': 'any', 'description': 'Enter text for assessing whether it is respectful'}}
|
22 |
output_type = "any"
|
23 |
|
|
|
4 |
|
5 |
|
6 |
class PoliteGuardTool(Tool):
|
7 |
+
"""
|
8 |
+
Takes the input text from users and then evaluates it against Polite Guard to return specific information
|
9 |
+
about whether the content is polite.
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
Args:
|
12 |
+
input_text: Text that the user inputs into the agent and should then be evaluated.
|
13 |
+
|
14 |
+
Returns:
|
15 |
+
A classification label about whether the content is polite, somewhat polite, neutral or impolite.
|
16 |
+
|
17 |
"""
|
18 |
|
19 |
name = "polite_guard"
|
20 |
+
description = "Uses Polite guard to classify input text from polite to impolite"
|
21 |
inputs = {'input_text': {'type': 'any', 'description': 'Enter text for assessing whether it is respectful'}}
|
22 |
output_type = "any"
|
23 |
|