File size: 1,591 Bytes
8cb570b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language: 
  - en
thumbnail: https://raw.githubusercontent.com/altsoph/misc/main/imgs/aer_logo.png
tags:
- nlp
- roberta
- xlmr
- classifier
- aer
- narrative
- entity recognition
license: mit
---

An XLM-Roberta based language model fine-tuned for AER (Actionable Entities Recognition) -- recognition of entities that protagonists could interact with for further plot development.

We used 5K+ locations from 1K interactive text fiction games and extracted textual descriptions of locations and lists of actionable entities in them. 
The resulting [BAER dataset is available here](https://github.com/altsoph/BAER). Then we used it to train this model.

The example of usage:
```py
from transformers import AutoModelForTokenClassification, AutoTokenizer, pipeline

MODEL_NAME = "altsoph/xlmr-AER"

text = """This bedroom is extremely spare, with dirty laundry scattered haphazardly all over the floor. Cleaner clothing can be found in the dresser.
A bathroom lies to the south, while a door to the east leads to the living room."""

model = AutoModelForTokenClassification.from_pretrained(MODEL_NAME)
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)

pipe = pipeline("token-classification", model=model, tokenizer=tokenizer, aggregation_strategy="simple", ignore_labels=['O','PAD'])
entities = pipe(text)

print(entities)
```


If you use the model, please cite the following:

```
@inproceedings{Tikhonov-etal-2022-AER,
    title = "Actionable Entities Recognition Benchmark for Interactive Fiction",
    author = "Alexey Tikhonov and Ivan P. Yamshchikov",
    year = "2022",
}
```