The described technology relates generally to displaying of tables on a small display area.
It can be particularly challenging to view images on small devices such as cell phones, mobile computers, and personal digital assistants (“PDAs”). These devices typically have a very small display area in which to display a display page. To display the display page, the devices may use software and information that is designed for devices with much larger display areas. For example, these devices may use a web browser to display standard size web pages. If a display page in a high resolution is displayed in such a small display area, the display page may need to be displayed in a much lower resolution to fit the entire display page. With such a low resolution, however, the user may not be able to see the details of the display page. Alternatively, if the display page is displayed in full resolution in a small display area, only a small portion of the display page can be displayed at once. To view other portions of the display page, the user needs to navigate (e.g., scroll and zoom) to view those portions. Because such devices are typically very small, it can be difficult for a user to perform such navigation.
Currently, most browsers used by small devices offer only a simplified set of user interface features that are directly ported from a desktop browser. Few designers of browsers, however, take the characteristics of a small device into consideration when designing their user interfaces. Small devices are different from larger devices in input capabilities, processing power, and screen characteristics. For example, since small devices usually do not have a keyboard or mouse, it can be difficult to navigate around a display page. The primary difference from a user's perspective is display area size. Because the display area is small, a user is forced to scroll and zoom in to areas of interest. Such scrolling and zooming are typically not necessary on a device with a large display area.
To allow for the effective display of web pages on a small display area, some techniques have been developed to dynamically adapt web pages that are too large for a small display area. One such adaptation technique is “page splitting,” which attempts to divide a web page into blocks that can fit as a unit into a small display area. One such page splitting technique analyzes the position and shape of HTML elements of a web page to identify blocks. However, it can be difficult to identify blocks from low-level HTML tags in a way that preserves page structure and does not lose information.
When a page is split, the device may display the blocks of the page in a single column on the display. Such display of the page is referred to as a “one-column view.” A one-column view effectively discards the layout of a block when it is wider than the display area. The discarding of the layout presents problems when the information of the block is correlated based on the layout.
The tables of an HTML document can be identified in a relatively straightforward manner. As such, a browser could take steps to display such tables in a way that may maintain some of their structure. Unfortunately, tables of an HTML document are used to lay out a page or block in such a way that the data of the page or block is not correlated to its structure. For example, an HTML document may use a <table> tag to define the overall layout of a page. The table may define two columns and five rows with cells of varying sizes in which unrelated data is presented.
It would be desirable to have a technique that could easily identify a table as a data table or layout table. In addition, it would be desirable to have a technique for displaying data tables in a way that would preserve the relationships and meaning between the data of the data table when displayed on a small display.
A method and system for classifying and displaying tables for small display areas is provided. A table system includes a classification system and a display system. The classification system trains a classifier to classify tables of display pages as a data table or not a data table based on certain features of the tables. The display system uses the classifier when displaying a display page. The display system identifies the tables of a display page, identifies the features of the table, and then uses the classifier to classify the table based on its features. When a table is not classified as a data table, the display system may display the table in a conventional one-column view. When a table is classified as a data table, the display system displays the data table in an alternate view that attempts to preserve the layout and thus meaning of the data table.
A method and system for classifying and displaying tables for small display areas is provided. In one embodiment, a table system includes a classification system and a display system. The classification system trains a classifier to classify tables of display pages as a data table or not a data table (e.g., a layout table) based on certain features of the tables. The display system uses the classifier when displaying a display page. The display system identifies the tables of a display page, identifies the features of the table, and then uses the classifier to classify the table as a data table or a layout table based on its features. When a table is classified as a layout table, the display system may display the layout table in a conventional one-column view. When a table is classified as a data table, the display system displays the data table in an alternate view that attempts to preserve the layout and thus meaning of the data table. For example, the display system may display a data table in its original layout with scrollbars to allow a user to view only a portion of the data table at a time. Alternately, the display system may display a data table by zooming out so that the entire data table can be displayed in one column. As another example, the display system may attempt to transpose (or rotate) the data table (i.e., switching rows and columns) and display the transposed table if the width of the transposed table is narrower than the un-transposed table. If the un-transposed table would fit on the display device, then no alternate view would be needed. In this way, the display system can identify data tables of a display page and display them in a way that preserves the layout of the data table while using a one-column view to display other portions of the display page.
In one embodiment, the classification system trains a classifier to classify tables as data tables or layout tables using training samples of HTML display pages. The classification system classifies the leaf tables of each display page. A leaf table is a table that contains no embedded tables. The classification system may represent the elements of a display page using the document object model (“DOM”) when identifying the tables. When the classification system identifies a leaf table, it generates a feature vector representing various features of the table. The features of the feature vector may include visual features and content features. The visual features represent the overall structure of the table, and the content features represent features of cells. Table 1 describes the visual features and content features used in one embodiment. One skilled in the art will appreciate that other features may be used to represent the table.
The classification system also inputs the classification of the tables of the training samples. For example, the classification system may display each table to a user who indicates whether the table is a data table or a layout table. The classification system then trains a classifier using the feature vectors along with the classifications. The classification system may use any of various well-known classification techniques such as support vector machines, adaptive boosting, neural networks, and so on.
A support vector machine operates by finding a hyper-surface in the space of possible inputs. The hyper-surface attempts to split the positive examples (e.g., feature vectors for data tables) from the negative examples (e.g., feature vectors for layout tables) by maximizing the distance between the nearest of the positive and negative examples to the hyper-surface. This allows for correct classification of data that is similar to but not identical to the training data. Various techniques can be used to train a support vector machine. One technique uses a sequential minimal optimization algorithm that breaks the large quadratic programming problem down into a series of small quadratic programming problems that can be solved analytically. (See Sequential Minimal Optimization, at http://research.microsoft.com/˜jplatt/smo.html.)
Adaptive boosting is an iterative process that runs multiple tests on a collection of training data. Adaptive boosting transforms a weak learning algorithm (an algorithm that performs at a level only slightly better than chance) into a strong learning algorithm (an algorithm that displays a low error rate). The weak learning algorithm is run on different subsets of the training data. The algorithm concentrates more and more on those examples in which its predecessors tended to show mistakes. The algorithm corrects the errors made by earlier weak learners. The algorithm is adaptive because it adjusts to the error rates of its predecessors. Adaptive boosting combines rough and moderately inaccurate rules of thumb to create a high-performance algorithm. Adaptive boosting combines the results of each separately run test into a single, very accurate classifier.
A neural network model has three major components: architecture, cost function, and search algorithm. The architecture defines the functional form relating the inputs to the outputs (in terms of network topology, unit connectivity, and activation functions). The search in weight space for a set of weights that minimizes the objective function is the training process. In one embodiment, the classification system may use a radial basis function (“RBF”) network and a standard gradient descent as the search technique.
The display system uses the classifier to classify tables of a display page that is to be displayed. The display system classifies the tables of the display page by identifying the leaf tables, generating feature vectors for the identified tables, and then invoking the classifier to classify the tables based on their feature vectors. The classification of tables may be performed by a device with a small display area (e.g., a PDA) or may be performed by a server. Since devices with small display areas may have very limited computational power, the overhead of identifying tables, extracting feature vectors, and classifying the tables may be too high. A server may be used to perform the classification of the tables. The display pages may be routed to the server for classification of the tables before the display page is provided to the device. Alternatively, the device upon receiving a display page may forward it to a server which classifies the tables and returns the resulting classifications to the device.
In one embodiment, when a data table is too wide to fit the display device, the display system determines whether a transposed data table would fit the display device. The transpose of an HTML table accounts for the column span (“COLSPAN”) and row span (“ROWSPAN”) properties of cells of the table. Column span defines the number of columns that a cell spans, and row span defines the number of rows that a column spans. The display system generates a mapping table that has a cell for each cell of the table if there was no spanning. The display system marks the initial cell of a span to its length. The transpose of a table can be represented by the following equation:
m×n→n×m; cijr(k)−>cijc(k); cijc(k)−>cjir(k); cij−>cji (1)
where m represents the number of rows of the table, n represents the number of columns of the table, cij represents the cell in the ith row and the jth column (1≦i≦m, 1≦j≦n), cijc(k) represents the cell in the ith row and the jth column which has COLSPAN=k, k≧2, and cijr(k) represents the cell in the ith row and the jth column which has ROWSPAN=k, k≧2. The display system calculates the width and height of the transposed data table to ensure that the transpose reduces the width of the original data table.
The computing device on which the table system is implemented may include a central processing unit, memory, input devices (e.g., keyboard and pointing devices), output devices (e.g., display devices), and storage devices (e.g., disk drives). The memory and storage devices are computer-readable media that may contain instructions that implement the table system. In addition, the data structures and message structures may be stored or transmitted via a data transmission medium, such as a signal on a communications link. Various communication links may be used, such as the Internet, a local area network, a wide area network, a point-to-point dial-up connection, or a cellphone network.
The table system may be implemented in various operating environments that include personal computers, PDAs, cell phones, server computers, hand-held or laptop devices, multiprocessor systems, microprocessor-based systems, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The table system may be described in the general context of computer-executable instructions, such as program modules, executed by one or more computers or other devices. Generally, program modules include routines, programs, objects, components, data structures, and so on that perform particular tasks or implement particular abstract data types. Typically, the functionality of the program modules may be combined or distributed as desired in various embodiments.
One skilled in the art will appreciate that although specific embodiments of the table system have been described herein for purposes of illustration, various modifications may be made without deviating from the spirit and scope of the invention. Accordingly, the invention is not limited except as by the appended claims.