Keywords in Context (Using n-grams) with Python
Like in Output Data as HTML File, this lesson takes the frequency pairs collected in Counting Frequencies and outputs them in HTML. This time the focus is on keywords in context (KWIC) which creates n-grams from the original document content – in this case a trial transcript from the Old Bailey Onli...
Main Authors: | , |
---|---|
Format: | Article |
Language: | English |
Published: |
Editorial Board of the Programming Historian
2012-07-01
|
Series: | The Programming Historian |
Subjects: | |
Online Access: | http://programminghistorian.org/lessons/keywords-in-context-using-n-grams |
_version_ | 1828200895633948672 |
---|---|
author | William J. Turkel Adam Crymble |
author_facet | William J. Turkel Adam Crymble |
author_sort | William J. Turkel |
collection | DOAJ |
description | Like in Output Data as HTML File, this lesson takes the frequency pairs collected in Counting Frequencies and outputs them in HTML. This time the focus is on keywords in context (KWIC) which creates n-grams from the original document content – in this case a trial transcript from the Old Bailey Online. You can use your program to select a keyword and the computer will output all instances of that keyword, along with the words to the left and right of it, making it easy to see at a glance how the keyword is used.
Once the KWICs have been created, they are then wrapped in HTML and sent to the browser where they can be viewed. This reinforces what was learned in Output Data as HTML File, opting for a slightly different output.
At the end of this lesson, you will be able to extract all possible n-grams from the text. In the next lesson, you will be learn how to output all of the n-grams of a given keyword in a document downloaded from the Internet, and display them clearly in your browser window. |
first_indexed | 2024-04-12T11:19:50Z |
format | Article |
id | doaj.art-1ef8c2067dba471bbefd90c742d0fbe4 |
institution | Directory Open Access Journal |
issn | 2397-2068 |
language | English |
last_indexed | 2024-04-12T11:19:50Z |
publishDate | 2012-07-01 |
publisher | Editorial Board of the Programming Historian |
record_format | Article |
series | The Programming Historian |
spelling | doaj.art-1ef8c2067dba471bbefd90c742d0fbe42022-12-22T03:35:23ZengEditorial Board of the Programming HistorianThe Programming Historian2397-20682012-07-01Keywords in Context (Using n-grams) with PythonWilliam J. Turkel0Adam Crymble1Western UniversityUniversity of HertfordshireLike in Output Data as HTML File, this lesson takes the frequency pairs collected in Counting Frequencies and outputs them in HTML. This time the focus is on keywords in context (KWIC) which creates n-grams from the original document content – in this case a trial transcript from the Old Bailey Online. You can use your program to select a keyword and the computer will output all instances of that keyword, along with the words to the left and right of it, making it easy to see at a glance how the keyword is used. Once the KWICs have been created, they are then wrapped in HTML and sent to the browser where they can be viewed. This reinforces what was learned in Output Data as HTML File, opting for a slightly different output. At the end of this lesson, you will be able to extract all possible n-grams from the text. In the next lesson, you will be learn how to output all of the n-grams of a given keyword in a document downloaded from the Internet, and display them clearly in your browser window.http://programminghistorian.org/lessons/keywords-in-context-using-n-gramsKeywords in ContextPythontext manipulation |
spellingShingle | William J. Turkel Adam Crymble Keywords in Context (Using n-grams) with Python The Programming Historian Keywords in Context Python text manipulation |
title | Keywords in Context (Using n-grams) with Python |
title_full | Keywords in Context (Using n-grams) with Python |
title_fullStr | Keywords in Context (Using n-grams) with Python |
title_full_unstemmed | Keywords in Context (Using n-grams) with Python |
title_short | Keywords in Context (Using n-grams) with Python |
title_sort | keywords in context using n grams with python |
topic | Keywords in Context Python text manipulation |
url | http://programminghistorian.org/lessons/keywords-in-context-using-n-grams |
work_keys_str_mv | AT williamjturkel keywordsincontextusingngramswithpython AT adamcrymble keywordsincontextusingngramswithpython |