In web searching environments, the traditional indexing and ranking framework for searching is not very straightforward, nor is it practical for the framework to be shared by different search applications. For example, to meet the requirements of different scenarios in a codebase, switch clauses (if-then-else/if- . . . -else/if-else) need to be inserted in many places in the code.
Moreover, the differences in requirements among various scenarios may be more than that can be easily handled by switching to different routines. Different scenarios may require different data structures. Code maintenance needs to consider such requirements to ensure that different scenarios are properly handled.
As a result, search applications have different codebases, even though some non-trivial parts of them are similar. This is inefficient and makes search code maintenance difficult. For example, to add a new scenario or modify an existing scenario, the places to be modified need to be determined, with modifications made at possibly dozens of places in many files. Further, because the code for various scenarios may interact, any modification to improve one scenario cannot adversely affect other modules.
This Summary is provided to introduce a selection of representative concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used in any way that would limit the scope of the claimed subject matter.
Briefly, various aspects of the subject matter described herein are directed towards a technology by which a search scenario may be implemented using some scenario-specific code to perform scenario-specific functionality, and some non-scenario-specific code of an index builder and retrieval engine for general functionality. The technology comprises an index builder and a retrieval engine, along with set of interfaces that allow calling programs to provide information and/or implement functionality as desired.
Example interfaces include an interface for specifying a document to be indexed, and an interface for specifying a document collection to be indexed. Other interfaces include an interface that when invoked transforms a document into features (e.g., in a list of hits), and an interface that when invoked transforms a document into document metadata. Still other interfaces are directed towards accessing the inverted index, e.g., an interface for adding document-related data to the inverted index, an interface for reading from the inverted index, and an interface for writing to the inverted index.
With respect to document searching, an interface associated with the retrieval engine may be used for specifying a ranking function to compute the relevance score of a given document with respect to a query. Another interface is used for specifying a retrieval strategy to generate a number of top documents with respect to a given query. Yet another interface may be used for generating a query-dependent document summarization for a document and a query.
Other advantages may become apparent from the following detailed description when taken in conjunction with the drawings.
The present invention is illustrated by way of example and not limited in the accompanying figures in which like reference numerals indicate similar elements and in which:
Various aspects of the technology described herein are generally directed towards an indexing and retrieval framework that supports multiple scenarios in one codebase. The framework thus makes it faster and more efficient to improve search modules and evaluate them. A general idea of the framework is to decouple scenario-specific code from non-scenario-specific indexing and/or retrieval operations.
It should be understood that any of the examples herein are non-limiting. Indeed, as one example, a particular implementation having various interfaces and functions is described, however this is only one example. As such, the present invention is not limited to any particular embodiments, aspects, concepts, structures, functionalities or examples described herein. Rather, any of the embodiments, aspects, concepts, structures, functionalities or examples described herein are non-limiting, and the present invention may be used various ways that provide benefits and advantages in computing and search technology in general.
Turning to
As will be understood, in this implementation the operations of the two modules may be shared by all search applications, as the index builder 102 performs operations that are common to all indexing scenarios, and the retrieval engine 104 performs scenario-independent operations of retrieving the top results with respect to a query via scenario-independent code.
As described below, certain data structures and operations of the index builder and the retrieval engine are abstracted into interfaces. Different search applications may have different implementations for one or several interfaces, while other code (e.g. framework code and some interface implementations) may be shared. Thus, any scenario-specific operations and settings are incorporated into the framework by implementing the appropriate interfaces.
To assist in program development, an extension layer 222 provides default implementations for the interfaces. As can be seen, implementing a search application is accomplished by customizing the implementations of some interfaces, while reusing others. This is much more efficient than developing an entire search application.
More particularly, the abstraction of data structures and operations in the indexing and retrieval process provides for customizing only the code differences needed for different search scenarios. Note however, that such data structures and/or operations may share some common characteristics. For example, the way of indexing a web page is different from the way of indexing an image. Because the common characteristics are abstracted via interfaces in the framework, different implementations of the same interface can be created for different scenarios, by placing scenario-specific operations and settings in the interface implementations corresponding to the scenario.
By way of a particular example, the aforementioned related patent application entitled “Experimental Web Search System” is able to build experimental indexes, rank documents according to experimental ranking functions, use experimental retrieval strategies and/or experimentally generate custom snippets by invoking the appropriate interfaces. For example, to test the quality of search results obtained from an experimental index that uses a new feature, the experimenter uses the interface to implement code for generating the experimental index. To test the quality of ranked results given a new ranking function, the experimenter specifies the ranking function to use via an appropriate interface.
Turning to the interfaces and their functionality, ITextStore and IDocTextInfo are the abstraction of input data for the index builder 102. ITextStore represents the document collection, and IDocTextInfo abstracts a single document in the collection. In one implementation, the index builder 102 reads the documents from a concrete ITextStore and indexes the documents one at a time:
IForward Indexer abstracts the logic of transforming raw document content into document features (e.g., a bag of words). The index builder 102 invokes inverted index-related interface implementations to convert the document features into inverted index. In other words, IForwardIndexer transforms a given document (abstracted by the IDocTextInfo interface) into a list of hits (or postings), as shown in the following tables; the document metadata (abstracted by IDocMeta) of the document is also assigned via this interface. Examples of document metadata include document length, number of terms in document, static rank, and so forth.
Hit information is represented in the following table:
The IInvertedIndex, IInvertedIndexReader, IInvertedIndexWriter, and IDocMeta interfaces are the abstraction of inverted index operations and data structures. By implementing these interfaces, users can generate various formats of inverted indexes used by a retrieval engine. IInvertedIndex, IIndexReader, and IIndexWriter combined together provide the primary operations of an inverted index:
The IRankingFunc interface represents the logic for calculating the relevance score of a given document with respect to a query. The IRetrievalStrategy interface abstracts the logic of generating the top N documents with respect to a given query:
The ISnippetGenerator allows for different ways to generate snippets (query-dependent document summarizations). To this end, given a document and query, the implementation of ISnippetGenerator generates snippet or query-dependent document summarization:
The snippet is provided via the following structure:
The invention is operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with the invention include, but are not limited to: personal computers, server computers, hand-held or laptop devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and so forth, which perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in local and/or remote computer storage media including memory storage devices.
With reference to
The computer 310 typically includes a variety of computer-readable media. Computer-readable media can be any available media that can be accessed by the computer 310 and includes both volatile and nonvolatile media, and removable and non-removable media. By way of example, and not limitation, computer-readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by the computer 310. Communication media typically embodies computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared and other wireless media. Combinations of the any of the above may also be included within the scope of computer-readable media.
The system memory 330 includes computer storage media in the form of volatile and/or nonvolatile memory such as read only memory (ROM) 331 and random access memory (RAM) 332. A basic input/output system 333 (BIOS), containing the basic routines that help to transfer information between elements within computer 310, such as during start-up, is typically stored in ROM 331. RAM 332 typically contains data and/or program modules that are immediately accessible to and/or presently being operated on by processing unit 320. By way of example, and not limitation,
The computer 310 may also include other removable/non-removable, volatile/nonvolatile computer storage media. By way of example only,
The drives and their associated computer storage media, described above and illustrated in
The computer 310 may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer 380. The remote computer 380 may be a personal computer, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the elements described above relative to the computer 310, although only a memory storage device 381 has been illustrated in
When used in a LAN networking environment, the computer 310 is connected to the LAN 371 through a network interface or adapter 370. When used in a WAN networking environment, the computer 310 typically includes a modem 372 or other means for establishing communications over the WAN 373, such as the Internet. The modem 372, which may be internal or external, may be connected to the system bus 321 via the user input interface 360 or other appropriate mechanism. A wireless networking component such as comprising an interface and antenna may be coupled through a suitable device such as an access point or peer computer to a WAN or LAN. In a networked environment, program modules depicted relative to the computer 310, or portions thereof, may be stored in the remote memory storage device. By way of example, and not limitation,
An auxiliary subsystem 399 (e.g., for auxiliary display of content) may be connected via the user interface 360 to allow data such as program content, system status and event notifications to be provided to the user, even if the main portions of the computer system are in a low power state. The auxiliary subsystem 399 may be connected to the modem 372 and/or network interface 370 to allow communication between these systems while the main processing unit 320 is in a low power state.
While the invention is susceptible to various modifications and alternative constructions, certain illustrated embodiments thereof are shown in the drawings and have been described above in detail. It should be understood, however, that there is no intention to limit the invention to the specific forms disclosed, but on the contrary, the intention is to cover all modifications, alternative constructions, and equivalents falling within the spirit and scope of the invention.
The present application is related to U.S. patent application Ser. No. ______ (attorney docket no. 327767.01), entitled “Experimental Web Search System,” filed concurrently herewith and hereby incorporated by reference.