andreim14 commited on
Commit
15beace
1 Parent(s): 19e2bd2

updated readme

Browse files
Files changed (1) hide show
  1. README.md +67 -0
README.md CHANGED
@@ -53,6 +53,73 @@ pip install -r requirements.txt
53
 
54
 
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  ## Additional Information
57
  **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.
58
 
 
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
+ candidates=Candidates(
82
+ span=[
83
+ [
84
+ [
85
+ {"text": "bus driver: someone who drives a bus", "id": "bus_driver%1:18:00::", "metadata": {}},
86
+ {"text": "driver: the operator of a motor vehicle", "id": "driver%1:18:00::", "metadata": {}},
87
+ {"text": "driver: someone who drives animals that pull a vehicle", "id": "driver%1:18:02::", "metadata": {}},
88
+ {"text": "bus: a vehicle carrying many passengers; used for public transport", "id": "bus%1:06:00::", "metadata": {}},
89
+ {"text": "living: the financial means whereby one lives", "id": "living%1:26:00::", "metadata": {}}
90
+ ]
91
+ ]
92
+ ]
93
+ ),
94
+ )
95
+
96
+
97
+ ## Model Performance
98
+
99
+ Here you can find the performances of our model on the [WSL evaluation dataset](https://huggingface.co/datasets/Babelscape/wsl).
100
+
101
+ ### Validation (SE07)
102
+
103
+ | Models | P | R | F1 |
104
+ |--------------|------|--------|--------|
105
+ | BEM_SUP | 67.6 | 40.9 | 51.0 |
106
+ | BEM_HEU | 70.8 | 51.2 | 59.4 |
107
+ | ConSeC_SUP | 76.4 | 46.5 | 57.8 |
108
+ | ConSeC_HEU | **76.7** | 55.4 | 64.3 |
109
+ | **Our Model**| 73.8 | **74.9** | **74.4** |
110
+
111
+ ### Test (ALL_FULL)
112
+
113
+ | Models | P | R | F1 |
114
+ |--------------|------|--------|--------|
115
+ | BEM_SUP | 74.8 | 50.7 | 60.4 |
116
+ | BEM_HEU | 76.6 | 61.2 | 68.0 |
117
+ | ConSeC_SUP | 78.9 | 53.1 | 63.5 |
118
+ | ConSeC_HEU | **80.4** | 64.3 | 71.5 |
119
+ | **Our Model**| 75.2 | **76.7** | **75.9** |
120
+
121
+
122
+
123
  ## Additional Information
124
  **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.
125