Re: [EXTERNAL] Re: Thoughts on mrow default intent

First off, let me say it is great to see some discussion about lifting our
heads from our work and asking "why"? Sometimes, I (and I suspect others)
start chasing a rabbit and follow it down the hole to find some magical
things that make us forget why we started the chase in the first place.

Speaking math gets difficult when we start running into ambiguities. For
some ambiguities, it is not too hard to resolve. The "absolute value" vs
"determinant" case is relatively easy because one can look at the
children... until you realize that 'M' might mean a matrix, so the child
being a table is no longer enough to determine when to say "determinant".
So ok, add another pattern to pick up a capital letter since |M| or |A| is
probably a determinant. But that fails for |M×N|, so maybe more patterns.
It gets ugly quickly which is why doing semantic speech is hard (ASFAIK,
few speech engines try to do both absolute value and determinant, and none
goes beyond the capital letter pattern). And we haven't even gotten to the
other words used for |...|.

There hasn't been a study comparing syntactic speech (which is sort what
the Nemeth braille code-based speech "MathSpeak" is about) vs semantic
speech, but virtually every visually impaired middle and high school
student I've spoken to says they want semantic speech. Not surprising
because that's what the teachers in the classroom use. Hence, the focus on
figuring out what is meant by the notation.

Returning to generating speech... Writing patterns to guess what to say
gets pretty messy. But the pattern to match to figure out what to say
becomes very simple if the meaning is given. However, it also depends on
how it is displayed. For Content MathML, the meaning is pretty clear, but
there is no presentation so
   <apply><divide/>....</apply>
tells me that it is division, but doesn't tell me whether I should say "a
slash b" or "fraction a over b end fraction". So what to speak is really a
combination of presentation and content. I think most people agree that
Content MathML isn't used much, and that parallel markup is used even less
frequently. Hence our search for an alternative that is good for
accessibility, good for search, and good for computation.

The original idea I had was to have two attrs: subject and mathrole.
mathrole had no fancy syntax, just a simple value. For all that it
mattered, the absolute value and determinate cases could have been encoded
as
    <mrow mathrole="role1"> <mo>(</mo> ....
and
    <mrow mathrole="role2"> <mo>(</mo> ....

For accessibility, it is a simple pattern match and from there the words
are generated. Maybe the words are "the determinant of" or just "det" --
that's a choice the AT tool makes based on user preferences (verbose,
terse, blind, dyslexic, ...). In many cases the words would be the same for
those groups, but in others they may differ. And they may differ based on
the values (e.g., 1/3 or x^2). They would certainly differ in a different
language. The important thing for AT is the simplicity of the pattern
match: if all the ambiguities were resolved this way, the AT checks to see
if there is something "special" (i.e., mathrole is given) and if not, falls
back on some specified default which likely involves reading the symbols as
is with their default words as specified by the Unicode spec (translated to
another language if needed).

That fixed (arbitrary) name works well for a *known *core (our Core Level
1), but fails outside that realm since there would be no entry in the
lookup table. That's where Denyan's idea that the intent should be the word
to say (or maybe not say depending on preferences) is useful -- I'm not
sure whether he feels this simple model still makes sense now that he has
~1,000 things in his level 3 list
<https://docs.google.com/spreadsheets/d/1EsWou1K5nxBdLPvQapdoA9h-s8lg_qjn8fJH64g9izQ/edit#gid=1818558895>.
Still, the distinction between "common" notations where people have
developed conventions on how they are spoken, often dependent on the values
vs less common ones where there is likely just a choice between saying "0"
or "zero vector" (to take an example from the end of his list) seems like a
good distinction that mostly works. So I think "mathrole" would work for
Deyan's list also.

However, mathrole="word" isn't good for computation, and probably not great
for search. So that leads to the more complicated "intent" syntax that
we've been developing/exploring over the last many months. For
accessibility, it's likely most of this syntax is irrelevant and just the
function name is all the AT software cares about as long as it is unique --
that's the word that the pattern match cares about and then the code is off
to the races. This probably glosses over some cases where more work is
needed, but it deals with the vast majority of the messy patterns that need
to be written to *guess* what the author meant. [I'm ignoring flat mrows
like 'a+b=c' where intent has to nest function names; in MathPlayer and
SRE, flat mrows are parsed and so don't exist in the end. With an intent
given, it complicates the parse a bit because the intent would likely need
to be examined first in place of parsing the contents, but in the end, flat
mrows would be gone].**

So for accessibility, what we are doing with "intent" is overkill. If
accessibility is all the CG cares about, then I think we shouldn't have
chased the rabbit down the hole. However, I think the bigger picture is
that we care about not only AT, but search and computation. And for at
least computation, I see the work the group has done on "intent" a
relatively easy way for MathML generators and for remediators to more
clearly specify intent. Defaulting, especially with specification of
"subject" area (which we haven't discussed much yet), probably vastly
simplifies a remediator's job. Hence, my feeling is that like Alice, we
have learned something by going down this rabbit hole.

Sorry for the long reply, but I wanted to share why I think we are on the
right track and why intent works for accessibility. Also, I couldn't pass
up the chance to use Alice in Wonderland as a metaphor :-)

     Neil


** For MathML newcomers, MathML has an operator dictionary that defines
many default properties of operators (I have spent weeks fixing the
operator dictionary for MathML 4, so don't bother pointing bugs in
the MathML 3 operator dictionary). One of properties associated with an
operator is "form", which says it is prefix, infix, or postfix. Another
property is "priority". That says how it is parsed. That removes ambiguity
from what a flat mrow structure *should* be. It defines a default. If
someone wants to say an operator has a different priority, they can do so.
That would allow the "algebra" parsing in the NYT article, although I find
the "algebra" parsing dubious as I was never taught it and calculators
don't follow those rules. Hence, there is a unique parse except when
someone elides an operator*** -- then the parser has to guess what is
elided. I would claim that is poorly written MathML, but unfortunately it
is very common.

*** Not entirely true because "|" is prefix, infix, and postfix. When
written in a flat mrow, you can't disambiguate which parse is desired.
Hence, "|a | b | c|" has potentially different interpretations. It is
probably something MathML 4 should clean up.

On Wed, Dec 16, 2020 at 5:54 PM Deyan Ginev <deyan.ginev@gmail.com> wrote:

> Hi Murray,
>
> It is good that I had 7 meanings for |·| in my previous message, so
> that the "norm" one doesn't detract too much from the general point
> :-) But to clarify, I am also myself most acquainted with the ‖
> (U+2016) notation for norm, I think in modern texts it is almost
> ubiquitous. That is not a numeric measurement however, just a general
> feeling from my own readings.
>
> And that was the crux of my question - which notational constructs and
> *why* make the cut to be "default-worthy" in the spec?
>
> As to more outdated (deprecated?) uses of |·| which denote norms, here
> is some evidence:
> - The encyclopedic resource I picked this up from was MathWorld:
> https://mathworld.wolfram.com/VectorNorm.html
> https://mathworld.wolfram.com/L2-Norm.html
>
> - I now see that wikipedia also gives an example:
> "For the length of a vector in Euclidean space (which is an example of
> a norm, as explained below), the notation |v| with single vertical
> lines is also widespread. "
> https://en.wikipedia.org/wiki/Norm_(mathematics)#Notation
>
> - the confusion has been discussed on math.stackexchange:
>
> https://math.stackexchange.com/questions/2486271/is-there-a-difference-between-one-or-two-lines-depicting-the-norm
>
> - and some course notes reachable online seem to still linger with the
> single vertical line use:
> https://www2.math.upenn.edu/~ryrogers/HW1-solutions.pdf
>
> So while I agree with recommending ‖ (U+2016) to write norms in new
> documents, I can't agree that defaulting existing |·| is "easily"
> absolute value. The good news is that at least "norm" isn't in the K12
> set, I vaguely remember it is college-level math.
>
> ---
> @all:
>
> I have to say I am puzzled with "computation" becoming the foreground
> topic of the current email thread about "mrow defaults". That is a
> long discussion in its own right, but it is one not present in the
> current charter - which focuses on "accessibility" and "search". I
> currently hold an opinion that we need a modern revamp of Content
> MathML sooner or later, and before that time comes I'll try to skirt
> away from the entire computability topic. I quite enjoy that the
> current 'intent' attributes enable (and were meant to enable) partial
> annotation. But that means there is no guarantee for a complete
> content tree at the end of an annotation pass. And respectively - in
> my mind - no general expectation of "computable" expressions, just
> "accessible" ones. Weaker outcome in a way, but a lot easier to
> produce by authors.
>
> Deyan
>
>
> On Wed, Dec 16, 2020 at 6:43 PM Murray Sargent
> <murrays@exchange.microsoft.com> wrote:
> >
> > Deyan wrote:
> >
> >
> >
> > 5. Question: did you think of |a| as defaulting to "absolute value"? If
> so, why that operation? It could be any of "absolute-value", "cardinality",
> "norm", "seminorm", "determinant", "hyperdeterminant", "order-of-group", to
> borrow from our Level lists. I can imagine that absolute value is the one
> taught earliest, but I do remember Bulgarians and Romanians learn the
> determinant syntax in the last grades of highschool. A quick search on Khan
> academy suggests this is taught in "precalculus", which may be encountered
> in the last years of K12 also in the US. So we get two meanings for the |a|
> notation already in K12 math.
> >
> >
> >
> > In my math speech implementation (used in Word, PowerPoint, OneNote,…),
> I default to “absolute value” for |…| unless the … is a matrix because norm
> is denoted with ‖ (U+2016), not |. It’s true that I don’t have a way to
> force “cardinality” and “order of group” and it’d be great to have such a
> convention. But for defaults, it’s easy to decide when to say “absolute
> value” and when to say “determinant” (in whatever natural language).
> >
> >
> >
> > Thanks,
> >
> > Murray
>

Received on Thursday, 17 December 2020 08:49:19 UTC