File size: 1,360 Bytes
f3a3874
f98cf20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f3a3874
f98cf20
 
 
 
e70afe4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language: en
datasets:
- squad_v2
license: cc-by-4.0
model-index:
- name: plm_qa
  results:
  - task:
      type: question-answering
      name: Question Answering
    dataset:
      name: squad_v2
      type: squad_v2
      config: squad_v2
      split: validation
    metrics:
    - name: Exact Match
      type: exact_match
      value: 0
      verified: false
    - name: F1
      type: f1
      value: 0
      verified: false
    - name: total
      type: total
      value: 11869
      verified: false
---

# roberta-base for QA finetuned over community safety domain data

We fine-tuned the roBERTa-based model (https://huggingface.co./deepset/roberta-base-squad2) over LiveSafe community safety dialogue data for event argument extraction with the objective of question-answering. 


### Using model in Transformers
```python
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
model_name = "yirenl2/plm_qa"
# a) Get predictions
nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
QA_input = {
    'question': 'What is the location of the incident?',
    'context': 'I was attacked by someone in front of the bus station.'
}
res = nlp(QA_input)
# b) Load model & tokenizer
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
```