Spaces:
No application file
No application file
shreyasmeher
commited on
Commit
•
e7b46ca
1
Parent(s):
475d57c
Update README.md
Browse files
README.md
CHANGED
@@ -51,10 +51,20 @@ from transformers import AutoTokenizer, AutoModelForMaskedLM
|
|
51 |
tokenizer = AutoTokenizer.from_pretrained("eventdata-utd/ConfliBERT-scr-uncased-BBC_News")
|
52 |
model = AutoModelForMaskedLM.from_pretrained("eventdata-utd/ConfliBERT-scr-uncased-BBC_News")
|
53 |
|
54 |
-
# Example of usage
|
55 |
text = "The government of [MASK] was overthrown in a coup."
|
56 |
input_ids = tokenizer.encode(text, return_tensors='pt')
|
57 |
outputs = model(input_ids)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
```
|
59 |
|
60 |
## Limitations and Bias
|
|
|
51 |
tokenizer = AutoTokenizer.from_pretrained("eventdata-utd/ConfliBERT-scr-uncased-BBC_News")
|
52 |
model = AutoModelForMaskedLM.from_pretrained("eventdata-utd/ConfliBERT-scr-uncased-BBC_News")
|
53 |
|
54 |
+
# Example of usage for masking task
|
55 |
text = "The government of [MASK] was overthrown in a coup."
|
56 |
input_ids = tokenizer.encode(text, return_tensors='pt')
|
57 |
outputs = model(input_ids)
|
58 |
+
|
59 |
+
# Example for using the ConfliBERT-cont-cased-20news model
|
60 |
+
tokenizer = AutoTokenizer.from_pretrained("eventdata-utd/ConfliBERT-cont-cased-20news")
|
61 |
+
model = AutoModelForMaskedLM.from_pretrained("eventdata-utd/ConfliBERT-cont-cased-20news")
|
62 |
+
|
63 |
+
# Example of usage for binary classification task
|
64 |
+
text = "The President of Brunei asked for protestors to remain peaceful during the upcoming Independence Day holiday."
|
65 |
+
input_ids = tokenizer.encode(text, return_tensors='pt')
|
66 |
+
outputs = model(input_ids)
|
67 |
+
|
68 |
```
|
69 |
|
70 |
## Limitations and Bias
|