Google Ngram Viewer


The Google Ngram Viewer or Google Books Ngram Viewer is an online search engine that charts the frequencies of any set of comma-delimited search strings using a yearly count of grams found in sources printed between 1500 and 2008 in Google's text corpora in English, Chinese, French, German, Hebrew, Italian, Russian, or Spanish. There are also some specialized English corpora, such as American English, British English, English Fiction, and English One Million; and the 2009 version of most corpora is also available.
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, and, if found in 40 or more books, are then plotted on a graph.
The Google Ngram Viewer, as of 2016, supports searches for parts of speech and wildcards. It is now also routinely used in research.

History

The program was developed by Jon Orwant and Will Brockman and released in mid-December 2010. It was inspired by a prototype 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 the 2009 edition of the Google Books Ngram Corpus., the program can search an individual language's corpus within the 2009 or the 2012 edition.

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.
As an adjustment for more books having been published during some years, the data is normalized, as a relative level, by the number of books published in each year.
Google populated the database from over 5 million books published up to 2008. Accordingly, as of January 2016, no data will match beyond the year 2008, no matter if the corpus was generated in 2009 or 2012. Due to limitations on the size of the Ngram database, only matches found in at least 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 can be searched. Also, an ending question mark will cause a second 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".

Corpora

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:
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:
ngramyearmatch_countvolume_count
Wikipedia190411
Wikipedia1912111
Wikipedia192411
Wikipedia1925111
Wikipedia1929111
Wikipedia1943111
Wikipedia1946111
Wikipedia1947111
Wikipedia1949111
Wikipedia1951111
Wikipedia1953222
Wikipedia1955111
Wikipedia195811
Wikipedia1961222
Wikipedia1964222
Wikipedia1965111
Wikipedia1966152
Wikipedia1969333
Wikipedia19701294
Wikipedia1971444
Wikipedia1972222
Wikipedia197311
Wikipedia197421
Wikipedia1975333
Wikipedia1976111
Wikipedia1977133
Wikipedia1978111
Wikipedia197911212
Wikipedia1980134
Wikipedia1982111
Wikipedia198332
Wikipedia1984483
Wikipedia1985373
Wikipedia198664
Wikipedia1987132
Wikipedia1988143
Wikipedia1990122
Wikipedia199185
Wikipedia199211
Wikipedia199311
Wikipedia1994233
Wikipedia199541
Wikipedia1996233
Wikipedia199761
Wikipedia19983210
Wikipedia19993911
Wikipedia20004312
Wikipedia20015914
Wikipedia200210519
Wikipedia200314953
Wikipedia2004803285
Wikipedia20052964911
Wikipedia200698182655
Wikipedia2007200175400
Wikipedia2008337226825

The graph plotted by the Google Ngram Viewer using the above data is here:

Criticism

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. Because of these errors, and because it is uncontrolled for bias, it is risky to use this corpus to study language or test theories. Since the data set does not include metadata, it may not reflect general linguistic or cultural change and can only hint at such an effect.
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.
Guidelines for doing research with data from Google Ngram have been proposed that address many of the issues discussed above.

OCR issues

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" in pre-19th century texts can cause systemic bias. Although Google Ngram Viewer claims 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 onward, with earlier parts of the corpus showing no results at all for common terms, and data for some years containing more than 50% noise.