xlmr-AER / README.md
altsoph's picture
Create README.md
8cb570b
---
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",
}
```