How best to cope with Dragon speech recognition occasionally adding blank spaces at the beginning of lines?

K

Krazy Glew

BRIEF: When speech recognition software occasionally inserts extra blank spaces at the beginning of lines that are being dictated into emacs fundamental or textmode, how can the bad stuff below be avoided in the 1st place, or fixed up most conveniently?

Code:
 blah blah blah
   blah blah blah
    blah blah blah

---+ DETAIL​

I use speech recognition to dictate text into EMACS; also to invoke emacs commands, sometimes directly, but usually from "speech commands" in the speech software package.
Specifically Dragon speech recognition from Nuance (now owned by Microsoft).

Dragon typically inserts one blank space between words, and 1 or 2 blank spaces before the next word after the end of the sentence, if Dragon thinks appropriate. E.g. if Dragon thinks you are in the same flow of text, not at the beginning of a paragraph or after a hard newline. This works for "speech-ready" applications that allow Dragon to determine the state or context of the dictation.

Unfortunately, EMACS is not speech aware. Dragon will infer that it is at the beginning of a line if Dragon has seen the user dictate "newline" or some other line ending utterance. But Dragon's notion of state or context will fall out of sync (a) if the user types a key, rather than going through Dragon, or (b) if the user executes an emacs command like goto-line or kill-line that Dragon, and (c) in similar circumstances.

These extra spaces cause problems. (As similarly does Dragon's inferred capitalization of words, but that's not part of this question.)

This question seeks advice on how best to mitigate one particularly annoying aspect of this problem: when these extra spaces are inserted at the beginning of a line of text.

Below I provide a probably too large example of some of the artifacts that occur when dictating into EMACS fundamental mode or text mode. Both in my default setup, but also with all emacs startup files disabled. With electric-indent-mode both on and off.

The example is probably too large, and I may reduce its size in subsequent updates of this question. I'm somewhat reluctant to actually edit the example - I would prefer to have the example be exactly what I dictated - but that's a bit hard to make concise.

The short version is:

In the default configuration, with electric-indent-mode on, dictating text text, While also dictating new lines, mostly looks OK

Code:
 this text is dictated,  and Dragon sees the command  that ends this line
this is the new line
and this is another line, again with Dragon seeing the end of line
 but  here the previous line was terminated by physically pressing Enter
  here as well
    and so on
      because with electric-indent-mode on,
       each new line is aligned to the previous
         And then the extra space indents further.
 the above had electric-indent-mode on.
 with electric indent mode off
 we don't get this incrementing alignment behavior
 but we do get extra whitespace at the beginning of the line
 if Dragon  is not aware of the end of line.
  • It's not that hard to fix, e.g. by pressing TAB to invoke indent-for-tab-command, which typically invokes indent-relative.
    • although that does not remove the extra space of indentation that might've been inserted at the very 1st line.
  • I am a bit embarrassed to admit that I frequently resort to indent-rigidly
  • but I'm even more embarrassed to admit that quite a few of my git commit messages in my private repo exhibit such damage - especially when I had just started using Dragon and emacs.

I am sure there are other, better, ways to prevent this problem from happening and/or repair it once it has happened.


  • There are probably some standard ways to repair this damage that I don't know about: settings and/or commands that are especially convenient.
    • I look forward to answers that tell me that I am an idiot for not knowing about them.

  • I suspect that avoiding this damage requires that new code be written.
    • Although perhaps somebody has already solved this problem

  • And I seek advice as to the best ways to approach coding was to avoid this problem in the 1st place, or at least where it gets too bad.


I've already tried some things, and considered other approaches. I will post some of these as pseudo-answers, but I will not do so immediately.

Posting to https://emacs.stackexchange.com because the answer is almost certainly to write elisp code, since emacs is much more flexible than Dragon. some of the approaches that I have considered are purely elisp based, but some are a hybrid of elisp code and Dragon configurations, possibly Dragon extensions or plug-ins.

This is one of the of what will be several questions related to making emacs friendlier to speech recognition and voice control software. In particular Dragon speech recognition software from Nuance (now owned by Microsoft), because that is what I'm currently using, but I'm open to other speech recognition and voice control software packages.

---+ BIG EXAMPLE​


Code:
 blah blah blah
  blah blah blah
   blah blah blah

 ---+  PROBLEM:  incrementally incrementing indentation

    frequently text files that I have dictated into using Dragon speech recognition
     look like this, with successive lines frequently having one extra blank  on the left
      being progressively more indented
       because Dragon has not seen  me physically pressing the enter key
        so Dragon thinks I'm still dictating on the same line or in the same paragraph

    however if I say "newline" or "press enter" on the end of the line
    no problem occurs, because then Dragon has seen the actual transition

     the extra indentation occurs because I frequently hit enter on the keyboard,
       forgetting to say "newline" or "press enter" to  Dragon
 it also happens when I
       go back to a line
  i.e. when I'm editing nonlinearly
  I have emacs set to delete white space at the end of lines
    so if I move to a blank line
    pres TAB to align
     I still get an extra blank.

---+  BACKGROUND

 I use speech recognition because  it hurts me to type too much.
 But I can still type, and I often use a "hybrid mode"  where I dictate most
  but where I will  press a small number of physical keys
   typically  large easy to find keys like and enter
    and I will usually use a trackball
     rather than using the IMHO very annoying ways of moving the mouse by voice.
 at 1st I thought I was being "impure" by using such a hybrid mode
  for speech control, but it turns out a lot of people do this
    if they can.

 Observation:
 + speech recognition is pretty efficient for dictating text.
 +  Also for invoking "speech commands"
    + including emacs commands by voice
    + far fewer problems avoiding key-binding conflicts
 +  but speech recognition is somewhat inefficient for simple keypresses
    +  compare saying "press enter"  to simply hitting a large enter key


Yes: I know about  things
+ demos of emacs by voice such as
  + https://whalequench.club/blog/2019/09/14/strange-loop.html
  + Tavis Rudd's famous  "coding by voice...  using a combination of grunts and animal sounds"
+ I also know about things like
  + talon
  + DragonFly
"Know of",  I've chosen to go a slightly different direction.
   this is not the place to discuss overall approacesh to  voice control.
I just want to talk about this 1 specific problem  that arises when I
 use Dragon to dictate into emacs fundamental mode.

 blah blah blah
  blah blah blah

 if I  keyboard 2 blank lines,  I return to the right

 emacs help tells me that the key-binding "RET (translated from <return>) runs the command newline"

 if I say
  or press
   TAB
    on such an indented line
     it gets fixed (which I'll go back and demonstrate)
      because
      "TAB (translated from <tab>) runs the command indent-according-to-mode"

I forget
 if I have
 auto indent on
  indeed it looks like I do

---+ no startup files

OK, I just  started emacs --no-init-file --no-site-file
to get an absolutely fresh set up
 but see what happens now
  Yep I still get the  extra indentation
   if I start new  from the keyboard
 what happens if I do goto-line in emacs (target this line)
  Yep I get the indentation
  The above is with electric-indent-mode t,  i.e. on, the default in recent emacs

---+ disabling electric-indent-mode

Now I have disabled electric indent mode.
no extra space when Dragon saw the new line
 this is what I get when  actually press the physical key enter
 but of course I don't get the incrementing  behavior
 I just get one extra space at the beginning line.
 But that one extra space can cause problems e.g. in some  markup languages.

---+ org-mode

 now I have switched to Org mode
+ 1st list item
+ 2nd list item
  + again, if I  hit the enter key

  but it is not just  hitting the enter key.
+ Dragon also does not see the state of the buffer when I have
 executed an Emacs command, whether invoked from the keyboard or from
 the voice command, 
  + e.g. goto-line
  +  e.g.  killing a line and then typing new contents
 

Unreplied Threads

My volatility estimate is off by 30bps. My estimate of VaR is off by 5pts

  • Matheus Popst de Campos
  • Finance
  • Replies: 0
I am using parametric volatility to estimate the 90% confidence 3-month VaR for a 2-stock portfolio. (irl, I'll use much more than 2 stocks). I use here both the trailing volatility to estimate volatility, as also the volatilities of the option market.

The problem: my VaR estimate over an 8-year horizon is worse than the actual VaR just 3.5-4.5% of the time, when we expected it'd be ~10% of the time.

My estimate of the volatility is off by only 30bps on average through the period (but it's wrong with a 370bps standard deviation).

What could be happening here?

XDebug desde servidor Hostinger y con VSCode en local

Tengo un servidor compartido en Hostinger (no VPS) y he instalado la extensión de XDebug. Estoy utilizando VS Code como IDE con la extensión php debug.

Si entro en phpinfo(), puedo ver que XDebug está activo, pero solo en el modo desarrollador y no step debugging (debug). Como no puedo editar el archivo php.ini directamente, estoy realizando la configuración en el archivo .htaccess.

PHP Version 8.1.27 y XDebug Version 3.1.4

Enabled Features (through 'xdebug.mode' setting) Feature Enabled/Disabled
Development Helpers ✔ enabled Coverage ✘ disabled GC Stats ✘ disabled Profiler ✘ disabled Step Debugger ✘ disabled Tracing ✘ disabled

El problema es que aunque ponga los breakpoints para que vaya parando e inicio el debug, no va parando. Además, en la configuración de XDebug -> Step Debugger ✘ disabled

¿Alguna idea?

La configuración en .htaccess que tengo es:

Code:
# Configuración de XDebug para debugging remoto
php_value xdebug.mode develop,debug
php_value xdebug.start_with_request yes
php_value xdebug.client_host MI_IP_LOCAL
php_value xdebug.client_port 9003
php_value xdebug.idekey VSCODE
php_value xdebug.log MIPATHRAIZ/xdebug.log
php_value xdebug.log_level 1

En Visual studio code:

Code:
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9003,
            "log": true,
            "runtimeArgs": [
                "-dxdebug.mode=debug",
                "-dxdebug.start_with_request=yes"
            ],
            "pathMappings": {
                MIPath: "${workspaceFolder}"
            },
            "ignore": [
                "**/vendor/**/*.php"
            ]
        }
    ]
}

JSON formatting column based upon added column of lookup column

  • Jeroen Voortman
  • Technology
  • Replies: 0
I have two SharePoint lists.

List one has the following columns:

  • Productgroup (text)
  • Min (number, percentage)
  • Max (number, percentage)

List two has columns:

  • a lookup column for Productgroup
  • Added columns for Min and Max connected to the chosen productgroup
  • A column for the actual value (number, percentage)

I would like to have a conditional formatting for the column of the actual value so that

  • If below [Productgroup].[Min] Background turns red.
  • If above [Productgroup].[Max] Background turns orange.
  • If between [Productgroup].[Min] and [Productgroup].[Max] background turns green.

I have tried the following as a start, but that didn't do the job.

Code:
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "[$Productgroep.Min]"
  "attributes": {
    "class": "=if(@currentField < [Productgroep.Min],'sp-field-severity--warning', '')"
  },
  "children": [
    {
      "elmType": "span",
      "style": {
        "display": "inline-block",
        "padding": "0 4px"
      },
      "attributes": {
        "iconName": "=if(@currentField < [Productgroep.Min],'Error', '')"
      }
    },
    {
      "elmType": "span",
      "txtContent": "@currentField"
    }
  ]
}

Fourier transform relation for spherical convolution

Let $f$ and $g$ be two functions defined over the 2d sphere $\mathbb{S}^2$.

The convolution between $f$ and $g$ is defined as a function $f * g$ over the space $SO(3)$ of 3d rotations as $$(f*g)(R) = \int_{\mathbb{S}^2} f(R^{-1}x) g(x) \mu(dx)$$ where $\mu$ is the Haar measure on $\mathbb{S}^2$.

One can expand $f$ and $g$ in the orthonormal basis of spherical harmonics $Y_n^m$ for $n\geq0$ and $|m|\leq n$ such that $f = \sum \hat{f}_n^m Y_n^m$ where $\hat{f}_n^m = \langle f, Y_n^m \rangle$ (similarly for $g$).

Is there a Fourier relation for the Fourier transform of $f*g$ as is the case for instance for functions over $\mathbb{R}$, for which the Fourier transform of the convolution is the product of the Fourier transforms.

Note that this supposes to have a notion of Fourier transform for functions on $SO(3)$, which is provided by the Wigner D-matrix instead of the spherical harmonics as the Fourier basis.

2-topos “tasks of theory”

Is it possible to obtain any interesting results by associating with each theory T its 2-topos task(T). Consisting of : 1) Objects: Formal task in the theory of T. Condition-data, and a task from the data used. Tasks are considered as a mapping from solutions to answers. (a set of solutions can be considered as a category because solutions are conclusions from data a1→a2→... →answer and morphism between solutions: a1→a2→...→answer ↓ ↓ ↓ ↓ a1'→a2'→... →answer 2) Morphisms: corresponding commutative diagrams between task if and only if the solution to task A follows from task B terminal object: axiom. Product- as a product of categories. Exponential A and B - a task whose answers are morphisms from A to B.Classifier is the sum of two axioms.

Approximation on $H^1_0(B) and cut-off functions

Let $u \in H^1_0(B)$, where $B$ is the unit ball in $\mathbb{R}^N$. Given $\epsilon > 0$, I need to show there exists a function $\chi_\epsilon \in C^\infty_0(\mathbb{R}^N)$ such that $$ \| u - \chi_\epsilon u\|_{H^1_0(B)} < \epsilon $$ and $\text{supp} \chi_\epsilon \subset \subset B$.

My attemps I considered $f \in C^\infty_0(\mathbb{R}^N)$ such that $\text{supp} f \subset B_{1/4}(0)$ and defined $\chi_\epsilon = 1-\epsilon + \epsilon f.$ The bad part: The support of $\chi_\epsilon$ is all $\mathbb{R}^N$.

Extension of scalars for bounded chain complexes of $kG$-modules

I'm wondering if a generalization regarding a statement from Curtis-Reiner holds. The original statement is as follows:

(30.33) Theorem: Let $R$ and $S$ be complete discrete valuation rings, with $S$ an extension of $R$, and suppose that $R/J(R)$ is a finite field. Then for each indecomposable finitely generated $A$-module $M$, the $SA = S\otimes_R A$-module $SM$ is a direct sum of non-isomorphic indecomposable submodules.

I'd like to know if an analogous statement holds for bounded chain complexes rather than (f.g.) modules. The case I'm particularly interested in is when $R = kG$ and $S = k'G$, where $k'/k$ is an extension of finite fields and $G$ is a finite group. Going through the proof of this theorem, I don't know if the following isomorphism holds anymore: $\operatorname{Hom}_{k'G}(k'\otimes_k C,k' \otimes_k D) \cong k' \otimes_k \operatorname{Hom}_{kG}(C,D)$ where $C$ and $D$ are bounded chain complexes of $kG$-modules (see CR Theorem (2.38) for the module-theoretic statement).

Also, if anyone knows what "MO 2e" refers to in Theorem (2.38) of CR, please let me know. Thank you!
Top