# Context model

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Context_model
> Markdown URL: https://mediated.wiki/source/Context_model.md
> Source: https://en.wikipedia.org/wiki/Context_model
> Source revision: 1350107628
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Software engineering concept}}
A '''context model''' (or context modeling) defines how context data are structured and maintained (It plays a key role in supporting efficient context management).<ref>{{cite book | title=Rapid integration of software engineering techniques | publisher=Springer | author1=Nicolas Guelfi | author2=Anthony Savidis | year=2006 | page=131 | isbn=3-540-34063-7 | url=https://archive.org/details/rapidintegration0000rise/page/131 }}</ref> It aims to produce a formal or semi-formal description of the context information that is present in a [context-aware](/source/Context_awareness) system. In other words, the context is the surrounding element for the system, and a model provides the mathematical interface and a behavioral description of the surrounding environment.

It is used to represent the reusable context information of the components (The top-level classes consist of [Operating system](/source/Operating_system), component container, [hardware](/source/Computer_hardware) requirement and [Software](/source/Software) requirement).

A key role of context model is to simplify and introduce greater structure into the task of developing context-aware applications.<ref>{{cite book | title=The Engineering Handbook of Smart Technology for Aging, Disability and Independence | publisher=Wiley |author1=Abdelsalam Helal |author2=Mounir Mokhtari |author3=Bessam Abdulrazak |  year=2008 | pages=592 | isbn=978-0-471-71155-1}}</ref><ref name="cmt">{{cite journal | last1 = Trullemans | first1 = Sandra | first2 = Lars | last2 = Van Holsbeeke | first3 = Beat | last3 = Signer | title = The Context Modelling Toolkit: A Unified Multi-Layered Context Modelling Approach | journal = Proceedings of the ACM on Human-Computer Interaction (PACMHCI), 1(1) | pages = 7:1–7:16 | publisher = ACM | year = 2017 | url = https://www.academia.edu/33265122 }}</ref>  [Prompt engineering](/source/Prompt_engineering) is equivalent to context engineering, where a [Large language model](/source/Large_language_model) prompt establishes a context for a development task.

==Examples of context models==

The [Unified Modeling Language](/source/Unified_modeling_language) as used in systems engineering defines a context model as the physical scope of the system being designed, which could include the user as well as the environment and other actors. A [system context diagram](/source/system_context_diagram) represents the context graphically..

Several examples of context models occur under other domains.

* In the situation of parsing a [grammar](/source/grammar), a context model defines the surrounding text of a [lexical element](/source/Lexical_item). This enables a [context sensitive grammar](/source/Context-sensitive_grammar) that can have [deterministic](/source/deterministic) or [stochastic](/source/stochastic) rules. In the latter case, a [hidden Markov model](/source/hidden_Markov_model) can provide the probabilities for the surrounding context.<ref name="grammar">Klein, Dan, and Christopher D. (2002) Manning.  [https://web.archive.org/web/20051111080850/http://acl.ldc.upenn.edu/P/P02/P02-1017.pdf "A generative constituent-context model for improved grammar induction."] In Proceedings of the 40th Annual Meeting on Association for Computational Linguistics, pp. 128-135. Association for Computational Linguistics.</ref>
* A context model can also apply to the surrounding elements in a [gene sequence](/source/gene_sequence). Like the context rules of a grammar disambiguating a lexical element, this helps to disambiguate the role of the gene.<ref name="gene">{{cite journal|pmid=10556321 |pmc=148753 |doi=10.1093/nar/27.23.4636|title=Improved microbial gene identification with GLIMMER |year=1999 |last1=Delcher |first1=A. |last2=Harmon |first2=D. |last3=Kasif |first3=S. |last4=White |first4=O. |last5=Salzberg |first5=S. L. |journal=Nucleic Acids Research |volume=27 |issue=23 |pages=4636–4641 }}</ref>
* In enterprise automation, context models can dynamically adpt user interaction. For example, the Intelligent Filing Manager system (Mukherjee, 1999) used a rule-based engine to control a Q&A interface for generating regulatory forms. Based on user input and jurisdiction, it adapted which fields and questions were presented. This context-driven logic was presented at the IEEE International Conference on Systems, Man, and Cybernatics in 1999.<ref>{{Cite journal |last=Mukherjee |first=K.C. |date=1999 |title=Automating forms publishing with the Intelligent Filing Manager |url=http://ieeexplore.ieee.org/document/814108/ |publisher=IEEE |volume=1 |pages=308–313 |doi=10.1109/ICSMC.1999.814108 |isbn=978-0-7803-5731-0|url-access=subscription }}</ref>
* Within an [ontology](/source/ontology_(information_science)), a context model provides disambiguation of a subject via [semantic analysis](/source/Semantic_analysis_(knowledge_representation)) of information related to the subject.<ref name="ont1">{{cite journal | last1 = Wang | first1 = Xiao Hang | first2 = D. Qing | last2 = Zhang | first3 = Tao | last3 = Gu | first4 = Hung Keng | last4 = Pung | title = Ontology based context modeling and reasoning using OWL | journal = Proceedings of the Second IEEE Annual Conference on Pervasive Computing and Communications Workshops | pages = 18–22 | publisher = IEEE | year = 2004 | citeseerx = 10.1.1.3.9626 }}</ref><ref name="ont2">{{cite journal | url = http://www-public.it-sudparis.eu/~zhang_da/pub/Ontology-2004-2.pdf | last1 = Gu | first1 = Tao | first2 = Xiao Hang | last2 = Wang | first3 = Hung Keng | last3 = Pung | first4 = Da Qing | last4 = Zhang | title = An ontology-based context model in intelligent environments | journal = Proceedings of Communication Networks and Distributed Systems Modeling and Simulation Conference | volume = 2004 | pages = 270–275 | year = 2004}}</ref>
* In terms of a physical environment, a context model defines the external interfaces that a system will interact with. This type of context model has been used to create models for [virtual environment](/source/virtual_environment)s such as the [Adaptive Vehicle Make](/source/Adaptive_Vehicle_Make) program.  A context model used during design defines land, aquatic, or atmospheric characteristics (stated in terms of mathematical algorithms or a simulation) that the eventual product will face in the real environment.<ref name="c2m2l">[https://www.fbo.gov/utils/view?id=e151081630f5eb16692e286f00e450ad  Component, Context, and Manufacturing Model Library – 2 (C2M2L-2)], Broad Agency Announcement, DARPA-BAA-12-30, February 24, 2012</ref>
*  In the context of [large language model](/source/large_language_model)s, a context model refers to a component or aspect of the [language model](/source/language_model) that focuses on understanding and incorporating contextual information from the input text. The main purpose of a context model is to provide the language model with a better understanding of the context surrounding words, phrases, or sentences, so that it can generate more coherent and contextually appropriate responses. In [deep learning](/source/deep_learning)-based language models like [GPT-4](/source/GPT-4) or [BERT](/source/BERT_(language_model)), the context model is an inherent part of the architecture. These models use mechanisms such as [attention mechanism](/source/attention_mechanism)s and multi-layered [transformer (machine learning)](/source/transformer_(machine_learning)) architectures to capture contextual information from the input sequence. The context model takes into account the relationships between words and their surrounding text, helping the language model understand the meaning of a word in a specific context, handle ambiguities, and generate more accurate and coherent responses.
* Examples of AI-based [weather forecasting](/source/weather_forecasting) systems that apply context models include [Google DeepMind](/source/Google_DeepMind)'s [GraphCast](/source/GraphCast), [Huawei](/source/Huawei)'s [PanguWeather](/source/PanguWeather), and [NVIDIA](/source/NVIDIA)'s [FourCastNet](/source/FourCastNet), drawing from historical and re-analysis context data. In general, the approach is to match up current conditions using past data as context and then apply a mix of physics and historical outcomes to form a projection.

== References ==

{{reflist}}

Category:Systems analysis

---
Adapted from the Wikipedia article [Context model](https://en.wikipedia.org/wiki/Context_model) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Context_model?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
