-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guesslang in VS Code #29
Comments
Hello @isidorn Actually, I tried to convert Guesslang model to Javascript two years ago because I wanted to create an Atom extension, a VS Code extension and a Javascript front-end library. But it was a real challenge to convert the model to TensorFlow.js because several elements of the models where not implemented in TensorFlow.js at that time. I tried different options like simplifying Guesslang model, splitting the model, compiling the missing elements from C++ to Web Assembly, etc... While some solutions "worked", the result was way too buggy and dirty to ship. By the way, sorry for the late answer. |
It would be nice to have the insight of someone who managed to convert a canned TensorFlow model to TensorFlow.js. |
@yoeo thanks for your answer. |
@yoeo the Tensorflow team have just updated TensorflowJS so now it is possible to run your model in the browser, for more details checkout this comment tensorflow/tfjs#4838 (comment) We will look into adopting this in VS Code next milestone in June. |
Hi @isidorn that's really good news. Yes it is possible to add JSON. |
@yoeo cool, it would be really useful for us to add JSON when possible. |
There's progress on our side and we are looking into adding this to our VS Code product. More details can be found here tensorflow/tfjs#4838 (comment) and microsoft/vscode#118455 Two things we would still really like to improve in order to ship this:
@yoeo if you do not have time can you give us some instructions on how to do the first. So we might also put a help wanted in the VS Code repository, since we have lots of contributors maybe somebody will volunteer. Thanks a lot for this great model |
We were able to compress to model using gzip to be 20kb. So we are good regarding the size. |
Wow I wonder how you were able to compress the model that much, that's insane!
I'll try experiment that this week end.
Of course. I use this tool to build the dataset: https://github.com/yoeo/guesslangtools # Install Gesslang & GuesslangTools inside your virtualenv in developer mode
git clone [email protected]:yoeo/guesslang.git guesslang
cd guesslang/
pip install -e .
cd ..
git clone [email protected]:yoeo/guesslangtools.git guesslangtools
cd guesslangtools/
pip install -e .
cd ..
# Add the new languages to the language mapping
vi guesslang/guesslang/data/languages.json
cp guesslang/guesslang/data/languages.json guesslangtools/guesslangtools/data/languages.json
# Build the dataset (might take few days, depending on your Internet connection)
DESTINATION_PATH=... # dataset directory, 1TB of free space recommended
gltool $DESTINATION_PATH
# Train the model (might take few hours, depending on your computer speed)
guesslang --train $DESTINATION_PATH --model ./new_model/
# Play with the new model
echo '
#include <stdio.h>
int main(int argc, char* argv[])
{
printf("Hello world");
}
' | guesslang --model ./new_model/ # Should output "Programming language: C" Thanks for the updates @isidorn. |
Hello, just an update. I'm trying to add the following languages to Guesslang:
I built the list according the requests #24 #23 #19 , Tiobe language index and Stackoverflow popular languages . But there are few issues:
Therefore my current strategy is to add the "simplest" languages first then bump Guesslang and take some time to work on the more tricky languages. Thanks. |
@yoeo Thanks a lot for looking into this and for providing an update. As for the compression: the model after being converted for TensorFlowJS was If needed I can put help-wanted on the vscode issues, and somebody from the community can also help here. Just let me know... |
Hi @isidorn I've made some progress during last couple of weekends. There is now a development version of Guesslang model that supports most of the languages listed above (including JSON). You can try it at #33 There are still issues that I need to solve before merging it:
|
@yoeo this is great work, thanks a lot for the update 👏 Next three weeks I will be on vacation, so expect slow responses from me. |
Hi @isidorn , @TylerLeonhardt I just finished adding the new languages support to Guesslang #33
Feel free to tell me if you have feedbacks about this new model. |
Being able to tell the difference between Matlab Objective-C and Julia is killer, |
@yoeo this is amazing, thanks a lot 👏 We really appreciate your help. |
I think we can go ahead and close this issue now :) the guesslang model now ships in VS Code and beyond misc improvements to the model, there's no more action items here. |
Thanks for the info. You've got a new beta-tester 🙂 I'm closing this issue and do not hesitate to create new ones for improvement requests. |
For reference here's the test plan item on the vscode side that has good steps on how to setup microsoft/vscode#129436 |
Hi there,
My name is Isidor and I work on VS Code.
We have the following problem:
Novice user create a new untitled files and start typing and they have no clue that they have to set the language mode to get all the language smartness that VS Code provides.
Thus we were thinking to use some smart language detection so we could automatically set the language for the user.
I was doing a bit of online research and I came across this project - looks very cool!
Is it possible to somehow have this work as a node module instead of python? Since then we could consume it easily in VS Code and things might just work. Even cooler would be if it worked in the browser.
Let me know if you are interested we can also setup a meeting where I could explain our use case in more detail.
Thanks!
The text was updated successfully, but these errors were encountered: