An overview of computational analysis of text, foundations, and exploration of challenges and strategies.
Prep
- Bring text to play with in Voyant. Input format can be plain text, a PDF (with OCR), a MS Word Document or a URL for HTML analysis. Upload of any material will be subject to the Voyant privacy policy, so bring text you can safely share.
- Bring a laptop to support your explorations.
Going down the rabbit hole: anatomy of a digital book
How is a digital book made? How does the structure relate to its function? What opportunities does this afford us in terms of text analysis?
(1) Consider this book: Alice's Adventures in Wonderland. Explore the controls on the right side of the page turner.
- Note the different views of the book. What types of digital files are likely to make up the parts of a digital book?
- How are these files likely to be made?
- For what types of uses are each suited?
(2) Now explore the controls at he top of the page turner.
- There is a box labeled "search in this text". What can you deduce about the book from this functionality?
- What do the other controls do? Is there a way to summarize this class of controls? What underlying logic might you predict that coordinates these functions? (Food for thought...)
(3) What might this page be? (It also has this view.) Is this also part of the book? When and how might it be used?
(4) Diving deeper into text. OCR processes are not perfect. Consider some areas of special challenge:
- poor image quality (resolution, warp, skew, crop)
- books where characters vary from "standard"
- handwritten manuscripts, block printed books
- early font styles, many non-Roman alphabets (Panjabi example)
- character-based writing systems: Japanese done well, and not so well
- language specific challenges - Arapaho gospel of St. Luke
- Mixed languages: Latin/Greek, German/Greek
- Unexpected arrangement
Computational analysis of text
We count tokens - What is tokenization? Why tokenize? What are some strategies used to tokenize?
Let's look again at the Arapaho gospel of St. Luke. Switch to text view.
- What is a word? How would you define this for a computer?
- What isn't a word? How would you tell a computer to exclude these?
- Can you think of special cases where tokens might contain more than one word?
- What sets of rules would we need to tokenize? Would these be ordered in any specific way?
- Is there a "right way" to tokenize?
What are the opportunity points that the structure and arrangement of a book afford?
- How do challenges with OCR intersect with strategies for computational analysis of text? What might be effective strategies to deal with these challenges?
- What exactly is the "text"? Can you think of parts of a book that you might not want to include in your analysis? Why or why not? If you would, how would you exclude these parts?
Introducing Control - Microanalysis with Voyant
Voyant is a low barrier text analysis tool that delivers a rich, interactive interface and a variety of visualizations. Input format can be plain text, a PDF (with OCR), a MS Word Document or a URL for HTML analysis. Upload of any material will be subject to the Voyant privacy policy. Sample texts and URLs for analysis are listed below for experimentation, but feel free to use other source data that interests you.
- Sample texts, courtesy of Project Gutenberg. Use the plain text version.
- Crane, Stephen, 1871-1900. The Red Badge of Courage: An Episode of the American Civil War.
- Dickens, Charles, 1812-1870. A Tale of Two Cities.
- Upham, Charles Wentworth, 1802-1875. Salem Witchcraft, Volumes I and II
- Sample URLS: copy and paste into the Voyant upload browser window to get started.Sample URLS: copy and paste into the Voyant upload browser window to get started.
Economics of Crisis - http://www.economicsofcrisis.com/indications.html
Instructions to major John Sullivan. Washington, George, 1732-1799. The writings of George Washington from the original manuscript sources. Electronic Text Center, University of Virginia Library
- Copyright Law of the United States of America and Related Laws Contained in Title 17 of the United States Code - http://www.copyright.gov/title17/92preface.html
- Sample visualization: Dr. Martin Luther King, Jr. I Have a Dream speech.
We calculate frequency
- We can express our counts simply (as counts), or we can express them as frequencies. Why calculate frequencies?
- Is either representation misleading? If so, in what ways?
(1) Visualization of derived data
- Explore visualizations. Change the options in the dashboard.
- Discuss the relative merits of the various visualizations.
(2) Exerting control
- stopwords
- slider for word counts
- counts vs frequencies
(3) General questions
- What does exerting control do to our results? Does it change the validity of our assertions?
- What is signal? What is noise?
Moving from Microanalysis to Macroanalysis (Google nGrams and HTRC bookworm)
Google's nGram Viewer. Use the links below as starting points; dynamic modifications can be made at any point. Rules for syntax can be found on the About page.
- graffiti - let's start with this, and make it more meaningful
- "Ralph Ellison" and "Invisible Man
- "lyric/lyrics"
- "Jarndyce and Jarndyce" and "Bleak House"
- lot,urban renewal,gentrification
HathiTrust Research Center (HTRC) Bookworm
- monster in fiction/non-fiction/unknown
- mystery (contrast fiction and nonfiction)
- Various words for "creole"
- "phonograph" in three languages
General questions for discussion
- How easily can these examples above be refined and improved?
- Compare the various interfaces, especially as to the affordances and the limits of each.
- What additional elements of control would be useful that aren't available?
- When we see unexpected wave forms, what do we make of these?
- Are these important discoveries or flaws? How can we distinguish?
- Would the flaws be due to the data, the metadata, the algorithms?
More Macroanalysis with HTRC
- HTRC
- entity extraction
- What are entities?
- False positives/false negatives (omissions)
- Clustering - topic modeling
- define and defer for Mimno
Image analysis
- Edge analysis
- Neural networks
Resources
"Formatting Science Reports." Academic and Professional Writing: Scientific Reports. University of Wisconsin - Madison, 24 Aug. 2014. Web. 03 June 2016.
Jockers, Matthew L Text Analysis with R for Students of Literature. Cham: Springer International Publishing, 2014.
Underwood, Ted. The Stone and the Shell. Ted Underwood. Web. Accessed 03 June 2016.