Google Ngram Viewer
The Google Ngram Viewer or Google Books Ngram Viewer is an online search engine that charts frequencies of any set of comma-delimited search strings using a yearly count of n-grams found in sources printed between 1500 and 2008 in Google's text corpora in American English, British English, French, German, Spanish, Russian, Hebrew, or Chinese, generated in either 2008 or 2012. There are also some specialized English-language corpora, such as English Fiction. Lacking an independent corpus, Italian words are counted by their use in other languages.[needs update]
The program can search for a single word or a phrase, including misspellings or gibberish. The n-grams are matched with the text within the selected corpus, optionally using case-sensitive spelling (which compares the exact use of uppercase letters), and, if found in 40 or more books, are then plotted on a graph.
The Ngram Viewer as of January 2016 supports searches for parts of speech and wildcards.
The program was developed by Jon Orwant and Will Brockman and released in mid-December 2010. It was inspired by a prototype (called "Bookworm") created by Jean-Baptiste Michel and Erez Aiden from Harvard's Cultural Observatory and Yuan Shen from MIT and Steven Pinker.
The Ngram Viewer was initially based on Google Books, but then[when?] switched to the 2009 edition of the Google Books Ngram Corpus. As of January 2016[update], the program can search an individual language's corpus within the 2009 or the 2012 edition. Although the latter edition has various new features, it only includes source texts within the same range of years as the former: through 2008 and not beyond.
Research based on the Ngram Corpus (that is, the databases of text from the scanned books) has included the finding of correlations between the emotional output and significant events in the 20th century such as World War II or to check and challenge popular trend statements such as the secularisation or economisation of modern societies. With such results, the Viewer and its corpora are useful for research in the digital humanities.
Operation and restrictions
Commas delimit user-entered search-terms, indicating each separate word or phrase to find. The Ngram Viewer returns a plotted line chart within seconds of the user pressing the Enter key or the "Search" button on the screen.
Google populated the database from over 5 million books published up to 2008. Accordingly, as of January 2016[update], no data will match beyond the year 2008, no matter if the corpora was generated in 2009 or 2012. Due to limitations on the size of the Ngram database, only matches found in over 40 books are indexed in the database; otherwise the database could not have stored all possible combinations.
Typically, search terms cannot end with punctuation, although a separate full stop (a period) can be searched. Also, an ending question mark (as in "Why?") will cause a 2nd search for the question mark separately.
Omitting the periods in abbreviations will allow a form of matching, such as using "R M S" to search for "R.M.S." versus "RMS".
The corpora used for the search are composed of total_counts, 1-grams, 2-grams, 3-grams, 4-grams, and 5-grams files for each language. The file format of each of the files is tab-separated data. Each line has the following format:
- total_counts file
- year TAB match_count TAB page_count TAB volume_count NEWLINE
- Version 1 ngram file (generated in July 2009)
- ngram TAB year TAB match_count TAB page_count TAB volume_count NEWLINE
- Version 2 ngram file (generated in July 2012)
- ngram TAB year TAB match_count TAB volume_count NEWLINE
The Google Ngram Viewer uses match_count to plot the graph.
As an example, a word "Wikipedia" from the Version 2 file of the English 1-grams is stored as follows:
The graph plotted by the Google Ngram Viewer using the above data is here.
The data set has been criticized for its reliance upon inaccurate OCR, an overabundance of Scientific Literature, and for including large numbers of incorrectly dated and categorized texts. Another issue is that the corpus is in effect a library, containing one of each book. A single, prolific author is thereby able to noticeably insert new phrases into the Google Books lexicon, whether the author is widely read or not.
Optical character recognition, or OCR, is not always reliable, and some characters may not be scanned correctly. In particular, systemic errors like the confusion of "s" and "f" can cause systemic bias. Although the authors claim that the results are reliable from 1800 onwards, poor OCR and insufficient data mean that frequencies given for languages such as Chinese may only be accurate from 1970 onwards, with earlier parts of the corpus showing no results at all for common terms, and data for some years containing more than 50% noise.
- "Google Ngram Database Tracks Popularity Of 500 Billion Words" Huffington Post, 17 December 2010, webpage: HP8150.
- "Google Ngram Viewer - Google Books", Books.Google.com, May 2012, webpage: G-Ngrams.
- "Google's Ngram Viewer: A time machine for wordplay", Cnet.com, 17 December 2010, webpage: CN93.
- "A Picture is Worth 500 Billion Words – By Rusty S. Thompson", HarrisburgMagazine.com, 20 September 2011, webpage: HBMag20.
- "Google Books Ngram Viewer - University at Buffalo Libraries", Lib.Buffalo.edu, 22 August 2011, webpage: Buf497.
- "Google Ngram Viewer - Google Books" (Information), Books.Google.com, December 16, 2010, webpage: G-Ngrams-info: notes bigrams and use of quotes for words with apostrophes.
- Acerbi A, Lampos V, Garnett P, Bentley RA (2013) The Expression of Emotions in 20th Century Books. PLoS ONE 8(3): e59030. doi: 10.1371/journal.pone.0059030
- Roth, S. (2014), "Fashionable functions. A Google ngram view of trends in functional differentiation (1800-2000)", International Journal of Technology and Human Interaction, Band 10, Nr. 2, S. 34-58 (online: http://ssrn.com/abstract=2491422).
- "Google Books Ngram Viewer". Google.
- googlebooks-eng-all-1gram-20120701-w.gz at http://storage.googleapis.com/books/ngrams/books/datasetsv2.html
- Google Ngrams: OCR and Metadata. web.resourceshelf.com.
- Humanities research with the Google Books corpus. languagelog.ldc.upenn.edu.
- Characterizing the Google Books Corpus: Strong Limits to Inferences of Socio-Cultural and Linguistic Evolution. http://journals.plos.org.
- Google n-grams and pre-modern Chinese. digitalsinology.org.
- When n-grams go bad. digitalsinology.org.
- Lin, Yuri; et al. (July 2012). "Syntactic Annotations for the Google Books Ngram Corpus" (pdf). Proceedings of the 50th Annual Meeting. Demo Papers. Jeju, Republic of Korea: Association for Computational Linguistics. 2: 169–174. 2390499.
Whitepaper presenting the 2012 edition of the Google Books Ngram Corpus