Giter VIP home page Giter VIP logo

adv_re's Introduction

Pointing out the Shortcomings of Relation Extraction Models with Semantically Motivated Adversarials

Read the paper: https://aclanthology.org/2024.lrec-main.1121/

See the poster we presented: poster_adversial_re_lrec-coling.pdf

Dataset

The src/create_adv_dataset.py file is used to generated aversarial dataset. To reproduce you need:

  • tacred test file in data/test.json
  • a json file of all the entities together with their types named entities_complete.json
    • this file follows the structure:
      { entity_id :
      { surface_form : entity surface form,
      type: type of the entity,
      subj_of: a list of relations in which this entity appears as subject,
      obj_of : a list of relations in which this entity appears as an object}
      ..}\

The script is invoked as follows:

python create_adv_dataset.py {N} {M}

where {N} identifies the substitution strategy implemented (1: same-role, 2: same-type, 3:diff-type, 4:masked), and {M} identifies the entity to substitute (1: subject, 2: object, 3: both).

NB: this code is not optimized, and should only be used for experimental purposes.

Cite

Please cite our paper if you use our evaluation dataset in your own work:

@inproceedings{nolano-etal-2024-pointing-shortcomings,
    title = "Pointing Out the Shortcomings of Relation Extraction Models with Semantically Motivated Adversarials",
    author = "Nolano, Gennaro  and
      Blum, Moritz  and
      Ell, Basil  and
      Cimiano, Philipp",
    editor = "Calzolari, Nicoletta  and
      Kan, Min-Yen  and
      Hoste, Veronique  and
      Lenci, Alessandro  and
      Sakti, Sakriani  and
      Xue, Nianwen",
    booktitle = "Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)",
    month = may,
    year = "2024",
    address = "Torino, Italia",
    publisher = "ELRA and ICCL",
    url = "https://aclanthology.org/2024.lrec-main.1121",
    pages = "12809--12820",
    abstract = "In recent years, large language models have achieved state-of-the-art performance across various NLP tasks. However, investigations have shown that these models tend to rely on shortcut features, leading to inaccurate predictions and causing the models to be unreliable at generalization to out-of-distribution (OOD) samples. For instance, in the context of relation extraction (RE), we would expect a model to identify the same relation independently of the entities involved in it. For example, consider the sentence {``}Leonardo da Vinci painted the Mona Lisa{''} expressing the created(Leonardo{\_}da{\_}Vinci, Mona{\_}Lisa) relation. If we substiute {``}Leonardo da Vinci{''} with {``}Barack Obama{''}, then the sentence still expresses the created relation. A robust model is supposed to detect the same relation in both cases. In this work, we describe several semantically-motivated strategies to generate adversarial examples by replacing entity mentions and investigate how state-of-the-art RE models perform under pressure. Our analyses show that the performance of these models significantly deteriorates on the modified datasets (avg. of -48.5{\%} in F1), which indicates that these models rely to a great extent on shortcuts, such as surface forms (or patterns therein) of entities, without making full use of the information present in the sentences.",
}

adv_re's People

Contributors

nolanogenn avatar moritzblum avatar

Stargazers

 avatar

Watchers

 avatar

adv_re's Issues

another paper code

Hello! I'd like to ask if the code of your another paper, "Investigating the Impact of Different Graph Representations for Relation Extraction with Graph Neural Networks", which was also published on LREC-COLING, can be open-sourced?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.