TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Autocomplete Using Markov Chains

166 pointsby dennis714over 6 years ago

6 comments

rijojaover 6 years ago
This is really cool and an inspiration of mine. As a matter of fact I am working on something very similar to this.<p>I don&#x27;t know if you are familiar with the Dasher project for text input, but as of know I&#x27;m trying to improve on that work partly by improving on how many letters are available simultaneously by protecting the line of text upon a fractal surface. Something that should be a more efficient use of a 2d surface, theoretically infinitely so.<p>As far as autocomplete is concerned my approach is to try to do exactly this but on a character basis. I think this can lead to some interesting advantages, for example different dialects gives rise to words that not always conform to dictionary specifications.<p>The next level would be to go one step higher so to speak. If we imagine Markov Chain on letters as the first level and said chains level, I&#x27;d say that the third level in our hierarchy would be to apply markov chain on groups of words grouped by proximity in a word2vec space.<p>Having markov chains working on groups of word2vec words would give us a statistical analogy of grammar. However without having to implement it programatically, something that inevitably would lead to missed corner cases and if not that a too strict algorithm that would hinder intentional abuse of grammar by purpose.<p>Maybe this is already being implemented, as it to me seems as the logical next step. Anybody got any info on this?
评论 #19207099 未加载
评论 #19206766 未加载
stewbrewover 6 years ago
I wonder what the result would look like if this were applied to source code. IMHO a probabilistic algorithm for code completion could turn out interesting.<p>Most code completion algorithms work deterministic by deducing the set of completion candidates from the receiver&#x27;s type&#x2F;class or a list of keywords. Given that people&#x2F;teams tend to name variables in a certain fashion, a probabilistic completion algorithm could make use of this and adapt to team&#x2F;project-specific conventions. Given a team&#x27;s code base one could probably build a pretty good code completion algorithm without any knowledge about the programming language.<p>likelycomplete[1] tries to do this in a dilettantish ad-hoc way for vim. It rates completion candidates (that are gathers from previously seen code) on the basis of context information. It&#x27;s hampered by the limited performance of vimscript though. A full fledged solution would require an external server.<p>[1] <a href="https:&#x2F;&#x2F;www.vim.org&#x2F;scripts&#x2F;script.php?script_id=4889" rel="nofollow">https:&#x2F;&#x2F;www.vim.org&#x2F;scripts&#x2F;script.php?script_id=4889</a>
评论 #19207583 未加载
评论 #19207015 未加载
评论 #19207409 未加载
评论 #19207484 未加载
darkpumaover 6 years ago
I&#x27;ve thought about using a markov chain suggester to trip up stylometric analysis, but never got around to creating some sort of practical UX for it.<p>I think if you plugged it into Vim or Emacs&#x27;s autocompletion functionality, that might do the trick.
xkapastelover 6 years ago
Keep in mind this is essentially the same concept as the big scary AI from OpenAI that is making the news recently. They use neural nets, not markov chains, but the idea is similar: given a word, predict the next word.<p>&gt; It&#x27;s surprising how easy this can be turned into something rather practically useful<p>Given the above, it&#x27;s not so surprising: this word prediction problem is fundamental, with a wide range of applications.
评论 #19207612 未加载
braindead_inover 6 years ago
This looks to be quite useful. Is there a github project that I can play around with?
评论 #19206210 未加载
TomK32over 6 years ago
would be nice to test this as a reply bot for spam mails.