ที่เก็บนี้มีรหัสของกระดาษ ที่เคารพหรือเป็นพิษ? การใช้การเรียนรู้แบบไม่มีการยิงกับแบบจำลองภาษาเพื่อตรวจจับคำพูดแสดงความเกลียดชัง ที่ยอมรับในการประชุมเชิงปฏิบัติการครั้งที่ 7 เกี่ยวกับการละเมิดออนไลน์และอันตราย (WOAH) ที่ ACL 2023
Flor Miriam Plaza-Del-Arco • Debora Nozza • Dirk Hovy •
รหัสมาจาก HuggingFace และอนุญาตให้ใบอนุญาตของเราเป็นใบอนุญาต MIT
สำหรับข้อ จำกัด ของโมเดลอาจนำไปใช้กับข้อมูล (ซึ่งได้มาจากชุดข้อมูลที่มีอยู่) หรือ Twitter (แหล่งข้อมูลหลัก) เราอ้างอิงผู้ใช้ไปยังใบอนุญาตดั้งเดิมที่มาพร้อมกับแต่ละชุดข้อมูลและกฎระเบียบ Twitter
ในการใช้ LMS ENCODER คุณสามารถนำเข้าโมดูล prompting
จาก encoder_lms
:
from encoder_lms import prompting
prompt_template = "This text is"
verb_h = "toxic" # verbalizer for hate speech class
verb_nh = "respectful" # verbalizer for non-hate speech class
enc_lms = prompting("deberta-base") # Models: roberta-base, roberta-large, bert, deberta-base, deberta-large, xlm-roberta
# The input can be a dataframe, a text or a list of texts
enc_lms.predict(prompt_template, verb_h, verb_nh, ["Shut your dumbass up bitch we all know you a hoe", "My lovely cat"])
>> ["hate", "non-hate"]
ในการใช้คำสั่ง LMS ที่ปรับแต่งได้คุณสามารถนำเข้าโมดูล prompting
จาก instruction_fine_tuned_lms
:
from instruction_fine_tuned_lms import prompting
prompt_template = "Classify this text as hate or non-hate. Text:"
output_indicator = "Answer:"
inst_lms = prompting("flant5") # Models: flant5, mt0
# The input can be a dataframe, a text or a list of texts
inst_lms.predict(prompt_template, output_indicator, ["Shut your dumbass up bitch we all know you a hoe", "My lovely cat"])
>> ["hate", "non-hate"]
หมายเหตุ: ตัวอย่าง (ความเกลียดชัง) ที่ให้มาจากคลังคำพูดแสดงความเกลียดชังและไม่ได้สร้างขึ้นโดยผู้เขียนของที่เก็บนี้