Most NLP tasks are concerned with the analysis of data. In this chapter, we will illustrate several approaches to acquiring data from multiple sources. This includes processing data from an HTML page and PDF, Word, and Excel documents. Each of these techniques involves connecting to a data source and then extracting the data from that source. For complex documents, such as Wikipedia articles or a Word document, we will be faced with choices in terms of what type of data we want to retrieve.
For example, with an HTML document, we may be interested in the actual text and possibly the HTML markup. For a document containing a table of contents, we may want to process that information separately. To extract text form a Wikipedia article, we treat it as an HTML document.
These recipes are an introduction to the topic. Most of these data sources...