This repository contains a minimal utility for converting firm activity descriptions to ISIC Rev.4 codes.
- Install the
openaipackage and set yourOPENAI_API_KEYenvironment variable if you want to use ChatGPT for classification. - Run the classifier on a CSV file:
python isic_classifier.py input.csv output.csv --gptThis will read input.csv which must contain a column d1a1x with the activity description. The classified code will be written to output.csv.
Without the --gpt flag, a simple token overlap classifier is used instead of the ChatGPT API.
Run the automated tests with:
This repository provides a simple tool for mapping free-text firm activity descriptions to four digit ISIC Rev.4 codes.
Install the required packages:
pip install streamlit pandaspytest -qThe classifier can process a CSV file containing a column named d1a1x:
python isic_classifier.py input.csv output.csvThe output CSV will contain the predicted code and a match score for each row.
A basic Streamlit interface is provided for classifying a single description or uploading a CSV file.
streamlit run app.pyThe app allows you to download the classified results as a new CSV file.
This repository contains a minimal utility to map free-text business activity descriptions to ISIC Rev.4 four digit codes.
isic_classifier.py– script and library for classifying activities.isic.csv– small sample of ISIC codes used for matching.sample_activities.csv– example CSV with a columnd1a1xcontaining activity descriptions.test_classifier.py– simple pytest verifying classification of sample data.
python isic_classifier.py input.csv output.csvThe input CSV must contain a column named d1a1x. The output file will contain the original data along with isic_code and match_score columns.
To classify the provided sample activities, run:
python isic_classifier.py sample_activities.csv classified.csvpytest -qThe included isic.csv contains only a small subset of ISIC Rev.4 codes for demonstration purposes. For production use, replace it with the full ISIC dataset.