Here is a term paper on ‘Semantic Language Processing’. Find paragraphs, long and short term papers on ‘Semantic Language Processing’ especially written for school and college students.

Term Paper # 1. Introduction to Semantic Language Processing:

Syntactic analysis shows how a sentence is correctly constructed according to the rules of the language. However, it does not check whether the sentence is meaningful, or gives information about its meaning. For this we need to perform semantic analysis. Semantic analysis enables us to determine the meaning of the sentence, which may vary depending on context; a system for understanding children’s stories and a natural language interface may assign different meanings to the same word.

Take the word ‘run, for example:

In a children’s story this is likely to refer to quick movement, while in a natural language interface it is more likely to be an instruction to execute a program or even a run in the game of cricket. There are two levels at which semantic analysis can operate: the lexical level and the sentence level.

ADVERTISEMENTS:

Lexical processing involves looking up the meaning of the word in the lexicon. However, many words have several meanings within the same lexical category (for example, the noun ‘square’ may refer to a geometrical shape or an area of a town). In addition, the same word may have further meanings under different lexical categories: ‘square’ can also be an adjective meaning ‘not trendy’, or a verb meaning ‘reconcile’.

The latter cases can be disambiguated syntactically but the former rely on reference to known properties of the different meanings. Ultimately, words are understood in the context of the sentences in which they occur. Therefore lexical processing alone is inadequate. Sentence level processing on the other hand does take context into account.

Term Paper # 2. Approaches to Semantic Language Processing:

There are a number of approaches to sentence-level processing but we will look briefly only at two:

1. Semantic Grammars:

ADVERTISEMENTS:

Now that we have seen that syntactic grammars enable us to parse sentences according to their structure and, in the case of context-sensitive grammars in terms of attributes such as number and tense. However, syntactic grammars provide no representation of the meaning of the sentence, so it is still possible to parse nonsense if it is written in correctly structured sentences.

In a semantic grammar, the symbols and rules have semantic as well as syntactic significance. Semantic actions can also be associated with a rule, so that a grammar can be used to translate a natural language sentence into a command or query.

Let us take another look at our two sentences:

“WHO BELONGS TO A COLLEGE? AND, DOES AMITSHARMA WORK IN THE DEPARTMENT?” We know how to generate a syntactic grammar to deal with these sentences but we really need to derive a grammar which takes into account not only the syntax of the sentences but their meaning as well.

ADVERTISEMENTS:

In the context of a query interpreter, meaning is related to the form of the query which we will make to the database in response to the question. So what we would like is a grammar which will not only parse our sentence, but interpret its meaning and convert it into a database query. This is exactly what we can do with a semantic grammar.

In following the grammar, a query is built up as part of the semantic analysis of the sentence: when a rule is matched, the query template associated with it (shown in square brackets) is instantiated.

The grammar is generated as follows:

First, sentence structures are identified.

ADVERTISEMENTS:

Our sentences represent two types of questions:

i. The first is looking for information (Names of College IT Department Teachers),

ii. The second for a yes/no answer.

So we define two legal sentence structures, the first seeking information and preceded by the word ‘who’, the second seeking a yes/no response, preceded by the word ‘does’. The action associated with these rules is to set up a query which will be whatever is the result of parsing the INFO or YN structures. Having done this we need to determine the structure of the main query parts.

ADVERTISEMENTS:

We will concentrate on the INFO category to simplify matters but the YN category is generated in the same way. Words are categorised in terms of their meaning to the query (rather than, their syntactic category). Therefore, the words “belong to” and “work in” are semantically equivalent, because they require the same query (but with different information) to answer.

Both are concerned with who is in what organisation. Similarly, ‘college’ and ‘department’ are also classed as semantically equivalent: they are both examples of a type of organisation, obviously, such an interpretation is context dependent.

If, instead of a query interpreter, we wanted our natural language processing system to understand a political manifesto, then the semantic categories would be very different. INFO is therefore a structure which consists of an AFFIL_VB (another category) followed by an ORG. Its associated action is to return the query which results from parsing AFFIL_VB.

The rest of the grammar is built up in the same way down to the terminals, which return the values matched from the input sentence. The full grammar is shown in Fig. 10.14, for the above sentences respectively. Parse trees for these sentences are shown in figures 10.15 and 10.16. These show how the query is built up at every stage in the parse. Instantiation of the query components works from the bottom of the tree and moves up.

Using the grammer we can get the parsers:

query : is_in (PERSON, org (NAME, college))

query: is_in (Amit Sharma. Org(IT, Department))

 

 

2. Case Grammars:

Semantic grammars are designed to give a structural and semantic parse of the sentence. Grammars can get very big as a result. Case grammars represent the semantics in the first instance, ignoring the syntactic, so reducing the size of the grammar Verbs W.

For example, a sentence such as “Talwar wrote the letter” would be represented as:

Wrote (agent (Talwar), object (letter))

This indicates that Talwar was the active participate, the agent, who performed the action ‘wrote’, on the object ‘letter’. The passive version, “the letter was written by Talwar” would be represented in the same way, since the meaning of the sentences is identical.

Case grammars rely on cases, which describe relationships between verbs and their arguments.

A number of cases are available to build case grammar representations the following list gives only a few cases:

i. (S) Source:

Place from which something moves.

ii. (L) Locate:

Place of event.

iii. (A) Agent:

The person or thing performing the action.

iv. (F) Action:

A object or being resulting from the event.

v. (O) Object:

The person or thing to which something is done or the action is performed upon.

vi. (I) Instrument:

The person or thing which allows an agent to perform an action.

vii. (T) Time:

The time at which an action occurs.

viii. (B) Beneficiary:

The person or thing benefiting from an action.

ix. (G) Goal:

The place reached by the action.

x. (D) Direction:

Which action is oriented.

xi. (E) Experiencer:

The entity which receives or accepts or experiences or undergoes the effect of an action.

So, for example, the sentence “At 1 pm, Paul hit the bell with the hammer for lunch” would be parsed as

hit (time(1pm), agent (Paul), object (bill), instrument(hammer),goal(lunch)) If we changed the sentence to At 1 pm, Paul hit the bill with the hammer for his father, the case representation would be

hit (time (1pm), agent (Paul),object (bell), instrument (hammer), beneficiary (his father)

The process of parsing into a case representation is heavily directed by the lexical entries associated with each verb. Fig. 10.17., shows examples of a few such entries. Optional cases are indicated in parentheses.

The case structures can be used to derive syntactic structures, by using rules to map from the semantic components which are present in the syntactic structures which are expected to contain these components. However, case grammars do not provide a full semantic representation, since the resulting parse will still contain English words which must be understood.

Definite Clause Grammar:

The problem of subject – verb agreement be fixed by introducing new categories such as NPs and NPo to stand for noun phrases in the subjective and objective case respectively.

The category pronoun would be split into two categories:

Pronoun S, which includes ‘I and pronoun which includes ‘me’

The following table shows the complete BNF grammar for case Table:

agreement. The resulting NP rules must be duplicated, once for NPs and other for NPo.

But this form of language over generates, as English and other languages require, agreement between the subject and the main verb of a sentence. For example, if’ I is the subject the “I smell” is grammatical, but I ‘smells’ is not. If ‘it’ is the subject we get the reverse- “it smells” which is grammatically incorrect.

In English, the agreement distinctions are minimal: most verbs have one form for the third person singular subjects (he, she or it) and a second form for other combinations of person and number.

There is one exception:

“I am/you are/he is” has three forms. If we multiply these three by the two distinctions of NPs and NPo, we end up with six forms of NP. Thus there are exponential forms with more distinctions.

The alternative is to argument the existing rules of the grammar instead of introducing new rules.

We shall first give an example of what the augmented rules would look like:

Augmented rules allow for parameters on non-terminal categories, as in the case of NP and pronoun categories parameters indicate their case (Nouns do not have case in English, other language do have). In the rule for 8 the NP must be in the subjective case, whereas in the rules for VP and PP, the NP must be in the objective case.

The rule for NP takes a variable case as its adjustment. The intent is that NP can have any case; but if the NP is rewritten as a pronoun, then it must have the same case. This use of a variable, avoiding a decision where distinction is not important, is what keeps the size of the rule set from growing exponentially with the number of features.

This formalism for augmentation is called the Definite Clause Grammar (DCG) because each grammar rule can be interpreted as a definite clause in Horn Logic (has exactly one atom in its consequent and a conjunction of zero or more atom in its antecedent, for example, A ˄ B→ C and just C).

First we shall show how a normal augmented rule can be interpreted as a definite clause. We consider each category symbol to be a predicate on strings, so that NP(S) is true if the string S forms on NP.

The CFG rule:

S → NPVP

is the short hand for the definite clause

NP (S1) ˄ VP (S2) S (S1 + S2)

Here S1 + S2 denote the concentration of two strings so this rule says that if the string S1 is an NP and S2 is a VP then their concentration is an S, which is exactly how we were already interpreting the CFG rule. DCGs also allow us to talk about parsing as logical inference.

The real benefit of the DCG approach is that we can augment the category symbols with additional arguments other than the string argument.

For example, the rule:

NP (Case) → NP (Case, S1)

This means that if string S1 is a pronoun with case specified by the variable case, then S1 is also an NP with the same case. In general, we can augment a category symbol with any number of arguments and the arguments which are subject to unification as in regular Horn clause inference.