added readme
Browse files
README.md
CHANGED
@@ -1,3 +1,139 @@
|
|
1 |
---
|
2 |
-
license:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license:
|
3 |
+
- cc-by-nc-sa-4.0
|
4 |
+
source_datasets:
|
5 |
+
- original
|
6 |
+
task_ids:
|
7 |
+
- word-sense-disambiguation
|
8 |
+
pretty_name: word-sense-linking-dataset
|
9 |
+
tags:
|
10 |
+
- word-sense-linking
|
11 |
+
- word-sense-disambiguation
|
12 |
+
- lexical-semantics
|
13 |
+
size_categories:
|
14 |
+
- 10K<n<100K
|
15 |
+
extra_gated_fields:
|
16 |
+
Email: text
|
17 |
+
Company: text
|
18 |
+
Country: country
|
19 |
+
I want to use this dataset for:
|
20 |
+
type: select
|
21 |
+
options:
|
22 |
+
- Research
|
23 |
+
- Education
|
24 |
+
- label: Other
|
25 |
+
value: other
|
26 |
+
I agree to use this dataset for non-commercial use ONLY: checkbox
|
27 |
+
extra_gated_heading: "Acknowledge our [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0)](https://github.com/Babelscape/WSL/wsl_data_license.txt) to access the repository"
|
28 |
+
extra_gated_description: "Our team may take 2-3 days to process your request"
|
29 |
+
extra_gated_button_content: "Acknowledge license"
|
30 |
---
|
31 |
+
---
|
32 |
+
|
33 |
+
|
34 |
+
# Word Sense Linking: Disambiguating Outside the Sandbox
|
35 |
+
|
36 |
+
[![Conference](http://img.shields.io/badge/ACL-2024-4b44ce.svg)](https://2024.aclweb.org/)
|
37 |
+
[![Paper](http://img.shields.io/badge/paper-ACL--anthology-B31B1B.svg)](https://aclanthology.org/)
|
38 |
+
[![Hugging Face Collection](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-FCD21D)](https://huggingface.co/collections/Babelscape/word-sense-linking-66ace2182bc45680964cefcb)
|
39 |
+
|
40 |
+
## Model Description
|
41 |
+
|
42 |
+
The Word Sense Linking model is designed to identify and disambiguate spans of text to their most suitable senses from a reference inventory. The annotations are provided as sense keys from WordNet, a large lexical database of English.
|
43 |
+
|
44 |
+
## Installation
|
45 |
+
|
46 |
+
Installation from PyPI:
|
47 |
+
|
48 |
+
```bash
|
49 |
+
git clone https://github.com/Babelscape/WSL
|
50 |
+
cd WSL
|
51 |
+
pip install -r requirements.txt
|
52 |
+
```
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
## Usage
|
57 |
+
|
58 |
+
WSL is composed of two main components: a retriever and a reader.
|
59 |
+
The retriever is responsible for retrieving relevant senses from a senses inventory (e.g WordNet),
|
60 |
+
while the reader is responsible for extracting spans from the input text and link them to the retrieved documents.
|
61 |
+
WSL can be used with the `from_pretrained` method to load a pre-trained pipeline.
|
62 |
+
|
63 |
+
```python
|
64 |
+
from wsl import WSL
|
65 |
+
from wsl.inference.data.objects import WSLOutput
|
66 |
+
|
67 |
+
wsl_model = WSL.from_pretrained("Babelscape/wsl-base")
|
68 |
+
relik_out: WSLOutput = wsl_model("Bus drivers drive busses for a living.")
|
69 |
+
```
|
70 |
+
|
71 |
+
WSLOutput(
|
72 |
+
text='Bus drivers drive busses for a living.',
|
73 |
+
tokens=['Bus', 'drivers', 'drive', 'busses', 'for', 'a', 'living', '.'],
|
74 |
+
id=0,
|
75 |
+
spans=[
|
76 |
+
Span(start=0, end=11, label='bus driver: someone who drives a bus', text='Bus drivers'),
|
77 |
+
Span(start=12, end=17, label='drive: operate or control a vehicle', text='drive'),
|
78 |
+
Span(start=18, end=24, label='bus: a vehicle carrying many passengers; used for public transport', text='busses'),
|
79 |
+
Span(start=31, end=37, label='living: the financial means whereby one lives', text='living')
|
80 |
+
],
|
81 |
+
triples=[],
|
82 |
+
candidates=Candidates(
|
83 |
+
candidates=[
|
84 |
+
{"text": "bus driver: someone who drives a bus", "id": "bus_driver%1:18:00::", "metadata": {}},
|
85 |
+
{"text": "driver: the operator of a motor vehicle", "id": "driver%1:18:00::", "metadata": {}},
|
86 |
+
{"text": "driver: someone who drives animals that pull a vehicle", "id": "driver%1:18:02::", "metadata": {}},
|
87 |
+
{"text": "bus: a vehicle carrying many passengers; used for public transport", "id": "bus%1:06:00::", "metadata": {}},
|
88 |
+
{"text": "living: the financial means whereby one lives", "id": "living%1:26:00::", "metadata": {}}
|
89 |
+
]
|
90 |
+
),
|
91 |
+
)
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
## Model Performance
|
96 |
+
|
97 |
+
Here you can find the performances of our model on the [WSL evaluation dataset](https://huggingface.co/datasets/Babelscape/wsl).
|
98 |
+
|
99 |
+
### Validation (SE07)
|
100 |
+
|
101 |
+
| Models | P | R | F1 |
|
102 |
+
|--------------|------|--------|--------|
|
103 |
+
| BEM_SUP | 67.6 | 40.9 | 51.0 |
|
104 |
+
| BEM_HEU | 70.8 | 51.2 | 59.4 |
|
105 |
+
| ConSeC_SUP | 76.4 | 46.5 | 57.8 |
|
106 |
+
| ConSeC_HEU | **76.7** | 55.4 | 64.3 |
|
107 |
+
| **Our Model**| 73.8 | **74.9** | **74.4** |
|
108 |
+
|
109 |
+
### Test (ALL_FULL)
|
110 |
+
|
111 |
+
| Models | P | R | F1 |
|
112 |
+
|--------------|------|--------|--------|
|
113 |
+
| BEM_SUP | 74.8 | 50.7 | 60.4 |
|
114 |
+
| BEM_HEU | 76.6 | 61.2 | 68.0 |
|
115 |
+
| ConSeC_SUP | 78.9 | 53.1 | 63.5 |
|
116 |
+
| ConSeC_HEU | **80.4** | 64.3 | 71.5 |
|
117 |
+
| **Our Model**| 75.2 | **76.7** | **75.9** |
|
118 |
+
|
119 |
+
|
120 |
+
|
121 |
+
## Additional Information
|
122 |
+
**Licensing Information**: Contents of this repository are restricted to only non-commercial research purposes under the [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/). Copyright of the dataset contents belongs to Babelscape.
|
123 |
+
|
124 |
+
## Citation Information
|
125 |
+
|
126 |
+
|
127 |
+
```bibtex
|
128 |
+
@inproceedings{bejgu-etal-2024-wsl,
|
129 |
+
title = "Word Sense Linking: Disambiguating Outside the Sandbox",
|
130 |
+
author = "Bejgu, Andrei Stefan and Barba, Edoardo and Procopio, Luigi and Fern{\'a}ndez-Castro, Alberte and Navigli, Roberto",
|
131 |
+
booktitle = "Findings of the Association for Computational Linguistics: ACL 2024",
|
132 |
+
month = aug,
|
133 |
+
year = "2024",
|
134 |
+
address = "Bangkok, Thailand",
|
135 |
+
publisher = "Association for Computational Linguistics",
|
136 |
+
}
|
137 |
+
```
|
138 |
+
|
139 |
+
**Contributions**: Thanks to [@andreim14](https://github.com/andreim14), [@edobobo](https://github.com/edobobo), [@poccio](https://github.com/poccio) and [@navigli](https://github.com/navigli) for adding this model.
|