Giter VIP home page Giter VIP logo

obscene-journey's Introduction

!#$@: An obscene journey through quotations in media

You can find the data story here

Abstract

The perception and use of profanity depend on the situation and differ from person to person. While swearing is relatively common and sometimes even welcomed in a relaxed environment, the use of such language is mostly frowned upon in a workplace or public spaces. This is why we are not likely to encounter it while reading the news. Still, heated debates and unexpected events can inspire the appearance of obscene language even in more formal settings. To better understand the circumstances in which profanity appears in media, we will explore Quotebank, a large and heterogeneous dataset of quotes from media. We will focus mainly on obscene quotes identified by a machine learning model. Our main goal is to analyze the distribution of such quotations through time and to examine their presence with respect to the attributes of the speakers who uttered them and the media outlets who featured those speakers.

Research questions

  1. What is the overall distribution of obscene quotes?
  2. How does the use of profanity behave through time? Can we relate the use of profanity to certain events?
  3. Which speakers and groups of speakers are most likely to use obscene language? Are there any differences in the distribution of profanity with respect to the occupation or gender of a speaker?
  4. Which media sources feature vulgar speakers? How does it relate to the nature of the sources and their role? Which media sources censor profanities?
  5. What are profanities about? Which lexical categories are most represented in the profane quotations?

Additional datasets

To obtain attributes of the speakers we will use the speaker_attributes.parquet dataset prepared by the teaching staff. The speaker attributes were obtained from WikiData.

Methods

Data processing

Due to the size of the data, it is not possible to load it entirely in memory, which is why we will mostly use PySpark for data processing. The aggregated results that we obtain with spark will then be converted to Pandas dataframe so that they can be visualized.

Identifying quotes with profanity

To identify obscene quotes, we use a combination of approaches. Firstly, we will employ an SVM-based machine learning model profanity_check to compute profanity scores (a real number between 0 and 1). Although the author reports high results on the Wikipedia comments dataset, we don't know a thing about its performance on Quotebank. Thus, we label as profanities only the quotations with a profanity score higher than 0.9. Aside from that, since some censored quotes may be difficult to handle for our model, we use regular expressions to identify and remove censorship from the quotes, labeling all the censored quotations as profane. Finally, since we opted for a high profanity score threshold, we missed quite a few true positives. To alleviate this we then use a large list of profane words from which we first select the words with a profanity_check's profanity score higher than 0.5, and then further filter the set manually.

Empath

We also compute Empath's lexical categories and analyze them with respect to profane and non-profane quotes.

Analyzing speaker attributes and quote profanity

To analyze the profanity distribution of quotes with respect to speaker demographics, we will use data visualization techniques such as bar plots accompanied with confidence intervals. We use confidence intervals to argue that the differences in average profanity across different occupations or genders are statistically significant.

Repository structure

  • ExploratoryDataAnalysis.ipynb - includes an extensive exploratory data analysis
  • SpeakerAttributesNewsOutlets.ipynb - contains some speaker and news domain-level analysis
  • milestone2.ipynb - old notebook from project milestone 2
  • QuotationLevelAnalysis.ipynb - temporal analysis and general statistics
  • Preprocessing.ipynb - data cleaning, censorship removal, calculating the scores

Proposed timeline

Week 1: Develop the regular expression for removing censorship from the data, data cleaning
Week 2: Assign sentiment and profanity scores to all the quotes in the data
Week 3: Expand the initial analysis on the entire dataset, explore the relationship between sentiment and profanity, visualize the data, answer the research questions
Week 4: Refine the plots, learn how to use GitHub pages, start with the data story
Week 5: Finish the data story

Organization within the team

Week 1: Dani and Marko work on data cleaning and developing the regular expression while Dewmini and Mauro start working on homework 2.
Week 2: Everybody works on the homework. In the meantime, we run the code for computing sentiment and profanity scores on the entire data.
Week 3: Dewmini and Dani work on speaker-level analysis, Mauro analyzes profanity with respect to news outlets, while Marko explores the relations between sentiment and profanity in the quotes.
Week 4: The team firstly meets to discuss potential improvements of the plots, develop the outline of the data story and select the GitHub Pages theme. We then split into two pairs. Dewmini and Marko work on the story aspect while Dani and Mauro work on visual appearance.
Week 5: Everyone works on refining the data story.

Who did what

Dani: speaker-level analysis, data story
Dewmini: general exploratory data analysis, speaker-level analysis, data visualization
Marko: data preprocessing, quotation-level analysis, news outlet analysis
Mauro: news outlet analysis, data story

obscene-journey's People

Contributors

maculjak avatar mdsudara avatar danihinjos avatar staverm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.