Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pprogrammer
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
Python Code Suggestions Using a Long Short-Term Memory RNN
(blog.algorithmia.com)
7 points
by
pprogrammer
10y ago
|
0 comments
2.
▲
Show HN: Python next word prediction
(algorithmia.com)
4 points
by
pprogrammer
10y ago
|
0 comments
3.
▲
by
pprogrammer
10y ago
The model does generalize to data it hasn't seen before (and that's validated using a validation set) but not to data that isn't similar to the data set. For example, it would probably not detect the programming language well
4.
▲
by
pprogrammer
10y ago
puts is probably much more informative than <<
5.
▲
by
pprogrammer
10y ago
It probably does not contain a lot of es6 syntax, and the let keyword probably occurs a lot more in other languages (Swift, Haskell, Lua). You could try to add more code to disambiguate it, for example adding a semicolon already displays it
6.
▲
by
pprogrammer
10y ago
This is a great idea! I did think of something like this, because similar languages often end up in the top-3 of the classifier.
7.
▲
by
pprogrammer
10y ago
That would probably work OK, I guess, but some languages have the same keywords, so I don't think you'll get very high accuracy. I also tried a word level n-grams with linear classifiers, I couldn't get very high accuracy out
8.
▲
by
pprogrammer
10y ago
Interesting example. It is not a valid Python/C example, you wouldn't find such an example in the code (edit: dataset). The model also isn't trained on small code snippets (only on running code), this is currently probably a
9.
▲
by
pprogrammer
10y ago
Great idea! Will think about this when I am going to add languages.
10.
▲
by
pprogrammer
10y ago
Probably almost all of the samples are syntactically valid, but it probably works OK for invalid code. Adding or removing symbols can have an impact on the results though, as those may occur more frequently in other languages.
11.
▲
by
pprogrammer
10y ago
I tried a linear classifier, yes. It works decent too, but has lower accuracy when using a big dataset (+/- 98% top-1 accuracy vs. 99.4%).
12.
▲
Show HN: Detecting the Programming Language of Code Using ML and Neural Networks
(danielheres.space)
53 points
by
pprogrammer
10y ago
|
28 comments