Sentiment Analysis to Evaluate for Psychological Ambivalence in Large Bodies of Narrative Text

Avery Richards

2021


The following code explores a preliminary sentiment analysis of semi-structured interview transcriptions. A case use application of this method could support human exploration of semi-structured narrative text for evidence of psychological ambivalence. All data is completely ambiguated and de-identified for the purpose of this example.

Text is now tokenized with a transcript ID and answer number linked to each token. We repeat this process with three other transcripts.

The AFINN Sentiment Lexicon is a list of English terms with a valence score between (-5 to 5). AFINN sentiment lexicon is created by Finn Årup Nielsen, and distributed under the Open Database License (ODbL) v1.0.

Here we can evaluate an interviee response as a whole, after filtering for tokens that are present in the afinn sentiment lexicon. The construct of psychological ambivalence would be expressed here as question responses with both high and low values together.

If qualitative analysis and exploration of these specific questions interested us, we could follow up with a close reading of the question and interviewee response.

Looking a several interviews with this method is helpful, but also highlights limitations, future directions, and next steps to be employed.

We notice at once the different length of each interview. A more formal analysis would need to align questions to answers in a data cleaning or post-hoc wrangling process, allowing for aggregate comparison across individual responses to specific questions.

As we are observing open ended narrative text, perhaps the frequency of words in a participant repsonse is related to the intensity of the ambivalency score. Developing a scale value with something like afinn_words_per_answer / tokens_per_answer would help standardize ambivalence as we hope to measure the construct.

The tokens we have used are single words, where n-gram tokens of two or more words could very well help us contextualize and control for negative association with words. “I’m hungry” vs. “I’m not hungry”, for example.

Finally the sentiment dictionary of choice. An AFINN lexicon is useful for quantifying sentiment through a numeric scale, exploring and comparing results between different sentiment dictionaries may add depth to the analysis and more accurate expression of the construct we seek to evaluate for.

Questions, comments, concerns? Feel free to contact me: . Any sort of feedback is welcome!