Deep linguistic processing is a natural language processing framework which draws on theoretical and descriptive linguistics . It models language predominantly by way of theoretical syntactic/semantic theory (e.g. CCG , HPSG , LFG , TAG , the Prague School ). Deep linguistic processing approaches differ from "shallower" methods in that they yield more expressive and structural representations which directly capture long-distance dependencies and underlying predicate - argument structures. The knowledge-intensive approach of deep linguistic processing requires considerable computational power, and has in the past sometimes been judged as being intractable. However, research in the early 2000s had made considerable advancement in efficiency of deep processing. Today, efficiency is no longer a major problem for applications using deep linguistic processing.
47-613: Traditionally, deep linguistic processing has been concerned with computational grammar development (for use in both parsing and generation). These grammars were manually developed, maintained and were computationally expensive to run. In recent years, machine learning approaches (also known as shallow linguistic processing ) have fundamentally altered the field of natural language processing . The rapid creation of robust and wide-coverage machine learning NLP tools requires substantially lesser amount of manual labor. Thus deep linguistic processing methods have received less attention. However, it
94-449: A computer programming language to create some form of internal representation; the parser is a key step in the compiler frontend . Programming languages tend to be specified in terms of a deterministic context-free grammar because fast and efficient parsers can be written for them. For compilers, the parsing itself can be done in one pass or multiple passes – see one-pass compiler and multi-pass compiler . The implied disadvantages of
141-425: A context-free grammar which recursively defines components that can make up an expression and the order in which they must appear. However, not all rules defining programming languages can be expressed by context-free grammars alone, for example type validity and proper declaration of identifiers. These rules can be formally expressed with attribute grammars . The final phase is semantic parsing or analysis, which
188-490: A parse tree showing their syntactic relation to each other, which may also contain semantic information. Some parsing algorithms generate a parse forest or list of parse trees from a string that is syntactically ambiguous . The term is also used in psycholinguistics when describing language comprehension. In this context, parsing refers to the way that human beings analyze a sentence or phrase (in spoken language or text) "in terms of grammatical constituents, identifying
235-429: A parser generator for efficient LL( k ) parsers, where k is any fixed value. LR parsers typically have only a few actions after seeing each token. They are shift (add this token to the stack for later reduction), reduce (pop tokens from the stack and form a syntactic construct), end, error (no known rule applies) or conflict (does not know whether to shift or reduce). Lookahead has two advantages. Example: Parsing
282-498: A knowledge-rich analysis of language through manually developed grammars and language resources. Whereas, shallow linguistic processing provides a knowledge-lean analysis of language through statistical/machine learning manipulation of texts and/or annotated linguistic resource. "Deep" computational linguists are divided in different sub-communities based on the grammatical formalism they adopted for deep linguistic processing. The major sub-communities includes the: The shortlist above
329-455: A one-pass compiler can largely be overcome by adding fix-ups , where provision is made for code relocation during the forward pass, and the fix-ups are applied backwards when the current program segment has been recognized as having been completed. An example where such a fix-up mechanism would be useful would be a forward GOTO statement, where the target of the GOTO is unknown until the program segment
376-415: A phrase such as "man bites dog" involves noting that the singular noun "man" is the subject of the sentence, the verb "bites" is the third person singular of the present tense of the verb "to bite", and the singular noun "dog" is the object of the sentence. Techniques such as sentence diagrams are sometimes used to indicate relation between elements in the sentence. Parsing was formerly central to
423-450: A potential problem is detected. The opposing, more contemporary model theorizes that within the mind, the processing of a sentence is not modular, or happening in strict sequence. Rather, it poses that several different syntactic possibilities can be considered at the same time, because lexical access, syntactic processing, and determination of meaning occur in parallel in the brain. In this way these processes are integrated. Although there
470-469: A rightmost derivation (although usually in reverse). Some graphical parsing algorithms have been designed for visual programming languages . Parsers for visual languages are sometimes based on graph grammars . Adaptive parsing algorithms have been used to construct "self-extending" natural language user interfaces . A simple parser implementation reads the entire input file, performs an intermediate computation or translation, and then writes
517-423: A separate lexical analyser , which creates tokens from the sequence of input characters; alternatively, these can be combined in scannerless parsing . Parsers may be programmed by hand or may be automatically or semi-automatically generated by a parser generator . Parsing is complementary to templating , which produces formatted output. These may be applied to different domains, but often appear together, such as
SECTION 10
#1732858831483564-432: A split or separation. The traditional grammatical exercise of parsing, sometimes known as clause analysis , involves breaking down a text into its component parts of speech with an explanation of the form, function, and syntactic relationship of each part. This is determined in large part from study of the language's conjugations and declensions , which can be quite intricate for heavily inflected languages. To parse
611-503: Is dependency grammar parsing. Most modern parsers are at least partly statistical; that is, they rely on a corpus of training data which has already been annotated (parsed by hand). This approach allows the system to gather information about the frequency with which various constructions occur in specific contexts. (See machine learning .) Approaches which have been used include straightforward PCFGs (probabilistic context-free grammars), maximum entropy , and neural nets . Most of
658-421: Is a meaningful symbol in the context of an arithmetic expression. The lexer would contain rules to tell it that the characters * , + , ^ , ( and ) mark the start of a new token, so meaningless tokens like " 12* " or " (3 " will not be generated. The next stage is parsing or syntactic analysis, which is checking that the tokens form an allowable expression. This is usually done with reference to
705-399: Is a software component that takes input data (typically text) and builds a data structure – often some kind of parse tree , abstract syntax tree or other hierarchical structure, giving a structural representation of the input while checking for correct syntax. The parsing may be preceded or followed by other steps, or these may be combined into a single step. The parser is often preceded by
752-429: Is completed. In this case, the application of the fix-up would be delayed until the target of the GOTO was recognized. Conversely, a backward GOTO does not require a fix-up, as the location will already be known. Context-free grammars are limited in the extent to which they can express all of the requirements of a language. Informally, the reason is that the memory of such a language is limited. The grammar cannot remember
799-473: Is known to be NP-complete . Head-driven phrase structure grammar is another linguistic formalism which has been popular in the parsing community, but other research efforts have focused on less complex formalisms such as the one used in the Penn Treebank . Shallow parsing aims to find only the boundaries of major constituents such as noun phrases. Another popular strategy for avoiding linguistic controversy
846-568: Is not exhaustively representative of all the communities working on deep linguistic processing. Parsing Parsing , syntax analysis , or syntactic analysis is the process of analyzing a string of symbols , either in natural language , computer languages or data structures , conforming to the rules of a formal grammar . The term parsing comes from Latin pars ( orationis ), meaning part (of speech) . The term has slightly different meanings in different branches of linguistics and computer science . Traditional sentence parsing
893-423: Is often performed as a method of understanding the exact meaning of a sentence or word, sometimes with the aid of devices such as sentence diagrams . It usually emphasizes the importance of grammatical divisions such as subject and predicate . Within computational linguistics the term is used to refer to the formal analysis by a computer of a sentence or other string of words into its constituents, resulting in
940-778: Is still much to learn about the neurology of parsing, studies have shown evidence that several areas of the brain might play a role in parsing. These include the left anterior temporal pole, the left inferior frontal gyrus, the left superior temporal gyrus, the left superior frontal gyrus, the right posterior cingulate cortex, and the left angular gyrus. Although it has not been absolutely proven, it has been suggested that these different structures might favor either phrase-structure parsing or dependency-structure parsing, meaning different types of parsing could be processed in different ways which have yet to be understood. Discourse analysis examines ways to analyze language use and semiotic events. Persuasive language may be called rhetoric . A parser
987-477: Is substantial ambiguity in the structure of human language, whose usage is to convey meaning (or semantics ) amongst a potentially unlimited range of possibilities, but only some of which are germane to the particular case. So an utterance "Man bites dog" versus "Dog bites man" is definite on one detail but in another language might appear as "Man dog bites" with a reliance on the larger context to distinguish between those two possibilities, if indeed that difference
SECTION 20
#17328588314831034-456: Is the belief of some computational linguists that in order for computers to understand natural language or inference , detailed syntactic and semantic representation is necessary. Moreover, while humans can easily understand a sentence and its meaning, shallow linguistic processing might lack human language 'understanding'. For example: In sentence (a), a shallow information extraction system might infer wrongly that Microsoft's headquarters
1081-421: Is used to identify parts of speech, these sentences challenge the parsing ability of the reader. Another type of sentence that is difficult to parse is an attachment ambiguity, which includes a phrase that could potentially modify different parts of a sentence, and therefore presents a challenge in identifying syntactic relationship (i.e. "The boy saw the lady with the telescope", in which the ambiguous phrase with
1128-419: Is working out the implications of the expression just validated and taking the appropriate action. In the case of a calculator or interpreter, the action is to evaluate the expression or program; a compiler, on the other hand, would generate some kind of code. Attribute grammars can also be used to define these actions. The task of the parser is essentially to determine if and how the input can be derived from
1175-468: The scanf / printf pair, or the input (front end parsing) and output (back end code generation) stages of a compiler . The input to a parser is typically text in some computer language , but may also be text in a natural language or less structured textual data, in which case generally only certain parts of the text are extracted, rather than a parse tree being constructed. Parsers range from very simple functions such as scanf , to complex programs such as
1222-454: The shift-reduce algorithm. A somewhat recent development has been parse reranking in which the parser proposes some large number of analyses, and a more complex system selects the best option. In natural language understanding applications, semantic parsers convert the text into a representation of its meaning. In psycholinguistics , parsing involves not just the assignment of words to categories (formation of ontological insights), but
1269-570: The Expression 1 + 2 * 3 Most programming languages (except for a few such as APL and Smalltalk) and algebraic formulas give higher precedence to multiplication than addition, in which case the correct interpretation of the example above is 1 + (2 * 3) . Note that Rule4 above is a semantic rule. It is possible to rewrite the grammar to incorporate this into the syntax. However, not all such rules can be translated into syntax. Initially Input = [1, +, 2, *, 3] The parse tree and resulting code from it
1316-407: The brain. One such model is a more traditional generative model of sentence processing, which theorizes that within the brain there is a distinct module designed for sentence parsing, which is preceded by access to lexical recognition and retrieval, and then followed by syntactic processing that considers a single syntactic result of the parsing, only returning to revise that syntactic interpretation if
1363-472: The common case of parsing a computer language with two levels of grammar: lexical and syntactic. The first stage is the token generation, or lexical analysis , by which the input character stream is split into meaningful symbols defined by a grammar of regular expressions . For example, a calculator program would look at an input such as " 12 * (3 + 4)^2 " and split it into the tokens 12 , * , ( , 3 , + , 4 , ) , ^ , 2 , each of which
1410-455: The desired structure is not context-free , some kind of context-free approximation to the grammar is used to perform a first pass. Algorithms which use context-free grammars often rely on some variant of the CYK algorithm , usually with some heuristic to prune away unlikely analyses to save time. (See chart parsing .) However some systems trade speed for accuracy using, e.g., linear-time versions of
1457-415: The entire output file, such as in-memory multi-pass compilers . Alternative parser implementation approaches: Some of the well known parser development tools include the following: Lookahead establishes the maximum incoming tokens that a parser can use to decide which rule it should use. Lookahead is especially relevant to LL , LR , and LALR parsers , where it is often explicitly indicated by affixing
Deep linguistic processing - Misplaced Pages Continue
1504-455: The evaluation of the meaning of a sentence according to the rules of syntax drawn by inferences made from each word in the sentence (known as connotation ). This normally occurs as words are being heard or read. Neurolinguistics generally understands parsing to be a function of working memory, meaning that parsing is used to keep several parts of one sentence at play in the mind at one time, all readily accessible to be analyzed as needed. Because
1551-475: The frontend of a C++ compiler or the HTML parser of a web browser . An important class of simple parsing is done using regular expressions , in which a group of regular expressions defines a regular language and a regular expression engine automatically generating a parser for that language, allowing pattern matching and extraction of text. In other contexts regular expressions are instead used prior to parsing, as
1598-420: The human working memory has limitations, so does the function of sentence parsing. This is evidenced by several different types of syntactically complex sentences that propose potentially issues for mental parsing of sentences. The first, and perhaps most well-known, type of sentence that challenges parsing ability is the garden-path sentence. These sentences are designed so that the most common interpretation of
1645-449: The lexing step whose output is then used by the parser. The use of parsers varies by input. In the case of data languages, a parser is often found as the file reading facility of a program, such as reading in HTML or XML text; these examples are markup languages . In the case of programming languages , a parser is a component of a compiler or interpreter , which parses the source code of
1692-408: The lookahead to the algorithm name in parentheses, such as LALR(1). Most programming languages , the primary target of parsers, are carefully defined in such a way that a parser with limited lookahead, typically one, can parse them, because parsers with limited lookahead are often more efficient. One important change to this trend came in 1990 when Terence Parr created ANTLR for his Ph.D. thesis,
1739-524: The more successful systems use lexical statistics (that is, they consider the identities of the words involved, as well as their part of speech ). However such systems are vulnerable to overfitting and require some kind of smoothing to be effective. Parsing algorithms for natural language cannot rely on the grammar having 'nice' properties as with manually designed grammars for programming languages. As mentioned earlier some grammar formalisms are very difficult to parse computationally; in general, even if
1786-438: The parts of speech, syntactic relations, etc." This term is especially common when discussing which linguistic cues help speakers interpret garden-path sentences . Within computer science, the term is used in the analysis of computer languages , referring to the syntactic analysis of the input code into its component parts in order to facilitate the writing of compilers and interpreters . The term may also be used to describe
1833-426: The potentially exponential number of parse trees. Their algorithm is able to produce both left-most and right-most derivations of an input with regard to a given context-free grammar . An important distinction with regard to parsers is whether a parser generates a leftmost derivation or a rightmost derivation (see context-free grammar ). LL parsers will generate a leftmost derivation and LR parsers will generate
1880-462: The presence of a construct over an arbitrarily long input; this is necessary for a language in which, for example, a name must be declared before it may be referenced. More powerful grammars that can express this constraint, however, cannot be parsed efficiently. Thus, it is a common strategy to create a relaxed parser for a context-free grammar which accepts a superset of the desired language constructs (that is, it accepts some invalid constructs); later,
1927-496: The sentence appears grammatically faulty, but upon further inspection, these sentences are grammatically sound. Garden-path sentences are difficult to parse because they contain a phrase or a word with more than one meaning, often their most typical meaning being a different part of speech. For example, in the sentence, "the horse raced past the barn fell", raced is initially interpreted as a past tense verb, but in this sentence, it functions as part of an adjective phrase. Since parsing
Deep linguistic processing - Misplaced Pages Continue
1974-676: The start symbol of the grammar. This can be done in essentially two ways: LL parsers and recursive-descent parser are examples of top-down parsers that cannot accommodate left recursive production rules . Although it has been believed that simple implementations of top-down parsing cannot accommodate direct and indirect left-recursion and may require exponential time and space complexity while parsing ambiguous context-free grammars , more sophisticated algorithms for top-down parsing have been created by Frost, Hafiz, and Callaghan which accommodate ambiguity and left recursion in polynomial time and which generate polynomial-size representations of
2021-475: The teaching of grammar throughout the English-speaking world, and widely regarded as basic to the use and understanding of written language. However, the general teaching of such techniques is no longer current. In some machine translation and natural language processing systems, written texts in human languages are parsed by computer programs. Human sentences are not easily parsed by programs, as there
2068-532: The telescope could modify the boy saw or the lady.) A third type of sentence that challenges parsing ability is center embedding, in which phrases are placed in the center of other similarly formed phrases (i.e. "The rat the cat the man hit chased ran into the trap".) Sentences with 2 or in the most extreme cases 3 center embeddings are challenging for mental parsing, again because of ambiguity of syntactic relationship. Within neurolinguistics there are multiple theories that aim to describe how parsing takes place in
2115-491: The unwanted constructs can be filtered out at the semantic analysis (contextual analysis) step. For example, in Python the following is syntactically valid code: The following code, however, is syntactically valid in terms of the context-free grammar, yielding a syntax tree with the same structure as the previous, but violates the semantic rule requiring variables to be initialized before use: The following example demonstrates
2162-579: Was located in Georgia. While as humans, we understand from the sentence that Microsoft office was never in Georgia. In sentence (b), a shallow system could wrongly infer that Israel was established in May 1971. Humans know that it is the National Institute for Psychobiology that was established in 1971. In summary of the comparison between deep and shallow language processing, deep linguistic processing provides
2209-448: Was of concern. It is difficult to prepare formal rules to describe informal behaviour even though it is clear that some rules are being followed. In order to parse natural language data, researchers must first agree on the grammar to be used. The choice of syntax is affected by both linguistic and computational concerns; for instance some parsing systems use lexical functional grammar , but in general, parsing for grammars of this type
#482517