The contextual analysis helps to assess the text, for example, in its historical, cultural or social context. It may also charcterise the text in terms of its textuality. Generally, contextual analysis considers all the circumstances in the emergence of the text.
Some key questions are:
What does the text reveal about itself as a text?
What does the text tell us about its apparent intended audience(s)?
What seems to have been the author’s intention?
What is the occasion for this text?
...
The semantic analysis deals with the meaning of the text.
In more detail, during a semantic analysis the meaning of the terms in their textual context is examined to understand the meaning of the entire text. One can say, the meaning of the entire text is opend up from the different levels of its syntactic parts.
Thanks for your detail answer...actually i want to ask usually we select key terms from a huge text if we see these terms can they capture context of whole text, in this regard which things should we consider?
For capturing the context you should consider the neighbourhood of the key terms you found (e.g., word n-grams). Using a semantic dictionary, e.g. WordNet, will help to distinguish possibly different meanings of words. The usage of an ontology for introducing knowledge about relationships between terms may be useful as well.
I think studying some work in the field of automatic text summarization will be useful.
The terms "semantic" and "contextual" can sometimes become conflated, so I can understand your need to ask this question. They both describe the application of meaning to words and their subsequent use in language. If we were discussing pure comm. theory and not any kind of text analysis using lemmatization, n-gram proximity, NLP, etc. I'd say that the adjective semantic applies to studying the meaning or a word or term both in and out of context. The adjective contextual simply implies that one is studying the overall meaning of the words (plural) that appear in a structured document or piece of writing or speech taken together to have an applied meaning based on how the words are used together. While a word or term can have one or several direct meaning(s) by itself, context in language can specify (or disambiguate from other meanings) the meaning of a word based on grammatical usage.
The irony of the terms "semantic analysis" and "contextual analysis" in modern computer-based text analysis is that semantic analysis (possibly also referred to as ontological analysis) has come to describe the method of studying a text or document looking at the terms/tags that appear within and looking at their relationship to one another to disambiguate their meanings and provide actual contextual understanding of what was written. Contextual analysis, on the other hand, stops at the level of words or terms without looking more deeply into contextual relationships between them and actually provides less of a contextual understanding of the text or document than semantic analysis.