evaluation
Evaluation module.
This module provides a method to evaluate the performance of a search string generated with SeSG.
EvaluationFactory
dataclass
Evaluation factory.
To evaluate a search string, use the evaluate method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gs |
list[Study]
|
Gold standard. |
required |
qgs |
list[Study]
|
Quasi gold standard. |
required |
Source code in src/sesg/evaluation/evaluation_factory.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
directed_adjacency_list: dict[int, list[int]]
property
cached
Directed adjacency list of the GS.
processed_gs_titles: list[str]
property
cached
Preprocessed GS titles.
processed_qgs_titles: list[str]
property
cached
Preprocessed QGS titles.
studies_dict: dict[int, Study]
property
cached
Dictionary mapping a study ID to a study.
undirected_adjacency_list: dict[int, list[int]]
property
cached
Undirected adjacency list of the GS.
evaluate(scopus_results)
Evaluate the performance of a search string using the results returned by Scopus.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scopus_results |
list[str]
|
List with the titles of the studies returned by Scopus. |
required |
Returns:
| Type | Description |
|---|---|
Evaluation
|
An object with the evaluation metrics. |
Source code in src/sesg/evaluation/evaluation_factory.py
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
get_gs_in_bsb(gs_in_scopus)
Get GS studies that were found via backward snowballing.
Source code in src/sesg/evaluation/evaluation_factory.py
289 290 291 292 293 294 295 296 297 298 299 | |
get_gs_in_sb(gs_in_scopus)
Get GS studies that were found via backward or forward snowballing.
Source code in src/sesg/evaluation/evaluation_factory.py
301 302 303 304 305 306 307 308 309 310 311 | |
get_gs_in_scopus(processed_scopus_titles)
Get GS studies that were found in Scopus.
Source code in src/sesg/evaluation/evaluation_factory.py
277 278 279 280 281 282 283 284 285 286 287 | |
get_qgs_in_scopus(processed_scopus_titles)
Get QGS studies that were found in Scopus.
Source code in src/sesg/evaluation/evaluation_factory.py
265 266 267 268 269 270 271 272 273 274 275 | |
Study
dataclass
Represents a study.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id |
int
|
Study's ID. |
required |
title |
str
|
Study's title. |
required |
references |
list[Study]
|
Study's references. If None, defaults to an empty list. |
field(default_factory=list)
|
Source code in src/sesg/evaluation/evaluation_factory.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
processed_title
property
cached
Preprocessed title.
create_citation_graph(*, adjacency_list, studies_titles, start_set=None)
Creates a graphviz.Digraph instance with the following properties.
- Filled nodes: nodes on the start set.
- Bold nodes: nodes found via snowballing on the start set.
- Dashed nodes: nodes that are not on the start set, neither were found via snowballing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
adjacency_list |
dict[int, list[int]]
|
A dict mapping a study ID to it's neighbors (citations/references). |
required |
studies_titles |
list[str]
|
A dict mapping a study ID to it's title. |
required |
start_set |
Optional[list[int]]
|
Start set. List of study IDs. If None, will default to an empty list. |
None
|
Returns:
| Type | Description |
|---|---|
Digraph
|
A graphviz dot object with the said properties. |
Examples:
>>> adjacency_list = {1: [2], 2: [3, 4], 3: [4, 5], 4: [6], 5: [7]}
>>> tooltips = {1: "Paper 1", 2: "Paper 2", 3: "Paper 3", 4: "Paper 4", 5: "Paper 5", 6: "Paper 6", 7: "Paper 7"}
>>> results_list = [1, 3]
>>> g = create_citation_graph(adjacency_list=adjacency_list, tooltips=tooltips, results_list=results_list)
>>> g.render(
... filename="graph.dot",
... directory="out",
... format="pdf",
... )
Source code in src/sesg/evaluation/graph.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |