A production ready pipeline for extracting and analyzing economic sentiment from textual data using established central bank and financial dictionaries.
Jupyter Notebook
2
157 commits
updated Oct 9, 2026
auto-econ-sentiment is a reproducible pipeline for measuring economic sentiment in central bank and financial text.
.txt and Markdown files, with dates parsed from filenames_net column lies in $[-1, 1]$ with zero as neutral, so methods share one scaleInstall from PyPI, adding the extras you need:
pip install auto-econ-sentiment # lexical dictionaries only
pip install 'auto-econ-sentiment[transformers]' # + Hugging Face classifiers
pip install 'auto-econ-sentiment[llm]' # + Ollama / OpenAI-compatible LLMs
Or, working from a clone of this repository:
uv sync
Run the default YAML-configured pipeline:
uv run python -m src.auto_econ_sentiment.pipeline
Or call the Python API:
from auto_econ_sentiment.pipeline import AutoEconSentiment
analyzer = AutoEconSentiment(
import_file_path="data/raw/basic_tests/monetary_policy_statement.parquet.gzip",
text_column="text",
date_column="date",
export_path="data/sentiment/basic_tests/",
)
analyzer.run(
clean_config={"tokenize": True, "stem": True},
dictionaries={"unstemmed": ["correa", "hubert", "lm", "hiv"], "stemmed": ["ap", "bn"]},
aggregation_methods=["posneg", "allwords"],
export_results=True,
)
Transformer support is optional so lexical users do not need to install torch or download Hugging Face models.
FOMC-RoBERTa (gtfintechlab/FOMC-RoBERTa) is gated on Hugging Face: request access on its model page and run hf auth login before the first run. The other example models download without an account.
uv sync --extra transformers
Then enable transformer models in params.yaml:
transformer:
enabled: true
text_column_transformer: text_clean
aggregation_methods: [bysentence]
output_schema: shares
min_sentence_chars: 20
sentence_probability_cutoff: 0.7
models:
- name: gtfintechlab/FOMC-RoBERTa
short_name: fomc
num_labels: 3
# FOMC-RoBERTa classifies stance: LABEL_0 dovish, LABEL_1 hawkish,
# LABEL_2 neutral. Hawkish maps to +1.
label_mapping:
LABEL_0: negative
LABEL_1: positive
LABEL_2: neutral
sentiment_values:
positive: 1
negative: -1
neutral: 0
The transformer examples in params.yaml show the supported model-list format, including each model's label mapping.
Transformer runs export sentiment_transformer.parquet.gzip and, for sentence-level aggregation, sentiment_transformer_sentence_probabilities.parquet.gzip, which carries each sentence's number and text next to its class probabilities.
uv sync --extra llm
Set llm.enabled: true in params.yaml and point it at a local Ollama model or any OpenAI-compatible API. See LLM Scoring for providers, prompting and output columns.
Download the CBS central bank speeches dataset and run the sentiment pipeline:
uv run python -m src.data.cb_speeches_download
uv run python -m src.data.cb_speeches_clean
Then open notebooks/demo_cb_speechs.ipynb to explore the outputs.
To cite auto-econ-sentiment itself, use the Cite this repository button on GitHub, which reads CITATION.cff. Contributions are welcome; see CONTRIBUTING.
Dataset:
Lexical dictionaries:
Transformer models:
A production ready pipeline for extracting and analyzing economic sentiment from textual data using established central bank and financial dictionaries.
Jupyter Notebook
2
157 commits
updated Oct 9, 2026
auto-econ-sentiment is a reproducible pipeline for measuring economic sentiment in central bank and financial text.
.txt and Markdown files, with dates parsed from filenames_net column lies in $[-1, 1]$ with zero as neutral, so methods share one scaleInstall from PyPI, adding the extras you need:
pip install auto-econ-sentiment # lexical dictionaries only
pip install 'auto-econ-sentiment[transformers]' # + Hugging Face classifiers
pip install 'auto-econ-sentiment[llm]' # + Ollama / OpenAI-compatible LLMs
Or, working from a clone of this repository:
uv sync
Run the default YAML-configured pipeline:
uv run python -m src.auto_econ_sentiment.pipeline
Or call the Python API:
from auto_econ_sentiment.pipeline import AutoEconSentiment
analyzer = AutoEconSentiment(
import_file_path="data/raw/basic_tests/monetary_policy_statement.parquet.gzip",
text_column="text",
date_column="date",
export_path="data/sentiment/basic_tests/",
)
analyzer.run(
clean_config={"tokenize": True, "stem": True},
dictionaries={"unstemmed": ["correa", "hubert", "lm", "hiv"], "stemmed": ["ap", "bn"]},
aggregation_methods=["posneg", "allwords"],
export_results=True,
)
Transformer support is optional so lexical users do not need to install torch or download Hugging Face models.
FOMC-RoBERTa (gtfintechlab/FOMC-RoBERTa) is gated on Hugging Face: request access on its model page and run hf auth login before the first run. The other example models download without an account.
uv sync --extra transformers
Then enable transformer models in params.yaml:
transformer:
enabled: true
text_column_transformer: text_clean
aggregation_methods: [bysentence]
output_schema: shares
min_sentence_chars: 20
sentence_probability_cutoff: 0.7
models:
- name: gtfintechlab/FOMC-RoBERTa
short_name: fomc
num_labels: 3
# FOMC-RoBERTa classifies stance: LABEL_0 dovish, LABEL_1 hawkish,
# LABEL_2 neutral. Hawkish maps to +1.
label_mapping:
LABEL_0: negative
LABEL_1: positive
LABEL_2: neutral
sentiment_values:
positive: 1
negative: -1
neutral: 0
The transformer examples in params.yaml show the supported model-list format, including each model's label mapping.
Transformer runs export sentiment_transformer.parquet.gzip and, for sentence-level aggregation, sentiment_transformer_sentence_probabilities.parquet.gzip, which carries each sentence's number and text next to its class probabilities.
uv sync --extra llm
Set llm.enabled: true in params.yaml and point it at a local Ollama model or any OpenAI-compatible API. See LLM Scoring for providers, prompting and output columns.
Download the CBS central bank speeches dataset and run the sentiment pipeline:
uv run python -m src.data.cb_speeches_download
uv run python -m src.data.cb_speeches_clean
Then open notebooks/demo_cb_speechs.ipynb to explore the outputs.
To cite auto-econ-sentiment itself, use the Cite this repository button on GitHub, which reads CITATION.cff. Contributions are welcome; see CONTRIBUTING.
Dataset:
Lexical dictionaries:
Transformer models: