Sentiment Analysis using BERT model and Tensorflowjs
- Run
npm install
first to install the required modules. - Run
npm run dev
to run to start the server.
Open http://localhost:3000 in browser. Open web console in browser to see output which should look like:
Loaded Tokenizer.
105 Model Loading time (ms): 4941
Open http://localhost:3000/server.html in your browser.
- An included vocabulary file, vocab.json, is extracted and converted from "Bert-base, uncase". If you would like to convert other pre-trained vocabularies use the following example:
-
cd src/util python txt2json.py ../../public/vocab.txt /tmp/vocab.json
- Install the debugger from here
- Open the debugger in VSCode.
- Set break points in the source code (*.ts).
- Clicking on the "Start Debugging" button will launch the Chrome browser using the configuration in launch.json.