#nlp #text #traits #analysis #gender #age #lexica

bin+lib ragegun

Performs lexica based analysis on text (i.e. age, gender, PERMA, OCEAN personality traits, ..)

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

#800 in Text processing

Download history 22/week @ 2024-02-22 70/week @ 2024-02-29

92 downloads per month

MIT and LGPL-3.0

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

Dependencies

~9–12MB
~185K SLoC