File size: 1,369 Bytes
1faabb2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Copyright 2026 Cobuild Tech Private Limited
# SPDX-License-Identifier: Apache-2.0
"""Run from the model folder:  python example.py   (every company and passage below is invented)"""
from cbx_esg import ESGClassifier

clf = ESGClassifier(".")
passages = [
    "During 2025 Larkspur Industrial reduced its Scope 1 and Scope 2 greenhouse gas emissions by 18 percent "
    "compared with its 2019 baseline, mainly by switching two smelting lines to electric furnaces and buying "
    "renewable electricity for its European plants. The Board's Sustainability Committee reviews progress against "
    "the 2030 target each quarter.",
    "Fenwick Foods agreed to pay a civil penalty of $2.4 million to resolve allegations that it failed to report "
    "injuries at its packaging plant and exposed workers to unguarded machinery. The company also agreed to hire an "
    "independent safety consultant and to retrain line supervisors.",
    "Our principal executive offices are located at 400 Harbor Street, Suite 12, and our telephone number is "
    "(555) 010-2300. Our common stock is listed on the exchange under the symbol \"HRBR\".",
]
for text, r in zip(passages, clf.classify(passages)):
    names = ", ".join(f"{t} {clf.topic_name(t)}" for t in r["topics"]) or "no ESG topic (N00)"
    print(f"{names} | primary {r['primary']} | orientation {r['orientation']}")