Skip to main content

Crate finvader

Crate finvader 

Source
Expand description

§finvader

Finance-aware sentiment analysis for Rust, built on top of the VADER algorithm (vader-sentimental).

Generic VADER was tuned for social media and misreads financial text in two directions: it misses finance-specific sentiment (“beats expectations”, “cuts guidance” score near zero), and it misfires on finance-neutral words (“gross margin”, “cancer drug”, “debt refinancing” score negative). finvader fixes both:

  • a financial lexicon of single words and multi-word phrases with valences calibrated for market news,
  • neutral overrides that mask finance-neutral words before the base VADER pass,
  • negation and booster handling for financial terms (“failed to beat expectations” flips), and magnitude amplification (“beat by 23%”),
  • catalyst detection for episodic-pivot events (FDA approvals, contract awards, index inclusions, bankruptcy filings).
use finvader::{FinVader, Signal};

let fv = FinVader::new();
let s = fv.analyze("Acme beats Q3 expectations and raises full-year guidance");
assert!(s.compound > 0.5);
assert_eq!(s.signal, Signal::StronglyBullish);

Structs§

Catalyst
A detected catalytic event.
FinVader
Finance-aware sentiment analyzer. Construction loads the lexicons once; reuse one instance across calls (it is Send + Sync).
FinancialSentiment
Result of analyzing one piece of text.
Trigger
A lexicon term that contributed to the financial score.

Enums§

Signal
Discrete trading signal derived from the compound score.