README / README.md
shreyasmeher's picture
Update README.md
65f0d36 verified
|
raw
history blame
2.34 kB
metadata
title: ConfliBERT
emoji: 🏛️
colorFrom: red
colorTo: indigo
sdk: streamlit
pinned: true

Model Name

ConfliBERT

Developers

Yibo Hu, MohammadSaleh Hosseini, Erick Skorupa Parolin, Javier Osorio, Latifur Khan, Patrick Brandt, Vito D’Orazio

Released

2022, NAACL 2022 conference

Repository

GitHub Repository

Paper

ConfliBERT: A Pre-trained Language Model for Political Conflict and Violence

Model Description

ConfliBERT is a transformer model pretrained on a vast corpus of texts related to political conflict and violence. This model is based on the BERT architecture and is specialized for analyzing texts within its domain, using masked language modeling (MLM) and next sentence prediction (NSP) as its main pretraining objectives. It is designed to improve performance in tasks like sentiment analysis, event extraction, and entity recognition for texts dealing with political subjects.

Model Variations

  • ConfliBERT-scr-uncased: Pretrained from scratch with a custom uncased vocabulary.
  • ConfliBERT-scr-cased: Pretrained from scratch with a custom cased vocabulary.
  • ConfliBERT-cont-uncased: Continual pretraining from BERT's original uncased vocabulary.
  • ConfliBERT-cont-cased: Continual pretraining from BERT's original cased vocabulary.

Intended Uses & Limitations

ConfliBERT is intended for use in tasks related to its training domain (political conflict and violence). It can be used for masked language modeling or next sentence prediction and is particularly useful when fine-tuned on downstream tasks such as classification or information extraction in political contexts.

How to Use

ConfliBERT can be loaded and used directly with pipelines for masked language modeling or integrated into custom applications for more specific tasks:

from transformers import AutoTokenizer, AutoModelForMaskedLM

tokenizer = AutoTokenizer.from_pretrained("snowood1/ConfliBERT-scr-uncased", use_auth_token=True)
model = AutoModelForMaskedLM.from_pretrained("snowood1/ConfliBERT-scr-uncased", use_auth_token=True)

# Example of usage
text = "The government of [MASK] was overthrown in a coup."
input_ids = tokenizer.encode(text, return_tensors='pt')
outputs = model(input_ids)