detect_sdg_systems {text2sdg} | R Documentation |
Detect SDGs in text
Description
detect_sdg_systems
identifies SDGs in text using multiple SDG query systems.
Usage
detect_sdg_systems(
text,
systems = c("Aurora", "Elsevier", "Auckland", "SIRIS"),
sdgs = 1:17,
output = c("features", "documents"),
verbose = TRUE
)
Arguments
text |
|
systems |
|
sdgs |
|
output |
|
verbose |
|
Details
detect_sdg_systems
implements six SDG query systems. Four systems developed by the Aurora Universities Network (see aurora_queries
), Elsevier (see elsevier_queries
), Auckland University (see elsevier_queries
), and SIRIS Academic (see siris_queries
) rely on Lucene-style Boolean queries, whereas two systems, namely SDGO (see sdgo_queries
) and SDSN (see sdsn_queries
) rely on basic keyword matching. 'detect_sdg_systems' calls dedicated detect_*
for each of the five system. Search of the queries is implemented using the search_features
function from the corpustools
package.
By default, detect_sdg_systems
runs only the Aurora, Elsevier, Auckland, and Siris query systems, as they are considerably less liberal than the SDSN and SDGO systems and therefore likely produce more valid SDG classifications. Users should be aware that systematic validations and comparison between the systems are largely lacking and that results should be interpreted with caution.
Value
The function returns a tibble
containing the SDG hits found in the vector of documents. The columns of the tibble
depend on the value of output
. Possible columns are:
- document
Index of the element in
text
where match was found. Formatted as a factor with the number of levels matching the original number of documents.- sdg
Label of the SDG found in document.
- system
The name of the query system that produced the match.
- query_id
Index of the query within the query system that produced the match.
- features
Concatenated list of words that caused the query to match.
- hit
Index of hit for a given system.
- n_hits
Number of queries that produced a hit for a given system, sdg, and document.
Examples
# run sdg detection
hits <- detect_sdg_systems(projects)
# run sdg detection with Aurora only
hits <- detect_sdg_systems(projects, systems = "Aurora")
# run sdg detection for sdg 3 only
hits <- detect_sdg_systems(projects, sdgs = 3)