영어 버전 문서로 돌아가기증오성, 욕설, 모독적인 콘텐츠 감지
증오성, 욕설, 모독적인 콘텐츠 감지
마지막 업데이트 날짜: 2024년 7월 25일
그만큼 Watson 자연어 처리 HAP 탐지는 증오, 모욕 및 모독적인 콘텐츠를 식별합니다(HAP
내용) 텍스트로.
블록 이름
classification_transformer_en_slate.38m.hap
지원되는 언어
HAP 감지 블록은 영어 텍스트에서만 HAP를 감지할 수 있습니다.
기능
이 블록을 사용하여 텍스트에서 증오, 모욕 또는 모독적인 콘텐츠를 탐지합니다.
다른 블록에 대한 종속성
없음
코드 샘플
import watson_nlp
# Load the HAP model
hap_model = watson_nlp.load('classification_transformer_en_slate.38m.hap')
# Run the HAP model and print the result
hap_prediction = hap_model.run('Spiders are disgusting.')
print(hap_prediction)
코드 샘플의 출력
{
"classes": [
{
"class_name": "has_HAP",
"confidence": 0.9629989862442017
},
{
"class_name": "no_HAP",
"confidence": 0.03700101003050804
}
],
"producer_id": {
"name": "Transformer-based Text Classifier",
"version": "0.0.1"
}
}
상위 주제: Watson 자연어 처리 작업 카탈로그