Re:Show HN: Predictive Text Using Only 13KB of JavaScript. N...
by adzm on Friday March 01, 2024 @02:21AM
(#39559423)
So this is basically a Markov chain right?
[ Parent
| on HN ]
Re:Show HN: Predictive Text Using Only 13KB of JavaScript. N...
by hidelooktropic on Friday March 01, 2024 @02:40AM
(#39559531)
I don't think so. It's basically just traversing nested arrays and picking a random member on each level.
Re:Show HN: Predictive Text Using Only 13KB of JavaScript. N...
by dartos on Friday March 01, 2024 @02:59AM
(#39559627)
Yep. Sounds like a Markov chain to me.
Re:Show HN: Predictive Text Using Only 13KB of JavaScript. N...
by fruktmix on Friday March 01, 2024 @03:45AM
(#39559895)
Markov process is a stochastic model describing a sequence of possible events in which the probability of each event depends only on the state attained in the previous event.
Re:Show HN: Predictive Text Using Only 13KB of JavaScript. N...
by alucab on Friday March 01, 2024 @04:11AM
(#39560052)
That's a markov chain of the 1st order.
This is higher order Markov chain
Re:Show HN: Predictive Text Using Only 13KB of JavaScript. N...
by Robin_Message on Friday March 01, 2024 @10:41AM
(#39562773)
I think Markov chains have transition probabilities, which this model is lacking. But it's the same idea, just with uniform transition probabilitis.
Re:Show HN: Predictive Text Using Only 13KB of JavaScript. N...
by dartos on Friday March 01, 2024 @12:31PM
(#39564226)
It seems like it has transition probabilities.
Depending on the type of the prior word, it randomly selects the next word from a list of compatible word types.
Am I misunderstanding?
Re:Show HN: Predictive Text Using Only 13KB of JavaScript. N...
by Robin_Message on Friday March 01, 2024 @02:52PM
(#39566034)
It only has probability 0 or 1/n, where n is the number of compatible next words.
There are no numbers in https://github.com/adamjgrant/Tiny-Predictive-Text/blob/main...
A Markov chain could express probabilities like completing "the original" to -> "poster" (0.1), -> "McCoy" (0.2), -> "and best" (0.7) which I don't think this does. But I am tired and maybe also misunderstanding.