Skip to content

Latest commit

 

History

History
115 lines (92 loc) · 4.16 KB

MODEL.md

File metadata and controls

115 lines (92 loc) · 4.16 KB
license base_model library_name tags model-index
apache-2.0
base_model_name
transformers
relation extraction
nlp
name results
iter-{dataset}-{model_name}
task dataset metrics
type
relation-extraction
name type
dataset
dataset
name type value
F1
f1
f1

ITER: Iterative Transformer-based Entity Recognition and Relation Extraction

This model checkpoint is part of the collection of models published alongside our paper ITER, accepted at EMNLP 2024.
To ease reproducibility and enable open research, our source code has been published on GitHub.

This model achieved an F1 score of {f1} on dataset {dataset}

Using ITER in your code

First, install ITER in your preferred environment:

pip install git+https://github.com/fleonce/iter

To use our model, refer to the following code:

from iter import {model_class}

model = {model_class}.from_pretrained("fleonce/iter-{dataset}-{model_name}")
tokenizer = model.tokenizer

encodings = tokenizer(
  "An art exhibit at the Hakawati Theatre in Arab east Jerusalem was a series of portraits of Palestinians killed in the rebellion .",
  return_tensors="pt"
)

generation_output = model.generate(
    encodings["input_ids"],
    attention_mask=encodings["attention_mask"],
)

# entities
print(generation_output.entities)

# relations between entities
print(generation_output.links)

Checkpoints

We publish checkpoints for the models performing best on the following datasets:

Reproducibility

For each dataset, we selected the best performing checkpoint out of the 5 training runs we performed during training. This model was trained with the following hyperparameters:

  • Seed: {seed}
  • Config: {config}
  • PyTorch {torch.version} with CUDA {torch.cuda} and precision {torch.precision}
  • GPU: 1 {gpu}

Varying GPU and CUDA version as well as training precision did result in slightly different end results in our tests for reproducibility.

To train this model, refer to the following command:

python3 train.py --dataset {config} --transformer {base_model_name}{precision_command} --seed {seed}
@inproceedings{citation}