0% found this document useful (0 votes)
2 views45 pages

Query Language

The document discusses various types of query languages used in information retrieval systems, emphasizing their role in expressing user information needs. It covers different query types such as single-word queries, keyword-based queries, phrase queries, and pattern queries, along with their functionalities and examples. Additionally, it explores query reformulation techniques and the importance of user feedback in improving search results.

Uploaded by

Samruddhi Patait
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
2 views45 pages

Query Language

The document discusses various types of query languages used in information retrieval systems, emphasizing their role in expressing user information needs. It covers different query types such as single-word queries, keyword-based queries, phrase queries, and pattern queries, along with their functionalities and examples. Additionally, it explores query reformulation techniques and the importance of user feedback in improving search results.

Uploaded by

Samruddhi Patait
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
: - the Feld of mori Tetrieval aR) query languages play a crucial role in of information. * A query language allows users to express ¢ In the context of information retrieval, It is a way for users to express their information needs and retrieve relevant results from a search engine or IR system. Neer “* Queries are . * The document collection is searched for documents that * Word queries are ; to express and provide “ The must be defined: “+ A word is a terminated by a separator (period, comma, space, etc). Definition of and 5 e.g., hyphen could be defined as a letter or as a separator. “ Usually, (such as “a”, “the”, “of”, ...) are ignored. 3 en query is a “+ Single-word queries peer to queries that consist of a single keyword or term. “ Usually used for in document images. form of query. + What are the possible documents ? * All documents that are retrieved. : Football, apple .... “+ On what base ie “+ Documents may be of the in the document. “* Documents containing are given the 4 Vhat is the difference between Keyword-based Querying an Single-word Queries. Explain with example. “+ Keyword-based querying and single-word queries are related concepts but differ in terms of the level of specificity and complexity. ** Keyword-based querying involves searching for documents or information based on specific keywords or terms. “+ On the other hand, single-word queries are queries that consist of a single keyword or term. ° "Healthy recipe for vegetarian lasagna“ ° "Lasagna" called “ is ” query. + Phrase is usually surrounded by +“ All documents that include this + Usually, separators (commas, colons, ...) & common words (“a”, “the”, “of”, “for”...) in the “In effect, this query is for a that must * Allows users to and thus 5 * Ex.: “Information Processing for Document Retrieval”. “+ What are the possible as ? + All documents that include are retrieved. Unlike that retrieve documents with individual keywords, phrase queries focus on finding . Here's an explanation of phrase queries with an example: The search system then looks for . Here's an example: "artificial intelligence" In this example, the phrase query "artificial intelligence" is specified within quotation marks. The search system will retrieve documents or information where the exact phrase "artificial intelligence" appears, rather than documents containing the individual words "artificial" and "intelligence" separately. “ A query is a (or phrases). “% Ex.: What is the result for the query “ "9 + What are the possible documents ? : A document is retrieved if it includes: “ Any of the query words, or each of the query words. BOn what bases documents be according % 9 Documents are ranked by they contain. A document containing n query words is ranked higher than a document containing This implies that, , documents that contain a larger number Documents are ranked in 4 * Those containing all the at the top, may be used to break ties among documents that contain the . = rie queries ci me CO) q queries are SIE in ti " iy Don involve searching for specific combinations of words or terms. However, there are some key differences between the two: “+ In phrase queries, the search system looks for the exact occurrence of a specific phrase. The words in the phrase must appear in the specified order for a match to be found. * In multiple-word queries, the search system looks for documents that contain any combination of the specified words or terms. The order of the words is not strictly enforced, and they can appear in any order within the document. 10 Pend eries are formulated base , OR, “ It describes the by relating multiple words with : For each query word w a bees Donne set D,, constructed that includes the The is then interpreted as an expression on the corresponding document sets with : Finds only documents containing or 5 : Finds documents containing or ty Excludes documents containing the or 7 eee OR server Finds documents containing ’ or “2. (computer OR server) NOT mainframe Select all documents that discuss , do not select any documents that + 3. Computer NOT (server OR mainframe) % Select , and do not discuss either servers or mainframes. * 4. Computer OR server NOT mainframe Select all documents that discuss , or documents that discuss but F 12 “+ Weighted queries, also known as , are a type of query where each . These weights indicate the relative significance or relevance of each term in the query. “The search system uses and retrieve documents that align more closely with the user's information needs. “+ Here's an example to illustrate the concept: Weighted Query: apple*3 OR banana%2 OR orange. The query consists of three terms: "apple," "banana," and "orange." Each term is assigned a weight, indicated by the superscript number. * The is the sum of the weights for the query words that it satisfies. Wg “+ Each of the words is assigned a ft, expressing the of the word within the query. + A query is then a (G15 W1)s (as Wa)s --> Qn» Wa) “+ The of a document is the for the query words that it satisfies. : given Query: (A,0.8,), (B,0.9), (C,0.3); and : (A, B, D) and : (A, C, D) which document iu + Score of Document 1: 0.8 (for term A) + 0.9 (for B) + 0 (for C) = 1.7 * Score of Document 2: 0.8 (for term A) + 0 (for B) + 0.3 (for C) = 1.1 Each document includes , but Document! is ranked higher because it includes " 14 ‘* W ” Is i Mer? “ An expression that defines a . Pattern shows the % What is the ? : A word matches a pattern if it is equal to one of the words defined by . + In other words, “The semantics are of : A pattern P that defines a (C), Cy, ..., &,) is aS C,) VC) V... Vy. are a type of information retrieval query that involves searching for documents or information using patterns or wildcards to match variations of terms. “ Instead of specifying the exact terms, pattern queries allow users to define a pattern with placeholders or wildcards “+ Here's an explanation of pattern queries with an example: “ Pattern queries use special characters, known as wildcards, to represent unknown or variable portions of terms. The most commonly used wildcards are: wildcard: The asterisk represents any number of characters, including none or multiple characters. It can be used to match different variations of a term or to capture unknown parts of a word. wildcard: The question mark represents a single character. It can be used to match variations in spelling or to capture one character in a specific position within a term. 463 ¢ sma as n , Pattern queries help retrieve documents that contain various word forms or spellings. “> For example, a pattern query like "organiz*ation" can match "organization" and "organisation" simultaneously. Pattern queries with question mark wildcards can accommodate minor spelling variations. “ For instance, a pattern query like "c?t" can match "cat," "cot," or "cut." Pattern queries can capture specific patterns within terms. + For example, a pattern query like "b?g" can match "big," "beg," or "bug." . Saaatias a 7 ” - a xg * Defines all the words whose the string is within the radius. * Assume the distance between two strings is measured by the number of (insertions, deletions, replacements) required to transform one string into the other. + The (king, 2) defines kin, 4 ; > * Useful to compensate for (OCR) errors. ** One of the technique used for pattern matching is ¢ similarity pattern takes into account the conc ‘ 1 or" which measures the number of operations required to transform one string into another. “* When specifying a similarity pattern, two main components are typically involved: the ** The string represents the target pattern or sequence that you want to find similar matches for, and the radius determines the maximum allowed difference or deviation from the target pattern. ‘+ For example, let's consider the with a . This means we are looking for strings that are similar to "cat" with a maximum edit distance of 1. "cat" (exact match) "bat" (substitution of 'c' with 'b’) "car" (substitution of 't! with 'r) "catz" (insertion of '2') "at" (deletion of 'c’) 19 > gs ne prob lem is given — X; X)- Xs 0 and Y = y, y> --- Ym, transform X to Y, based ona sequence three operations: and , so that for every operation COST(C;;) is incurred, * The objective of string editing is to identify a of edit operation that will transform X into Y. «» Example: consider the *% X= {aabab} and Y= {babb} * Identify a of edit operation that transform X into Y. Assume change , delete and insert 20 ** The minimum cost of any x; into y, y> ... yj (for i>0 and j>0) is the minimum of the three costs: rs OF X, X *% The following is used for COST(i,j). 0 if i=0, j=0 -_ J COST(+1,0) + D(x) i>0, j=0 COST(ii) COST(O,-1) + I(y,) j>0, i=0 COST‘(i) i>0, j>0 where COST'(i,j) = min { COST(i-1,j) + D(x), COST(i-1,j-1) + C(x, y)), COST(i,j-1) + I(y,) 21 = Transform t ic : % Xi={aabab} into Yj={babb} “> With of edit operation using dynamic programming approach, Assume that > and 1 unit. J 0 1 2} ** The value 3 at (5,4) is the optimal solution “ By tracing back one can determine which operations lead to ** Delete x,, Delete x, and) Insert y, Or, + Change x, to y, & Delete x,. ss Tene mur language To querying is . : Find all the documents that discuss “* “ campaign finance reforms, including documents that discuss violations of campaign financing regulations. * Do not include documents that discuss campaign contributions by the gun and the tobacco industries”. “+ Natural language queries are converted to a formal language for processing against a + Such translation requires and is still a 23 ** Pseudo NL processing: System scans the text and extracts recognized terms and The is not important. % Often used by : Recognizing the negation in the (“Do not include...”). : Users enter natural language clauses connected with , In the above example: “ "and not “ 24 9/25/2023 9/25/2023 26 ae L ee eeu neuen aed Seas aucune) ota iT Deu athe Pen) “No i of collection and searching environment. * Difficult to well designed for searching “+ Need for effective searching often naive attempt to information. “+ Documents initially retrieved: “Can be examined for (by the user or automatically by the system) to “> Improve for retrieving (using query reformulation techniques) 28 “+ Identify terms related to ' + Revise query to account for feedback using : Add related to query terms from relevant documents. 5 based on documents relevance for the users query. “Increase weight of terms in weight of terms in “ Several for 29 “+ Term weight vectors of documents among themselves. « Term weight vectors of documents for those of relevant documents. “+ Reformulated query: * Closer to term weight vectors of For query q: “ Dr: set of documents among “+ Dn: set of documents among Cr: set of among all documents in collection. B d fm oy “ a,B,y: tuning constants. % Initial formulation a=1 * Usually information in (<<). is more important than “+ Same comments as for the Gin = 04, +B Did, -y¥ Did; d,=Dr dj;eDn + Both Ide and Rochio: no optimal criterion. + E.g. you are given a qi = (2,3,1,2,5); and : d,(3,3,2,0,9); d,(2,2,1,0,12); d3(3,2,1,0,9); — d4(2,2,1,3,1); d5(1,2,1,3,3); 3 documents identified as , (ie. dj-d3); and 2 documents as (ie dy-ds). “+ Compute the modified query with o= B= yl +» Users relevance feedback: * Approaches based on feedback from users of documents retrieved. ++ Pseudo-relevance feedback: Approaches based on information derived from set of documents (local set of documents), which is called “+ Approaches based on derived from document collection, which is called 33 “ Most popular ' “ User presented with list of + User marks those which are “> In practice: are examined. % Select assessed relevant by users. + Enhance importance of these “% New and away from Query Reformulation 1. Docl 2. Doc2 3. Doc3 35 [Link] «+ After initial searching results are presented, allow the user to on the of the retrieved documents. * Use this. to reformulate the query. “+ Produce new results based on “+ Allows more a process. z Use ree sia explicit user input. “> Obtain automatically; + Identify terms related to (e.g. synonyms, stemming variations, terms close to query terms in text) “+ Just assume the top m , and use them to * Allows for that includes terms that are with the *%* Two B + Local strategies * Global strategies = e semi automatically ay query to determine query expansion. “* At query time, based on analysis of “ Base correlation analysis on only the “ PasctnOls for a specific query. « Avoids ambiguity by de s (correlated) terms only within : * “Apple computer” — “Apple computer Power book laptop” collection. “+ Determine term through a of the complete corpus. + Thesaurus-like structure using all documents: “+ Approach to (e.g. similarity thesaurus based on co-occurrence frequency) “+ Approach to + A thesaurus provides information on and and phrases. “+ Example: physician similar/synonymous: doctor, medical, MD related: general practitioner, surgeon 39 “ For , t, in a query, expand the query with synonyms and related ore of t from the “* May less than original query terms. “ Generally increases * May significantly , particularly with as terms. * “interest rate” > “interest rate fascinate evaluate” 40 * Global analysis requires only + Local analysis requires for every query at run time (although number of terms and documents is less than in global analysis). “> But gives better results. “ Term ambiguity may introduce correlated terms during + “Apple computer” — “Apple red fruit computer” 4 z On ly errr query ci terms Tee are in the sim(k,,Q) = ie, k,

You might also like