a strongly typed wrapper for google's perspective api
pip install perspectiveapi
from perspective import Perspective, Attribute
p = Perspective(key="...")
async def main():
s = await p.score(
"your message here", attributes=(Attribute.FLIRTATION, Attribute.SEVERE_TOXICITY)
)
print(s.flirtation)
print(s.severe_toxicity)
from perspective.blocking import Perspective, Attribute
p = Perspective(key="...")
def main():
s = p.score(
"your message here", attributes=(Attribute.FLIRTATION, Attribute.SEVERE_TOXICITY)
)
print(s.flirtation)
print(s.severe_toxicity)