YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Word Importance

This repository contains code snippets used for training models which are described in the paper Assessing Word Importance Using Models Trained for Semantic Tasks.

Generating scores

head -n 10 data/quora-paws-labeled-swap/processed/valid.premise | python ./scripts/masks/evaluation/generate_masks.py --model_path=./interpreters/pi/checkpoint4.ckpt | python ./scripts/masks/evaluation/aggregate_masks.py --scale --float_precision 2

Output:

What is the difference between coincidence and luck ?   0.04 0.04 0.01 0.18 0.22 1.00 0.09 0.93 0.00
How do I close a pvt ltd company in India ?     0.02 0.05 0.09 0.50 0.03 0.45 1.00 0.67 0.13 0.62 0.00
Who will win if India and China fight now without allies ?      0.29 0.16 0.58 0.44 0.67 0.09 0.94 0.82 0.68 1.00 0.91 0.00
How long could a human survive on just peanut butter and water ?        0.02 0.55 0.39 0.04 0.33 0.73 0.28 0.66 1.00 0.89 0.06 0.77 0.00
What are the importance of mathematical induction ?     0.03 0.03 0.01 0.54 0.08 0.97 1.00 0.00
What is the Sahara , and how do the average temperatures there compare to the ones in the Simpson Desert ?      0.08 0.06 0.04 0.50 0.26 0.09 0.14 0.10 0.05 0.42 0.38 0.23 0.80 0.10 0.05 0.50 0.15 0.05 1.00 0.67 0.00
What does it mean when you dream about someone you haven 't seen for a long time ? 0.03 0.08 0.07 0.14 0.21 0.09 0.83 0.36 0.15 0.11 0.51 1.00 0.30 0.14 0.03 0.78 0.24 0.00
What are some adaptations of the great white shark ?    0.03 0.04 0.09 0.79 0.06 0.02 0.14 0.67 1.00 0.00
How much app partition size does Lenovo K3 Note have ?  0.03 0.31 0.43 0.31 0.46 0.11 1.00 0.78 0.41 0.12 0.00
What is the best smartphone app ?       0.12 0.10 0.06 0.20 1.00 0.98 0.00

Training

Underlying models (NLI and PI)

./train.sh

Masks

python scripts/masks/train/run_nli_diffmask.py

Automatized installation

./setup.sh <python_path> <virtual_env_name>

Interactive Gradio App

Install gradio (pip install gradio) and run python gradio_example.py and test the models using an interactive web-based application.

CREDITS

@inproceedings{javorsky-etal-2023-assessing,
    title = "Assessing Word Importance Using Models Trained for Semantic Tasks",
    author = "Javorsk{\'y}, D{\'a}vid  and
      Bojar, Ond{\v{r}}ej  and
      Yvon, Fran{\c{c}}ois",
    booktitle = "Findings of the Association for Computational Linguistics: ACL 2023",
    month = jul,
    year = "2023",
    address = "Toronto, Canada",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2023.findings-acl.563",
    doi = "10.18653/v1/2023.findings-acl.563",
    pages = "8846--8856",
    abstract = "Many NLP tasks require to automatically identify the most significant words in a text. In this work, we derive word significance from models trained to solve semantic task: Natural Language Inference and Paraphrase Identification. Using an attribution method aimed to explain the predictions of these models, we derive importance scores for each input token. We evaluate their relevance using a so-called cross-task evaluation: Analyzing the performance of one model on an input masked according to the other model{'}s weight, we show that our method is robust with respect to the choice of the initial task. Additionally, we investigate the scores from the syntax point of view and observe interesting patterns, e.g. words closer to the root of a syntactic tree receive higher importance scores. Altogether, these observations suggest that our method can be used to identify important words in sentences without any explicit word importance labeling in training.",
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The model has no library tag.