Skip to main content

DOI

seesus: a social, environmental, and economic sustainability classifier

seesus is a Python package that evaluates whether a textual expression aligns with the concept of sustainability as defined by the United Nations Sustainable Development Goals (SDGs). It labels a statement with the 17 SDGs as well as 169 specific targets and categorizes the statement into social, environmental, or economic sustainability. For analysis in R, please check SDGdector.

seesus currently has four main functions:

  1. Evaluating whether a statement aligns with the concept of sustainability
  2. Identifying SDGs and associated targets in a statement
  3. Classifying a statement into social, environmental, and economic sustainability
  4. Customizing match syntax

Installation

Please install seesus from PyPI by inputting the following command in your terminal:

pip install seesus

Example

Analyzing an individual sentence

from seesus import SeeSus

text1 = "We aim to contribute to the mitigation of climate change by reducing carbon emissions in the city."
result1 = SeeSus(text1)

# print a summary of the results
print(result1)

# print result on whether a statement aligns with sustainability, True or False
print(result1.sus)

# print the names of identified SDGs
print(result1.sdg)
# print the descriptions of identified SDGs
print(result1.sdg_desc)

# print the names of identified SDG targets
print(result1.target)
# print the descriptions of identified SDG targets
print(result1.target_desc)

# determine which dimension of sustainability (social, environmental, or economic) a statement belongs to
print(result1.see)

Analyzing a paragraph or a longer document

To achieve the best results, it is recommended to split a paragraph or a whole document into individual sentences (i.e., using individual sentences as the basic unit for seesus to analyze). This can be done by tools such as nltk.tokenize and re.split.

import re

# source: https://www.nyc.gov/site/planning/about/dcp-priorities/resiliency-sustainability.page
text2 = "By working with communities in the floodplain and facilitating flood-resistant building design, DCP is reducing the city’s risks to sea level rise and coastal flooding. Hurricane Sandy was a stark reminder of these risks. The City, led by the Mayor’s Office of Recovery and Resiliency (ORR), has developed a multifaceted plan for recovering from Sandy and improving the city’s resiliency–the ability of its neighborhoods, buildings and infrastructure to withstand and recover quickly from flooding and climate events. As part of this effort, DCP has initiated a series of projects to identify and implement land use and zoning changes as well as other actions needed to support the short-term recovery and long-term vitality of communities affected by Hurricane Sandy and other areas at risk of coastal flooding."

for sent in re.split(r'(?<!\w\.\w.)(?<![A-Z][a-z]\.)(?<=\.|\?)\s', text2):
    result = SeeSus(sent)
    print('"', sent, '"', sep = "")
    print("Is the sentence related to the concept of sustainability?", result.sus)
    print("Which SDGs?", result.sdg)
    print("Which SDG targets specifically?", result.target)
    print("which dimensions of sustainability?", result.see)
    print("----------------")

Customizing match syntax

# print match syntax
SeeSus.show_syntax("SDG1_general")

# customize match dyntax
SeeSus.edit_syntax("SDG1_general", "my match terms")

Please run example.ipynb to see more example usage.

Methodology

In an era of large language models, seesus chooses to use predefined regular expression patterns instead of machine learning, because this method is more transparent, replicable, and controllable. The regular expression syntax was developed for the 17 SDGs and the 169 SDG targets, including both direct and indirect matching. The accuracy of the matching syntax was manually tested, reviewed, and improved using randomly selected statements from corporate reports. Three rounds of adjustments were conducted to finalize the syntax. seesus achieves an accuracy rate of 76%, as determined by alignment with manual coding. Human intercoder agreement on the same text stands at 83%. Considering the inherent ambiguity and complexity of language, as well as the interconnected nature of the SDGs, the accuracy of seesus is rather high. Please see SDGdector for detailed information on the accuracy evaluation and manual refinement.

How to cite

Cai, M., Li, Y., Colbry, D., Frans, V. F., & Zhang, Y. (2024). seesus: a social, environmental, and economic sustainability classifier for Python. Journal of Open Source Software, 9(96), 6244. https://doi.org/10.21105/joss.06244

@article{Cai_seesus_a_social_2024,
author = {Cai, Meng and Li, Yingjie and Colbry, Dirk and Frans, Veronica F. and Zhang, Yuqian},
doi = {10.21105/joss.06244},
journal = {Journal of Open Source Software},
month = apr,
number = {96},
pages = {6244},
title = {{seesus: a social, environmental, and economic sustainability classifier for Python}},
url = {https://joss.theoj.org/papers/10.21105/joss.06244},
volume = {9},
year = {2024}
}

Maintenance

Please report any issues if you find that a matching syntax is not accurate or can be improved. We welcome contributions to enhance the classification accuracy of seesus.

Metadata

Release files for seesus 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for seesus 1.2.1
File Size Uploaded Provenance Actions
seesus-1.2.1.tar.gz 519.2 kB Without provenance Details for seesus-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for seesus 1.2.1
File Interpreter ABI Platform Actions
seesus-1.2.1-py3-none-any.whl Python 3 none any Details for seesus-1.2.1-py3-none-any.whl

Total release size: 593.8 kB

Release files / seesus-1.2.1.tar.gz

Download URL seesus-1.2.1.tar.gz
Size 519.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e272618ffa4e5d491b78de30bd88363f50c0814f840840d62202bf22ba80336f
BLAKE2b-256 checksum
How to use checksums
6758aa2476a77cebd1609ee309a1bf106b825e24ac3cde91f6ef497f2ecad766
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.3

Release files / seesus-1.2.1-py3-none-any.whl

Download URL seesus-1.2.1-py3-none-any.whl
Size 74.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa9c1ab421e1a315298092b6c956fc7984533b6d48e758375abcceb7ff2faad0
BLAKE2b-256 checksum
How to use checksums
e1dc34dc19f74d773911f3ec96bb1a4a78d0e367e18f83f82a13a42b64128caf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.3

Security for seesus 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page