Javascript Model
Prepare the dataset
- Find all the javascript file inside a folder and summarize its total size.
1 | find . -name "*.js" -print0 | xargs -0 du -sb | awk '{sum +=$1} END {print sum}' |
- Create a small tool which convert file into json string to make the workflow simpler.
1 |
|
a. Install dependencies
1 | npm install commander |
b. Create an alias to simplify the code
1 | alias jstr='/home/xxxx/jstr.js jsonstr' |
- Flat all the files into numbered sequence and put it in the folder.
1 |
|
Using spacy library
1 | # Install spacy and download the library |
After that you can run the follow code in the nodebook
1 | import spacy |
Here is the output
1 | Apple PROPN nsubj |