PoliBERTweet
1.0.0
แบบจำลองภาษาที่ใช้หม้อแปลงมาก่อนได้รับการฝึกอบรมล่วงหน้าเกี่ยวกับข้อมูล Twitter ที่เกี่ยวข้องกับการเมืองจำนวนมาก (ทวีต 83M) repo นี้เป็นทรัพยากรอย่างเป็นทางการของกระดาษต่อไปนี้
ชุดข้อมูลสำหรับงานประเมินผลที่นำเสนอในบทความของเรามีอยู่ด้านล่าง
ทุกรุ่นถูกอัปโหลดไปยัง HuggingFace ของฉัน? ดังนั้นคุณสามารถโหลดโมเดลด้วย รหัสเพียงสามบรรทัด !!!
เราทดสอบใน pytorch v1.10.2 และ transformers v4.18.0
from transformers import AutoModel , AutoTokenizer , pipeline
import torch
# Choose GPU if available
device = torch . device ( "cuda" if torch . cuda . is_available () else "cpu" )
# Select mode path here
pretrained_LM_path = "kornosk/polibertweet-mlm"
# Load model
tokenizer = AutoTokenizer . from_pretrained ( pretrained_LM_path )
model = AutoModel . from_pretrained ( pretrained_LM_path ) # Fill mask
example = "Trump is the <mask> of USA"
fill_mask = pipeline ( 'fill-mask' , model = pretrained_LM_path , tokenizer = tokenizer )
outputs = fill_mask ( example )
print ( outputs ) # See embeddings
inputs = tokenizer ( example , return_tensors = "pt" )
outputs = model ( ** inputs )
print ( outputs )
# OR you can use this model to train on your downstream task!
# please consider citing our paper if you feel this is useful :)ดูรายละเอียดในเอกสาร HuggingFace
หากคุณรู้สึกว่ากระดาษและทรัพยากรของเรามีประโยชน์โปรดพิจารณาอ้างถึงงานของเรา!
@inproceedings { kawintiranon2022polibertweet ,
title = { {P}oli{BERT}weet: A Pre-trained Language Model for Analyzing Political Content on {T}witter } ,
author = { Kawintiranon, Kornraphop and Singh, Lisa } ,
booktitle = { Proceedings of the Language Resources and Evaluation Conference (LREC) } ,
year = { 2022 } ,
pages = { 7360--7367 } ,
publisher = { European Language Resources Association } ,
url = { https://aclanthology.org/2022.lrec-1.801 }
}สร้างปัญหาที่นี่หากคุณมีปัญหาในการโหลดรูปแบบหรือชุดข้อมูล