The Persuasive Text Analyzer is a web application that takes in a piece of argumentative text, such as from a panel discussion or a debate, and uses text analytics to determine how persuasive it is based on Aristotle’s three modes of persuasion: Pathos (emotional connection), Logos (logical reasoning), and Ethos (credibility of the person making persuasive arguments).
The inspiration for this project comes from a love of panel debates and the variety and richness in speakers available online to listen to who speak publicly about their ideas about the future, their worldview or ideologies. I stumbled upon an article about Aristotle’s Art of Rhetoric and realized that some of the best speakers I had listened were using a combination of his three modes of persuasion and so this is my attempt to measure something of this.
What it does
The text is run through a number of natural language processing algorithms and the results from this analysis visually displayed in a dashboard. The dashboard shows several metrics including end scores for pathos, logos, ethos calculated using various text analytics including the computation of polarity of opinions expressed using Azure Sentiment Analysis API at the document level; overall subjectivity score; displays key phrases from the text which are extracted using the Azure Key Phrases API to give an instant insight into which topics stood out; and displays other metrics such as the average length of sentence, number of questions posed by the speaker, flow of speech, and metrics relating to the speaker’s use of language.
How we built it
The backend API was built using Flask and python, http requests using axios library, and the application UI was built using ReactJS, React charting library, Recharts, for the pie and bar charts, and TextBlob library to gauge subjectivity of the text.
The application uses the Text Analytics API from Azure Cognitive Services specifically sentiment analysis, and key phrases extraction.
Challenges we ran into
Using CSS Grid for the first time for application layout was strangely enjoyable but writing custom CSS for application's UI was more challenging than expected.
Accomplishments that we're proud of
Proud that the overall application came together and to get a measure of this kind of speech.
What we learned
A bunch of stuff. Working with the Flask micro-framework for the first time was pure joy, getting results back from Text Analytics APIs and integrating them into the app’s backend was really satisfying.
What's next for Persuasive Text
More metrics and algorithms in order to process the text more fully, open source and guides on methodology and how to extend.