financial-text-nlp
Skill63 starsChanged 5 months agoMITView on GitHub
Measure sentiment and stance in financial and economic text — 10-K/10-Q MD&A, earnings calls, Fed/ECB communications — using FinBERT, FinVADER, and domain models. Use for accounting and finance NLP features, not general chat sentiment.
In this repository47 other files it gives its agents.
- install/claude.mdCLAUDE.md
- daskSkill
- econ-visualizationSkill
- geopandasSkill
- matplotlibSkill
- plotlySkill
- polarsSkill
- pymc-bayesian-modelingSkill
- scikit-learnSkill
- seabornSkill
- statistical-analysisSkill
- statsmodelsSkill
- pyfixestSkill
- python-panel-dataSkill
- r-econometricsSkill
- stata-data-cleaningSkill
- stata-regressionSkill
- wrdsSkill
- api-data-fetcherSkill
- citation-managementSkill
- datacommons-clientSkill
- exploratory-data-analysisSkill
- literature-reviewSkill
- lit-review-assistantSkill
- openalex-apiSkill
- paper-2-acfin-webSkill
- research-ideationSkill
- research-lookupSkill
- sec-edgarSkill
- web-scrapeSkill
- academic-paper-writerSkill
- beamer-presentationSkill
- econ-humanizer-plusSkill
- econ-humanizerSkill
- econ-refereeSkill
- econ-slidesSkill
- econ-writeSkill
- econ-writing-plusSkill
- hypothesis-generationSkill
- latex-econ-modelSkill
- latex-postersSkill
- latex-tablesSkill
- paper-pdfSkill
- peer-reviewSkill
- scholar-evaluationSkill
- scientific-critical-thinkingSkill
- venue-templatesSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Train/test hygiene: do not tune thresholds on the same sample used for causal estimates
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Barrios Skills — John Barrios's curated workflow for economists and accountants. Prioritize reproducible empirical work, clear identification language, and journal-ready output.
Financial & economic text NLP
When to use
- Tone of MD&A, risk factors, 8-K text, or ESG/boilerplate sections
- Earnings-call transcripts (prepare/Q&A separately when possible)
- Central-bank or supervisory communications (hawkish/dovish stance)
- Building panel covariates (firm–year sentiment) for regressions in
pyfixestor Stata
Not for: casual product reviews or generic Twitter sentiment without a finance lexicon/model.
Tool map
| Task | Tool | Notes |
| General financial tone | FinBERT (ProsusAI) | Sentence/chunk classification: positive/negative/neutral |
| Lexicon baseline | FinVADER | Fast, transparent; good robustness check |
| Central-bank stance | CentralBankRoBERTa, WorldCentralBanks | Domain labels ≠ FinBERT polarity |
| Econ NER / domain LM | EconBERTa | Entity/paper domain — not a drop-in sentiment score |
| Document → text | sec-edgar, markitdown/Docling | Get clean text before scoring |
Iron law: define the unit and the label
- Unit of analysis: sentence, paragraph, section, or full document (document scores need aggregation rules)
- Label meaning: polarity ≠ hawkishness ≠ forward-looking statements
- Train/test hygiene: do not tune thresholds on the same sample used for causal estimates
- Inspect: print 10 scored excerpts before merging to Compustat
Minimal FinBERT pattern
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_id = "ProsusAI/finbert"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
def score_texts(texts: list[str], max_length: int = 256):
inputs = tokenizer(
texts, padding=True, truncation=True, max_length=max_length, return_tensors="pt"
)
with torch.no_grad():
probs = torch.nn.functional.softmax(model(**inputs).logits, dim=-1)
# labels: positive, negative, neutral (confirm order via model.config.id2label)
return probsAggregate to firm–year with an explicit rule (mean of sentence scores; or net positivity = pos − neg). Document the rule in the paper.
Accounting / finance research notes
- Boilerplate: length and legalese dilute tone — consider section fixed effects or residuals
- Attribution: link scores to accession IDs / transcript IDs for replication
- Identification: sentiment as outcome vs covariate vs instrument — state which; NLP error is measurement error
- Robustness: report FinBERT + lexicon (FinVADER) or alternative chunking
Checklist
- Text source and cleaning steps logged
- Model id + revision pinned
- Aggregation rule written down
- Hand-checked excerpts saved
- Merge keys to firm identifiers validated (CIK / gvkey / ticker map)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

