Interpret linguisitc hedges¶
%load_ext rich
import pyuncertainnumber as pun
hedges indicate uncertainty¶
Minimally, qualitative linguistic description may be used to express the estimates over numerical input values. Those are called numerical hedges, which may include colloquial words such as “about”, “around”, “almost” etc. With the focus on NLP (Natural Language Processing) in many deep learning applications in recent years, the interpretation of hedged words and their quantitative implication of uncertainty is vital for downstream safety-related applications. pyuncertainnumber provides support to interpret these hedges in an effort to build a consistent basis for consistent uncertainty elicitation and communication in situations where empirical information is almost minimal. Importantly, real numbers such as “7” or “7.0” can also be interpreted as an interval based on significant digits, potentially leading to a complete system of rigorous numerical numbers.
pun.hedge_interpret("about 7")
[5.0,9.0]
pun.hedge_interpret("exactly 7")
[6.9,7.1]
pun.hedge_interpret("around 7")
[-3.0,17.0]
pun.hedge_interpret("7")
[6.5,7.5]
pun.hedge_interpret("7.0")
[6.95,7.05]
hedges could also be represented as p-boxes¶
In essence, hedges are used to characterise either an interval or a p-box. So, in the function hedge_interpred() you get to add the additional argument to specify which type you want. But, in the constructor pun.I() it has already indicated to return an interval.
p = pun.hedge_interpret("about 7", return_type="pbox")
characterise model inputs with hedges¶
When empirical knowledge about model parameters/inputs are minimal to only qualitive descriptions, one could construct uncertain numbers accordingly. See xxx for additional details regarding the effects of significant digits in the number.
pun.I("7")
UncertainNumber(essence='interval', intervals=[6.5,7.5], _construct=[6.5,7.5], nominal_value=7.0)
pun.I("7.0")
UncertainNumber(essence='interval', intervals=[6.95,7.05], _construct=[6.95,7.05], nominal_value=7.0)
pun.I("7.00")
UncertainNumber(essence='interval', intervals=[6.995,7.005], _construct=[6.995,7.005], nominal_value=7.0)
pun.I("about 7")
UncertainNumber(essence='interval', intervals=[5.0,9.0], _construct=[5.0,9.0], nominal_value=7.0)