4 releases
0.2.2 | Nov 26, 2022 |
---|---|
0.2.1 | Nov 26, 2022 |
0.2.0 | Nov 26, 2022 |
0.1.0 | Nov 25, 2022 |
#649 in Text processing
56KB
1.5K
SLoC
ragegun
Lexica based text analysis.
As crates.io is a pain in the ass, this module will download the lexica from GitHub at build time.
API
Age (default feature, age)
mod ragegun;
fn main() {
let rg = ragegun::RageGun::new("foo");
dbg!(rg.age()); // value like 30.00
}
Gender (default feature, gender)
mod ragegun;
fn main() {
let rg = ragegun::RageGun::new("foo");
rg.gender() // value like GenderInterpretation::Female
}
Distress (default feature, distress)
mod ragegun;
fn main() {
let rg = ragegun::RageGun::new("foo");
dbg!(rg.distress()); // value like 1.00
}
PERMA (default feature, perma)
mod ragegun;
fn main() {
let rg = ragegun::RageGun::new("foo");
dbg!(rg.perma());
// PERMAAnalysis {
// positive_emotion: Negative,
// engagement: Negative,
// relationships: Postive,
// meaning: Negative,
// accomplishment: Negative,
// }
}
EmoLex (emolex_all_languages, 20MB+)
mod ragegun;
fn main() {
let rg = ragegun::RageGun::new("foo");
dbg!(rg.emolex_all_languages());
// EmoLexEmotions {
// anger: Neutral,
// anticipation: Neutral,
// disgust: Neutral,
// fear: Neutral,
// joy: Neutral,
// negative: Neutral,
// positive: Neutral,
// sadness: Neutral,
// surprise: Neutral,
// trust: Neutral,
// }
}
EmoLex (emolex_english, ~2MB)
mod ragegun;
fn main() {
let rg = ragegun::RageGun::new("foo");
dbg!(rg.emolex_english());
// EmoLexEmotions {
// anger: Neutral,
// anticipation: Neutral,
// disgust: Neutral,
// fear: Neutral,
// joy: Neutral,
// negative: Neutral,
// positive: Neutral,
// sadness: Neutral,
// surprise: Neutral,
// trust: Neutral,
// }
}
References
Age & gender prediction
Personal distress prediction
Prospection Lexicon: Temporal Orientation
Dark Triad
Empathic Concern
EmoLex / NRC Word-Emotion Association Lexicon
Affect Intensity / NRC Emotion Intensity Lexicon
NRC Valence, Arousal, Dominance Lexicon
PERMA (Positive Emotions, Engagement, Relationships, Meaning, Accomplishment)
Sources
- WWBP (Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported)
- NRC Word-Emotion Association Lexicon (EmoLex)
- NRC Emotion Intensity Lexicon (NRC-EIL)
- NRC Valence, Arousal, and Dominance (NRC-VAD)
Dependencies
~9–12MB
~183K SLoC