File size: 4,445 Bytes
ddfcbd9
65f0d36
4cdff69
65f0d36
 
 
 
ddfcbd9
 
65f0d36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4cdff69
 
 
 
 
 
 
 
 
 
 
 
65f0d36
 
 
 
 
6bffade
 
65f0d36
 
 
4cdff69
 
 
65f0d36
 
 
 
6bffade
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
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](https://github.com/snowood1/ConfliBERT)

## Paper
[ConfliBERT: A Pre-trained Language Model for Political Conflict and Violence](https://aclanthology.org/2022.naacl-main.395/)

## 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 Variants
ConfliBERT has several variants, each fine-tuned on specific datasets to cater to different use cases within the domain of political conflict and violence:
- **ConfliBERT-scr-uncased-BBC_News**
- **ConfliBERT-cont-cased-BBC_News**
- **ConfliBERT-scr-uncased-20news**
- **ConfliBERT-cont-cased-20news**
- **ConfliBERT-re3d-ner** (Token Classification)
- **ConfliBERT-indiapolice-events-multilabel** (Text Classification)
- **ConfliBERT-named-entity-recognition** (Token Classification)
- **ConfliBERT-insight-crime-multilabel** (Text Classification)

These models are fine-tuned versions intended for specific text classification and named entity recognition tasks, enhancing their effectiveness in practical applications.

## 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
To load and use a specific ConfliBERT model variant, you can follow these steps using the transformers library:

```python
from transformers import AutoTokenizer, AutoModelForMaskedLM

# Example for using the ConfliBERT-scr-uncased-BBC_News model
tokenizer = AutoTokenizer.from_pretrained("eventdata-utd/ConfliBERT-scr-uncased-BBC_News")
model = AutoModelForMaskedLM.from_pretrained("eventdata-utd/ConfliBERT-scr-uncased-BBC_News")

# 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)
```

## Limitations and Bias
While ConfliBERT is pretrained on data related to political conflicts, it may inherit biases present in its training corpus or exhibit limitations in understanding contexts outside its trained domain. As with any model, users should evaluate its fairness and suitability for their specific applications.

## Training Data
ConfliBERT was trained on a specialized corpus of 33 GB of texts about politics and conflict, curated to provide comprehensive coverage of its intended application domain. This corpus includes diverse sources such as news articles, reports, and books related to global political events and conflicts.

## Training Procedure
The model was pretrained using masked language modeling and next sentence prediction tasks, following procedures similar to those used for BERT. Specific training details, including configurations and scripts, are available in the model's GitHub repository.

## Evaluation Results
ConfliBERT has shown improved performance on several benchmarks relevant to its domain compared to general-purpose language models like BERT, especially in tasks that require understanding of political contexts.

## Citation
If you use ConfliBERT in your research, please cite the following paper:
```bibtex
@inproceedings{hu2022conflibert,
  title={ConfliBERT: A Pre-trained Language Model for Political Conflict and Violence},
  author={Hu, Yibo and Hosseini, MohammadSaleh and Parolin, Erick Skorupa and Osorio, Javier and Khan, Latifur and Brandt, Patrick and D’Orazio, Vito},
  booktitle={Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies},
  pages={5469--5482},
  year={2022}
}
```