Write Your Own Song
Use SameDiff to analyze the lyrical styles of two
musicians and invent a duet for them
What is SameDiff? Total time
SameDiff compares two or more text files and tells you how 30 to 45 Minutes
similar or different they are. It helps you see differences
and similarities in the words used in each file so you can Audience
learn about quantitative analysis of text. This hands-on ac- 3 - 100 people. Ages 12+.
tivity helps participants build their data literacy by compar- Designed for grades 6 - 12, Higher Ed class-
rooms, News Organizations, Non-profits,
ing lyrics from two musicians and inventing a new song they and Community Workshops. No prior expe-
would write together. rience with data is required.
Space
Learning Goals • A projector and computer.
• Increased ability to analyze text data. • Ability to break out into small
• Understanding that comparing two things is one powerful groups of 3 clustered around a
way to find stories in data. computer.
• Awareness of what kind of questions you can/should ask • Large tables or floor, or tape
text data. to stick paper to walls so
• Understanding that algorithmic analysis can reveal participants can draw
interesting information about your data.
Supplies
• Computers
Run the Activity 1 for every 3 participants
• Large pieces of paper
Solving a Problem
roughly 2 feet x 3 feet
Analyzing large text is hard to do by hand. One way to
understand a “corpus” of text is to compare it to another • Thick crayons or markers
one, or to compare to parts of it. Computer scientists have
come up with ways to help, inventing various recipes, or “algorithms”, that can compare two corpora.
SameDiff runs some of those algorithms for you so you can try to compare two big pieces of text to
each other.
Share Inspirational Examples
Large text data is all around us. Today you can download all of Hillary Clinton’s Secretary of State
emails, diplomatic cables from Wikileaks, or all the Sherlock Holmes novels from the Gutenberg Proj-
ect. Analyzing and visualizing these large texts is a common thing to do now, in serious or fun ways.
Show Jaz Parkinson’s “Color Signatures” pieces that compares the colors mentioned in different
books ([Link] and Tahir Hemphill’s “Rap Research Lab”
([Link]
Run the Activity ( continued ) Reminders
• We run algorithms everyday. For
Introduce the Tool example, when you lose your
Open up SameDiff ([Link] and choose keys you run an algorithm to
Beyoncé and Aretha Franklin from the samples. On the re- search for them - first you check
sults page explain that the left column shows words unique your pockets, the counter by
to Beyoncé, while the right column shows words unique the door, etc.
to Aretha Franklin. Those are their differences. The middle
• A cosine similarity of 1.0 means
column shows the words they have in common. Draw their
exactly the same; zero means
attention to the top of the results page where it says, “These
totally different.
two documents are sort of similar”. SameDiff uses an algo-
rithm called “cosine similarity” to give you a similarity score. Terms to Introduce
Cosine similarity works by creating a list of words from
Algorithm
Beyonce and a list of words from Aretha Franklin. It counts
A set of steps you (or a computer) do
how often each term appears in each document and then
in order to solve a problem.
compares how closely those two lists match each other. This
is a helpful algorithm for text analysis. Corpus
A collection of written texts. For
Launch the Activity example, all of the lyrics in Katy
Perry songs.
1. Participants have 15 minutes.
Cosine Similarity
2. Participants work in teams of three.
The Cosine Similarity score tries to
3. Each team uses SameDiff to compare the lyrics of two tell you how similar two documents
musicians. Since musical collaborations are very popular, are based on the number of times
pick two artists and then imagine what a song written by words are used in each.
the two artists would look like.
[Link]
4. Each team writes the lyrics of their song on a big piece of paper with crayons.
5. Teams get bonus points if: (a) their song rhymes and/or (b) they come up with a tune to sing it to
and/or (c) They perform it karaoke-style for the group.
Share-Back Sample Sketches
Take 1 minute for each group to share their new song.
Some questions and themes to look for and focus on
during the discussion:
• Did you notice any common themes?
• Are the resulting lyrics more interesting when they
come from artists whose work is very different?
• Comparison is a powerful way to find stories in data.
• Working with data can be fun!
DataBasic is a suite of easy-to-use web tools for beginners that
introduce concepts of working with data. DataBasic is a project of
the Engagement Lab at Emerson College and the MIT Center for
Civic Media. Supported by the Knight Foundation.
This work is licensed under a Creative Commons
Attribution-NonCommercial-ShareAlike 4.0
International License.